Adapter for Apache HBase 9.8 | webMethods Adapter for Apache HBase Documentation | webMethods Adapter for Apache HBase Installation and User’s Documentation | Adapter Services | Configuring Retrieve Operation With Comparator Service
 
Configuring Retrieve Operation With Comparator Service
Use the Retrieve Operation With Comparator template to configure an adapter service that retrieves selected fields from the records of a HBase table. This service can either retrieve all the records from the selected table or retrieve any required records based on filters, standard set of compound operators, and comparators are provided to form hierarchical queries. For more information about adapter services, see Using Adapter Services.
Be sure to review the section Before Configuring or Managing Adapter Services, before you configure adapter services.
*To configure an adapter service using the Retrieve Operation template
1. In Designer, right-click the package in which the service should be contained and select New > Adapter Service.
2. Select the parent namespace, type a name for the adapter service, and click Next.
3. Select Adapter for Apache HBase as the adapter type and click Next.
4. Select the appropriate Adapter Connection Name and click Next.
5. From the list of available templates, select the Retrieve Operation With Comparator Service template and click Finish.
The adapter service editor for the selected adapter service appears. You can select the Adapter Settings tab at any time to confirm adapter service properties such as the Adapter Name , Adapter Connection Name, and Adapter Service Template as necessary.
6. Select the Schema tab to configure the database table, using the following fields:
Field
Field Description/Action
HBase Table
Select a table name from the list of tables.
Column Family
Displays the list of column families for the selected table name.
Select
Select the check box for the corresponding column family to query.
Maximum Version
Specify the maximum number of versioned values for a corresponding column family.
Sampling Range
Specify the number of records to be scanned to get a minimum set of column qualifiers. These column qualifiers are listed in the Columns tab.
Value can be entered in the following formats:
*Input value can be an integer and it should be greater than 0.
For example, if you provide Sampling Range: 10, then the service will scan initial 10 records of the selected table.
*Input value can be the range between two row ids separated by hyphen (-). The start row id and the end row id should be valid row ids, present in the selected table. The start Row Id should be lexicographically smaller than the end Row Id.
For example, if you provide Sampling Range: row100-row1000, then the service will scan all the records which contain row ids between row100 to row1000
Note:
Sampling is not performed for the values which do not contain the above formats, and the list of column qualifiers under Columns tab will remain empty.
Versions
Specify the number of versions for the selected table, to retrieve more than one value for a particular column qualifier. The default value is 1. Use the default value to get the latest value of the column qualifiers.
Note:
Minimum value of version should be 1, to get a valid output.
Output Structure
Select either of the following Output Structure:
*By Column Family
*By Row Id
Note:
If you do not make an entry for a column qualifier in Columns tab, then the Output Structure of the table remains the same, and returns the complete list of Row Ids of the selected table.
7. Use the Columns tab to define the column qualifiers using the following fields:
Use the icon to create a new row as needed. You can use the icon to fill in all column families to the table.
Use the following fields:
Field
Description/Action
Row Id Data Type
Select the data type to retrieve the required row id.
Column Family
Provides the list of column families based on the selection made in the Schema tab.
Select Column Qualifier
Select the column qualifier which can be retrieved for the corresponding column family.
The Select Column Qualifier field is displayed as a drop down list. These values are retrieved based on the Sampling Range provided in the Schema tab.
Column Qualifier Type
The Select Column Qualifier field supports the following data types:
*java.lang.String
*byte array
*java.lang.Object
Note:
If you change the values of Table Name and Column Family of Schema tab then, the following fields for Columns tab changes:
*The values of Column Family and Select Column Qualifier changes automatically.
*The Column Family changes automatically, but you need to manually change the values of Enter Column Qualifier.
Note:
You must select an appropriate data type for the Column Qualifiers, based on the data type being inserted.
8. Use the WHERE tab to specify the conditions for retrieving records:
a. Select the icon to define new WHERE clause fields.
b. Select a logical operator from the AND/OR field, an Operator as needed, and specify values for the following fields:
Name
Name Description/Action
Parameter Key
Defines a unique key.
The following are the two scenarios which defines the usage of parameter key:
*Rows in both tables in the WHERE clause will be inter dependent if it contains same parameter key.
For example, if you delete a row having parameter key as 1, then it automatically deletes the row having the same parameter key from the other table.
*Two rows having same key within a single table defines its relation, to achieve the functionality of IS/IS NOT operator. The behaviour of filters are decided based on the provided relation.
For example, if you have two rows with same parameter key within a table, then the filter is performed based on the respective IS/IS NOT operator.
Note:
By default, the number of unique keys are between1 to 25. To increase the number of unique keys, set the watt property as, watt.hbase.filters.limit =30.
Compound Operators
Displays the following operators:
*AND
*OR
*SKIP
*WHILE
Filter List
Lists the following filters:
*FamilyFilter
*FirstKeyOnlyFilter
*InclusiveStopFilter
*PageFilter
*PrefixFilter
*QualifierFilter
*RowFilter
*SingleColumnValueExcludeFilter
*SingleColumnValueFilter
*ValueFilter
*DependentColumnFilter
Family/Qualifier
Displays the list of Column Family/Column Qualifier/Column Family.Column Qualifier based on the selected Filter List.
Comparators
Displays the list of following comparators based on the selected Filter List:
*binary
*binaryprefix
*regexstring
*substring
Operator
The following are the operators used:
*=
*<=
*!=
*>
*<
*>=
*IS
*IS NOT
Here are the ways to handle null values when passed as a parameter,
Operator
Input Field
Behaviour
IS
null
Filter with null in the input field will also accept NULL as an input and form the query.
null|T
Filter with null|T accepts NULL as an input and fetches only the rows which passes the provided condition. It ignores the rows which does not have the provided qualifier.
null|F
Filter with null|F accepts NULL as an input and fetches all the rows which passes the provided condition. It also fetches the rows which does not have the provided qualifier.
IS NOT
null
Filter with null in the input field will not accept NULL as an input. If NULL is passed as a value, then corresponding filter will be ignored from the query.
null|T
Filter with null|T will not accept NULL as an input. If NULL is passed as a value, then the corresponding filter will be ignored from the query. If any value other than NULL is passed, it fetches only the rows which passes the provided condition and ignores the rows which does not have the provided qualifier.
null|F
Filter with null|F will not accept NULL as an input. If NULL is passed as a value, then the corresponding filter will be ignored from the query. If any value other than NULL is passed, it fetches all the rows which passes the provided condition and also fetches all the rows which does not have the provided qualifier.
Input Field Type
The data type of the Input Field. You can change this type if needed.
Input Field
The default value is ?, which acts as a placeholder for the variable so that you can set the input variable for that column at run time, or get input external to this adapter service. You can also type a fixed value in this field now or at run time. If you type a fixed value, be sure that it is valid, or an exception will be generated at run time.
The adapter automatically generates values for the following fields:
Field
Description/Action
Parameter Key
The unique key for those rows in the above table which takes input at runtime.
Filters(second occurrence of this field)
The name of the column you need to use in the WHERE clause.
Input Field Type
The corresponding data type of an Input Field.
Input Field(second occurrence of this field)
The name of the input field. By default the name combines the values of Parameter and Field fields. However, you can also choose to specify any custom value.
c. If necessary, use the or icons to change the order of the WHERE clause to ensure the parameters are parsed in the correct order.
d. Repeat this procedure until you have specified all WHERE parameters.
Note:
If u do not pass any input values or if you explicitly pass the value as a NULL character, then the corresponding filters are skipped.
Note:
You must select an appropriate data type for the Column Qualifier filters and Value filters, based on the data type being inserted.
9. Use the Configuration tab to specify the configurations for the required records:
a. Select the icon to define new Configuration fields.
b. Specify values for the following fields:
Name
Name Description/Action
Name
Specifies the field in which the configuration properties are applied. The following are the list of available configuration properties:
*StartRow: Refers to RowID from which the service can start retrieving records.
*StopRow: Refers to RowID till where the service can retrieve records.
*Reverse: Requires input values as boolean. It can either be true or false.
*RowPrefixFilter: Refers to retrieve the records for the mentioned RowID prefix.
Value
The input value provided for the field.
Input Type
The data type of the Input Field. You can change this type if needed.
Input Field
The default value is ?, which acts as a placeholder for the variable so that you can set the input variable for that column at run time, or get input external to this adapter service. You can also type a fixed value in this field now or at run time. If you type a fixed value, be sure that it is valid, or an exception will be generated at run time.
10. To verify input or output information for the service, use the Input/Output tab as required.
11. From the File menu, select Save.