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

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

本文整理了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

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

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

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

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

  1. @Override
  2. public void setReadRpcTimeout(int readRpcTimeout) {
  3. delegate.setReadRpcTimeout(readRpcTimeout);
  4. }

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

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

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

  1. @Override
  2. public void setReadRpcTimeout(int readRpcTimeout) {
  3. delegate.setReadRpcTimeout(readRpcTimeout);
  4. }

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

  1. @Override
  2. public void setReadRpcTimeout(int readRpcTimeout) {
  3. delegate.setReadRpcTimeout(readRpcTimeout);
  4. }

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

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

相关文章