Package org.apache.hadoop.ipc
Class ProtobufHelper
java.lang.Object
org.apache.hadoop.ipc.ProtobufHelper
Deprecated.
Helper methods for protobuf related RPC implementation.
This is deprecated because it references protobuf 2.5 classes
as well as the shaded ones -and so needs an unshaded protobuf-2.5
JAR on the classpath during execution.
It MUST NOT be used internally; it is retained in case existing,
external applications already use it.
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.hadoop.thirdparty.protobuf.ByteStringgetByteString(byte[] bytes) Deprecated.Get the byte string of a non-null byte array.static org.apache.hadoop.thirdparty.protobuf.ByteStringgetFixedByteString(String key) Deprecated.Get the ByteString for frequently used fixed and small set strings.static org.apache.hadoop.thirdparty.protobuf.ByteStringgetFixedByteString(Text key) Deprecated.Get the ByteString for frequently used fixed and small set strings.static IOExceptiongetRemoteException(com.google.protobuf.ServiceException se) Deprecated.static IOExceptiongetRemoteException(org.apache.hadoop.thirdparty.protobuf.ServiceException se) Deprecated.Return the IOException thrown by the remote server wrapped in ServiceException as cause.static org.apache.hadoop.security.proto.SecurityProtos.TokenProtoprotoFromToken(Token<?> tok) Deprecated.Create aTokenProtoinstance from a hadoop token.static Token<? extends TokenIdentifier>tokenFromProto(org.apache.hadoop.security.proto.SecurityProtos.TokenProto tokenProto) Deprecated.Get a token from a TokenProto payload.
-
Method Details
-
getRemoteException
public static IOException getRemoteException(org.apache.hadoop.thirdparty.protobuf.ServiceException se) Deprecated.Return the IOException thrown by the remote server wrapped in ServiceException as cause.- Parameters:
se- ServiceException that wraps IO exception thrown by the server- Returns:
- Exception wrapped in ServiceException or a new IOException that wraps the unexpected ServiceException.
-
getRemoteException
Deprecated.Extract the remote exception from an unshaded version of the protobuf libraries. Kept for backward compatibility. Return the IOException thrown by the remote server wrapped in ServiceException as cause.- Parameters:
se- ServiceException that wraps IO exception thrown by the server- Returns:
- Exception wrapped in ServiceException or a new IOException that wraps the unexpected ServiceException.
-
getFixedByteString
Deprecated.Get the ByteString for frequently used fixed and small set strings.- Parameters:
key- string- Returns:
- the ByteString for frequently used fixed and small set strings.
-
getFixedByteString
Deprecated.Get the ByteString for frequently used fixed and small set strings.- Parameters:
key- string- Returns:
- ByteString for frequently used fixed and small set strings.
-
getByteString
public static org.apache.hadoop.thirdparty.protobuf.ByteString getByteString(byte[] bytes) Deprecated.Get the byte string of a non-null byte array. If the array is 0 bytes long, return a singleton to reduce object allocation.- Parameters:
bytes- bytes to convert.- Returns:
- a value
-
tokenFromProto
public static Token<? extends TokenIdentifier> tokenFromProto(org.apache.hadoop.security.proto.SecurityProtos.TokenProto tokenProto) Deprecated.Get a token from a TokenProto payload.- Parameters:
tokenProto- marshalled token- Returns:
- the token.
-
protoFromToken
public static org.apache.hadoop.security.proto.SecurityProtos.TokenProto protoFromToken(Token<?> tok) Deprecated.Create aTokenProtoinstance from a hadoop token. This builds and caches the fields (identifier, password, kind, service) but not renewer or any payload.- Parameters:
tok- token- Returns:
- a marshallable protobuf class.
-
ShadedProtobufHelper.