About custom table coprocessors

You can add table coprocessors so that HBase can run custom code on the server side against the stored data and filter local minimum or maximum value during ingestion without scanning the entire table.

You can use built-in table coprocessors from the upstream HBase releases. COD supports custom table coprocessors, which you can implement and extend from HBase coprocessors’ interfaces.

You can add custom table coprocessors into the HBase tables or remove them from HBase tables, also obtain a list of coprocessors with its status on the COD environment.

You must ensure that:
  • You have the CDP CLI setup.
  • You have uploaded the JAR file (custom coprocessor) to a remote location that the COD instance can access.

Add custom coprocessors into HBase tables

You can execute the following steps to add custom table coprocessors into the HBase table.

  1. Upload your custom coprocessor to a remote location. For example, S3.
  2. Run the following add-coprocessor command to add a specific coprocessor using its canonical class name.
    # add table-level coprocessor
    cdp opdb add-coprocessor \
    --environment ENVIRONMENT \ 
    --database DATABASE  \
    --table-name TABLE_NAME \ 
    --coprocessor-canonical-name COPROCESSOR_CANONICAL_NAME \
    [--coprocessor-location-url COPROCESSOR_LOCATION_URL] \
    [--coprocessor-args COPROCESSOR_ARGS]

Remove custom coprocessors from HBase tables

Run the following command to remove the custom coprocessors from the HBase tables.

  1. Run the following remove-coprocessor command to remove a specific coprocessor using its canonical class name.
    # remove table-level coprocessor
    cdp opdb remove-coprocessor \
    --environment ENVIRONMENT \
    --database DATABASE \
    --table-name TABLE_NAME \
    --coprocessor-canonical-name COPROCESSOR_CANONICAL_NAME \
    [--force] \
    [--no-force]

Obtain a list of coprocessors from a COD environment

Run the following command to obtain a list of coprocessors from a COD environment.

  1. Run the following list-coprocessors command to obtan a list of all the added coprocessors.
    # Get a list of coprocessors with its status on the COD environment
    cdp opdb list-coprocessors \
    --environment ENVIRONMENT \
    --database DATABASE \
    [--table-name TABLE_NAME] \
    [--command-id COMMAND_ID]

Verify table coprocessors in HBase tables

After you add or remove the table coprocessors through CDP CLI, you can verify whether they are added successfully.

  1. Open the HBase UI from the Cloudera Manager.
  2. Click User Tables under Tables.
  3. Check the coprocessors details in the Description column for the respective HBase tables.