Skip to content

Commit 98ff33e

Browse files
committed
Cleanup and add LoadSpecHolder
1 parent 2093cd1 commit 98ff33e

File tree

2 files changed

+43
-4
lines changed

2 files changed

+43
-4
lines changed

server/src/main/java/org/apache/druid/query/lookup/LookupListeningAnnouncerConfig.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
class LookupListeningAnnouncerConfig
3232
{
3333
public static final String DEFAULT_TIER = "__default";
34-
private final TaskHolder taskPropsHolder;
34+
private final TaskHolder taskHolder;
3535
private final LoadSpecHolder loadSpecHolder;
3636

3737
@JsonProperty("lookupTier")
@@ -41,11 +41,11 @@ class LookupListeningAnnouncerConfig
4141

4242
@JsonCreator
4343
public LookupListeningAnnouncerConfig(
44-
@JacksonInject TaskHolder taskPropsHolder,
44+
@JacksonInject TaskHolder taskHolder,
4545
@JacksonInject LoadSpecHolder loadSpecHolder
4646
)
4747
{
48-
this.taskPropsHolder = taskPropsHolder;
48+
this.taskHolder = taskHolder;
4949
this.loadSpecHolder = loadSpecHolder;
5050
}
5151

@@ -55,7 +55,7 @@ public String getLookupTier()
5555
!(lookupTierIsDatasource && null != lookupTier),
5656
"Cannot specify both `lookupTier` and `lookupTierIsDatasource`"
5757
);
58-
final String lookupTier = lookupTierIsDatasource ? taskPropsHolder.getDataSource() : this.lookupTier;
58+
final String lookupTier = lookupTierIsDatasource ? taskHolder.getDataSource() : this.lookupTier;
5959

6060
return Preconditions.checkNotNull(
6161
lookupTier == null ? DEFAULT_TIER : StringUtils.emptyToNullNonDruidDataString(lookupTier),
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package org.apache.druid.server.metrics;
21+
22+
import org.apache.druid.server.coordination.BroadcastDatasourceLoadingSpec;
23+
import org.apache.druid.server.lookup.cache.LookupLoadingSpec;
24+
25+
/**
26+
* Provides loading specifications for a task or server.
27+
*/
28+
public interface LoadSpecHolder
29+
{
30+
/**
31+
* @return the lookup loading specification.
32+
*/
33+
LookupLoadingSpec getLookupLoadingSpec();
34+
35+
/**
36+
* @return the broadcast datasource loading specification.
37+
*/
38+
BroadcastDatasourceLoadingSpec getBroadcastDatasourceLoadingSpec();
39+
}

0 commit comments

Comments
 (0)