本文整理了Java中org.apache.hadoop.hbase.client.Table.setOperationTimeout()
方法的一些代码示例,展示了Table.setOperationTimeout()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.setOperationTimeout()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.client.Table
类名称:Table
方法名:setOperationTimeout
[英]Set timeout (millisecond) of each operation in this Table instance, will override the value of hbase.client.operation.timeout in configuration. Operation timeout is a top-level restriction that makes sure a blocking method will not be blocked more than this. In each operation, if rpc request fails because of timeout or other reason, it will retry until success or throw a RetriesExhaustedException. But if the total time being blocking reach the operation timeout before retries exhausted, it will break early and throw SocketTimeoutException.
[中]设置此表实例中每个操作的超时(毫秒)将覆盖hbase的值。客户活动配置超时。操作超时是一个顶级限制,确保阻塞方法的阻塞不会超过此限制。在每个操作中,如果rpc请求由于超时或其他原因失败,它将重试直到成功,或者抛出RetriesHaustedException。但是,如果阻塞的总时间在重试耗尽之前达到操作超时,它将提前中断并抛出SocketTimeoutException。
代码示例来源: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 setOperationTimeout(int operationTimeout) {
delegate.setOperationTimeout(operationTimeout);
}
代码示例来源:origin: apache/hbase
@Test
public void testgetColumnHint() throws IOException {
try (Table t = createTable()) {
t.setOperationTimeout(10000);
t.setRpcTimeout(10000);
t.put(new Put(ROW).addColumn(FAMILY, col1, 100, value));
t.put(new Put(ROW).addColumn(FAMILY, col1, 101, value));
t.put(new Put(ROW).addColumn(FAMILY, col1, 102, value));
t.put(new Put(ROW).addColumn(FAMILY, col1, 103, value));
t.put(new Put(ROW).addColumn(FAMILY, col1, 104, value));
t.put(new Put(ROW2).addColumn(FAMILY, col1, 104, value));
TEST_UTIL.getAdmin().flush(t.getName());
t.delete(new Delete(ROW).addColumn(FAMILY, col1));
}
}
代码示例来源:origin: org.apache.phoenix/phoenix-core
@Override
public void setOperationTimeout(int operationTimeout) {
delegate.setOperationTimeout(operationTimeout);
}
代码示例来源:origin: com.aliyun.phoenix/ali-phoenix-core
@Override
public void setOperationTimeout(int operationTimeout) {
delegate.setOperationTimeout(operationTimeout);
}
代码示例来源:origin: ManbangGroup/cantor
private Table getTable(String namespace, String tableName) throws Exception {
Table table = connection.getTable(TableName.valueOf(namespace, tableName));
table.setOperationTimeout(TABLE_OPERATION_TIMEOUT);
return table;
}
代码示例来源: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();
}
代码示例来源:origin: org.apache.hbase/hbase-server
@Test
public void testgetColumnHint() throws IOException {
try (Table t = createTable()) {
t.setOperationTimeout(10000);
t.setRpcTimeout(10000);
t.put(new Put(ROW).addColumn(FAMILY, col1, 100, value));
t.put(new Put(ROW).addColumn(FAMILY, col1, 101, value));
t.put(new Put(ROW).addColumn(FAMILY, col1, 102, value));
t.put(new Put(ROW).addColumn(FAMILY, col1, 103, value));
t.put(new Put(ROW).addColumn(FAMILY, col1, 104, value));
t.put(new Put(ROW2).addColumn(FAMILY, col1, 104, value));
TEST_UTIL.getAdmin().flush(t.getName());
t.delete(new Delete(ROW).addColumn(FAMILY, col1));
}
}
内容来源于网络,如有侵权,请联系作者删除!