From e892d14f772f47b28adbcf884e578afd4b123ccb Mon Sep 17 00:00:00 2001 From: cheddar Date: Tue, 9 Jul 2013 16:16:56 -0700 Subject: [PATCH] 1) Configuration fixes, slowly gonna make the MasterMain actually start up! --- .../druid/initialization/CuratorDiscoveryConfig.java | 3 +++ .../main/java/com/metamx/druid/guice/HttpClientModule.java | 2 +- server/src/main/java/com/metamx/druid/http/MasterMain.java | 7 +++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/client/src/main/java/com/metamx/druid/initialization/CuratorDiscoveryConfig.java b/client/src/main/java/com/metamx/druid/initialization/CuratorDiscoveryConfig.java index 4fc6c28360e..00221db1a1d 100644 --- a/client/src/main/java/com/metamx/druid/initialization/CuratorDiscoveryConfig.java +++ b/client/src/main/java/com/metamx/druid/initialization/CuratorDiscoveryConfig.java @@ -21,11 +21,14 @@ package com.metamx.druid.initialization; import com.fasterxml.jackson.annotation.JsonProperty; +import javax.validation.constraints.NotNull; + /** */ public class CuratorDiscoveryConfig { @JsonProperty + @NotNull private String path = null; public String getPath() diff --git a/server/src/main/java/com/metamx/druid/guice/HttpClientModule.java b/server/src/main/java/com/metamx/druid/guice/HttpClientModule.java index ac5eb18df16..757c75b3a71 100644 --- a/server/src/main/java/com/metamx/druid/guice/HttpClientModule.java +++ b/server/src/main/java/com/metamx/druid/guice/HttpClientModule.java @@ -43,7 +43,7 @@ public class HttpClientModule implements Module public Duration getReadTimeout() { - return readTimeout.toStandardDuration(); + return readTimeout == null ? null : readTimeout.toStandardDuration(); } } diff --git a/server/src/main/java/com/metamx/druid/http/MasterMain.java b/server/src/main/java/com/metamx/druid/http/MasterMain.java index 9f43e482d69..aef21c936b2 100644 --- a/server/src/main/java/com/metamx/druid/http/MasterMain.java +++ b/server/src/main/java/com/metamx/druid/http/MasterMain.java @@ -19,8 +19,10 @@ package com.metamx.druid.http; +import com.google.common.base.Supplier; import com.google.inject.Injector; import com.google.inject.Key; +import com.google.inject.TypeLiteral; import com.google.inject.servlet.GuiceFilter; import com.metamx.common.lifecycle.Lifecycle; import com.metamx.common.logger.Logger; @@ -71,12 +73,13 @@ public class MasterMain final Lifecycle lifecycle = injector.getInstance(Lifecycle.class); - final DruidNodeConfig nodeConfig = injector.getInstance(DruidNodeConfig.class); + final Supplier nodeConfig = injector.getInstance(Key.get(new TypeLiteral>(){})); final ServiceAnnouncer serviceAnnouncer = injector.getInstance(ServiceAnnouncer.class); try { - Initialization.announceDefaultService(nodeConfig, serviceAnnouncer, lifecycle); + // TODO: Make the announcement work through the lifecycle + Initialization.announceDefaultService(nodeConfig.get(), serviceAnnouncer, lifecycle); lifecycle.start(); } catch (Throwable t) {