public class HBaseLookupTable
extends java.lang.Object
implements java.io.Closeable
"hawq1"
is mapped to
"cf1:hbase1"
and "hawq2"
is mapped to
"cf1:hbase2"
, will be:ROW COLUMN+CELL hbase_table column=mapping:hawq1, value=cf1:hbase1 hbase_table column=mapping:hawq2, value=cf1:hbase2Data is returned as a map of string and byte array from
getMappings(String)
.
Once created, close()
MUST be called to cleanup resources.
Constructor and Description |
---|
HBaseLookupTable(org.apache.hadoop.conf.Configuration conf)
Constructs a connector to HBase lookup table.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes HBase resources.
|
java.util.Map<java.lang.String,byte[]> |
getMappings(java.lang.String tableName)
Returns mappings for given table name between its HAWQ column names and
HBase column names.
|
public HBaseLookupTable(org.apache.hadoop.conf.Configuration conf) throws java.lang.Exception
close()
to close HBaseAdmin
instance.conf
- HBase configurationjava.io.IOException
- when initializing HBaseAdmin failsjava.lang.Exception
public java.util.Map<java.lang.String,byte[]> getMappings(java.lang.String tableName) throws java.io.IOException
All HAWQ column names are returns in low case.
tableName
- HBase table namejava.io.IOException
- when HBase operations failpublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException