Class ProtobufHelper

java.lang.Object
org.apache.hadoop.ipc.ProtobufHelper

@Private @Deprecated public class ProtobufHelper extends Object
Deprecated.
hadoop code MUST use ShadedProtobufHelper.
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 Type
    Method
    Description
    static org.apache.hadoop.thirdparty.protobuf.ByteString
    getByteString(byte[] bytes)
    Deprecated.
    Get the byte string of a non-null byte array.
    static org.apache.hadoop.thirdparty.protobuf.ByteString
    Deprecated.
    Get the ByteString for frequently used fixed and small set strings.
    static org.apache.hadoop.thirdparty.protobuf.ByteString
    Deprecated.
    Get the ByteString for frequently used fixed and small set strings.
    getRemoteException(com.google.protobuf.ServiceException se)
    Deprecated.
    getRemoteException(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.TokenProto
    Deprecated.
    Create a TokenProto instance 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 public static IOException getRemoteException(com.google.protobuf.ServiceException se)
      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

      public static org.apache.hadoop.thirdparty.protobuf.ByteString getFixedByteString(Text key)
      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

      public static org.apache.hadoop.thirdparty.protobuf.ByteString getFixedByteString(String key)
      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 a TokenProto instance 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.