|
Spring for Apache Hadoop | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.data.hadoop.hbase.HbaseAccessor org.springframework.data.hadoop.hbase.HbaseTemplate
public class HbaseTemplate
Central class for accessing the HBase API. Simplifies the use of HBase and helps to avoid common errors. It executes core HBase workflow, leaving application code to invoke actions and extract results.
Constructor Summary | |
---|---|
HbaseTemplate()
|
|
HbaseTemplate(org.apache.hadoop.conf.Configuration configuration)
|
Method Summary | ||
---|---|---|
org.springframework.dao.DataAccessException |
convertHbaseAccessException(java.lang.Exception ex)
|
|
|
execute(java.lang.String tableName,
TableCallback<T> action)
Executes the given action against the specified table handling resource management. |
|
|
find(java.lang.String tableName,
org.apache.hadoop.hbase.client.Scan scan,
ResultsExtractor<T> action)
Scans the target table using the given Scan object. |
|
|
find(java.lang.String tableName,
org.apache.hadoop.hbase.client.Scan scan,
RowMapper<T> action)
Scans the target table using the given Scan object. |
|
|
find(java.lang.String tableName,
java.lang.String family,
ResultsExtractor<T> action)
Scans the target table, using the given family. |
|
|
find(java.lang.String tableName,
java.lang.String family,
RowMapper<T> action)
Scans the target table, using the given column family. |
|
|
find(java.lang.String tableName,
java.lang.String family,
java.lang.String qualifier,
ResultsExtractor<T> action)
Scans the target table, using the given column family and qualifier. |
|
|
find(java.lang.String tableName,
java.lang.String family,
java.lang.String qualifier,
RowMapper<T> action)
Scans the target table, using the given column family. |
|
|
get(java.lang.String tableName,
java.lang.String rowName,
RowMapper<T> mapper)
Gets an individual row from the given table. |
|
|
get(java.lang.String tableName,
java.lang.String rowName,
java.lang.String familyName,
RowMapper<T> mapper)
Gets an individual row from the given table. |
|
|
get(java.lang.String tableName,
java.lang.String rowName,
java.lang.String familyName,
java.lang.String qualifier,
RowMapper<T> mapper)
Gets an individual row from the given table. |
|
void |
setAutoFlush(boolean autoFlush)
Sets the auto flush. |
Methods inherited from class org.springframework.data.hadoop.hbase.HbaseAccessor |
---|
afterPropertiesSet, getCharset, getConfiguration, getTableFactory, setConfiguration, setEncoding, setTableFactory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HbaseTemplate()
public HbaseTemplate(org.apache.hadoop.conf.Configuration configuration)
Method Detail |
---|
public <T> T execute(java.lang.String tableName, TableCallback<T> action)
HbaseOperations
execute
in interface HbaseOperations
tableName
- the target tableaction
- callback object that specifies the action
public org.springframework.dao.DataAccessException convertHbaseAccessException(java.lang.Exception ex)
public <T> T find(java.lang.String tableName, java.lang.String family, ResultsExtractor<T> action)
HbaseOperations
find
in interface HbaseOperations
tableName
- target tablefamily
- column familyaction
- action handling the scanner results
public <T> T find(java.lang.String tableName, java.lang.String family, java.lang.String qualifier, ResultsExtractor<T> action)
HbaseOperations
find
in interface HbaseOperations
tableName
- target tablefamily
- column familyqualifier
- column qualifieraction
- action handling the scanner results
public <T> T find(java.lang.String tableName, org.apache.hadoop.hbase.client.Scan scan, ResultsExtractor<T> action)
HbaseOperations
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.
find
in interface HbaseOperations
tableName
- target tablescan
- table scanneraction
- action handling the scanner results
public <T> java.util.List<T> find(java.lang.String tableName, java.lang.String family, RowMapper<T> action)
HbaseOperations
find
in interface HbaseOperations
tableName
- target tablefamily
- column familyaction
- row mapper handling the scanner results
public <T> java.util.List<T> find(java.lang.String tableName, java.lang.String family, java.lang.String qualifier, RowMapper<T> action)
HbaseOperations
find
in interface HbaseOperations
tableName
- target tablefamily
- column familyqualifier
- column qualifieraction
- row mapper handling the scanner results
public <T> java.util.List<T> find(java.lang.String tableName, org.apache.hadoop.hbase.client.Scan scan, RowMapper<T> action)
HbaseOperations
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.
find
in interface HbaseOperations
tableName
- target tablescan
- table scanneraction
- row mapper handling the scanner results
public <T> T get(java.lang.String tableName, java.lang.String rowName, RowMapper<T> mapper)
HbaseOperations
get
in interface HbaseOperations
tableName
- target tablerowName
- row namemapper
- row mapper
public <T> T get(java.lang.String tableName, java.lang.String rowName, java.lang.String familyName, RowMapper<T> mapper)
HbaseOperations
get
in interface HbaseOperations
tableName
- target tablerowName
- row namefamilyName
- column familymapper
- row mapper
public <T> T get(java.lang.String tableName, java.lang.String rowName, java.lang.String familyName, java.lang.String qualifier, RowMapper<T> mapper)
HbaseOperations
get
in interface HbaseOperations
tableName
- target tablerowName
- row namefamilyName
- familyqualifier
- column qualifiermapper
- row mapper
public void setAutoFlush(boolean autoFlush)
autoFlush
- The autoFlush to set.
|
Spring for Apache Hadoop | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |