org.apache.hadoop.hbase.client.Table.setReadRpcTimeout()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(95)

本文整理了Java中org.apache.hadoop.hbase.client.Table.setReadRpcTimeout()方法的一些代码示例,展示了Table.setReadRpcTimeout()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.setReadRpcTimeout()方法的具体详情如下:
包路径:org.apache.hadoop.hbase.client.Table
类名称:Table
方法名:setReadRpcTimeout

Table.setReadRpcTimeout介绍

[英]Set timeout (millisecond) of each rpc read request in operations of this Table instance, will override the value of hbase.rpc.read.timeout in configuration. If a rpc read request waiting too long, it will stop waiting and send a new request to retry until retries exhausted or operation timeout reached.
[中]在此表实例的操作中设置每个rpc读取请求的超时(毫秒),将覆盖hbase的值。rpc。阅读配置超时。如果rpc读取请求等待时间过长,它将停止等待,并发送一个新请求以重试,直到重试次数用尽或达到操作超时。

代码示例

代码示例来源:origin: apache/hbase

/**
 * Set timeout (millisecond) of each rpc request in operations of this Table instance, will
 * override the value of hbase.rpc.timeout in configuration.
 * If a rpc request waiting too long, it will stop waiting and send a new request to retry until
 * retries exhausted or operation timeout reached.
 * <p>
 * NOTE: This will set both the read and write timeout settings to the provided value.
 *
 * @param rpcTimeout the timeout of each rpc request in millisecond.
 *
 * @deprecated Use setReadRpcTimeout or setWriteRpcTimeout instead
 */
@Deprecated
default void setRpcTimeout(int rpcTimeout) {
 setReadRpcTimeout(rpcTimeout);
 setWriteRpcTimeout(rpcTimeout);
}

代码示例来源:origin: apache/hbase

@Test
public void testMultiRowRangeFilterWithExclusive() throws IOException {
 tableName = TableName.valueOf(name.getMethodName());
 TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD, 6000000);
 Table ht = TEST_UTIL.createTable(tableName, family, Integer.MAX_VALUE);
 ht.setReadRpcTimeout(600000);
 ht.setOperationTimeout(6000000);
 generateRows(numRows, ht, family, qf, value);
 Scan scan = new Scan();
 scan.setMaxVersions();
 List<RowRange> ranges = new ArrayList<>();
 ranges.add(new RowRange(Bytes.toBytes(10), true, Bytes.toBytes(20), false));
 ranges.add(new RowRange(Bytes.toBytes(20), false, Bytes.toBytes(40), false));
 ranges.add(new RowRange(Bytes.toBytes(65), true, Bytes.toBytes(75), false));
 MultiRowRangeFilter filter = new MultiRowRangeFilter(ranges);
 scan.setFilter(filter);
 int resultsSize = getResultsSize(ht, scan);
 LOG.info("found " + resultsSize + " results");
 List<Cell> results1 = getScanResult(Bytes.toBytes(10), Bytes.toBytes(40), ht);
 List<Cell> results2 = getScanResult(Bytes.toBytes(65), Bytes.toBytes(75), ht);
 assertEquals((results1.size() - 1) + results2.size(), resultsSize);
 ht.close();
}

代码示例来源:origin: apache/phoenix

@Override
public void setReadRpcTimeout(int readRpcTimeout) {
  delegate.setReadRpcTimeout(readRpcTimeout);
}

代码示例来源:origin: org.apache.hbase/hbase-client

/**
 * Set timeout (millisecond) of each rpc request in operations of this Table instance, will
 * override the value of hbase.rpc.timeout in configuration.
 * If a rpc request waiting too long, it will stop waiting and send a new request to retry until
 * retries exhausted or operation timeout reached.
 * <p>
 * NOTE: This will set both the read and write timeout settings to the provided value.
 *
 * @param rpcTimeout the timeout of each rpc request in millisecond.
 *
 * @deprecated Use setReadRpcTimeout or setWriteRpcTimeout instead
 */
@Deprecated
default void setRpcTimeout(int rpcTimeout) {
 setReadRpcTimeout(rpcTimeout);
 setWriteRpcTimeout(rpcTimeout);
}

代码示例来源:origin: com.aliyun.phoenix/ali-phoenix-core

@Override
public void setReadRpcTimeout(int readRpcTimeout) {
  delegate.setReadRpcTimeout(readRpcTimeout);
}

代码示例来源:origin: org.apache.phoenix/phoenix-core

@Override
public void setReadRpcTimeout(int readRpcTimeout) {
  delegate.setReadRpcTimeout(readRpcTimeout);
}

代码示例来源:origin: org.apache.hbase/hbase-server

@Test
public void testMultiRowRangeFilterWithExclusive() throws IOException {
 tableName = TableName.valueOf(name.getMethodName());
 TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD, 6000000);
 Table ht = TEST_UTIL.createTable(tableName, family, Integer.MAX_VALUE);
 ht.setReadRpcTimeout(600000);
 ht.setOperationTimeout(6000000);
 generateRows(numRows, ht, family, qf, value);
 Scan scan = new Scan();
 scan.setMaxVersions();
 List<RowRange> ranges = new ArrayList<>();
 ranges.add(new RowRange(Bytes.toBytes(10), true, Bytes.toBytes(20), false));
 ranges.add(new RowRange(Bytes.toBytes(20), false, Bytes.toBytes(40), false));
 ranges.add(new RowRange(Bytes.toBytes(65), true, Bytes.toBytes(75), false));
 MultiRowRangeFilter filter = new MultiRowRangeFilter(ranges);
 scan.setFilter(filter);
 int resultsSize = getResultsSize(ht, scan);
 LOG.info("found " + resultsSize + " results");
 List<Cell> results1 = getScanResult(Bytes.toBytes(10), Bytes.toBytes(40), ht);
 List<Cell> results2 = getScanResult(Bytes.toBytes(65), Bytes.toBytes(75), ht);
 assertEquals((results1.size() - 1) + results2.size(), resultsSize);
 ht.close();
}

相关文章