HandshakingState(StateMachine.Fsm fsm, Channel channel) { super(fsm); LOG.debug("NEW STATE: HANDSHAKING"); this.channel = channel; TSOProto.HandshakeRequest.Builder handshake = TSOProto.HandshakeRequest.newBuilder(); // Add the required handshake capabilities when necessary handshake.setClientCapabilities(TSOProto.Capabilities.newBuilder().build()); channel.write(TSOProto.Request.newBuilder().setHandshakeRequest(handshake.build()).build()); timeout = newTimeout(); }
public org.apache.omid.proto.TSOProto.HandshakeRequest buildPartial() { org.apache.omid.proto.TSOProto.HandshakeRequest result = new org.apache.omid.proto.TSOProto.HandshakeRequest(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } if (clientCapabilitiesBuilder_ == null) { result.clientCapabilities_ = clientCapabilities_; } else { result.clientCapabilities_ = clientCapabilitiesBuilder_.build(); } result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public Builder clear() { super.clear(); if (timestampRequestBuilder_ == null) { timestampRequest_ = org.apache.omid.proto.TSOProto.TimestampRequest.getDefaultInstance(); } else { timestampRequestBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000001); if (commitRequestBuilder_ == null) { commitRequest_ = org.apache.omid.proto.TSOProto.CommitRequest.getDefaultInstance(); } else { commitRequestBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000002); if (handshakeRequestBuilder_ == null) { handshakeRequest_ = org.apache.omid.proto.TSOProto.HandshakeRequest.getDefaultInstance(); } else { handshakeRequestBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000004); if (fenceRequestBuilder_ == null) { fenceRequest_ = org.apache.omid.proto.TSOProto.FenceRequest.getDefaultInstance(); } else { fenceRequestBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000008); return this; }
/** * <code>optional .HandshakeRequest handshakeRequest = 3;</code> */ public Builder mergeHandshakeRequest(org.apache.omid.proto.TSOProto.HandshakeRequest value) { if (handshakeRequestBuilder_ == null) { if (((bitField0_ & 0x00000004) == 0x00000004) && handshakeRequest_ != org.apache.omid.proto.TSOProto.HandshakeRequest.getDefaultInstance()) { handshakeRequest_ = org.apache.omid.proto.TSOProto.HandshakeRequest.newBuilder(handshakeRequest_).mergeFrom(value).buildPartial(); } else { handshakeRequest_ = value; } onChanged(); } else { handshakeRequestBuilder_.mergeFrom(value); } bitField0_ |= 0x00000004; return this; } /**
public Builder toBuilder() { return newBuilder(this); }
/** * <code>optional .HandshakeRequest handshakeRequest = 3;</code> */ public Builder clearHandshakeRequest() { if (handshakeRequestBuilder_ == null) { handshakeRequest_ = org.apache.omid.proto.TSOProto.HandshakeRequest.getDefaultInstance(); onChanged(); } else { handshakeRequestBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000004); return this; } /**
public static Builder newBuilder(org.apache.omid.proto.TSOProto.HandshakeRequest prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
private void checkHandshake(final ChannelHandlerContext ctx, TSOProto.HandshakeRequest request) { TSOProto.HandshakeResponse.Builder response = TSOProto.HandshakeResponse.newBuilder(); if (request.hasClientCapabilities()) { response.setClientCompatible(true) .setServerCapabilities(TSOProto.Capabilities.newBuilder().build()); TSOChannelContext tsoCtx = new TSOChannelContext(); tsoCtx.setHandshakeComplete(); ctx.setAttachment(tsoCtx); } else { response.setClientCompatible(false); } ctx.getChannel().write(TSOProto.Response.newBuilder().setHandshakeResponse(response.build()).build()); }
private void checkHandshake(final ChannelHandlerContext ctx, TSOProto.HandshakeRequest request) { TSOProto.HandshakeResponse.Builder response = TSOProto.HandshakeResponse.newBuilder(); if (request.hasClientCapabilities()) { response.setClientCompatible(true) .setServerCapabilities(TSOProto.Capabilities.newBuilder().build()); TSOChannelContext tsoCtx = new TSOChannelContext(); tsoCtx.setHandshakeComplete(); ctx.setAttachment(tsoCtx); } else { response.setClientCompatible(false); } response.setLowLatency(config.getLowLatency()); ctx.getChannel().write(TSOProto.Response.newBuilder().setHandshakeResponse(response.build()).build()); }
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, clientCapabilities_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
public org.apache.omid.proto.TSOProto.HandshakeRequest getDefaultInstanceForType() { return org.apache.omid.proto.TSOProto.HandshakeRequest.getDefaultInstance(); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.apache.omid.proto.TSOProto.HandshakeRequest prototype) {
HandshakingState(StateMachine.Fsm fsm, Channel channel) { super(fsm); LOG.debug("NEW STATE: HANDSHAKING"); this.channel = channel; TSOProto.HandshakeRequest.Builder handshake = TSOProto.HandshakeRequest.newBuilder(); // Add the required handshake capabilities when necessary handshake.setClientCapabilities(TSOProto.Capabilities.newBuilder().build()); channel.write(TSOProto.Request.newBuilder().setHandshakeRequest(handshake.build()).build()); timeout = newTimeout(); }
private void initFields() { timestampRequest_ = org.apache.omid.proto.TSOProto.TimestampRequest.getDefaultInstance(); commitRequest_ = org.apache.omid.proto.TSOProto.CommitRequest.getDefaultInstance(); handshakeRequest_ = org.apache.omid.proto.TSOProto.HandshakeRequest.getDefaultInstance(); fenceRequest_ = org.apache.omid.proto.TSOProto.FenceRequest.getDefaultInstance(); } private byte memoizedIsInitialized = -1;
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeMessage(1, clientCapabilities_); } getUnknownFields().writeTo(output); }
private void checkHandshake(final ChannelHandlerContext ctx, TSOProto.HandshakeRequest request) { TSOProto.HandshakeResponse.Builder response = TSOProto.HandshakeResponse.newBuilder(); if (request.hasClientCapabilities()) { response.setClientCompatible(true) .setServerCapabilities(TSOProto.Capabilities.newBuilder().build()); TSOChannelContext tsoCtx = new TSOChannelContext(); tsoCtx.setHandshakeComplete(); ctx.setAttachment(tsoCtx); } else { response.setClientCompatible(false); } ctx.getChannel().write(TSOProto.Response.newBuilder().setHandshakeResponse(response.build()).build()); }
public Builder mergeFrom(org.apache.omid.proto.TSOProto.HandshakeRequest other) { if (other == org.apache.omid.proto.TSOProto.HandshakeRequest.getDefaultInstance()) return this; if (other.hasClientCapabilities()) { mergeClientCapabilities(other.getClientCapabilities()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }