-
Notifications
You must be signed in to change notification settings - Fork 96
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
Replace UI/Non-UI broker configuration with one broker #489
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall pretty good. Mostly minor fixes, but it looks like the AsyncDruidWebServiceImplSpec
tests needs to be fixed up as well.
@@ -96,18 +128,46 @@ public static Integer getDruidNonUiPriority() { | |||
* Fetches the druid UI URL. | |||
* | |||
* @return druid UI URL | |||
* @deprecated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a newline after @return
and then add a description saying to use {@link #getDruidUrl()}
return Integer.parseInt(priority); | ||
} | ||
|
||
/** | ||
* Fetches the druid non-UI Priority. | ||
* | ||
* @return druid non-UI URL | ||
* @return druid non-UI priority | ||
* @deprecated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
* The default timeout for queries. | ||
*/ | ||
private static final int DRUID_REQUEST_TIMEOUT_DEFAULT = Math.toIntExact(TimeUnit.MINUTES.toMillis(10)); | ||
|
||
/** | ||
* Fetches the druid UI request Priority. | ||
* | ||
* @return druid UI request timeout | ||
* @return druid UI request priority | ||
* @deprecated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
} | ||
|
||
/** | ||
* Fetches the druid non-UI URL. | ||
* | ||
* @return druid non-UI URL | ||
* @deprecated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -123,7 +183,9 @@ public static String getDruidCoordUrl() { | |||
* Fetches the druid UI request timeout. | |||
* | |||
* @return druid UI request timeout | |||
* @deprecated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
@@ -132,9 +194,28 @@ public static Integer getDruidUiTimeout() { | |||
* Fetches the druid non-UI request timeout. | |||
* | |||
* @return druid non-UI request timeout | |||
* @deprecated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
@@ -155,6 +236,10 @@ public static DruidServiceConfig getNonUiServiceConfig() { | |||
return new DruidServiceConfig("Broker", getDruidNonUiUrl(), getDruidNonUiTimeout(), getDruidNonUiPriority()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't getNonUiServiceConfig()
and getUiServiceConfig()
be deprecated as well?
Also getNonUiServiceConfig()
is used in AsyncDruidWebServiceImplSpec
, which should probably be replaced with calls to getServiceConfig()
.
handlers = getHandlerChain(defaultHandler.nonUiWebServiceHandler.next) | ||
|
||
then: | ||
[AsyncWebServiceRequestHandler, DebugRequestHandler, WeightCheckRequestHandler].every { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we move WeightCheckRequestHandler
up to the previous then
section so that we're still testing that it's in the workflow?
@@ -242,12 +211,10 @@ class DruidWorkflowSpec extends Specification { | |||
def defaultHandler = select.handlerSelector as DefaultWebServiceHandlerSelector | |||
|
|||
when: | |||
def handlers1 = getHandlerChain(defaultHandler.uiWebServiceHandler.next) | |||
def handlers2 = getHandlerChain(defaultHandler.nonUiWebServiceHandler.next) | |||
def handlers1 = getHandlerChain(defaultHandler.webServiceHandler.next) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove the 1
from the variable name
@@ -85,8 +83,7 @@ | |||
@Inject | |||
public DruidWorkflow( | |||
@NotNull DataCache<?> dataCache, | |||
@Named("uiDruidWebService") DruidWebService uiWebService, | |||
@Named("nonUiDruidWebService") DruidWebService nonUiWebService, | |||
@Named("druidWebService") DruidWebService webService, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to remove @Named("druidWebService")
here and the call to .named("druidWebService")
in AbstractBinderFactory
since there's only one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I pulled in a comment that I forgot to include in my last review, but it's pretty small
|
||
bind(uiDruidWebService).named("uiDruidWebService").to(DruidWebService.class); | ||
bind(nonUiDruidWebService).named("nonUiDruidWebService").to(DruidWebService.class); | ||
bind(druidWebService).named("druidWebService").to(DruidWebService.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to remove the call to .named("druidWebService")
since there's only one. Then you can remove the annotations that have @Named("druidWebService")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to do this in my earlier commit. I have pushed another commit with these changes.
@mpardesh This guy needs to be rebased as well. |
Merged from another PR. Good job. |
Here is an attempt at replacing the UI/non-UI code to simplify the code. This feature isn't used anymore and complicates the config. I left the UI and non-UI settings in the configuration for backwards compatibility. First, we will check if
druid_broker
is set. If not, we will try to usenon_ui_druid_broker
and thenui_druid_broker
.