incubator-s4-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmo...@apache.org
Subject git commit: S4-129 properly handle zk CLI option for node command
Date Wed, 13 Mar 2013 11:18:06 GMT
Updated Branches:
  refs/heads/S4-129 [created] 1cd3c5db9


S4-129 properly handle zk CLI option for node command


Project: http://git-wip-us.apache.org/repos/asf/incubator-s4/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-s4/commit/1cd3c5db
Tree: http://git-wip-us.apache.org/repos/asf/incubator-s4/tree/1cd3c5db
Diff: http://git-wip-us.apache.org/repos/asf/incubator-s4/diff/1cd3c5db

Branch: refs/heads/S4-129
Commit: 1cd3c5db9ca34fa3807df873c140e74ec7cca90f
Parents: 632057f
Author: Matthieu Morel <mmorel@apache.org>
Authored: Wed Mar 13 12:15:47 2013 +0100
Committer: Matthieu Morel <mmorel@apache.org>
Committed: Wed Mar 13 12:15:47 2013 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/s4/core/S4Node.java   |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/1cd3c5db/subprojects/s4-core/src/main/java/org/apache/s4/core/S4Node.java
----------------------------------------------------------------------
diff --git a/subprojects/s4-core/src/main/java/org/apache/s4/core/S4Node.java b/subprojects/s4-core/src/main/java/org/apache/s4/core/S4Node.java
index c5b0151..7aafe90 100644
--- a/subprojects/s4-core/src/main/java/org/apache/s4/core/S4Node.java
+++ b/subprojects/s4-core/src/main/java/org/apache/s4/core/S4Node.java
@@ -21,16 +21,18 @@ import java.io.IOException;
 import java.lang.Thread.UncaughtExceptionHandler;
 
 import org.apache.s4.core.util.ArchiveFetchException;
+import org.apache.s4.core.util.ParametersInjectionModule;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.beust.jcommander.JCommander;
 import com.beust.jcommander.Parameter;
 import com.beust.jcommander.Parameters;
+import com.google.common.collect.ImmutableMap;
 import com.google.common.io.Resources;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
-import com.google.inject.Module;
+import com.google.inject.util.Modules;
 
 /**
  * Entry point for starting an S4 node. It parses arguments and injects an {@link S4Bootstrap}
based on the
@@ -66,8 +68,10 @@ public class S4Node {
             }
         });
 
-        Injector injector = Guice.createInjector(new Module[] { new BaseModule(Resources.getResource(
-                "default.s4.base.properties").openStream(), nodeArgs.clusterName) });
+        Injector injector = Guice.createInjector(Modules.override(
+                new BaseModule(Resources.getResource("default.s4.base.properties").openStream(),
nodeArgs.clusterName))
+                .with(new ParametersInjectionModule(ImmutableMap.of("s4.cluster.zk_address",
+                        nodeArgs.zkConnectionString))));
         S4Bootstrap bootstrap = injector.getInstance(S4Bootstrap.class);
         try {
             bootstrap.start(injector);
@@ -90,7 +94,7 @@ public class S4Node {
         String baseConfigFilePath = null;
 
         @Parameter(names = "-zk", description = "Zookeeper connection string", required =
false)
-        String zkConnectionString;
+        String zkConnectionString = "localhost:2181";
 
     }
 }


Mime
View raw message