Skip to content

Commit

Permalink
Revert "remove CongBackedToolchestWH"
Browse files Browse the repository at this point in the history
This reverts commit b494861.
  • Loading branch information
kgyrtkirk committed Oct 17, 2024
1 parent 5bc29e3 commit 3f14241
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.druid.query;

public class ConglomerateBackedQueryToolChestWarehouse implements QueryToolChestWarehouse
{
private QueryRunnerFactoryConglomerate conglomerate;

public ConglomerateBackedQueryToolChestWarehouse(QueryRunnerFactoryConglomerate conglomerate)
{
this.conglomerate = conglomerate;
}

@Override
public <T, QueryType extends Query<T>> QueryToolChest<T, QueryType> getToolChest(final QueryType query)
{
return conglomerate.findFactory(query).getToolchest();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ protected QueryRunnerBasedOnClusteredClientTestBase()
CLOSER,
TopNQueryConfig.DEFAULT_MIN_TOPN_THRESHOLD
);
toolChestWarehouse = conglomerate;
toolChestWarehouse = new ConglomerateBackedQueryToolChestWarehouse(conglomerate);
}

@AfterClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.apache.druid.data.input.impl.TimestampSpec;
import org.apache.druid.java.util.common.Intervals;
import org.apache.druid.java.util.common.io.Closer;
import org.apache.druid.query.ConglomerateBackedQueryToolChestWarehouse;
import org.apache.druid.query.DefaultGenericQueryMetricsFactory;
import org.apache.druid.query.DefaultQueryConfig;
import org.apache.druid.query.QueryRunnerFactoryConglomerate;
Expand Down Expand Up @@ -110,7 +111,7 @@ public void setUpCommon()
{
resourceCloser = Closer.create();
conglomerate = QueryStackTests.createQueryRunnerFactoryConglomerate(resourceCloser);
queryToolChestWarehouse = conglomerate;
queryToolChestWarehouse = new ConglomerateBackedQueryToolChestWarehouse(conglomerate);
}

public void setUpData() throws Exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.apache.druid.java.util.common.io.Closer;
import org.apache.druid.java.util.emitter.service.ServiceEmitter;
import org.apache.druid.query.BrokerParallelMergeConfig;
import org.apache.druid.query.ConglomerateBackedQueryToolChestWarehouse;
import org.apache.druid.query.DataSource;
import org.apache.druid.query.DefaultGenericQueryMetricsFactory;
import org.apache.druid.query.DefaultQueryRunnerFactoryConglomerate;
Expand Down Expand Up @@ -95,7 +96,6 @@
import org.junit.Assert;

import javax.annotation.Nullable;

import java.util.Collections;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -135,7 +135,7 @@ public static ClientQuerySegmentWalker createClientQuerySegmentWalker(
emitter,
clusterWalker,
localWalker,
conglomerate,
new ConglomerateBackedQueryToolChestWarehouse(conglomerate),
joinableFactory,
new RetryQueryRunnerConfig(),
injector.getInstance(ObjectMapper.class),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.apache.druid.client.InternalQueryConfig;
import org.apache.druid.java.util.emitter.core.NoopEmitter;
import org.apache.druid.java.util.emitter.service.ServiceEmitter;
import org.apache.druid.query.ConglomerateBackedQueryToolChestWarehouse;
import org.apache.druid.query.DefaultGenericQueryMetricsFactory;
import org.apache.druid.query.DefaultQueryConfig;
import org.apache.druid.query.GlobalTableDataSource;
Expand Down Expand Up @@ -73,7 +74,6 @@
import org.easymock.EasyMock;

import javax.annotation.Nullable;

import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;
Expand All @@ -88,7 +88,7 @@ public static QueryLifecycleFactory createMockQueryLifecycleFactory(
)
{
return new QueryLifecycleFactory(
conglomerate,
new ConglomerateBackedQueryToolChestWarehouse(conglomerate),
walker,
new DefaultGenericQueryMetricsFactory(),
new ServiceEmitter("dummy", "dummy", new NoopEmitter()),
Expand Down

0 comments on commit 3f14241

Please sign in to comment.