Package org.apache.hadoop.hbase.util
Class ClientUtils
java.lang.Object
org.apache.hadoop.hbase.util.ClientUtils
Common Utility class for clients
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LoginContextTo authenticate the demo client, kinit should be invoked ahead.static voidprintRow(org.apache.hadoop.hbase.thrift.generated.TRowResult rowResult) copy values into a TreeMap to get them in sorted order and print itstatic Stringutf8(byte[] buf) Helper to translate byte[]s to UTF8 stringsstatic Stringutf8(ByteBuffer bb) Helper to translate a byte buffer to UTF8 strings
-
Constructor Details
-
ClientUtils
private ClientUtils()
-
-
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
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
Helper to translate byte[]s to UTF8 strings- Parameters:
buf- byte array- Returns:
- UTF8 decoded string value
-
utf8
Helper to translate a byte buffer to UTF8 strings- Parameters:
bb- byte buffer- Returns:
- UTF8 decoded string value
-