Search in sources :

Example 1 with AutoCommitState

use of org.neo4j.bolt.v4.runtime.AutoCommitState in project neo4j by neo4j.

the class BoltStateMachineV4 method buildStates.

@Override
protected States buildStates(MapValue connectionHints, MemoryTracker memoryTracker) {
    memoryTracker.allocateHeap(ConnectedState.SHALLOW_SIZE + ReadyState.SHALLOW_SIZE + AutoCommitState.SHALLOW_SIZE + InTransactionState.SHALLOW_SIZE + FailedState.SHALLOW_SIZE + InterruptedState.SHALLOW_SIZE);
    ConnectedState connected = new ConnectedState(connectionHints);
    // v4
    ReadyState ready = new ReadyState();
    // v4
    AutoCommitState autoCommitState = new AutoCommitState();
    // v4
    InTransactionState inTransaction = new InTransactionState();
    // v4
    FailedState failed = new FailedState();
    InterruptedState interrupted = new InterruptedState();
    connected.setReadyState(ready);
    ready.setTransactionReadyState(inTransaction);
    ready.setStreamingState(autoCommitState);
    ready.setFailedState(failed);
    ready.setInterruptedState(interrupted);
    autoCommitState.setReadyState(ready);
    autoCommitState.setFailedState(failed);
    autoCommitState.setInterruptedState(interrupted);
    inTransaction.setReadyState(ready);
    inTransaction.setFailedState(failed);
    inTransaction.setInterruptedState(interrupted);
    failed.setInterruptedState(interrupted);
    interrupted.setReadyState(ready);
    return new States(connected, failed);
}
Also used : InterruptedState(org.neo4j.bolt.v3.runtime.InterruptedState) InTransactionState(org.neo4j.bolt.v4.runtime.InTransactionState) ReadyState(org.neo4j.bolt.v4.runtime.ReadyState) ConnectedState(org.neo4j.bolt.v3.runtime.ConnectedState) FailedState(org.neo4j.bolt.v4.runtime.FailedState) AutoCommitState(org.neo4j.bolt.v4.runtime.AutoCommitState)

Example 2 with AutoCommitState

use of org.neo4j.bolt.v4.runtime.AutoCommitState in project neo4j by neo4j.

the class BoltStateMachineV43 method buildStates.

@Override
protected States buildStates(MapValue connectionHints, MemoryTracker memoryTracker) {
    memoryTracker.allocateHeap(ConnectedState.SHALLOW_SIZE + RouteMessageHandleStateDecorator.SHALLOW_SIZE + ReadyState.SHALLOW_SIZE + AutoCommitState.SHALLOW_SIZE + InTransactionState.SHALLOW_SIZE + FailedState.SHALLOW_SIZE + InterruptedState.SHALLOW_SIZE);
    // v4.1
    var connected = new ConnectedState(connectionHints);
    // v4
    var autoCommitState = new AutoCommitState();
    // v4
    var inTransaction = new InTransactionState();
    // v4
    var failed = new FailedState();
    // v4
    var ready = RouteMessageHandleStateDecorator.decorate(new ReadyState(), failed);
    // v3
    var interrupted = new InterruptedState();
    connected.setReadyState(ready);
    ready.apply(it -> {
        it.setTransactionReadyState(inTransaction);
        it.setStreamingState(autoCommitState);
        it.setFailedState(failed);
        it.setInterruptedState(interrupted);
    });
    autoCommitState.setReadyState(ready);
    autoCommitState.setFailedState(failed);
    autoCommitState.setInterruptedState(interrupted);
    inTransaction.setReadyState(ready);
    inTransaction.setFailedState(failed);
    inTransaction.setInterruptedState(interrupted);
    failed.setInterruptedState(interrupted);
    interrupted.setReadyState(ready);
    return new States(connected, failed);
}
Also used : InterruptedState(org.neo4j.bolt.v3.runtime.InterruptedState) InTransactionState(org.neo4j.bolt.v4.runtime.InTransactionState) ReadyState(org.neo4j.bolt.v4.runtime.ReadyState) ConnectedState(org.neo4j.bolt.v41.runtime.ConnectedState) FailedState(org.neo4j.bolt.v4.runtime.FailedState) AutoCommitState(org.neo4j.bolt.v4.runtime.AutoCommitState)

Example 3 with AutoCommitState

use of org.neo4j.bolt.v4.runtime.AutoCommitState in project neo4j by neo4j.

the class BoltStateMachineV41 method buildStates.

