use of org.apache.gobblin.runtime.app.ServiceBasedAppLauncher in project incubator-gobblin by apache.
the class OrchestratorTest method setup.
@BeforeClass
public void setup() throws Exception {
cleanUpDir(TOPOLOGY_SPEC_STORE_DIR);
cleanUpDir(FLOW_SPEC_STORE_DIR);
Properties orchestratorProperties = new Properties();
Properties topologyProperties = new Properties();
topologyProperties.put("specStore.fs.dir", TOPOLOGY_SPEC_STORE_DIR);
Properties flowProperties = new Properties();
flowProperties.put("specStore.fs.dir", FLOW_SPEC_STORE_DIR);
this.serviceLauncher = new ServiceBasedAppLauncher(orchestratorProperties, "OrchestratorCatalogTest");
this.topologyCatalog = new TopologyCatalog(ConfigUtils.propertiesToConfig(topologyProperties), Optional.of(logger));
this.serviceLauncher.addService(topologyCatalog);
this.flowCatalog = new FlowCatalog(ConfigUtils.propertiesToConfig(flowProperties), Optional.of(logger));
this.serviceLauncher.addService(flowCatalog);
this.orchestrator = new Orchestrator(ConfigUtils.propertiesToConfig(orchestratorProperties), Optional.of(this.topologyCatalog), Optional.of(logger));
this.topologyCatalog.addListener(orchestrator);
this.flowCatalog.addListener(orchestrator);
// Start application
this.serviceLauncher.start();
// Create Spec to play with
this.topologySpec = initTopologySpec();
this.flowSpec = initFlowSpec();
}
use of org.apache.gobblin.runtime.app.ServiceBasedAppLauncher in project incubator-gobblin by apache.
the class FlowCatalogTest method setup.
@BeforeClass
public void setup() throws Exception {
File specStoreDir = new File(SPEC_STORE_DIR);
if (specStoreDir.exists()) {
FileUtils.deleteDirectory(specStoreDir);
}
Properties properties = new Properties();
properties.put("specStore.fs.dir", SPEC_STORE_DIR);
this.serviceLauncher = new ServiceBasedAppLauncher(properties, "FlowCatalogTest");
this.flowCatalog = new FlowCatalog(ConfigUtils.propertiesToConfig(properties), Optional.of(logger));
this.serviceLauncher.addService(flowCatalog);
// Start Catalog
this.serviceLauncher.start();
// Create Spec to play with
this.flowSpec = initFlowSpec();
}
use of org.apache.gobblin.runtime.app.ServiceBasedAppLauncher in project incubator-gobblin by apache.
the class TopologyCatalogTest method setup.
@BeforeClass
public void setup() throws Exception {
File specStoreDir = new File(SPEC_STORE_DIR);
if (specStoreDir.exists()) {
FileUtils.deleteDirectory(specStoreDir);
}
Properties properties = new Properties();
properties.put("specStore.fs.dir", SPEC_STORE_DIR);
this.serviceLauncher = new ServiceBasedAppLauncher(properties, "TopologyCatalogTest");
this.topologyCatalog = new TopologyCatalog(ConfigUtils.propertiesToConfig(properties), Optional.of(logger));
this.serviceLauncher.addService(topologyCatalog);
// Start Catalog
this.serviceLauncher.start();
// Create Spec to play with
this.topologySpec = initTopologySpec();
}
use of org.apache.gobblin.runtime.app.ServiceBasedAppLauncher in project incubator-gobblin by apache.
the class GobblinLocalJobLauncherUtils method invokeLocalJobLauncher.
public static void invokeLocalJobLauncher(Properties properties) throws Exception {
try (ApplicationLauncher applicationLauncher = new ServiceBasedAppLauncher(properties, properties.getProperty(ServiceBasedAppLauncher.APP_NAME, "CliLocalJob-" + UUID.randomUUID()))) {
applicationLauncher.start();
try (LocalJobLauncher localJobLauncher = new LocalJobLauncher(properties)) {
localJobLauncher.launchJob(null);
}
applicationLauncher.stop();
}
}
use of org.apache.gobblin.runtime.app.ServiceBasedAppLauncher in project incubator-gobblin by apache.
the class GobblinClusterManager method initializeAppLauncherAndServices.
/**
* Create the service based application launcher and other associated services
* @throws Exception
*/
private void initializeAppLauncherAndServices() throws Exception {
// Done to preserve backwards compatibility with the previously hard-coded timeout of 5 minutes
Properties properties = ConfigUtils.configToProperties(this.config);
if (!properties.contains(ServiceBasedAppLauncher.APP_STOP_TIME_SECONDS)) {
properties.setProperty(ServiceBasedAppLauncher.APP_STOP_TIME_SECONDS, Long.toString(300));
}
this.applicationLauncher = new ServiceBasedAppLauncher(properties, this.clusterName);
// create a job catalog for keeping track of received jobs if a job config path is specified
if (this.config.hasPath(GobblinClusterConfigurationKeys.GOBBLIN_CLUSTER_PREFIX + ConfigurationKeys.JOB_CONFIG_FILE_GENERAL_PATH_KEY)) {
String jobCatalogClassName = ConfigUtils.getString(config, GobblinClusterConfigurationKeys.JOB_CATALOG_KEY, GobblinClusterConfigurationKeys.DEFAULT_JOB_CATALOG);
this.jobCatalog = (MutableJobCatalog) GobblinConstructorUtils.invokeFirstConstructor(Class.forName(jobCatalogClassName), ImmutableList.<Object>of(config.getConfig(StringUtils.removeEnd(GobblinClusterConfigurationKeys.GOBBLIN_CLUSTER_PREFIX, ".")).withFallback(this.config)));
} else {
this.jobCatalog = null;
}
SchedulerService schedulerService = new SchedulerService(properties);
this.applicationLauncher.addService(schedulerService);
this.jobScheduler = buildGobblinHelixJobScheduler(config, this.appWorkDir, getMetadataTags(clusterName, applicationId), schedulerService);
this.applicationLauncher.addService(this.jobScheduler);
this.jobConfigurationManager = buildJobConfigurationManager(config);
this.applicationLauncher.addService(this.jobConfigurationManager);
}
Aggregations