mirror of https://github.com/apache/druid.git
Add "includeAllCounters()" to WorkerContext. (#17047)
This removes the need to read it from the query context.
This commit is contained in:
parent
28ec962a06
commit
99e8f664a9
|
@ -27,6 +27,7 @@ import org.apache.druid.msq.kernel.FrameContext;
|
|||
import org.apache.druid.msq.kernel.FrameProcessorFactory;
|
||||
import org.apache.druid.msq.kernel.QueryDefinition;
|
||||
import org.apache.druid.msq.kernel.WorkOrder;
|
||||
import org.apache.druid.msq.util.MultiStageQueryContext;
|
||||
import org.apache.druid.server.DruidNode;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -98,4 +99,9 @@ public interface WorkerContext
|
|||
DruidNode selfNode();
|
||||
|
||||
DataServerQueryHandlerFactory dataServerQueryHandlerFactory();
|
||||
|
||||
/**
|
||||
* Whether to include all counters in reports. See {@link MultiStageQueryContext#CTX_INCLUDE_ALL_COUNTERS} for detail.
|
||||
*/
|
||||
boolean includeAllCounters();
|
||||
}
|
||||
|
|
|
@ -407,7 +407,7 @@ public class WorkerImpl implements Worker
|
|||
kernel.startReading();
|
||||
|
||||
final QueryContext queryContext = task != null ? QueryContext.of(task.getContext()) : QueryContext.empty();
|
||||
final boolean includeAllCounters = MultiStageQueryContext.getIncludeAllCounters(queryContext);
|
||||
final boolean includeAllCounters = context.includeAllCounters();
|
||||
final RunWorkOrder runWorkOrder = new RunWorkOrder(
|
||||
task.getControllerTaskId(),
|
||||
workOrder,
|
||||
|
|
|
@ -312,6 +312,12 @@ public class IndexerWorkerContext implements WorkerContext
|
|||
return dataServerQueryHandlerFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean includeAllCounters()
|
||||
{
|
||||
return includeAllCounters;
|
||||
}
|
||||
|
||||
private synchronized ServiceLocator makeControllerLocator(final String controllerId)
|
||||
{
|
||||
if (controllerLocator == null) {
|
||||
|
|
|
@ -159,6 +159,12 @@ public class MSQTestWorkerContext implements WorkerContext
|
|||
return injector.getInstance(DataServerQueryHandlerFactory.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean includeAllCounters()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
class FrameContextImpl implements FrameContext
|
||||
{
|
||||
private final File tempDir;
|
||||
|
|
Loading…
Reference in New Issue