/** * <code>optional .HandshakeResponse handshakeResponse = 3;</code> */ public Builder mergeHandshakeResponse(org.apache.omid.proto.TSOProto.HandshakeResponse value) { if (handshakeResponseBuilder_ == null) { if (((bitField0_ & 0x00000004) == 0x00000004) && handshakeResponse_ != org.apache.omid.proto.TSOProto.HandshakeResponse.getDefaultInstance()) { handshakeResponse_ = org.apache.omid.proto.TSOProto.HandshakeResponse.newBuilder(handshakeResponse_).mergeFrom(value).buildPartial(); } else { handshakeResponse_ = value; } onChanged(); } else { handshakeResponseBuilder_.mergeFrom(value); } bitField0_ |= 0x00000004; return this; } /**
public org.apache.omid.proto.TSOProto.HandshakeResponse buildPartial() { org.apache.omid.proto.TSOProto.HandshakeResponse result = new org.apache.omid.proto.TSOProto.HandshakeResponse(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.clientCompatible_ = clientCompatible_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } if (serverCapabilitiesBuilder_ == null) { result.serverCapabilities_ = serverCapabilities_; } else { result.serverCapabilities_ = serverCapabilitiesBuilder_.build(); } if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } result.lowLatency_ = lowLatency_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeBool(1, clientCompatible_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeMessage(2, serverCapabilities_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeBool(3, lowLatency_); } getUnknownFields().writeTo(output); }
public Builder clear() { super.clear(); if (timestampResponseBuilder_ == null) { timestampResponse_ = org.apache.omid.proto.TSOProto.TimestampResponse.getDefaultInstance(); } else { timestampResponseBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000001); if (commitResponseBuilder_ == null) { commitResponse_ = org.apache.omid.proto.TSOProto.CommitResponse.getDefaultInstance(); } else { commitResponseBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000002); if (handshakeResponseBuilder_ == null) { handshakeResponse_ = org.apache.omid.proto.TSOProto.HandshakeResponse.getDefaultInstance(); } else { handshakeResponseBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000004); if (fenceResponseBuilder_ == null) { fenceResponse_ = org.apache.omid.proto.TSOProto.FenceResponse.getDefaultInstance(); } else { fenceResponseBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000008); return this; }
public Builder toBuilder() { return newBuilder(this); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.apache.omid.proto.TSOProto.HandshakeResponse prototype) {
public org.apache.omid.proto.TSOProto.HandshakeResponse getDefaultInstanceForType() { return org.apache.omid.proto.TSOProto.HandshakeResponse.getDefaultInstance(); }
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()); }
/** * <code>optional .HandshakeResponse handshakeResponse = 3;</code> */ public Builder clearHandshakeResponse() { if (handshakeResponseBuilder_ == null) { handshakeResponse_ = org.apache.omid.proto.TSOProto.HandshakeResponse.getDefaultInstance(); onChanged(); } else { handshakeResponseBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000004); return this; } /**
public static Builder newBuilder(org.apache.omid.proto.TSOProto.HandshakeResponse prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
public StateMachine.State handleEvent(ResponseEvent e) { lowLatency = e.getParam().getHandshakeResponse().getLowLatency(); if (e.getParam().hasHandshakeResponse() && e.getParam().getHandshakeResponse().getClientCompatible()) { if (timeout != null) { timeout.cancel(); } return new ConnectedState(fsm, channel, timeoutExecutor); } else { cleanupState(); LOG.error("Client incompatible with server"); return new HandshakeFailedState(fsm, new HandshakeFailedException()); } }
public Builder mergeFrom(org.apache.omid.proto.TSOProto.HandshakeResponse other) { if (other == org.apache.omid.proto.TSOProto.HandshakeResponse.getDefaultInstance()) return this; if (other.hasClientCompatible()) { setClientCompatible(other.getClientCompatible()); } if (other.hasServerCapabilities()) { mergeServerCapabilities(other.getServerCapabilities()); } if (other.hasLowLatency()) { setLowLatency(other.getLowLatency()); } this.mergeUnknownFields(other.getUnknownFields()); return 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()); }
public StateMachine.State handleEvent(ResponseEvent e) { if (e.getParam().hasHandshakeResponse() && e.getParam().getHandshakeResponse().getClientCompatible()) { if (timeout != null) { timeout.cancel(); } return new ConnectedState(fsm, channel, timeoutExecutor); } else { cleanupState(); LOG.error("Client incompatible with server"); return new HandshakeFailedState(fsm, new HandshakeFailedException()); } }
private void initFields() { timestampResponse_ = org.apache.omid.proto.TSOProto.TimestampResponse.getDefaultInstance(); commitResponse_ = org.apache.omid.proto.TSOProto.CommitResponse.getDefaultInstance(); handshakeResponse_ = org.apache.omid.proto.TSOProto.HandshakeResponse.getDefaultInstance(); fenceResponse_ = org.apache.omid.proto.TSOProto.FenceResponse.getDefaultInstance(); } private byte memoizedIsInitialized = -1;
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()); }