org.springframework.data.hadoop.hbase
Interface HbaseOperations

All Known Implementing Classes:
HbaseTemplate

public interface HbaseOperations

Interface that specifies a basic set of Hbase operations, implemented by HbaseTemplate. Not often used, but a useful option to enhance testability, as it can easily be mocked or stubbed.

Author:
Costin Leau

Method Summary
<T> T
execute(String tableName, TableCallback<T> action)
          Executes the given action against the specified table handling resource management.
<T> T
find(String tableName, Scan scan, ResultsExtractor<T> action)
          Scans the target table using the given Scan object.
<T> List<T>
find(String tableName, Scan scan, RowMapper<T> action)
          Scans the target table using the given Scan object.
<T> T
find(String tableName, String family, ResultsExtractor<T> action)
          Scans the target table, using the given family.
<T> List<T>
find(String tableName, String family, RowMapper<T> action)
          Scans the target table, using the given column family.
<T> T
find(String tableName, String family, String qualifier, ResultsExtractor<T> action)
          Scans the target table, using the given column family and qualifier.
<T> List<T>
find(String tableName, String family, String qualifier, RowMapper<T> action)
          Scans the target table, using the given column family.
<T> T
get(String tableName, String rowName, RowMapper<T> mapper)
          Gets an individual row from the given table.
<T> T
get(String tableName, String rowName, String familyName, RowMapper<T> mapper)
          Gets an individual row from the given table.
<T> T
get(String tableName, String rowName, String familyName, String qualifier, RowMapper<T> mapper)
          Gets an individual row from the given table.
 

Method Detail

execute

<T> T execute(String tableName,
              TableCallback<T> action)
Executes the given action against the specified table handling resource management.

Application exceptions thrown by the action object get propagated to the caller (can only be unchecked). Allows for returning a result object (typically a domain object or collection of domain objects).

Parameters:
tableName - the target table
action - callback object that specifies the action
Returns:
the result object of the callback action, or null

find

<T> T find(String tableName,
           String family,
           ResultsExtractor<T> action)
Scans the target table, using the given family. The content is processed by the given action typically returning a domain object or collection of domain objects.

Parameters:
tableName - target table
family - column family
action - action handling the scanner results
Returns:
the result object of the callback action, or null

find

<T> T find(String tableName,
           String family,
           String qualifier,
           ResultsExtractor<T> action)
Scans the target table, using the given column family and qualifier. The content is processed by the given action typically returning a domain object or collection of domain objects.

Parameters:
tableName - target table
family - column family
qualifier - column qualifier
action - action handling the scanner results
Returns:
the result object of the callback action, or null

find

<T> T find(String tableName,
           Scan scan,
           ResultsExtractor<T> action)
Scans the target table using the given Scan object. Suitable for maximum control over the scanning process. The content is processed by the given action typically returning a domain object or collection of domain objects.

Parameters:
tableName - target table
scan - table scanner
action - action handling the scanner results
Returns:
the result object of the callback action, or null

find

<T> List<T> find(String tableName,
                 String family,
                 RowMapper<T> action)
Scans the target table, using the given column family. The content is processed row by row by the given action, returning a list of domain objects.

Parameters:
tableName - target table
family - column family
action - row mapper handling the scanner results
Returns:
a list of objects mapping the scanned rows

find

<T> List<T> find(String tableName,
                 String family,
                 String qualifier,
                 RowMapper<T> action)
Scans the target table, using the given column family. The content is processed row by row by the given action, returning a list of domain objects.

Parameters:
tableName - target table
family - column family
qualifier - column qualifier
action - row mapper handling the scanner results
Returns:
a list of objects mapping the scanned rows

find

<T> List<T> find(String tableName,
                 Scan scan,
                 RowMapper<T> action)
Scans the target table using the given Scan object. Suitable for maximum control over the scanning process. The content is processed row by row by the given action, returning a list of domain objects.

Parameters:
tableName - target table
scan - table scanner
action - row mapper handling the scanner results
Returns:
a list of objects mapping the scanned rows

get

<T> T get(String tableName,
          String rowName,
          RowMapper<T> mapper)
Gets an individual row from the given table. The content is mapped by the given action.

Parameters:
tableName - target table
rowName - row name
mapper - row mapper
Returns:
object mapping the target row

get

<T> T get(String tableName,
          String rowName,
          String familyName,
          RowMapper<T> mapper)
Gets an individual row from the given table. The content is mapped by the given action.

Parameters:
tableName - target table
rowName - row name
familyName - column family
mapper - row mapper
Returns:
object mapping the target row

get

<T> T get(String tableName,
          String rowName,
          String familyName,
          String qualifier,
          RowMapper<T> mapper)
Gets an individual row from the given table. The content is mapped by the given action.

Parameters:
tableName - target table
rowName - row name
familyName - family
qualifier - column qualifier
mapper - row mapper
Returns:
object mapping the target row