示例#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: private ContentBuilder<org.neo4j.causalclustering.core.replication.ReplicatedContent> unmarshal(byte contentType, io.netty.buffer.ByteBuf buffer) throws java.io.IOException, org.neo4j.causalclustering.messaging.EndOfStreamException
        private ContentBuilder <ReplicatedContent> Unmarshal(sbyte contentType, ByteBuf buffer)
        {
            switch (contentType)
            {
            case TX_CONTENT_TYPE:
            {
                return(ContentBuilder.Finished(ReplicatedTransactionSerializer.decode(buffer)));
            }

            case DUMMY_REQUEST:
                return(ContentBuilder.Finished(DummyRequest.decode(buffer)));

            default:
                return(Unmarshal(contentType, new NetworkReadableClosableChannelNetty4(buffer)));
            }
        }