-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Refactor: Rename DataSourceTaskIdHolder and extract load spec holder to its own class #18732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
64b8b73
Move lookup and broadcast datasource load spec configs to its own cla…
abhishekrb19 eb3feb3
No final in strict compilation mode
abhishekrb19 51c5f85
Add indexing-logs to CI artifact
abhishekrb19 ccaefec
Consolidate into one TaskPropertiesHolder
abhishekrb19 2b08b0d
Works with named injections
abhishekrb19 ca5e6ae
Test works!
abhishekrb19 eb80524
Different approach
abhishekrb19 32e672e
Cleanup MetricsModule
abhishekrb19 a434eeb
Merge branch 'master' into refactor_ds_lookup_holder
abhishekrb19 5033413
Revert changes to EmbeddedKafkaSupervisorTest
abhishekrb19 f44be2f
Revert logging changes
abhishekrb19 2093cd1
Better exception
abhishekrb19 6fd60d6
Cleanup and add LoadSpecHolder
abhishekrb19 58185c0
Try ImplementedBy to avoid explicit bindings everywhere
abhishekrb19 519d536
Revert "Try ImplementedBy to avoid explicit bindings everywhere"
abhishekrb19 0ec0380
Add common DefaultServerHolderModule
abhishekrb19 89e3418
Cleanup CliPeonTest and rename
abhishekrb19 b04d09c
Fix test
abhishekrb19 98979dc
Fix quidem test module init
abhishekrb19 efa0b5e
Rename to mapOfTaskHolderDimensions()
abhishekrb19 b81a9b6
Add test for default non-peon servers
abhishekrb19 91acfd3
Return null from NoopTaskHolder to avoid callers from doing instanceo…
abhishekrb19 014dac2
Merge branch 'master' into refactor_ds_lookup_holder
abhishekrb19 9ed233a
Review suggestions & more tests
abhishekrb19 a810414
Merge branch 'master' into refactor_ds_lookup_holder
abhishekrb19 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
server/src/main/java/org/apache/druid/guice/DefaultServerHolderModule.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| /* | ||
| * 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.guice; | ||
|
|
||
| import com.google.inject.Binder; | ||
| import org.apache.druid.discovery.NodeRole; | ||
| import org.apache.druid.guice.annotations.ExcludeScope; | ||
| import org.apache.druid.initialization.DruidModule; | ||
| import org.apache.druid.server.metrics.DefaultLoadSpecHolder; | ||
| import org.apache.druid.server.metrics.LoadSpecHolder; | ||
| import org.apache.druid.server.metrics.NoopTaskHolder; | ||
| import org.apache.druid.server.metrics.TaskHolder; | ||
|
|
||
| /** | ||
| * Binds the following holder configs for all servers except {@code CliPeon}: | ||
| * <ul> | ||
| * <li>{@link TaskHolder} to {@link NoopTaskHolder}</li> | ||
| * <li>{@link LoadSpecHolder} to {@link DefaultLoadSpecHolder}</li> | ||
| * </ul> | ||
| * | ||
| * <p>For {@code CliPeon}, these bindings are overridden by the peon-specific module.</p> | ||
| */ | ||
| @ExcludeScope(roles = {NodeRole.PEON_JSON_NAME}) | ||
| public class DefaultServerHolderModule implements DruidModule | ||
| { | ||
| @Override | ||
| public void configure(Binder binder) | ||
| { | ||
| binder.bind(TaskHolder.class).to(NoopTaskHolder.class).in(LazySingleton.class); | ||
| binder.bind(LoadSpecHolder.class).to(DefaultLoadSpecHolder.class).in(LazySingleton.class); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check notice
Code scanning / CodeQL
Possible confusion of local and field Note
Copilot Autofix
AI 2 months ago
The best fix is to rename the local variable
lookupTierin thegetLookupTier()method to a different name, such astierToReturnoreffectiveLookupTier. This removes any ambiguity between the field and the local variable. This change should only be performed in the methodgetLookupTier()withinLookupListeningAnnouncerConfig.java, specifically where the local variable is declared and used. No imports or additional definitions are necessary, as it's a straightforward renaming.