示例#1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private ContentBuilder<org.neo4j.causalclustering.core.replication.ReplicatedContent> unmarshal(byte contentType, org.neo4j.storageengine.api.ReadableChannel channel) throws java.io.IOException, org.neo4j.causalclustering.messaging.EndOfStreamException
        private ContentBuilder <ReplicatedContent> Unmarshal(sbyte contentType, ReadableChannel channel)
        {
            switch (contentType)
            {
            case TX_CONTENT_TYPE:
                return(ContentBuilder.Finished(ReplicatedTransactionSerializer.unmarshal(channel)));

            case RAFT_MEMBER_SET_TYPE:
                return(ContentBuilder.Finished(MemberIdSetSerializer.unmarshal(channel)));

            case ID_RANGE_REQUEST_TYPE:
                return(ContentBuilder.Finished(ReplicatedIdAllocationRequestSerializer.unmarshal(channel)));

            case TOKEN_REQUEST_TYPE:
                return(ContentBuilder.Finished(ReplicatedTokenRequestSerializer.unmarshal(channel)));

            case NEW_LEADER_BARRIER_TYPE:
                return(ContentBuilder.Finished(new NewLeaderBarrier()));

            case LOCK_TOKEN_REQUEST:
                return(ContentBuilder.Finished(ReplicatedLockTokenSerializer.unmarshal(channel)));

            case DISTRIBUTED_OPERATION:
            {
                return(DistributedOperation.deserialize(channel));
            }

            case DUMMY_REQUEST:
                return(ContentBuilder.Finished(DummyRequest.Marshal.INSTANCE.unmarshal(channel)));

            default:
                throw new System.InvalidOperationException("Not a recognized content type: " + contentType);
            }
        }
示例#2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void handle(org.neo4j.causalclustering.core.consensus.membership.MemberIdSet memberIdSet) throws java.io.IOException
            public override void Handle(MemberIdSet memberIdSet)
            {
                WritableChannel.put(RAFT_MEMBER_SET_TYPE);
                MemberIdSetSerializer.marshal(memberIdSet, WritableChannel);
            }
示例#3
0
 public override void Handle(MemberIdSet memberIdSet)
 {
     Output.Add(ChunkedReplicatedContent.Single(RAFT_MEMBER_SET_TYPE, channel => MemberIdSetSerializer.marshal(memberIdSet, channel)));
 }