use of org.neo4j.kernel.impl.store.format.RecordFormats in project neo4j by neo4j.
the class IdGeneratorTest method makeSureIdCapacityCannotBeExceeded.
@Test
public void makeSureIdCapacityCannotBeExceeded() throws Exception {
RecordFormats formats = Standard.LATEST_RECORD_FORMATS;
List<RecordFormat<? extends AbstractBaseRecord>> recordFormats = Arrays.asList(formats.node(), formats.dynamic(), formats.labelToken(), formats.property(), formats.propertyKeyToken(), formats.relationship(), formats.relationshipGroup(), formats.relationshipTypeToken());
for (RecordFormat format : recordFormats) {
makeSureIdCapacityCannotBeExceeded(format);
}
}
use of org.neo4j.kernel.impl.store.format.RecordFormats in project neo4j by neo4j.
the class StoreFactoryTest method storeFactory.
private StoreFactory storeFactory(Config config, OpenOption... openOptions) {
LogProvider logProvider = NullLogProvider.getInstance();
RecordFormats recordFormats = selectForStoreOrConfig(config, storeDir, fsRule.get(), pageCache, logProvider);
return new StoreFactory(storeDir, DEFAULT_NAME, config, idGeneratorFactory, pageCache, fsRule.get(), recordFormats, logProvider, openOptions);
}
use of org.neo4j.kernel.impl.store.format.RecordFormats in project neo4j by neo4j.
the class NeoStores method verifyRecordFormat.
private void verifyRecordFormat() {
try {
String expectedStoreVersion = recordFormats.storeVersion();
long record = getRecord(pageCache, neoStoreFileName, STORE_VERSION);
if (record != MetaDataRecordFormat.FIELD_NOT_PRESENT) {
String actualStoreVersion = versionLongToString(record);
RecordFormats actualStoreFormat = RecordFormatSelector.selectForVersion(actualStoreVersion);
if (!isCompatibleFormats(actualStoreFormat)) {
throw new UnexpectedStoreVersionException(actualStoreVersion, expectedStoreVersion);
}
}
} catch (NoSuchFileException e) {
// Occurs when there is no file, which is obviously when creating a store.
// Caught as an exception because we want to leave as much interaction with files as possible
// to the page cache.
} catch (IOException e) {
throw new UnderlyingStorageException(e);
}
}
use of org.neo4j.kernel.impl.store.format.RecordFormats in project neo4j by neo4j.
the class NeoStoresRule method open.
public NeoStores open(String... config) throws IOException {
Config configuration = Config.embeddedDefaults(stringMap(config));
RecordFormats formats = RecordFormatSelector.selectForConfig(configuration, NullLogProvider.getInstance());
return open(formats, config);
}
use of org.neo4j.kernel.impl.store.format.RecordFormats in project neo4j by neo4j.
the class LegacyIndexMigrator method migrate.
@Override
public void migrate(File storeDir, File migrationDir, MigrationProgressMonitor.Section progressMonitor, String versionToMigrateFrom, String versionToMigrateTo) throws IOException {
IndexImplementation indexImplementation = indexProviders.get(LUCENE_LEGACY_INDEX_PROVIDER_NAME);
if (indexImplementation != null) {
RecordFormats from = RecordFormatSelector.selectForVersion(versionToMigrateFrom);
RecordFormats to = RecordFormatSelector.selectForVersion(versionToMigrateTo);
if (!from.hasSameCapabilities(to, CapabilityType.INDEX)) {
originalLegacyIndexesRoot = indexImplementation.getIndexImplementationDirectory(storeDir);
migrationLegacyIndexesRoot = indexImplementation.getIndexImplementationDirectory(migrationDir);
if (isNotEmptyDirectory(originalLegacyIndexesRoot)) {
migrateLegacyIndexes(progressMonitor);
legacyIndexMigrated = true;
}
}
} else {
log.debug("Lucene index provider not found, nothing to migrate.");
}
}
Aggregations