use of org.neo4j.kernel.impl.store.format.RecordFormats in project neo4j by neo4j.
the class RecordFormatsMigrationIT method assertStoreFormat.
private void assertStoreFormat(RecordFormats expected) throws IOException {
Config config = Config.embeddedDefaults(stringMap(GraphDatabaseSettings.pagecache_memory.name(), "8m"));
try (PageCache pageCache = ConfigurableStandalonePageCacheFactory.createPageCache(fileSystemRule.get(), config)) {
RecordFormats actual = RecordFormatSelector.selectForStoreOrConfig(config, testDirectory.graphDbDir(), fileSystemRule.get(), pageCache, NullLogProvider.getInstance());
assertNotNull(actual);
assertEquals(expected.storeVersion(), actual.storeVersion());
}
}
use of org.neo4j.kernel.impl.store.format.RecordFormats in project neo4j by neo4j.
the class StoreMigrationIT method data.
@Parameterized.Parameters(name = "Migrate: {0}->{1}")
public static Iterable<Object[]> data() throws IOException {
FileSystemAbstraction fs = fileSystemRule.get();
PageCache pageCache = pageCacheRule.getPageCache(fs);
File dir = TestDirectory.testDirectory(StoreMigrationIT.class).prepareDirectoryForTest("migration");
StoreVersionCheck storeVersionCheck = new StoreVersionCheck(pageCache);
LegacyStoreVersionCheck legacyStoreVersionCheck = new LegacyStoreVersionCheck(fs);
List<Object[]> data = new ArrayList<>();
ArrayList<RecordFormats> recordFormatses = new ArrayList<>();
RecordFormatSelector.allFormats().forEach((f) -> addIfNotThere(f, recordFormatses));
for (RecordFormats toFormat : recordFormatses) {
UpgradableDatabase upgradableDatabase = new UpgradableDatabase(fs, storeVersionCheck, legacyStoreVersionCheck, toFormat);
for (RecordFormats fromFormat : recordFormatses) {
File db = new File(dir, baseDirName(toFormat, fromFormat));
try {
createDb(fromFormat, db);
if (!upgradableDatabase.hasCurrentVersion(db)) {
upgradableDatabase.checkUpgradeable(db);
data.add(new Object[] { fromFormat, toFormat });
}
} catch (Exception e) {
//This means that the combination is not migratable.
}
fs.deleteRecursively(db);
}
}
return data;
}
use of org.neo4j.kernel.impl.store.format.RecordFormats in project neo4j by neo4j.
the class NeoStoreDataSource method selectStoreFormats.
private static RecordFormats selectStoreFormats(Config config, File storeDir, FileSystemAbstraction fs, PageCache pageCache, LogService logService) {
LogProvider logging = logService.getInternalLogProvider();
RecordFormats formats = RecordFormatSelector.selectNewestFormat(config, storeDir, fs, pageCache, logging);
new RecordFormatPropertyConfigurator(formats, config).configure();
return formats;
}
use of org.neo4j.kernel.impl.store.format.RecordFormats in project neo4j by neo4j.
the class BatchingNeoStoresTest method shouldDecideToAllocateDoubleRelationshipRecordUnitsOnLargeAmountOfRelationshipsOnSupportedFormat.
@Test
void shouldDecideToAllocateDoubleRelationshipRecordUnitsOnLargeAmountOfRelationshipsOnSupportedFormat() throws Exception {
// given
RecordFormats formats = new ForcedSecondaryUnitRecordFormats(LATEST_RECORD_FORMATS);
try (BatchingNeoStores stores = BatchingNeoStores.batchingNeoStoresWithExternalPageCache(fileSystem, pageCache, PageCacheTracer.NULL, databaseLayout, formats, Configuration.DEFAULT, NullLogService.getInstance(), EMPTY, Config.defaults(), INSTANCE)) {
stores.createNew();
Input.Estimates estimates = Input.knownEstimates(0, DOUBLE_RELATIONSHIP_RECORD_UNIT_THRESHOLD << 1, 0, 0, 0, 0, 0);
// when
boolean doubleUnits = stores.determineDoubleRelationshipRecordUnits(estimates);
// then
assertTrue(doubleUnits);
}
}
use of org.neo4j.kernel.impl.store.format.RecordFormats in project neo4j by neo4j.
the class BatchingNeoStoresTest method shouldNotDecideToAllocateDoubleRelationshipRecordUnitsonLowAmountOfRelationshipsOnSupportedFormat.
@Test
void shouldNotDecideToAllocateDoubleRelationshipRecordUnitsonLowAmountOfRelationshipsOnSupportedFormat() throws Exception {
// given
RecordFormats formats = new ForcedSecondaryUnitRecordFormats(LATEST_RECORD_FORMATS);
try (BatchingNeoStores stores = BatchingNeoStores.batchingNeoStoresWithExternalPageCache(fileSystem, pageCache, PageCacheTracer.NULL, databaseLayout, formats, Configuration.DEFAULT, NullLogService.getInstance(), EMPTY, Config.defaults(), INSTANCE)) {
stores.createNew();
Input.Estimates estimates = Input.knownEstimates(0, DOUBLE_RELATIONSHIP_RECORD_UNIT_THRESHOLD >> 1, 0, 0, 0, 0, 0);
// when
boolean doubleUnits = stores.determineDoubleRelationshipRecordUnits(estimates);
// then
assertFalse(doubleUnits);
}
}
Aggregations