FetchHBaseRow

Description:

Fetches a row from an HBase table. The Destination property controls whether the cells are added as flow file attributes, or the row is written to the flow file content as JSON. This processor may be used to fetch a fixed row on a interval by specifying the table and row id directly in the processor, or it may be used to dynamically fetch rows by referencing the table and row id from incoming flow files.

Tags:

hbase, scan, fetch, get, enrich

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
HBase Client ServiceHBase Client ServiceController Service API:
HBaseClientService
Implementation: HBase_2_ClientService
Specifies the Controller Service to use for accessing HBase.
Table NameTable NameThe name of the HBase Table to fetch from.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Row IdentifierRow IdentifierThe identifier of the row to fetch.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
ColumnsColumnsAn optional comma-separated list of "<colFamily>:<colQualifier>" pairs to fetch. To return all columns for a given family, leave off the qualifier such as "<colFamily1>,<colFamily2>".
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Authorizationshbase-fetch-row-authorizationsThe list of authorizations to pass to the scanner. This will be ignored if cell visibility labels are not in use.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
DestinationDestinationflowfile-attributes
  • flowfile-attributes Adds the JSON document representing the row that was fetched as an attribute named hbase.row. The format of the JSON document is determined by the JSON Format property. NOTE: Fetching many large rows into attributes may have a negative impact on performance.
  • flowfile-content Overwrites the FlowFile content with a JSON document representing the row that was fetched. The format of the JSON document is determined by the JSON Format property.
Indicates whether the row fetched from HBase is written to FlowFile content or FlowFile Attributes.
JSON FormatJSON Formatfull-row
  • full-row Creates a JSON document with the format: {"row":<row-id>, "cells":[{"fam":<col-fam>, "qual":<col-val>, "val":<value>, "ts":<timestamp>}]}.
  • col-qual-and-val Creates a JSON document with the format: {"<col-qual>":"<value>", "<col-qual>":"<value>".
Specifies how to represent the HBase row as a JSON document.
JSON Value EncodingJSON Value Encodingnone
  • none Creates a String using the bytes of given data and the given Character Set.
  • base64 Creates a Base64 encoded String of the given data.
Specifies how to represent row ids, column families, column qualifiers, and values when stored in FlowFile attributes, or written to JSON.
Encode Character SetEncode Character SetUTF-8The character set used to encode the JSON representation of the row.
Decode Character SetDecode Character SetUTF-8The character set used to decode data from HBase.

Relationships:

NameDescription
successAll successful fetches are routed to this relationship.
failureAll failed fetches are routed to this relationship.
not foundAll fetches where the row id is not found are routed to this relationship.

Reads Attributes:

None specified.

Writes Attributes:

NameDescription
hbase.tableThe name of the HBase table that the row was fetched from
hbase.rowA JSON document representing the row. This property is only written when a Destination of flowfile-attributes is selected.
mime.typeSet to application/json when using a Destination of flowfile-content, not set or modified otherwise

State management:

This component does not store state.

Restricted:

This component is not restricted.

Input requirement:

This component requires an incoming relationship.

System Resource Considerations:

None specified.