Repository: incubator-gobblin
Updated Branches:
  refs/heads/master 60d4e61d0 -> 95fa56400


[GOBBLIN-674] Skip initialization of GitMonitoringService when gobblin template 
dirs is empty.[]

Closes #2543 from sv2000/skipInit


Project: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/commit/95fa5640
Tree: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/tree/95fa5640
Diff: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/diff/95fa5640

Branch: refs/heads/master
Commit: 95fa564001cedf68368d8f887a736354c5131f25
Parents: 60d4e61
Author: suvasude <[email protected]>
Authored: Tue Jan 29 14:57:33 2019 -0800
Committer: Hung Tran <[email protected]>
Committed: Tue Jan 29 14:57:33 2019 -0800

----------------------------------------------------------------------
 .../service/modules/flow/MultiHopFlowCompiler.java        | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-gobblin/blob/95fa5640/gobblin-service/src/main/java/org/apache/gobblin/service/modules/flow/MultiHopFlowCompiler.java
----------------------------------------------------------------------
diff --git 
a/gobblin-service/src/main/java/org/apache/gobblin/service/modules/flow/MultiHopFlowCompiler.java
 
b/gobblin-service/src/main/java/org/apache/gobblin/service/modules/flow/MultiHopFlowCompiler.java
index 49915ef..756dfaa 100644
--- 
a/gobblin-service/src/main/java/org/apache/gobblin/service/modules/flow/MultiHopFlowCompiler.java
+++ 
b/gobblin-service/src/main/java/org/apache/gobblin/service/modules/flow/MultiHopFlowCompiler.java
@@ -87,7 +87,8 @@ public class MultiHopFlowCompiler extends 
BaseFlowToJobSpecCompiler {
 
   public MultiHopFlowCompiler(Config config, Optional<Logger> log, boolean 
instrumentationEnabled) {
     super(config, log, instrumentationEnabled);
-    Optional<FSFlowCatalog> flowCatalog;
+    this.flowGraph = new BaseFlowGraph();
+    Optional<FSFlowCatalog> flowCatalog = Optional.absent();
     if 
(config.hasPath(ServiceConfigKeys.TEMPLATE_CATALOGS_FULLY_QUALIFIED_PATH_KEY)
         && 
StringUtils.isNotBlank(config.getString(ServiceConfigKeys.TEMPLATE_CATALOGS_FULLY_QUALIFIED_PATH_KEY)))
 {
       try {
@@ -96,9 +97,8 @@ public class MultiHopFlowCompiler extends 
BaseFlowToJobSpecCompiler {
         throw new RuntimeException("Cannot instantiate " + 
getClass().getName(), e);
       }
     } else {
-      flowCatalog = Optional.absent();
+      return;
     }
-    this.flowGraph = new BaseFlowGraph();
     Config gitFlowGraphConfig = this.config;
     if (this.config.hasPath(ConfigurationKeys.ENCRYPT_KEY_LOC)) {
       //Add encrypt.key.loc config to the config passed to GitFlowGraphMonitor
@@ -131,7 +131,9 @@ public class MultiHopFlowCompiler extends 
BaseFlowToJobSpecCompiler {
   @Override
   public void setActive(boolean active) {
     super.setActive(active);
-    this.gitFlowGraphMonitor.setActive(active);
+    if (this.gitFlowGraphMonitor != null) {
+      this.gitFlowGraphMonitor.setActive(active);
+    }
   }
 
   @Override

Reply via email to