You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/05/20 04:03:29 UTC

[GitHub] [druid] bananaaggle opened a new pull request #11276: init commit

bananaaggle opened a new pull request #11276:
URL: https://github.com/apache/druid/pull/11276


   A work around to make moving average query through router.
    Hi, @FrankChen021. As I mentioned in #11262, add an empty implementation of QuerySegmentWalker in CliRouter.java can make moving average query through router(just load this extension in broker and router). We use it on production for months. I don't think it very suitable for make same change in community version, because this change only for a contribution extension and it is wired to add an empty implementation. I think it can help you. If you think my way is suitable, I will change my code follow your advice. And if you have other good idea, you can open another PR. 
   
   This PR has:
   - [ ] been self-reviewed.
      - [ ] using the [concurrency checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md) (Remove this item if the PR doesn't have any relation to concurrency.)
   - [ ] added documentation for new or modified features or behaviors.
   - [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
   - [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
   - [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
   - [ ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met.
   - [ ] added integration tests.
   - [ ] been tested in a test Druid cluster.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] bananaaggle commented on pull request #11276: Allow query through router when load moving average extension

Posted by GitBox <gi...@apache.org>.
bananaaggle commented on pull request #11276:
URL: https://github.com/apache/druid/pull/11276#issuecomment-845604374


   @nishantmonu51 Class changed. I don't think its' package is proper, should I move this  NoopQuerySegmentWalker to other package? And should I create unit test for this change? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] bananaaggle commented on pull request #11276: Allow query through router when load moving average extension

Posted by GitBox <gi...@apache.org>.
bananaaggle commented on pull request #11276:
URL: https://github.com/apache/druid/pull/11276#issuecomment-849414875


   > IMO, there should be an IT case to cover this change. But since there's no IT integration for community contributed extensions, currently we don't have to do so.
   > 
   > And for the changes in this PR, any javadoc to describe why `NoopQuerySegmentWalker` should be binded in router is useful.
   
   Good suggestion! I will add javadoc.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] FrankChen021 commented on pull request #11276: Allow query through router when load moving average extension

Posted by GitBox <gi...@apache.org>.
FrankChen021 commented on pull request #11276:
URL: https://github.com/apache/druid/pull/11276#issuecomment-849347965


   IMO, there should be an IT case to cover this change. But since there's no IT integration for community contributed extensions, currently we don't have to do so. 
   
   And for the changes in this PR, any javadoc to describe why `NoopQuerySegmentWalker` should be binded in router is useful.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] bananaaggle commented on pull request #11276: Allow query through router when load moving average extension

Posted by GitBox <gi...@apache.org>.
bananaaggle commented on pull request #11276:
URL: https://github.com/apache/druid/pull/11276#issuecomment-851102356


   > @bananaaggle My PR(#11262), in which a limitation description is added, has been merged into the master branch, I'm suggesting you that you merge the master back to your branch and delete such limitation in this PR. Thanks.
   
   OK, Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] FrankChen021 merged pull request #11276: Allow query through router when load moving average extension

Posted by GitBox <gi...@apache.org>.
FrankChen021 merged pull request #11276:
URL: https://github.com/apache/druid/pull/11276


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] bananaaggle commented on pull request #11276: Allow query through router when load moving average extension

Posted by GitBox <gi...@apache.org>.
bananaaggle commented on pull request #11276:
URL: https://github.com/apache/druid/pull/11276#issuecomment-856377499


   Hi, @FrankChen021. I add annotation for NoopQuerySegmentWalker and move it to package org.apache.druid.server. It is an empty implementation, so should I create unit test for it? If necessary, where should I add it?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] FrankChen021 commented on pull request #11276: Allow query through router when load moving average extension

