You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@heron.apache.org by hu...@apache.org on 2018/04/10 18:47:27 UTC

[incubator-heron] branch huijunw/healthmgrmetrics updated: update style 2

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

huijun pushed a commit to branch huijunw/healthmgrmetrics
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git


The following commit(s) were added to refs/heads/huijunw/healthmgrmetrics by this push:
     new 1cd888c  update style 2
1cd888c is described below

commit 1cd888cbc2e82ef0cd51453901ae8b3bff9640fd
Author: Huijun Wu <hu...@twitter.com>
AuthorDate: Tue Apr 10 11:47:14 2018 -0700

    update style 2
---
 .../com/twitter/heron/healthmgr/HealthManager.java | 33 ++++++++++++++--------
 1 file changed, 21 insertions(+), 12 deletions(-)

diff --git a/heron/healthmgr/src/java/com/twitter/heron/healthmgr/HealthManager.java b/heron/healthmgr/src/java/com/twitter/heron/healthmgr/HealthManager.java
index a4b57cc..127a413 100644
--- a/heron/healthmgr/src/java/com/twitter/heron/healthmgr/HealthManager.java
+++ b/heron/healthmgr/src/java/com/twitter/heron/healthmgr/HealthManager.java
@@ -314,8 +314,8 @@ public class HealthManager {
 
       String policyClassName = policyConfig.getPolicyClass();
       LOG.info(String.format("Initializing %s with class %s", policyId, policyClassName));
-      Class<IHealthPolicy> policyClass =
-          (Class<IHealthPolicy>) this.getClass().getClassLoader().loadClass(policyClassName);
+      Class<IHealthPolicy> policyClass
+          = (Class<IHealthPolicy>) this.getClass().getClassLoader().loadClass(policyClassName);
 
       AbstractModule module = constructPolicySpecificModule(policyConfig);
       IHealthPolicy policy = injector.createChildInjector(module).getInstance(policyClass);
@@ -326,8 +326,8 @@ public class HealthManager {
 
   @VisibleForTesting
   HealthPolicyConfigReader createPolicyConfigReader() throws FileNotFoundException {
-    String policyConfigFile =
-        Paths.get(Context.heronConf(config), PolicyConfigKey.CONF_FILE_NAME.key()).toString();
+    String policyConfigFile
+        = Paths.get(Context.heronConf(config), PolicyConfigKey.CONF_FILE_NAME.key()).toString();
     HealthPolicyConfigReader configReader = new HealthPolicyConfigReader(policyConfigFile);
     configReader.loadConfig();
     return configReader;
@@ -338,15 +338,19 @@ public class HealthManager {
     return new AbstractModule() {
       @Override
       protected void configure() {
-        bind(String.class).annotatedWith(Names.named(CONF_METRICS_SOURCE_URL))
+        bind(String.class)
+            .annotatedWith(Names.named(CONF_METRICS_SOURCE_URL))
             .toInstance(sourceUrl);
-        bind(String.class).annotatedWith(Names.named(CONF_METRICS_SOURCE_TYPE)).toInstance(type);
+        bind(String.class)
+            .annotatedWith(Names.named(CONF_METRICS_SOURCE_TYPE))
+            .toInstance(type);
       }
     };
   }
 
   private AbstractModule buildCommonConfigModule() throws ReflectiveOperationException {
-    String metricSourceClassName = injector.getInstance(
+    String metricSourceClassName
+        = injector.getInstance(
         com.google.inject.Key.get(String.class, Names.named(CONF_METRICS_SOURCE_TYPE)));
 
     Class<? extends MetricsProvider> metricsProviderClass =
@@ -405,9 +409,12 @@ public class HealthManager {
     String topologyName = getOptionValue(cmd, CliArgs.TOPOLOGY_NAME);
     Boolean verbose = hasOption(cmd, CliArgs.VERBOSE);
 
-    Config.Builder commandLineConfig =
-        Config.newBuilder().put(Key.CLUSTER, cluster).put(Key.ROLE, role).put(Key.ENVIRON, environ)
-            .put(Key.TOPOLOGY_NAME, topologyName).put(Key.VERBOSE, verbose);
+    Config.Builder commandLineConfig = Config.newBuilder()
+        .put(Key.CLUSTER, cluster)
+        .put(Key.ROLE, role)
+        .put(Key.ENVIRON, environ)
+        .put(Key.TOPOLOGY_NAME, topologyName)
+        .put(Key.VERBOSE, verbose);
 
     return commandLineConfig.build();
   }
@@ -421,8 +428,10 @@ public class HealthManager {
   // construct command line help options
   private static Options constructHelpOptions() {
     Options options = new Options();
-    Option help =
-        Option.builder("h").desc("List all options and their description").longOpt("help").build();
+    Option help = Option.builder("h")
+        .desc("List all options and their description")
+        .longOpt("help")
+        .build();
 
     options.addOption(help);
     return options;

-- 
To stop receiving notification emails like this one, please contact
huijun@apache.org.