Java 类org.apache.hadoop.hbase.client.HTableInterfaceFactory 实例源码
项目:apple-data
文件:HbaseUtils.java
/**
* Retrieves an Hbase table instance identified by its name and charset using the given table factory.
*
* @param tableName table name
* @param configuration Hbase configuration object
* @param charset name charset (may be null)
* @param tableFactory table factory (may be null)
* @return table instance
*/
public static HTableInterface getHTable(String tableName, Configuration configuration, Charset charset, HTableInterfaceFactory tableFactory) {
if (HbaseSynchronizationManager.hasResource(tableName)) {
return (HTable) HbaseSynchronizationManager.getResource(tableName);
}
HTableInterface t = null;
try {
if (tableFactory != null) {
t = tableFactory.createHTableInterface(configuration, tableName.getBytes(charset));
}
else {
t = new HTable(configuration, tableName.getBytes(charset));
}
return t;
} catch (Exception ex) {
throw convertHbaseException(ex);
}
}
项目:apple-data
文件:HbaseUtils.java
private static void doReleaseTable(String tableName, HTableInterface table, HTableInterfaceFactory tableFactory)
throws IOException {
if (table == null) {
return;
}
// close only if its unbound
if (!isBoundToThread(tableName)) {
if (tableFactory != null) {
tableFactory.releaseHTableInterface(table);
}
else {
table.close();
}
}
}
项目:apple-data
文件:HbaseUtils.java
/**
* Retrieves an Hbase table instance identified by its name and charset using the given table factory.
*
* @param tableName table name
* @param configuration Hbase configuration object
* @param charset name charset (may be null)
* @param tableFactory table factory (may be null)
* @return table instance
*/
public static HTableInterface getHTable(String tableName, Configuration configuration, Charset charset, HTableInterfaceFactory tableFactory) {
if (HbaseSynchronizationManager.hasResource(tableName)) {
return (HTable) HbaseSynchronizationManager.getResource(tableName);
}
HTableInterface t = null;
try {
if (tableFactory != null) {
t = tableFactory.createHTableInterface(configuration, tableName.getBytes(charset));
}
else {
t = new HTable(configuration, tableName.getBytes(charset));
}
return t;
} catch (Exception ex) {
throw convertHbaseException(ex);
}
}
项目:apple-data
文件:HbaseUtils.java
private static void doReleaseTable(String tableName, HTableInterface table, HTableInterfaceFactory tableFactory)
throws IOException {
if (table == null) {
return;
}
// close only if its unbound
if (!isBoundToThread(tableName)) {
if (tableFactory != null) {
tableFactory.releaseHTableInterface(table);
}
else {
table.close();
}
}
}
项目:apple-data
文件:HbaseUtils.java
/**
* Retrieves an Hbase table instance identified by its name and charset using the given table factory.
*
* @param tableName table name
* @param configuration Hbase configuration object
* @param charset name charset (may be null)
* @param tableFactory table factory (may be null)
* @return table instance
*/
public static HTableInterface getHTable(String tableName, Configuration configuration, Charset charset, HTableInterfaceFactory tableFactory) {
if (HbaseSynchronizationManager.hasResource(tableName)) {
return (HTable) HbaseSynchronizationManager.getResource(tableName);
}
HTableInterface t = null;
try {
if (tableFactory != null) {
t = tableFactory.createHTableInterface(configuration, tableName.getBytes(charset));
}
else {
t = new HTable(configuration, tableName.getBytes(charset));
}
return t;
} catch (Exception ex) {
throw convertHbaseException(ex);
}
}
项目:apple-data
文件:HbaseUtils.java
private static void doReleaseTable(String tableName, HTableInterface table, HTableInterfaceFactory tableFactory)
throws IOException {
if (table == null) {
return;
}
// close only if its unbound
if (!isBoundToThread(tableName)) {
if (tableFactory != null) {
tableFactory.releaseHTableInterface(table);
}
else {
table.close();
}
}
}
项目:CSBT
文件:CrossSiteClientScanner.java
protected CrossSiteClientScanner(final Configuration conf, final Scan scan,
final byte[] tableName,
List<Pair<ClusterInfo, Pair<byte[], byte[]>>> clusterStartStopKeyPairs, boolean failover,
ExecutorService pool, CrossSiteZNodes znodes, HTableInterfaceFactory hTableFactory)
throws IOException {
this.configuration = conf;
this.scan = scan;
this.tableName = Bytes.toString(tableName);
this.pool = pool;
this.ignoreUnavailableClusters = configuration.getBoolean(
CrossSiteConstants.CROSS_SITE_TABLE_SCAN_IGNORE_UNAVAILABLE_CLUSTERS, false);
this.failover = failover;
this.clusterStartStopKeyPairs = clusterStartStopKeyPairs;
this.znodes = znodes;
clusterScannerIterators = new ArrayList<ScannerIterator>();
this.hTableFactory = hTableFactory;
initialize();
}
项目:spring-data-hbase
文件:HbaseUtils.java
/**
* Retrieves an Hbase table instance identified by its name and charset
* using the given table factory.
*
* @param tableName table name
* @param configuration Hbase configuration object
* @param charset name charset (may be null)
* @param tableFactory table factory (may be null)
* @return table instance
*/
public static HTableInterface getHTable(String tableName, Configuration configuration, Charset charset,
HTableInterfaceFactory tableFactory) {
if (HbaseSynchronizationManager.hasResource(tableName)) {
return (HTable) HbaseSynchronizationManager.getResource(tableName);
}
HTableInterface t = null;
try {
if (tableFactory != null) {
t = tableFactory.createHTableInterface(configuration, tableName.getBytes(charset));
}
else {
t = new HTable(configuration, tableName.getBytes(charset));
}
return t;
} catch (Exception ex) {
throw convertHbaseException(ex);
}
}
项目:spring-data-hbase
文件:HbaseUtils.java
private static void doReleaseTable(String tableName, HTableInterface table, HTableInterfaceFactory tableFactory)
throws IOException {
if (table == null) {
return;
}
// close only if its unbound
if (!isBoundToThread(tableName)) {
if (tableFactory != null) {
tableFactory.releaseHTableInterface(table);
}
else {
table.close();
}
}
}
项目:apple-data
文件:HbaseUtils.java
/**
* Releases (or closes) the given table, created via the given configuration if it is not managed externally (or bound to the thread).
*
* @param tableName table name
* @param table table
* @param tableFactory table factory
*/
public static void releaseTable(String tableName, HTableInterface table, HTableInterfaceFactory tableFactory) {
try {
doReleaseTable(tableName, table, tableFactory);
} catch (IOException ex) {
throw HbaseUtils.convertHbaseException(ex);
}
}
项目:apple-data
文件:HbaseUtils.java
/**
* Releases (or closes) the given table, created via the given configuration if it is not managed externally (or bound to the thread).
*
* @param tableName table name
* @param table table
* @param tableFactory table factory
*/
public static void releaseTable(String tableName, HTableInterface table, HTableInterfaceFactory tableFactory) {
try {
doReleaseTable(tableName, table, tableFactory);
} catch (IOException ex) {
throw HbaseUtils.convertHbaseException(ex);
}
}
项目:apple-data
文件:HbaseUtils.java
/**
* Releases (or closes) the given table, created via the given configuration if it is not managed externally (or bound to the thread).
*
* @param tableName table name
* @param table table
* @param tableFactory table factory
*/
public static void releaseTable(String tableName, HTableInterface table, HTableInterfaceFactory tableFactory) {
try {
doReleaseTable(tableName, table, tableFactory);
} catch (IOException ex) {
throw HbaseUtils.convertHbaseException(ex);
}
}
项目:apple-data
文件:HBaseDataSource.java
public HTableInterfaceFactory getTableFactory() {
return tableFactory;
}
项目:apple-data
文件:HBaseDataSource.java
public void setTableFactory(HTableInterfaceFactory tableFactory) {
this.tableFactory = tableFactory;
}
项目:apple-data
文件:HBaseDataSource.java
public HTableInterfaceFactory getTableFactory() {
return tableFactory;
}
项目:apple-data
文件:HBaseDataSource.java
public void setTableFactory(HTableInterfaceFactory tableFactory) {
this.tableFactory = tableFactory;
}
项目:apple-data
文件:HBaseDataSource.java
public HTableInterfaceFactory getTableFactory() {
return tableFactory;
}
项目:apple-data
文件:HBaseDataSource.java
public void setTableFactory(HTableInterfaceFactory tableFactory) {
this.tableFactory = tableFactory;
}
项目:spring-data-hbase
文件:HbaseAccessor.java
public HTableInterfaceFactory getTableFactory() {
return tableFactory;
}
项目:haeinsa
文件:DefaultHaeinsaTableIfaceFactory.java
public DefaultHaeinsaTableIfaceFactory(HTableInterfaceFactory tableInterfaceFactory) {
this.tableInterfaceFactory = tableInterfaceFactory;
}
项目:spring-data-hbase
文件:HbaseUtils.java
/**
* Releases (or closes) the given table, created via the given configuration
* if it is not managed externally (or bound to the thread).
*
* @param tableName table name
* @param table table
* @param tableFactory table factory
*/
public static void releaseTable(String tableName, HTableInterface table, HTableInterfaceFactory tableFactory) {
try {
doReleaseTable(tableName, table, tableFactory);
} catch (IOException ex) {
throw HbaseUtils.convertHbaseException(ex);
}
}
项目:spring-data-hbase
文件:HbaseAccessor.java
/**
* Sets the table factory.
*
* @param tableFactory The tableFactory to set.
*/
public void setTableFactory(HTableInterfaceFactory tableFactory) {
this.tableFactory = tableFactory;
}