- Index

< Previous |  | Next >

# Using the HBase Admin Operator

## Introduction

The TIBCO StreamBase® Adapter for Apache HBase is implemented as a suite of five global Java operators, including the HBase Admin, Delete, Get, Put, and Scan operators.

This page describes the HBase Admin operator, which allows a StreamBase application to handle data administration calls to the connected HBase database. The operator uses property values in the project's server configuration file to set up the connection to the HBase database, as described in Configuration File Settings. Multiple HBase operators can share a single instance of an HBase connection by selecting the same HBase configuration setting ID.

## Configuration File Settings

This section describes the configuration for an HBase database connection instance that you specify in your project's sbconf file. This configuration is the same for all HBase operator types.

### HBase Operator Configuration

The `<adapter-configurations>` element of a project's sbconf file, despite its name, is used to specify configuration value groups for either operators or adapters.

The HBase configuration section of the sbconf file starts with an `<adapter-configurations>` element that contains one `<adapter-configuration name="hbase">` element. This element, in turn, contains one or more `<setting>` elements.

Each `<section name="hbase">` element must contain one element in the form `<setting name="id" val="`HBaseConfigName`"/>`, where `HBaseConfigName` is the name you assign to a group of settings that uniquely define an individual HBase database connection. All other `<setting>` elements are optional.

The example configuration below shows a basic configuration to connect to an HBase server. You can have as many configurations as your application requires, but each configuration must have a unique `id`.

Example 1. Example <adapter-configuration> Section for HBase

      <adapter-configurations>
        <adapter-configuration name="hbase">
          <section name="hbase">
            <setting name="id" val="HBase Sample"/>
            <setting name="connectAtStartup" val="true" />

            <!-- All values below are passed directly to the
                 HBaseConfiguration class unmodified --/>
            <setting name="hbase.master" val="127.0.0.1:60000" />
            <setting name="hbase.zookeeper.quorum" val="127.0.0.1" />
            <setting name="hbase.zookeeper.property.clientPort" val="2181" />
            <setting name="hbase.client.retries.number" val="5" />
            <setting name="zookeeper.session.timeout" val="5000" />
            <setting name="zookeeper.recovery.retry" val="5" />
          </section>
        </adapter-configuration>
      </adapter-configurations>

### Configuration Settings

Setting | Type | Description
--- | --- | ---
id | string | The value of the `id` setting displays in the drop-down list in the adapter's Properties view, and is used to uniquely identify this section of the configuration file.
connectAtStartup | true or false | If true, this operator instance connects to HBase on startup of this operator's containing module.
*** | string | All other values are directly sent to the HBaseConfiguration class, which is responsible for setting up a connection to the HBase server. See the Apache HBase documentation for the available client configuration options and for further information on setting up a connection to HBase.

## Properties View Settings

This section describes the properties you can set for an HBase Admin operator, using the various tabs of the Properties view in StreamBase Studio.

### General Tab

Name: Use this required field to specify or change the component's name, which must be unique in the current module. The name must contain only alphabetic characters, numbers, and underscores, and no hyphens or other special characters. The first character must be alphabetic or an underscore.

Operator: A read-only field that shows the formal name of the operator.

Class: Shows the fully qualified class name that implements the functionality of this operator. If you need to reference this class name elsewhere in your application, you can right-click this field and select Copy from the context menu to place the full class name in the system clipboard.

Start with application: If this field is set to Yes (default) or to a module parameter that evaluates to `true`, this instance of this operator starts as part of the JVM engine that runs this EventFlow fragment. If this field is set to No or to a module parameter that evaluates to `false`, the operator instance is loaded with the engine, but does not start until you send an epadmin container resume command (or its sbadmin equivalent), or until you start the component with StreamBase Manager.

Enable Error Output Port: Select this check box to add an Error Port to this component. In the EventFlow canvas, the Error Port shows as a red output port, always the last port for the component. See Using Error Ports to learn about Error Ports.

Description: Optionally enter text to briefly describe the component's purpose and function. In the EventFlow canvas, you can see the description by pressing Ctrl while the component's tooltip is displayed.

### Operator Properties Tab

Property | Type | Description
--- | --- | ---
HBase Config | drop-down list | The name of the HBase configuration to use with this operator. The value selected by this drop-down list determines the database connection this operator works against. The values that populate this list are stored in the project's sbconf file, as described in the Configuration File Settings section.
Control Tuple Field Name | string | Specifies the field in the inbound schema that represents the control tuple that contains the control operation data. Leave this field blank to use the complete inbound schema as the control tuple.
Enable Pass Through Fields | check box | If enabled, the fields passed into the operator are copied into a user defined field in the output schema.
Pass Through Field Name | string | The name of the field in the output schema that is to hold the pass-through fields.
Enable Status Port | check box | If enabled, a status port is made available for this operator instance, which will emit status tuples for various events from this operator.
Log Level | drop-down list | Controls the level of verbosity the adapter uses to issue informational traces to the console. This setting is independent of the containing application's overall log level. Available values, in increasing order of verbosity, are: OFF, ERROR, WARN, INFO, DEBUG, TRACE.

### Concurrency Tab

Use the Concurrency tab to specify parallel regions for this instance of this component, or multiplicity options, or both. The Concurrency tab settings are described in Concurrency Options, and dispatch styles are described in Dispatch Styles.

### Caution

Concurrency settings are not suitable for every application, and using these settings requires a thorough analysis of your application. For details, see Execution Order and Concurrency, which includes important guidelines for using the concurrency options.

## Admin Command Information

The Admin Commands section below describes the administrative commands you can send to an HBase database. These commands are the possible values of the command field of the command tuple you send to an HBase Admin operator. The schema of the command tuple is described in Command Schema below.

### Admin Commands

Command | Description
--- | ---
createTable | Creates a new table in the connected HBase database with the families supplied by the input command tuple.
deleteTable | Deletes the specified table in the connected HBase database.
compactTable | Compacts the specified table in the connected HBase database.
enableTable | Enables the specified table in the connected HBase database.
disableTable | Disables the specified table in the connected HBase database.
flushTable | Flushes the specified table in the connected HBase database.
listTableNames | Lists all the current table names in the connected HBase database.
connect | Tells the adapter to connect to the specified HBase database.
disconnect | Tells the adapter to disconnect from the connected HBase database.

### Command Schema

Field | Type | Description
--- | --- | ---
command | string | The name of the command to perform; see above for a list of valid commands.
(optional) tableName | string | The name of the table to perform the command on, if applicable.
(optional) families | list<tuple<string familyName, int maxVersions>> | The family information to use when creating a new table. familyName (string) — The family name to add when the table is created. maxVersions (int) — The maximum number of versions to maintain for this family.

## Related Topics

- Using the HBase Delete Operator

- Using the HBase Get Operator

- Using the HBase Put Operator

- Using the HBase Scan Operator