@Override public MessageLite getHandshakeResponse(BitClientHandshake inbound) throws Exception { // logger.debug("Handling handshake from other bit. {}", inbound); if (inbound.getRpcVersion() != DataRpcConfig.RPC_VERSION) { throw new RpcException(String.format("Invalid rpc version. Expected %d, actual %d.", inbound.getRpcVersion(), DataRpcConfig.RPC_VERSION)); } if (inbound.getChannel() != RpcChannel.BIT_DATA) { throw new RpcException(String.format("Invalid NodeMode. Expected BIT_DATA but received %s.", inbound.getChannel())); } final BitServerHandshake.Builder builder = BitServerHandshake.newBuilder(); builder.setRpcVersion(DataRpcConfig.RPC_VERSION); if (config.getAuthMechanismToUse() != null) { builder.addAllAuthenticationMechanisms(config.getAuthProvider().getAllFactoryNames()); } return builder.build(); }
public Builder mergeFrom(org.apache.drill.exec.proto.BitData.BitClientHandshake other) { if (other == org.apache.drill.exec.proto.BitData.BitClientHandshake.getDefaultInstance()) return this; if (other.hasRpcVersion()) { setRpcVersion(other.getRpcVersion()); } if (other.hasChannel()) { setChannel(other.getChannel()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public void writeTo(com.dyuproject.protostuff.Output output, org.apache.drill.exec.proto.BitData.BitClientHandshake message) throws java.io.IOException { if(message.hasRpcVersion()) output.writeInt32(1, message.getRpcVersion(), false); if(message.hasChannel()) output.writeEnum(2, message.getChannel().getNumber(), false); } public boolean isInitialized(org.apache.drill.exec.proto.BitData.BitClientHandshake message)
public void writeTo(com.dyuproject.protostuff.Output output, org.apache.drill.exec.proto.BitData.BitClientHandshake message) throws java.io.IOException { if(message.hasRpcVersion()) output.writeInt32(1, message.getRpcVersion(), false); if(message.hasChannel()) output.writeEnum(2, message.getChannel().getNumber(), false); } public boolean isInitialized(org.apache.drill.exec.proto.BitData.BitClientHandshake message)
public Builder mergeFrom(org.apache.drill.exec.proto.BitData.BitClientHandshake other) { if (other == org.apache.drill.exec.proto.BitData.BitClientHandshake.getDefaultInstance()) return this; if (other.hasRpcVersion()) { setRpcVersion(other.getRpcVersion()); } if (other.hasChannel()) { setChannel(other.getChannel()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }