Package org.apache.hadoop.util
Class ProtoUtil
java.lang.Object
org.apache.hadoop.util.ProtoUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RPC.RpcKindconvert(org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcKindProto kind) static UserGroupInformationgetUgi(org.apache.hadoop.ipc.protobuf.IpcConnectionContextProtos.IpcConnectionContextProto context) static UserGroupInformationgetUgi(org.apache.hadoop.ipc.protobuf.IpcConnectionContextProtos.UserInformationProto userInfo) static org.apache.hadoop.ipc.protobuf.IpcConnectionContextProtos.IpcConnectionContextProtomakeIpcConnectionContext(String protocol, UserGroupInformation ugi, SaslRpcServer.AuthMethod authMethod) This method creates the connection context using exactly the same logic as the old connection context as was done for writable where the effective and real users are set based on the auth method.static org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcRequestHeaderProtomakeRpcRequestHeader(RPC.RpcKind rpcKind, org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcRequestHeaderProto.OperationProto operation, int callId, int retryCount, byte[] uuid) static org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcRequestHeaderProtomakeRpcRequestHeader(RPC.RpcKind rpcKind, org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcRequestHeaderProto.OperationProto operation, int callId, int retryCount, byte[] uuid, AlignmentContext alignmentContext) static intRead a variable length integer in the same format that ProtoBufs encodes.
-
Constructor Details
-
ProtoUtil
public ProtoUtil()
-
-
Method Details
-
readRawVarint32
Read a variable length integer in the same format that ProtoBufs encodes.- Parameters:
in- the input stream to read from- Returns:
- the integer
- Throws:
IOException- if it is malformed or EOF.
-
makeIpcConnectionContext
public static org.apache.hadoop.ipc.protobuf.IpcConnectionContextProtos.IpcConnectionContextProto makeIpcConnectionContext(String protocol, UserGroupInformation ugi, SaslRpcServer.AuthMethod authMethod) This method creates the connection context using exactly the same logic as the old connection context as was done for writable where the effective and real users are set based on the auth method.- Parameters:
protocol- protocol.ugi- ugi.authMethod- authMethod.- Returns:
- IpcConnectionContextProto.
-
getUgi
public static UserGroupInformation getUgi(org.apache.hadoop.ipc.protobuf.IpcConnectionContextProtos.IpcConnectionContextProto context) -
getUgi
public static UserGroupInformation getUgi(org.apache.hadoop.ipc.protobuf.IpcConnectionContextProtos.UserInformationProto userInfo) -
convert
-
makeRpcRequestHeader
public static org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcRequestHeaderProto makeRpcRequestHeader(RPC.RpcKind rpcKind, org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcRequestHeaderProto.OperationProto operation, int callId, int retryCount, byte[] uuid) -
makeRpcRequestHeader
public static org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcRequestHeaderProto makeRpcRequestHeader(RPC.RpcKind rpcKind, org.apache.hadoop.ipc.protobuf.RpcHeaderProtos.RpcRequestHeaderProto.OperationProto operation, int callId, int retryCount, byte[] uuid, AlignmentContext alignmentContext)
-