use of org.neo4j.kernel.impl.locking.NoOpClient in project neo4j by neo4j.
the class TransactionRecordStateTest method newTransactionRecordState.
private TransactionRecordState newTransactionRecordState(NeoStores neoStores) {
Loaders loaders = new Loaders(neoStores);
recordChangeSet = new RecordChangeSet(loaders);
PropertyTraverser propertyTraverser = new PropertyTraverser();
RelationshipGroupGetter relationshipGroupGetter = new RelationshipGroupGetter(neoStores.getRelationshipGroupStore());
PropertyDeleter propertyDeleter = new PropertyDeleter(propertyTraverser);
return new TransactionRecordState(neoStores, integrityValidator, recordChangeSet, 0, new NoOpClient(), new RelationshipCreator(relationshipGroupGetter, neoStores.getRelationshipGroupStore().getStoreHeaderInt()), new RelationshipDeleter(relationshipGroupGetter, propertyDeleter), new PropertyCreator(neoStores.getPropertyStore(), propertyTraverser), propertyDeleter);
}
use of org.neo4j.kernel.impl.locking.NoOpClient in project neo4j by neo4j.
the class KernelTransactionImplementationTest method shouldIncrementReuseCounterOnReuse.
@Test
public void shouldIncrementReuseCounterOnReuse() throws Exception {
// GIVEN
KernelTransactionImplementation transaction = newTransaction(securityContext());
int reuseCount = transaction.getReuseCount();
// WHEN
transaction.close();
SimpleStatementLocks statementLocks = new SimpleStatementLocks(new NoOpClient());
transaction.initialize(1, BASE_TX_COMMIT_TIMESTAMP, statementLocks, KernelTransaction.Type.implicit, securityContext(), 0L);
// THEN
assertEquals(reuseCount + 1, transaction.getReuseCount());
}
use of org.neo4j.kernel.impl.locking.NoOpClient in project neo4j by neo4j.
the class KernelTransactionFactory method kernelTransactionWithInternals.
static Instances kernelTransactionWithInternals(SecurityContext securityContext) {
TransactionHeaderInformation headerInformation = new TransactionHeaderInformation(-1, -1, new byte[0]);
TransactionHeaderInformationFactory headerInformationFactory = mock(TransactionHeaderInformationFactory.class);
when(headerInformationFactory.create()).thenReturn(headerInformation);
StorageEngine storageEngine = mock(StorageEngine.class);
StoreReadLayer storeReadLayer = mock(StoreReadLayer.class);
StorageStatement storageStatement = mock(StorageStatement.class);
when(storeReadLayer.newStatement()).thenReturn(storageStatement);
when(storageEngine.storeReadLayer()).thenReturn(storeReadLayer);
KernelTransactionImplementation transaction = new KernelTransactionImplementation(mock(StatementOperationContainer.class), mock(SchemaWriteGuard.class), new TransactionHooks(), mock(ConstraintIndexCreator.class), new Procedures(), headerInformationFactory, mock(TransactionRepresentationCommitProcess.class), mock(TransactionMonitor.class), mock(Supplier.class), mock(Pool.class), Clocks.systemClock(), NULL, LockTracer.NONE, PageCursorTracerSupplier.NULL, storageEngine, new CanWrite());
StatementLocks statementLocks = new SimpleStatementLocks(new NoOpClient());
transaction.initialize(0, 0, statementLocks, KernelTransaction.Type.implicit, securityContext, 0L);
return new Instances(transaction, storageEngine, storeReadLayer, storageStatement);
}
use of org.neo4j.kernel.impl.locking.NoOpClient in project neo4j by neo4j.
the class KernelTransactionImplementationTest method initializeAndClose.
private void initializeAndClose(KernelTransactionImplementation tx, int times) throws Exception {
for (int i = 0; i < times; i++) {
SimpleStatementLocks statementLocks = new SimpleStatementLocks(new NoOpClient());
tx.initialize(i + 10, i + 10, statementLocks, KernelTransaction.Type.implicit, securityContext(), 0L);
tx.close();
}
}
Aggregations