Skip to content

Commit

Permalink
Add "includeAllCounters()" to WorkerContext. (#17047)
Browse files Browse the repository at this point in the history
This removes the need to read it from the query context.
  • Loading branch information
gianm authored Sep 13, 2024
1 parent 28ec962 commit 99e8f66
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
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;
Expand Down Expand Up @@ -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();
}
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ private void handleNewWorkOrder(
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,12 @@ public DataServerQueryHandlerFactory dataServerQueryHandlerFactory()
return dataServerQueryHandlerFactory;
}

@Override
public boolean includeAllCounters()
{
return includeAllCounters;
}

private synchronized ServiceLocator makeControllerLocator(final String controllerId)
{
if (controllerLocator == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ public DataServerQueryHandlerFactory dataServerQueryHandlerFactory()
return injector.getInstance(DataServerQueryHandlerFactory.class);
}

@Override
public boolean includeAllCounters()
{
return true;
}

class FrameContextImpl implements FrameContext
{
private final File tempDir;
Expand Down

0 comments on commit 99e8f66

Please sign in to comment.