@Override public ITuple next() { if (scanCount++ % 100 == 1) { QueryContextFacade.current().checkMillisBeforeDeadline(); } if (++scanCountDelta >= 1000) { flushScanCountDelta(); } return tupleIterator.next(); }
protected long getCoprocessorTimeoutMillis() { long coopTimeout; if (BackdoorToggles.getQueryTimeout() != -1) { coopTimeout = BackdoorToggles.getQueryTimeout(); } else { coopTimeout = cubeSeg.getConfig().getQueryCoprocessorTimeoutSeconds() * 1000L; } int rpcTimeout; Configuration hconf = HBaseConnection.getCurrentHBaseConfiguration(); rpcTimeout = hconf.getInt(HConstants.HBASE_RPC_TIMEOUT_KEY, HConstants.DEFAULT_HBASE_RPC_TIMEOUT); // HBase rpc timeout must be longer than coprocessor timeout if ((int) (coopTimeout * 1.1) > rpcTimeout) { rpcTimeout = (int) (coopTimeout * 1.1); hconf.setInt(HConstants.HBASE_RPC_TIMEOUT_KEY, rpcTimeout); } // coprocessor timeout is 0 by default if (coopTimeout <= 0) { coopTimeout = (long) (rpcTimeout * 0.9); } queryContext.checkMillisBeforeDeadline(); logger.debug("{} = {} ms, use {} ms as timeout for coprocessor", HConstants.HBASE_RPC_TIMEOUT_KEY, rpcTimeout, coopTimeout); return coopTimeout; }
QueryContextFacade.current().checkMillisBeforeDeadline();
@Override public ITuple next() { if (scanCount++ % 100 == 1) { QueryContextFacade.current().checkMillisBeforeDeadline(); } if (++scanCountDelta >= 1000) { flushScanCountDelta(); } return tupleIterator.next(); }
protected long getCoprocessorTimeoutMillis() { long coopTimeout; if (BackdoorToggles.getQueryTimeout() != -1) { coopTimeout = BackdoorToggles.getQueryTimeout(); } else { coopTimeout = cubeSeg.getConfig().getQueryCoprocessorTimeoutSeconds() * 1000L; } int rpcTimeout; Configuration hconf = HBaseConnection.getCurrentHBaseConfiguration(); rpcTimeout = hconf.getInt(HConstants.HBASE_RPC_TIMEOUT_KEY, HConstants.DEFAULT_HBASE_RPC_TIMEOUT); // HBase rpc timeout must be longer than coprocessor timeout if ((int) (coopTimeout * 1.1) > rpcTimeout) { rpcTimeout = (int) (coopTimeout * 1.1); hconf.setInt(HConstants.HBASE_RPC_TIMEOUT_KEY, rpcTimeout); } // coprocessor timeout is 0 by default if (coopTimeout <= 0) { coopTimeout = (long) (rpcTimeout * 0.9); } queryContext.checkMillisBeforeDeadline(); logger.debug("{} = {} ms, use {} ms as timeout for coprocessor", HConstants.HBASE_RPC_TIMEOUT_KEY, rpcTimeout, coopTimeout); return coopTimeout; }
QueryContextFacade.current().checkMillisBeforeDeadline();