use of org.neo4j.graphdb.DependencyResolver in project neo4j by neo4j.
the class AbstractNeoServer method createTransactionalActions.
private TransactionFacade createTransactionalActions() {
final long timeoutMillis = getTransactionTimeoutMillis();
final Clock clock = Clocks.systemClock();
transactionRegistry = new TransactionHandleRegistry(clock, timeoutMillis, logProvider);
// ensure that this is > 0
long runEvery = round(timeoutMillis / 2.0);
resolveDependency(JobScheduler.class).scheduleRecurring(serverTransactionTimeout, () -> {
long maxAge = clock.millis() - timeoutMillis;
transactionRegistry.rollbackSuspendedTransactionsIdleSince(maxAge);
}, runEvery, MILLISECONDS);
DependencyResolver dependencyResolver = database.getGraph().getDependencyResolver();
return new TransactionFacade(new TransitionalPeriodTransactionMessContainer(database.getGraph()), dependencyResolver.resolveDependency(QueryExecutionEngine.class), dependencyResolver.resolveDependency(GraphDatabaseQueryService.class), transactionRegistry, logProvider);
}
use of org.neo4j.graphdb.DependencyResolver in project neo4j by neo4j.
the class GuardIT method notIncludeGuardingOperationLayerOnNonGuardingParts.
@Test
public void notIncludeGuardingOperationLayerOnNonGuardingParts() throws Exception {
GraphDatabaseAPI database = startDataBase();
DependencyResolver dependencyResolver = database.getDependencyResolver();
StatementOperationContainer operationParts = dependencyResolver.resolveDependency(StatementOperationContainer.class);
StatementOperationParts guardedParts = operationParts.nonGuarderParts();
assertThat(guardedParts.entityReadOperations(), not(instanceOf(GuardingStatementOperations.class)));
assertThat(guardedParts.entityWriteOperations(), not(instanceOf(GuardingStatementOperations.class)));
}
use of org.neo4j.graphdb.DependencyResolver in project neo4j by neo4j.
the class GuardIT method includeGuardingOperationLayerOnGuardingParts.
@Test
public void includeGuardingOperationLayerOnGuardingParts() throws Exception {
GraphDatabaseAPI database = startDataBase();
DependencyResolver dependencyResolver = database.getDependencyResolver();
StatementOperationContainer operationParts = dependencyResolver.resolveDependency(StatementOperationContainer.class);
StatementOperationParts guardedParts = operationParts.guardedParts();
assertThat(guardedParts.entityReadOperations(), instanceOf(GuardingStatementOperations.class));
assertThat(guardedParts.entityWriteOperations(), instanceOf(GuardingStatementOperations.class));
}
use of org.neo4j.graphdb.DependencyResolver in project neo4j by neo4j.
the class GuardIT method useTimeoutGuard.
@Test
public void useTimeoutGuard() throws Exception {
GraphDatabaseAPI database = startDataBase();
DependencyResolver dependencyResolver = database.getDependencyResolver();
Guard guard = dependencyResolver.resolveDependency(Guard.class);
assertThat(guard, instanceOf(TimeoutGuard.class));
}
use of org.neo4j.graphdb.DependencyResolver in project neo4j by neo4j.
the class StorageLayerRelTypesAndDegreeTest method relTypeId.
private int relTypeId(TestRelType type) {
DependencyResolver resolver = db.getDependencyResolver();
RelationshipTypeTokenHolder relTypeHolder = resolver.resolveDependency(RelationshipTypeTokenHolder.class);
int id = relTypeHolder.getIdByName(type.name());
assertNotEquals(NO_ID, id);
return id;
}
Aggregations