Skip to content
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

Closed
wants to merge 13 commits into from

Conversation

mpardesh
Copy link
Contributor

@mpardesh mpardesh commented Aug 6, 2017

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 use non_ui_druid_broker and then ui_druid_broker.

@yahoo yahoo deleted a comment Aug 6, 2017
@yahoo yahoo deleted a comment Aug 6, 2017
Copy link
Member

@kevinhinterlong kevinhinterlong left a 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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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());
Copy link
Member

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 {
Copy link
Member

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)
Copy link
Member

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,
Copy link
Member

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

@yahoo yahoo deleted a comment Aug 10, 2017
@yahoo yahoo deleted a comment Aug 10, 2017
Copy link
Member

@kevinhinterlong kevinhinterlong left a 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);
Copy link
Member

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")

Copy link
Contributor Author

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.

@yahoo yahoo deleted a comment Aug 11, 2017
@yahoo yahoo deleted a comment Aug 11, 2017
@archolewa
Copy link
Contributor

@mpardesh This guy needs to be rebased as well.

@yahoo yahoo deleted a comment Aug 25, 2017
@michael-mclawhorn
Copy link
Contributor

Merged from another PR. Good job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants