The HBaseAPI solution uses HBase-compatible APIs and a proper storage model to smoothly migrate HBase services to OceanBase Database.
Background information
Based on the basic APIs provided by TableAPI, the HBaseAPI client of OceanBase Database encapsulates the APIs compatible with HBase. Currently, the features of HBase 0.94 are supported. If your business system uses the native HBase data operation logic, you can install an OceanBase cluster to build HBase tables on OBServer nodes and perform data operations by using HBaseAPI.
Note
For more information about TableAPI, see Implementation of TableAPI.
You can visit the OceanBase GitHub website to experience OBKV.
- For more information about how to use TableAPI, see Simple TableAPI Demo.
To learn more about HBase, visit Apache HBase website or see Apache HBase interface.
HBaseAPI storage model
You can use the wide-column model for data modeling to ensure compatibility with HBase data and maintain data by using HBaseAPI. For detailed operations, see HBaseAPI storage model. For details about HBase storage models, see Apache HBase Data Model.
HBaseAPI client
You can use HBase-compatible APIs for data processing by using the HBaseAPI client. For detailed operations, see Use the HBaseAPI client.
The following sections describe the features of HBaseAPI.
Client thread pool model
HBaseAPI supports managing multiple tables in table pool mode. Currently, three resource pool modes are supported: Reusable, RoundRobin, and ThreadLoca. You can specify a mode when you instantiate the table pool.
Routing table warm-up
When an OBServer node in the cluster fails, the client can refresh the routing table information of the specified HBase table to avoid service interruption or unavailability. The client can also refresh the routing information of the cluster by performing irregular warm-up operations.
Compatibility
The HBaseAPI client implements HTableInterface. The following table describes the compatibility.
| Modifier and type | Method and description | Compatibility |
|---|---|---|
| Result | append(Append append) Appends values to one or more columns within a single row. |
Supported |
| Object[] | batch (List <? extends Row > actions)Same as batch(List, Object[]), but returns an array of results instead of using a results parameter reference. |
Unsupported |
| Void | batch(List <? extends Row > actions, Object[] results) Method that does a batch call on Deletes, Gets, Puts, Increments, Appends and RowMutations. |
Unsupported |
| Boolean | checkAndDelete(byte[] row, byte[] family, byte[] qualifier, byte[] value,Delete delete) Atomically checks if a row/family/qualifier value matches the expected value. |
Supported |
| Boolean | checkAndPut(byte[] row, byte[] family, byte[] qualifier, byte[] value, Put put) Atomically checks if a row/family/qualifier value matches the expected value. |
Supported |
| Void | close() Releases any resources help or pending changes in internal buffers. |
Supported |
| <T extends CoprocessorProtocol,R>Map<byte[],R> | coprocessorExec(Class<T> protocol, byte[] startKey, byte[] endKey, Batch.Call<T,R> callable) Invoke the passed Batch.Call against the CoprocessorProtocol instances running in the selected regions. |
Unsupported |
| <T extends CoprocessorProtocol,R> void | coprocessorExec(Class<T> protocol, byte[] startKey, byte[] endKey,Batch.Call<T,R> callable,Batch.Callback<R> callback) Invoke the passed Batch.Call against the CoprocessorProtocol instances running in the selected regions. |
Unsupported |
| <T extends CoprocessorProtocol> T | coprocessorProxy(Class<T> protocol, byte[] row) Creates and returns a proxy to the CoprocessorProtocol instance running in the region containing the specified row. |
Unsupported |
| Void | delete(Delete delete) Deletes the specified cells/row. |
Supported |
| Void | delete(List<Delete> deletes) Deletes the specified cells/rows in bulk. |
Supported |
| Boolean | exists(Get get) Test for the existence of columns in the table, as specified in the Get. |
Supported |
| Void | flushCommits() Executes all the buffered Put operations. |
Supported |
| Result | get(Get get) Extracts certain cells from a given row. |
Supported |
| Result[] | get(List<Get> gets) Extracts certain cells from the given rows, in batch. |
Supported |
| org.apache.hadoop.conf.Configuration | getConfiguration() Returns the Returns the Configuration object used by this instance. |
Supported |
| Result | getRowOrBefore(byte[] row, byte[] family) Deprecated. As of version 0.92 this method is deprecated without replacement. getRowOrBefore is used internally to find entries in .META. and makes various assumptions about the table (which are true for .META. but not in general) to be efficient. |
Deprecated |
| ResultScanner | getScanner(byte[] family) Gets a scanner on the current table for the given family. |
Supported |
| ResultScanner | getScanner(byte[] family, byte[] qualifier) Gets a scanner on the current table for the given family and qualifier. |
Supported |
| ResultScanner | getScanner(Scan scan) Returns a scanner on the current table as specified by the Scan object. |
Supported |
| HTableDescriptor | getTableDescriptor() Gets the table descriptor for this table. |
Unsupported |
| Byte[] | getTableName() Gets the name of this table. |
Supported |
| Long | getWriteBufferSize() Returns the maximum size in bytes of the write buffer for this HTable. |
Supported |
| Result | increment(Increment increment) Increments one or more columns within a single row. |
Supported |
| Long | incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount) Atomically increments a column value. |
Supported |
| Long | incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount, Durability durability) Atomically increments a column value. |
Supported |
| Boolean | isAutoFlush() Tells whether or not 'auto-flush' is turned on. |
Supported |
| RowLock | lockRow(byte[] row) Deprecated.RowLock and associated operations are deprecated |
Deprecated |
| Void | mutateRow(RowMutations rm) Performs multiple mutations atomically on a single row. |
Unsupported |
| Void | put(List<Put> puts) Puts some data in the table, in batch. |
Supported |
| Void | put(Put put) Puts some data in the table. |
Supported |
| Void | setAutoFlush(boolean autoFlush) See setAutoFlush(boolean, boolean) |
Supported |
| Void | setAutoFlush(boolean autoFlush, boolean clearBufferOnFail) Turns 'auto-flush' on or off. |
Supported |
| Void | setWriteBufferSize(long writeBufferSize) Sets the size of the buffer in bytes. |
Supported |
| Void | unlockRow(RowLock rl) Deprecated.RowLock and associated operations are deprecated |
Deprecated |