use of org.neo4j.causalclustering.core.replication.session.GlobalSession in project neo4j by neo4j.
the class DistributedOperation method deserialize.
public static DistributedOperation deserialize(ReadableChannel channel) throws IOException, EndOfStreamException {
long mostSigBits = channel.getLong();
long leastSigBits = channel.getLong();
MemberId owner = new MemberId.Marshal().unmarshal(channel);
GlobalSession globalSession = new GlobalSession(new UUID(mostSigBits, leastSigBits), owner);
long localSessionId = channel.getLong();
long sequenceNumber = channel.getLong();
LocalOperationId localOperationId = new LocalOperationId(localSessionId, sequenceNumber);
ReplicatedContent content = new CoreReplicatedContentMarshal().unmarshal(channel);
return new DistributedOperation(content, globalSession, localOperationId);
}
use of org.neo4j.causalclustering.core.replication.session.GlobalSession in project neo4j by neo4j.
the class ProgressTrackerImplTest method shouldIgnoreOtherSessions.
@Test
public void shouldIgnoreOtherSessions() throws Exception {
// given
GlobalSession sessionB = new GlobalSession(UUID.randomUUID(), null);
DistributedOperation aliasUnderSessionB = new DistributedOperation(ReplicatedInteger.valueOf(0), sessionB, new LocalOperationId(/* same id/sequence number as operationA */
operationA.operationId().localSessionId(), operationA.operationId().sequenceNumber()));
Progress progressA = tracker.start(operationA);
// when
tracker.trackReplication(aliasUnderSessionB);
tracker.trackResult(aliasUnderSessionB, Result.of("result"));
// then
assertEquals(false, progressA.isReplicated());
assertEquals(false, progressA.futureResult().isDone());
}
Aggregations