Search in sources :

Example 1 with CoreReplicatedContent

use of org.neo4j.causalclustering.core.state.machines.tx.CoreReplicatedContent in project neo4j by neo4j.

the class CommandApplicationProcess method handleOperations.

private long handleOperations(long commandIndex, List<DistributedOperation> operations) {
    try (CommandDispatcher dispatcher = coreStateMachines.commandDispatcher()) {
        for (DistributedOperation operation : operations) {
            if (!sessionTracker.validateOperation(operation.globalSession(), operation.operationId())) {
                sessionTracker.validateOperation(operation.globalSession(), operation.operationId());
                commandIndex++;
                continue;
            }
            CoreReplicatedContent command = (CoreReplicatedContent) operation.content();
            command.dispatch(dispatcher, commandIndex, result -> progressTracker.trackResult(operation, result));
            sessionTracker.update(operation.globalSession(), operation.operationId(), commandIndex);
            commandIndex++;
        }
    }
    return commandIndex - 1;
}
Also used : CoreReplicatedContent(org.neo4j.causalclustering.core.state.machines.tx.CoreReplicatedContent) DistributedOperation(org.neo4j.causalclustering.core.replication.DistributedOperation)

Aggregations

DistributedOperation (org.neo4j.causalclustering.core.replication.DistributedOperation)1 CoreReplicatedContent (org.neo4j.causalclustering.core.state.machines.tx.CoreReplicatedContent)1