@Override
protected States buildStates(MapValue connectionHints, MemoryTracker memoryTracker) {
    memoryTracker.allocateHeap(ConnectedState.SHALLOW_SIZE + ReadyState.SHALLOW_SIZE + AutoCommitState.SHALLOW_SIZE + InTransactionState.SHALLOW_SIZE + FailedState.SHALLOW_SIZE + InterruptedState.SHALLOW_SIZE);
    // v4.1
    ConnectedState connected = new ConnectedState(connectionHints);
    // v4
    ReadyState ready = new ReadyState();
    // v4
    AutoCommitState autoCommitState = new AutoCommitState();
    // v4
    InTransactionState inTransaction = new InTransactionState();
    // v4
    FailedState failed = new FailedState();
    InterruptedState interrupted = new InterruptedState();
    connected.setReadyState(ready);
    ready.setTransactionReadyState(inTransaction);
    ready.setStreamingState(autoCommitState);
    ready.setFailedState(failed);
    ready.setInterruptedState(interrupted);
    autoCommitState.setReadyState(ready);
    autoCommitState.setFailedState(failed);
    autoCommitState.setInterruptedState(interrupted);
    inTransaction.setReadyState(ready);
    inTransaction.setFailedState(failed);
    inTransaction.setInterruptedState(interrupted);
    failed.setInterruptedState(interrupted);
    interrupted.setReadyState(ready);
    return new States(connected, failed);
}
Also used : InterruptedState(org.neo4j.bolt.v3.runtime.InterruptedState) InTransactionState(org.neo4j.bolt.v4.runtime.InTransactionState) ReadyState(org.neo4j.bolt.v4.runtime.ReadyState) ConnectedState(org.neo4j.bolt.v41.runtime.ConnectedState) FailedState(org.neo4j.bolt.v4.runtime.FailedState) AutoCommitState(org.neo4j.bolt.v4.runtime.AutoCommitState)

Example 4 with AutoCommitState

use of org.neo4j.bolt.v4.runtime.AutoCommitState in project neo4j by neo4j.

the class BoltStateMachineV42 method buildStates.

@Override
protected States buildStates(MapValue connectionHints, MemoryTracker memoryTracker) {
    memoryTracker.allocateHeap(ConnectedState.SHALLOW_SIZE + ReadyState.SHALLOW_SIZE + AutoCommitState.SHALLOW_SIZE + InTransactionState.SHALLOW_SIZE + FailedState.SHALLOW_SIZE + InterruptedState.SHALLOW_SIZE);
    // v4.1
    ConnectedState connected = new ConnectedState(connectionHints);
    // v4
    ReadyState ready = new ReadyState();
    // v4
    AutoCommitState autoCommitState = new AutoCommitState();
    // v4
    InTransactionState inTransaction = new InTransactionState();
    // v4
    FailedState failed = new FailedState();
    // v3
    InterruptedState interrupted = new InterruptedState();
    connected.setReadyState(ready);
    ready.setTransactionReadyState(inTransaction);
    ready.setStreamingState(autoCommitState);
    ready.setFailedState(failed);
    ready.setInterruptedState(interrupted);
    autoCommitState.setReadyState(ready);
    autoCommitState.setFailedState(failed);
    autoCommitState.setInterruptedState(interrupted);
    inTransaction.setReadyState(ready);
    inTransaction.setFailedState(failed);
    inTransaction.setInterruptedState(interrupted);
    failed.setInterruptedState(interrupted);
    interrupted.setReadyState(ready);
    return new States(connected, failed);
}
Also used : InterruptedState(org.neo4j.bolt.v3.runtime.InterruptedState) InTransactionState(org.neo4j.bolt.v4.runtime.InTransactionState) ReadyState(org.neo4j.bolt.v4.runtime.ReadyState) ConnectedState(org.neo4j.bolt.v41.runtime.ConnectedState) FailedState(org.neo4j.bolt.v4.runtime.FailedState) AutoCommitState(org.neo4j.bolt.v4.runtime.AutoCommitState)

Aggregations

InterruptedState (org.neo4j.bolt.v3.runtime.InterruptedState)4 AutoCommitState (org.neo4j.bolt.v4.runtime.AutoCommitState)4 FailedState (org.neo4j.bolt.v4.runtime.FailedState)4 InTransactionState (org.neo4j.bolt.v4.runtime.InTransactionState)4 ReadyState (org.neo4j.bolt.v4.runtime.ReadyState)4 ConnectedState (org.neo4j.bolt.v41.runtime.ConnectedState)3 ConnectedState (org.neo4j.bolt.v3.runtime.ConnectedState)1