Posted by GitBox <gi...@apache.org>.
FrankChen021 commented on pull request #11276:
URL: https://github.com/apache/druid/pull/11276#issuecomment-850137335


   @bananaaggle My PR(#11262), in which a limitation description is added,  has been merged into the master branch, I'm suggesting you that you merge the master back to your branch and delete such limitation in this PR. Thanks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] nishantmonu51 commented on a change in pull request #11276: Allow query through router when load moving average extension

Posted by GitBox <gi...@apache.org>.
nishantmonu51 commented on a change in pull request #11276:
URL: https://github.com/apache/druid/pull/11276#discussion_r636521946



##########
File path: services/src/main/java/org/apache/druid/cli/FakeQuerySegmentWalker.java
##########
@@ -0,0 +1,22 @@
+package org.apache.druid.cli;
+
+import org.apache.druid.query.Query;
+import org.apache.druid.query.QueryRunner;
+import org.apache.druid.query.QuerySegmentWalker;
+import org.apache.druid.query.SegmentDescriptor;
+import org.joda.time.Interval;
+
+public class FakeQuerySegmentWalker implements QuerySegmentWalker

Review comment:
       nit: rename to NoopQuerySegmentWalker to be consistent with other druid naming conventions. 

##########
File path: services/src/main/java/org/apache/druid/cli/CliRouter.java
##########
@@ -91,6 +92,8 @@ public CliRouter()
           JsonConfigProvider.bind(binder, "druid.router.avatica.balancer", AvaticaConnectionBalancer.class);
           JsonConfigProvider.bind(binder, "druid.router.managementProxy", ManagementProxyConfig.class);
 
+          binder.bind(QuerySegmentWalker.class).to(FakeQuerySegmentWalker.class).in(LazySingleton.class);

Review comment:
       I would also add a comment mentioning that Router is just used to route the query to appropriate broker, so it is bound to a Noop walker. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] bananaaggle removed a comment on pull request #11276: Allow query through router when load moving average extension

Posted by GitBox <gi...@apache.org>.
bananaaggle removed a comment on pull request #11276:
URL: https://github.com/apache/druid/pull/11276#issuecomment-849414127


   > why `NoopQuerySegmentWalker` should b
   
   OK I will add javadoc.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] bananaaggle commented on pull request #11276: Allow query through router when load moving average extension

Posted by GitBox <gi...@apache.org>.
bananaaggle commented on pull request #11276:
URL: https://github.com/apache/druid/pull/11276#issuecomment-849414127


   > why `NoopQuerySegmentWalker` should b
   
   OK I will add javadoc.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] FrankChen021 commented on a change in pull request #11276: Allow query through router when load moving average extension

Posted by GitBox <gi...@apache.org>.
FrankChen021 commented on a change in pull request #11276:
URL: https://github.com/apache/druid/pull/11276#discussion_r647076400



##########
File path: server/src/main/java/org/apache/druid/server/NoopQuerySegmentWalker.java
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.server;
+
+import org.apache.druid.query.Query;
+import org.apache.druid.query.QueryRunner;
+import org.apache.druid.query.QuerySegmentWalker;
+import org.apache.druid.query.SegmentDescriptor;
+import org.joda.time.Interval;
+
+/**
+ * An empty implementation of {@link QuerySegmentWalker}.
+ *
+ * Some extentions need implementation of QuerySegmentWalker, but this class will not be used in
+ * router. Bind {@link NoopQuerySegmentWalker} in router to allow router load some extentions, which
+ * makes query can run

Review comment:
       nit: no new line after word 'run'




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] bananaaggle commented on a change in pull request #11276: Allow query through router when load moving average extension

Posted by GitBox <gi...@apache.org>.
bananaaggle commented on a change in pull request #11276:
URL: https://github.com/apache/druid/pull/11276#discussion_r647917089



##########
File path: server/src/main/java/org/apache/druid/server/NoopQuerySegmentWalker.java
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.server;
+
+import org.apache.druid.query.Query;
+import org.apache.druid.query.QueryRunner;
+import org.apache.druid.query.QuerySegmentWalker;
+import org.apache.druid.query.SegmentDescriptor;
+import org.joda.time.Interval;
+
+/**
+ * An empty implementation of {@link QuerySegmentWalker}.
+ *
+ * Some extentions need implementation of QuerySegmentWalker, but this class will not be used in
+ * router. Bind {@link NoopQuerySegmentWalker} in router to allow router load some extentions, which
+ * makes query can run

Review comment:
       Fixed.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org