use of org.neo4j.kernel.impl.store.NeoStores in project neo4j by neo4j.
the class CountsStoreRecoveryTest method flushNeoStoreOnly.
private void flushNeoStoreOnly() throws Exception {
NeoStores neoStores = ((GraphDatabaseAPI) db).getDependencyResolver().resolveDependency(RecordStorageEngine.class).testAccessNeoStores();
MetaDataStore metaDataStore = neoStores.getMetaDataStore();
metaDataStore.flush();
}
use of org.neo4j.kernel.impl.store.NeoStores in project neo4j by neo4j.
the class StoreUpgraderTest method upgradedNeoStoreShouldHaveNewUpgradeTimeAndUpgradeId.
@Test
public void upgradedNeoStoreShouldHaveNewUpgradeTimeAndUpgradeId() throws Exception {
// Given
fileSystem.deleteFile(new File(dbDirectory, StoreLogService.INTERNAL_LOG_NAME));
PageCache pageCache = pageCacheRule.getPageCache(fileSystem);
UpgradableDatabase upgradableDatabase = new UpgradableDatabase(fileSystem, new StoreVersionCheck(pageCache), new LegacyStoreVersionCheck(fileSystem), getRecordFormats());
// When
newUpgrader(upgradableDatabase, allowMigrateConfig, pageCache).migrateIfNeeded(dbDirectory);
// Then
StoreFactory factory = new StoreFactory(dbDirectory, pageCache, fileSystem, NullLogProvider.getInstance());
try (NeoStores neoStores = factory.openAllNeoStores()) {
assertThat(neoStores.getMetaDataStore().getUpgradeTransaction(), equalTo(neoStores.getMetaDataStore().getLastCommittedTransaction()));
assertThat(neoStores.getMetaDataStore().getUpgradeTime(), not(equalTo(MetaDataStore.FIELD_NOT_INITIALIZED)));
long minuteAgo = System.currentTimeMillis() - MINUTES.toMillis(1);
assertThat(neoStores.getMetaDataStore().getUpgradeTime(), greaterThan(minuteAgo));
}
}
Aggregations