public Builder mergeFrom(org.apache.drill.exec.proto.UserProtos.BitToUserHandshake other) { if (other == org.apache.drill.exec.proto.UserProtos.BitToUserHandshake.getDefaultInstance()) return this; if (other.hasRpcVersion()) { setRpcVersion(other.getRpcVersion()); setStatus(other.getStatus()); onChanged(); onChanged(); mergeServerInfos(other.getServerInfos()); bitField0_ = (bitField0_ & ~0x00000020); } else { ensureAuthenticationMechanismsIsMutable(); authenticationMechanisms_.addAll(other.authenticationMechanisms_); onChanged(); bitField0_ = (bitField0_ & ~0x00000040); } else { ensureSupportedMethodsIsMutable(); supportedMethods_.addAll(other.supportedMethods_); onChanged(); setEncrypted(other.getEncrypted()); setMaxWrappedSize(other.getMaxWrappedSize());
.setRpcVersion(UserRpcConfig.RPC_VERSION) .setServerInfos(UserRpcUtils.getRpcEndpointInfos(SERVER_NAME)) .addAllSupportedMethods(UserRpcConfig.SUPPORTED_SERVER_METHODS); respBuilder.setStatus(HandshakeStatus.SUCCESS); return respBuilder.build(); connection.changeHandlerTo(config.getMessageHandler()); connection.finalizeSession(userName); respBuilder.setStatus(HandshakeStatus.SUCCESS); if (logger.isTraceEnabled()) { logger.trace("Authenticated {} successfully using PLAIN from {}", userName, connection.getRemoteAddress()); return respBuilder.build(); } catch (UserAuthenticationException ex) { return handleFailure(respBuilder, HandshakeStatus.AUTH_FAILED, ex.getMessage(), ex); respBuilder.addAllAuthenticationMechanisms(config.getAuthProvider().getAllFactoryNames()); respBuilder.setEncrypted(connection.isEncryptionEnabled()); respBuilder.setMaxWrappedSize(connection.getMaxWrappedSize()); respBuilder.setStatus(HandshakeStatus.AUTH_REQUIRED); return respBuilder.build(); } catch (Exception e) { return handleFailure(respBuilder, HandshakeStatus.UNKNOWN_FAILURE, e.getMessage(), e);
public Builder mergeFrom(org.apache.drill.exec.proto.UserProtos.BitToUserHandshake other) { if (other == org.apache.drill.exec.proto.UserProtos.BitToUserHandshake.getDefaultInstance()) return this; if (other.hasRpcVersion()) { setRpcVersion(other.getRpcVersion()); setStatus(other.getStatus()); onChanged(); onChanged(); mergeServerInfos(other.getServerInfos()); bitField0_ = (bitField0_ & ~0x00000020); } else { ensureAuthenticationMechanismsIsMutable(); authenticationMechanisms_.addAll(other.authenticationMechanisms_); onChanged(); bitField0_ = (bitField0_ & ~0x00000040); } else { ensureSupportedMethodsIsMutable(); supportedMethods_.addAll(other.supportedMethods_); onChanged(); setEncrypted(other.getEncrypted()); setMaxWrappedSize(other.getMaxWrappedSize());
return; case 2: builder.setRpcVersion(input.readInt32()); break; case 3: builder.setStatus(org.apache.drill.exec.proto.UserProtos.HandshakeStatus.valueOf(input.readEnum())); break; case 4: builder.setErrorId(input.readString()); break; case 5: builder.setErrorMessage(input.readString()); break; case 6: builder.setServerInfos(input.mergeObject(org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.newBuilder(), org.apache.drill.exec.proto.SchemaUserProtos.RpcEndpointInfos.MERGE)); builder.addAuthenticationMechanisms(input.readString()); break; case 8: builder.addSupportedMethods(org.apache.drill.exec.proto.UserProtos.RpcType.valueOf(input.readEnum())); break; case 9: builder.setEncrypted(input.readBool()); break; case 10: builder.setMaxWrappedSize(input.readInt32()); break; default:
/** * Complete building the given builder for <i>BitToUserHandshake</i> message with given status and error details. * * @param respBuilder Instance of {@link org.apache.drill.exec.proto.UserProtos.BitToUserHandshake} builder which * has RPC version field already set. * @param status Status of handling handshake request. * @param errMsg Error message. * @param exception Optional exception. * @return */ private static BitToUserHandshake handleFailure(BitToUserHandshake.Builder respBuilder, HandshakeStatus status, String errMsg, Exception exception) { final String errorId = UUID.randomUUID().toString(); if (exception != null) { logger.error("Error {} in Handling handshake request: {}, {}", errorId, status, errMsg, exception); } else { logger.error("Error {} in Handling handshake request: {}, {}", errorId, status, errMsg); } return respBuilder .setStatus(status) .setErrorId(errorId) .setErrorMessage(errMsg) .build(); }
private static Builder create() { return new Builder(); }
@java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**
return; case 2: builder.setRpcVersion(input.readInt32()); break; case 3: builder.setStatus(org.apache.drill.exec.proto.UserProtos.HandshakeStatus.valueOf(input.readEnum())); break; case 4: builder.setErrorId(input.readString()); break; case 5: builder.setErrorMessage(input.readString()); break; case 6: builder.setServerInfos(input.mergeObject(org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.newBuilder(), org.apache.drill.exec.proto.SchemaUserProtos.RpcEndpointInfos.MERGE)); builder.addAuthenticationMechanisms(input.readString()); break; case 8: builder.addSupportedMethods(org.apache.drill.exec.proto.UserProtos.RpcType.valueOf(input.readEnum())); break; case 9: builder.setEncrypted(input.readBool()); break; case 10: builder.setMaxWrappedSize(input.readInt32()); break; default:
private static Builder create() { return new Builder(); }
@java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**