public UnionResultIterators(List<QueryPlan> plans, StatementContext parentStmtCtx) throws SQLException { this.parentStmtCtx = parentStmtCtx; int nPlans = plans.size(); iterators = Lists.newArrayListWithExpectedSize(nPlans); splits = Lists.newArrayListWithExpectedSize(nPlans * 30); scans = Lists.newArrayListWithExpectedSize(nPlans * 10); readMetricsList = Lists.newArrayListWithCapacity(nPlans); overAllQueryMetricsList = Lists.newArrayListWithCapacity(nPlans); for (QueryPlan plan : plans) { readMetricsList.add(plan.getContext().getReadMetricsQueue()); overAllQueryMetricsList.add(plan.getContext().getOverallQueryMetrics()); iterators.add(LookAheadResultIterator.wrap(plan.iterator())); splits.addAll(plan.getSplits()); scans.addAll(plan.getScans()); } }
private void setMetricsInParentContext() { ReadMetricQueue parentCtxReadMetrics = parentStmtCtx.getReadMetricsQueue(); for (ReadMetricQueue readMetrics : readMetricsList) { parentCtxReadMetrics.combineReadMetrics(readMetrics); } OverAllQueryMetrics parentCtxQueryMetrics = parentStmtCtx.getOverallQueryMetrics(); for (OverAllQueryMetrics metric : overAllQueryMetricsList) { parentCtxQueryMetrics.combine(metric); } }
public PhoenixResultSet(ResultIterator resultIterator, RowProjector rowProjector, StatementContext ctx) throws SQLException { this.rowProjector = rowProjector; this.scanner = resultIterator; this.context = ctx; this.statement = context.getStatement(); this.readMetricsQueue = context.getReadMetricsQueue(); this.overAllQueryMetrics = context.getOverallQueryMetrics(); this.queryLogger = context.getQueryLogger() != null ? context.getQueryLogger() : QueryLogger.NO_OP_INSTANCE; }
@Override public ResultIterator iterator(ParallelScanGrouper scanGrouper, Scan scan) throws SQLException { StatementContext context = delegate.getContext(); if (resultIterator == null) { context.getOverallQueryMetrics().startQuery(); resultIterator = new CursorResultIterator(LookAheadResultIterator.wrap(delegate.iterator(scanGrouper, scan)),cursorName); } return resultIterator; }
final String physicalTableName = tableRef.getTable().getPhysicalName().getString(); int numScans = scanLocations.size(); context.getOverallQueryMetrics().updateNumParallelScans(numScans); GLOBAL_NUM_PARALLEL_SCANS.update(numScans); final long renewLeaseThreshold = context.getConnection().getQueryServices().getRenewLeaseThresholdMilliSeconds();
context.getOverallQueryMetrics().cacheRefreshedDueToSplits(); return iterators; } catch (TimeoutException e) { context.getOverallQueryMetrics().queryTimedOut(); GLOBAL_QUERY_TIMEOUT_COUNTER.increment(); if (toThrow != null) { GLOBAL_FAILED_QUERY_COUNTER.increment(); context.getOverallQueryMetrics().queryFailed(); throw toThrow;
public UnionResultIterators(List<QueryPlan> plans, StatementContext parentStmtCtx) throws SQLException { this.parentStmtCtx = parentStmtCtx; int nPlans = plans.size(); iterators = Lists.newArrayListWithExpectedSize(nPlans); splits = Lists.newArrayListWithExpectedSize(nPlans * 30); scans = Lists.newArrayListWithExpectedSize(nPlans * 10); readMetricsList = Lists.newArrayListWithCapacity(nPlans); overAllQueryMetricsList = Lists.newArrayListWithCapacity(nPlans); for (QueryPlan plan : plans) { readMetricsList.add(plan.getContext().getReadMetricsQueue()); overAllQueryMetricsList.add(plan.getContext().getOverallQueryMetrics()); iterators.add(LookAheadResultIterator.wrap(plan.iterator())); splits.addAll(plan.getSplits()); scans.addAll(plan.getScans()); } }
public UnionResultIterators(List<QueryPlan> plans, StatementContext parentStmtCtx) throws SQLException { this.parentStmtCtx = parentStmtCtx; int nPlans = plans.size(); iterators = Lists.newArrayListWithExpectedSize(nPlans); splits = Lists.newArrayListWithExpectedSize(nPlans * 30); scans = Lists.newArrayListWithExpectedSize(nPlans * 10); readMetricsList = Lists.newArrayListWithCapacity(nPlans); overAllQueryMetricsList = Lists.newArrayListWithCapacity(nPlans); for (QueryPlan plan : plans) { readMetricsList.add(plan.getContext().getReadMetricsQueue()); overAllQueryMetricsList.add(plan.getContext().getOverallQueryMetrics()); iterators.add(LookAheadResultIterator.wrap(plan.iterator())); splits.addAll(plan.getSplits()); scans.addAll(plan.getScans()); } }
private void setMetricsInParentContext() { ReadMetricQueue parentCtxReadMetrics = parentStmtCtx.getReadMetricsQueue(); for (ReadMetricQueue readMetrics : readMetricsList) { parentCtxReadMetrics.combineReadMetrics(readMetrics); } OverAllQueryMetrics parentCtxQueryMetrics = parentStmtCtx.getOverallQueryMetrics(); for (OverAllQueryMetrics metric : overAllQueryMetricsList) { parentCtxQueryMetrics.combine(metric); } }
private void setMetricsInParentContext() { ReadMetricQueue parentCtxReadMetrics = parentStmtCtx.getReadMetricsQueue(); for (ReadMetricQueue readMetrics : readMetricsList) { parentCtxReadMetrics.combineReadMetrics(readMetrics); } OverAllQueryMetrics parentCtxQueryMetrics = parentStmtCtx.getOverallQueryMetrics(); for (OverAllQueryMetrics metric : overAllQueryMetricsList) { parentCtxQueryMetrics.combine(metric); } }
public PhoenixResultSet(ResultIterator resultIterator, RowProjector rowProjector, StatementContext ctx) throws SQLException { this.rowProjector = rowProjector; this.scanner = resultIterator; this.context = ctx; this.statement = context.getStatement(); this.readMetricsQueue = context.getReadMetricsQueue(); this.overAllQueryMetrics = context.getOverallQueryMetrics(); this.queryLogger = context.getQueryLogger() != null ? context.getQueryLogger() : QueryLogger.NO_OP_INSTANCE; }
public PhoenixResultSet(ResultIterator resultIterator, RowProjector rowProjector, StatementContext ctx) throws SQLException { this.rowProjector = rowProjector; this.scanner = resultIterator; this.context = ctx; this.statement = context.getStatement(); this.readMetricsQueue = context.getReadMetricsQueue(); this.overAllQueryMetrics = context.getOverallQueryMetrics(); this.queryLogger = context.getQueryLogger() != null ? context.getQueryLogger() : QueryLogger.NO_OP_INSTANCE; }
@Override public ResultIterator iterator(ParallelScanGrouper scanGrouper, Scan scan) throws SQLException { StatementContext context = delegate.getContext(); if (resultIterator == null) { context.getOverallQueryMetrics().startQuery(); resultIterator = new CursorResultIterator(LookAheadResultIterator.wrap(delegate.iterator(scanGrouper, scan)),cursorName); } return resultIterator; }
@Override public ResultIterator iterator(ParallelScanGrouper scanGrouper, Scan scan) throws SQLException { StatementContext context = delegate.getContext(); if (resultIterator == null) { context.getOverallQueryMetrics().startQuery(); resultIterator = new CursorResultIterator(LookAheadResultIterator.wrap(delegate.iterator(scanGrouper, scan)),cursorName); } return resultIterator; }
final String physicalTableName = tableRef.getTable().getPhysicalName().getString(); int numScans = scanLocations.size(); context.getOverallQueryMetrics().updateNumParallelScans(numScans); GLOBAL_NUM_PARALLEL_SCANS.update(numScans); final long renewLeaseThreshold = context.getConnection().getQueryServices().getRenewLeaseThresholdMilliSeconds();
final String physicalTableName = tableRef.getTable().getPhysicalName().getString(); int numScans = scanLocations.size(); context.getOverallQueryMetrics().updateNumParallelScans(numScans); GLOBAL_NUM_PARALLEL_SCANS.update(numScans); final long renewLeaseThreshold = context.getConnection().getQueryServices().getRenewLeaseThresholdMilliSeconds();
context.getOverallQueryMetrics().cacheRefreshedDueToSplits(); return iterators; } catch (TimeoutException e) { context.getOverallQueryMetrics().queryTimedOut(); GLOBAL_QUERY_TIMEOUT_COUNTER.increment(); if (toThrow != null) { GLOBAL_FAILED_QUERY_COUNTER.increment(); context.getOverallQueryMetrics().queryFailed(); throw toThrow;
context.getOverallQueryMetrics().cacheRefreshedDueToSplits(); return iterators; } catch (TimeoutException e) { context.getOverallQueryMetrics().queryTimedOut(); GLOBAL_QUERY_TIMEOUT_COUNTER.increment(); if (toThrow != null) { GLOBAL_FAILED_QUERY_COUNTER.increment(); context.getOverallQueryMetrics().queryFailed(); throw toThrow;