Class ClientUtils

java.lang.Object
org.apache.hadoop.hbase.util.ClientUtils

@Private public final class ClientUtils extends Object
Common Utility class for clients
  • Constructor Details

  • Method Details

    • getLoginContext

      To authenticate the demo client, kinit should be invoked ahead. Here we try to get the Kerberos credential from the ticket cache
      Returns:
      LoginContext Object
      Throws:
      LoginException - Exception thrown if unable to get LoginContext
    • printRow

      public static void printRow(org.apache.hadoop.hbase.thrift.generated.TRowResult rowResult)
      copy values into a TreeMap to get them in sorted order and print it
      Parameters:
      rowResult - Holds row name and then a map of columns to cells
    • utf8

      public static String utf8(byte[] buf)
      Helper to translate byte[]s to UTF8 strings
      Parameters:
      buf - byte array
      Returns:
      UTF8 decoded string value
    • utf8

      public static String utf8(ByteBuffer bb)
      Helper to translate a byte buffer to UTF8 strings
      Parameters:
      bb - byte buffer
      Returns:
      UTF8 decoded string value