You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by jl...@apache.org on 2019/06/04 00:26:06 UTC

[incubator-pinot] branch master updated: Fix controller metric (#4274)

This is an automated email from the ASF dual-hosted git repository.

jlli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new ccab9a1  Fix controller metric (#4274)
ccab9a1 is described below

commit ccab9a1986bbd86a44933df18bcd8dc824bd4964
Author: Jialiang Li <jl...@linkedin.com>
AuthorDate: Mon Jun 3 17:26:00 2019 -0700

    Fix controller metric (#4274)
---
 .../java/org/apache/pinot/controller/ControllerStarter.java    |  2 +-
 .../pinot/server/request/ScheduledRequestHandlerTest.java      | 10 ++++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/pinot-controller/src/main/java/org/apache/pinot/controller/ControllerStarter.java b/pinot-controller/src/main/java/org/apache/pinot/controller/ControllerStarter.java
index 36f6d20..f57d21f 100644
--- a/pinot-controller/src/main/java/org/apache/pinot/controller/ControllerStarter.java
+++ b/pinot-controller/src/main/java/org/apache/pinot/controller/ControllerStarter.java
@@ -195,6 +195,7 @@ public class ControllerStarter {
     // Set up controller metrics
     MetricsHelper.initializeMetrics(_config.subset(METRICS_REGISTRY_NAME));
     MetricsHelper.registerMetricsRegistry(_metricsRegistry);
+    _controllerMetrics.initializeGlobalMeters();
 
     switch (_controllerMode) {
       case DUAL:
@@ -213,7 +214,6 @@ public class ControllerStarter {
 
     ServiceStatus
         .setServiceStatusCallback(new ServiceStatus.MultipleCallbackServiceStatusCallback(_serviceStatusCallbackList));
-    _controllerMetrics.initializeGlobalMeters();
   }
 
   private void setUpHelixController() {
diff --git a/pinot-server/src/test/java/org/apache/pinot/server/request/ScheduledRequestHandlerTest.java b/pinot-server/src/test/java/org/apache/pinot/server/request/ScheduledRequestHandlerTest.java
index 00db1bd..f41f677 100644
--- a/pinot-server/src/test/java/org/apache/pinot/server/request/ScheduledRequestHandlerTest.java
+++ b/pinot-server/src/test/java/org/apache/pinot/server/request/ScheduledRequestHandlerTest.java
@@ -29,6 +29,7 @@ import io.netty.channel.ChannelHandlerContext;
 import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.util.Arrays;
+import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
@@ -126,8 +127,13 @@ public class ScheduledRequestHandlerTest {
           @Nonnull
           @Override
           public ListenableFuture<byte[]> submit(@Nonnull ServerQueryRequest queryRequest) {
-            ListenableFuture<DataTable> dataTable = resourceManager.getQueryRunners().submit(() -> {
-              throw new RuntimeException("query processing error");
+            // The default version of Java 1.8 cannot recognize whether the submit method comes from ListeningExecutorService or Runnable.
+            // Specifying it for less ambiguity.
+            ListenableFuture<DataTable> dataTable = resourceManager.getQueryRunners().submit(new Callable<DataTable>() {
+              @Override
+              public DataTable call() throws Exception {
+                throw new RuntimeException("query processing error");
+              }
             });
             ListenableFuture<DataTable> queryResponse = Futures.catching(dataTable, Throwable.class, input -> {
               DataTable result = new DataTableImplV2();


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