Database Reference
In-Depth Information
4.
Finally, the client calls the CoprocessorService.getService() method that
should return a reference to the endpoint's protocol buffer service instance.
Refer to the API documentation on the coprocessor package at
http://hbase.apache.org/devapidocs/org/apache/
hadoop/hbase/coprocessor/package-frame.html , and
for an example, refer to the details in /hbase-examples/src/
test/java/org/apache/hadoop/hbase/coprocessor/
example/ of the HBase source code.
The administrative API
So far, we have only talked about the API used by the client to deal with data
manipulation features. HBase also unfolds an API for data deinition such as
operations related to HBase tables, column family and so on. Table creation in HBase
implicitly requires the table schema deinition and the schemas for all contained
column families. Let's start with the data deinition API.
The data deinition API
In HBase, all data is grouped into tables. The important things required to deine a
table are column families. The HTableDescriptor class contains the details about an
HBase table such as the descriptors of all the column families, type of the table that
is catalog table or hbase:meta . It also deines whether the table is read-only or not,
the maximum size of MemStore, when the region split should occur, the registered
coprocessors, and so on. The following is the list of constructors available for the
HTableDescriptor class:
HTableDescriptor(HTableDescriptor desc)
The preceding constructor takes the existing descriptor as a parameter and clones it
to construct the new table descriptor.
HTableDescriptor(TableName name)
The preceding constructor takes the TableName object to construct the table descriptor.
HTableDescriptor(TableName name, HColumnDescriptor[] families)
HTableDescriptor(TableName name, HColumnDescriptor[] families, Map<Immuta
bleBytesWritable,ImmutableBytesWritable> values)
The preceding two protected constructors are used internally to create table descriptors
for catalog table and hbase:meta . Once table descriptor objects are created, the
descriptor provides getters and setters to set different options for the table.
 
Search WWH ::




Custom Search