This is an automated email from the ASF dual-hosted git repository.
suvasude pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-gobblin.git
The following commit(s) were added to refs/heads/master by this push:
new e967460 [GOBBLIN-953] Add scoped config for app launcher created by
gobblin service
e967460 is described below
commit e9674608c4b3d18ad3f6fa2efc0fd0af06fe7904
Author: Jack Moseley <[email protected]>
AuthorDate: Tue Nov 12 18:00:32 2019 -0800
[GOBBLIN-953] Add scoped config for app launcher created by gobblin service
Closes #2801 from jack-moseley/scope-app-config
---
.../java/org/apache/gobblin/service/ServiceConfigKeys.java | 3 +++
.../gobblin/service/modules/core/GobblinServiceManager.java | 11 ++++++-----
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git
a/gobblin-api/src/main/java/org/apache/gobblin/service/ServiceConfigKeys.java
b/gobblin-api/src/main/java/org/apache/gobblin/service/ServiceConfigKeys.java
index e40d3de..daa26c4 100644
---
a/gobblin-api/src/main/java/org/apache/gobblin/service/ServiceConfigKeys.java
+++
b/gobblin-api/src/main/java/org/apache/gobblin/service/ServiceConfigKeys.java
@@ -112,4 +112,7 @@ public class ServiceConfigKeys {
public static final String GOBBLIN_SERVICE_LOG4J_CONFIGURATION_FILE =
"log4j-service.properties";
// GAAS Listerning Port
public static final String SERVICE_PORT = GOBBLIN_SERVICE_PREFIX + "port";
+
+ // Prefix for config to ServiceBasedAppLauncher that will only be used by
GaaS and not orchestrated jobs
+ public static final String GOBBLIN_SERVICE_APP_LAUNCHER_PREFIX =
"gobblinServiceAppLauncher";
}
diff --git
a/gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GobblinServiceManager.java
b/gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GobblinServiceManager.java
index 6c42d49..0818b1d 100644
---
a/gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GobblinServiceManager.java
+++
b/gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GobblinServiceManager.java
@@ -168,17 +168,18 @@ public class GobblinServiceManager implements
ApplicationLauncher, StandardMetri
public GobblinServiceManager(String serviceName, String serviceId, Config
config,
Optional<Path> serviceWorkDirOptional) throws Exception {
+ Properties appLauncherProperties =
ConfigUtils.configToProperties(ConfigUtils.getConfigOrEmpty(config,
+
ServiceConfigKeys.GOBBLIN_SERVICE_APP_LAUNCHER_PREFIX).withFallback(config));
// Done to preserve backwards compatibility with the previously hard-coded
timeout of 5 minutes
- Properties properties = ConfigUtils.configToProperties(config);
- if (!properties.contains(ServiceBasedAppLauncher.APP_STOP_TIME_SECONDS)) {
- properties.setProperty(ServiceBasedAppLauncher.APP_STOP_TIME_SECONDS,
Long.toString(300));
+ if
(!appLauncherProperties.contains(ServiceBasedAppLauncher.APP_STOP_TIME_SECONDS))
{
+
appLauncherProperties.setProperty(ServiceBasedAppLauncher.APP_STOP_TIME_SECONDS,
Long.toString(300));
}
this.config = config;
this.metricContext =
Instrumented.getMetricContext(ConfigUtils.configToState(config),
this.getClass());
this.metrics = new Metrics(this.metricContext, config);
this.serviceName = serviceName;
this.serviceId = serviceId;
- this.serviceLauncher = new ServiceBasedAppLauncher(properties,
serviceName);
+ this.serviceLauncher = new ServiceBasedAppLauncher(appLauncherProperties,
serviceName);
this.fs = buildFileSystem(config);
this.serviceWorkDir = serviceWorkDirOptional.isPresent() ?
serviceWorkDirOptional.get()
@@ -243,7 +244,7 @@ public class GobblinServiceManager implements
ApplicationLauncher, StandardMetri
ServiceConfigKeys.GOBBLIN_SERVICE_SCHEDULER_ENABLED_KEY, true);
if (isSchedulerEnabled) {
this.orchestrator = new Orchestrator(config,
Optional.of(this.topologyCatalog), Optional.fromNullable(this.dagManager),
Optional.of(LOGGER));
- SchedulerService schedulerService = new SchedulerService(properties);
+ SchedulerService schedulerService = new
SchedulerService(ConfigUtils.configToProperties(config));
this.scheduler = new GobblinServiceJobScheduler(this.serviceName,
config, this.helixManager,
Optional.of(this.flowCatalog), Optional.of(this.topologyCatalog),
this.orchestrator,