use of org.neo4j.kernel.impl.storageengine.impl.recordstorage.RecordStorageEngine in project neo4j by neo4j.
the class CountsRotationTest method rotationShouldNotCauseUnmappedFileProblem.
@Test
public void rotationShouldNotCauseUnmappedFileProblem() throws IOException {
// GIVEN
GraphDatabaseAPI db = (GraphDatabaseAPI) dbBuilder.newGraphDatabase();
DependencyResolver resolver = db.getDependencyResolver();
RecordStorageEngine storageEngine = resolver.resolveDependency(RecordStorageEngine.class);
CountsTracker countStore = storageEngine.testAccessNeoStores().getCounts();
AtomicBoolean workerContinueFlag = new AtomicBoolean(true);
AtomicLong lookupsCounter = new AtomicLong();
int rotations = 100;
for (int i = 0; i < 5; i++) {
threadingRule.execute(countStoreLookup(workerContinueFlag, lookupsCounter), countStore);
}
long startTxId = countStore.txId();
for (int i = 1; (i < rotations) || (lookupsCounter.get() == 0); i++) {
try (Transaction tx = db.beginTx()) {
db.createNode(B);
tx.success();
}
checkPoint(db);
}
workerContinueFlag.set(false);
assertEquals("Should perform at least 100 rotations.", rotations, Math.min(rotations, countStore.txId() - startTxId));
assertTrue("Should perform more then 0 lookups without exceptions.", lookupsCounter.get() > 0);
db.shutdown();
}
use of org.neo4j.kernel.impl.storageengine.impl.recordstorage.RecordStorageEngine in project neo4j by neo4j.
the class RelationshipGroupStoreIT method shiftHighId.
private void shiftHighId(GraphDatabaseAPI db) {
RecordStorageEngine storageEngine = db.getDependencyResolver().resolveDependency(RecordStorageEngine.class);
NeoStores neoStores = storageEngine.testAccessNeoStores();
neoStores.getRelationshipTypeTokenStore().setHighId(Short.MAX_VALUE - RELATIONSHIP_COUNT / 2);
}
use of org.neo4j.kernel.impl.storageengine.impl.recordstorage.RecordStorageEngine in project neo4j by neo4j.
the class StorageLayerRelTypesAndDegreeTest method resolveNeoStores.
private NeoStores resolveNeoStores() {
DependencyResolver resolver = db.getDependencyResolver();
RecordStorageEngine storageEngine = resolver.resolveDependency(RecordStorageEngine.class);
return storageEngine.testAccessNeoStores();
}
use of org.neo4j.kernel.impl.storageengine.impl.recordstorage.RecordStorageEngine in project neo4j-apoc-procedures by neo4j-contrib.
the class PageRankArrayStorageParallelSPI method getNeoStores.
private NeoStores getNeoStores(GraphDatabaseAPI db) {
RecordStorageEngine recordStorageEngine = db.getDependencyResolver().resolveDependency(RecordStorageEngine.class);
StoreAccess storeAccess = new StoreAccess(recordStorageEngine.testAccessNeoStores());
return storeAccess.getRawNeoStores();
}
use of org.neo4j.kernel.impl.storageengine.impl.recordstorage.RecordStorageEngine in project neo4j by neo4j.
the class NeoStoreDataSource method buildStorageEngine.
private StorageEngine buildStorageEngine(PropertyKeyTokenHolder propertyKeyTokenHolder, LabelTokenHolder labelTokens, RelationshipTypeTokenHolder relationshipTypeTokens, LegacyIndexProviderLookup legacyIndexProviderLookup, IndexConfigStore indexConfigStore, Runnable schemaStateChangeCallback, SynchronizedArrayIdOrderingQueue legacyIndexTransactionOrdering) {
// TODO we should break this dependency on the kernelModule (which has not yet been created at this point in
// TODO the code) and instead let information about generations of transactions flow through the StorageEngine
// TODO API
Supplier<KernelTransactionsSnapshot> transactionSnapshotSupplier = () -> kernelModule.kernelTransactions().get();
RecordStorageEngine storageEngine = new RecordStorageEngine(storeDir, config, idGeneratorFactory, eligibleForReuse, idTypeConfigurationProvider, pageCache, fs, logProvider, propertyKeyTokenHolder, labelTokens, relationshipTypeTokens, schemaStateChangeCallback, constraintSemantics, scheduler, tokenNameLookup, lockService, schemaIndexProvider, indexingServiceMonitor, databaseHealth, labelScanStoreProvider, legacyIndexProviderLookup, indexConfigStore, legacyIndexTransactionOrdering, transactionSnapshotSupplier);
// We pretend that the storage engine abstract hides all details within it. Whereas that's mostly
// true it's not entirely true for the time being. As long as we need this call below, which
// makes available one or more internal things to the outside world, there are leaks to plug.
storageEngine.satisfyDependencies(dependencies);
return life.add(storageEngine);
}
Aggregations