public TaskRunnerSuiteBase build() { if (getIsRunTaskInSeparateProcessEnabled(config)) { return new TaskRunnerSuiteProcessModel(this); } else { return new TaskRunnerSuiteThreadModel(this); } }
/** * Create a Helix cluster for the Gobblin Cluster application. * * @param zkConnectionString the ZooKeeper connection string * @param clusterName the Helix cluster name */ public static void createGobblinHelixCluster( String zkConnectionString, String clusterName) { createGobblinHelixCluster(zkConnectionString, clusterName, true); }
@Override public void onControllerChange(NotificationContext changeContext) { handleLeadershipChange(changeContext); } });
List<String> build() { addJavaBin(); addJavaOptions(); addClassPath(); addLogConfig(); addClassName(); addOptions(); return this.cmd; }
@Override public Task createNewTask(TaskCallbackContext context) { return new TestHelixJobTask(context, jobsMapping, builder, new GobblinHelixJobLauncherMetrics("launcherInJobFactory", metricContext, 5), new GobblinHelixJobTask.GobblinHelixJobTaskMetrics(metricContext, 5), new GobblinHelixMetrics("helixMetricsInJobFactory", metricContext, 5)); } }
TaskRunnerSuiteThreadModel(TaskRunnerSuiteBase.Builder builder) { super(builder); // initialize task related metrics this.taskExecutor = new TaskExecutor(ConfigUtils.configToProperties(builder.getConfig())); this.taskExecutionMetrics = new GobblinTaskRunnerMetrics.TaskExecutionMetrics(taskExecutor, metricContext); this.taskFactory = generateTaskFactory(taskExecutor, builder); this.jobFactory = new GobblinHelixJobFactory(builder, this.metricContext); }
@Override public void run() { gobblinTaskRunner.start(); } });
private void addOptions() { addClusterConfigPath(); addJobId(); addWorkUnitPath(); }
TaskRunnerSuiteProcessModel(TaskRunnerSuiteBase.Builder builder) { super(builder); log.info("Running a task in a separate process is enabled."); taskFactory = new HelixTaskFactory(builder.getContainerMetrics(), GobblinTaskRunner.CLUSTER_CONF_PATH, builder.getConfig()); }
@Override public Task createNewTask(TaskCallbackContext context) { return new GobblinHelixJobTask(context, this.jobsMapping, this.builder, this.launcherMetrics, this.jobTaskMetrics, this.helixMetrics); } }
/** * Creates and returns a {@link MessageHandlerFactory} for handling of Helix * {@link org.apache.helix.model.Message.MessageType#USER_DEFINE_MSG}s. * * @returns a {@link MessageHandlerFactory}. */ protected MessageHandlerFactory getUserDefinedMessageHandlerFactory() { return new GobblinHelixMultiManager.ControllerUserDefinedMessageHandlerFactory(); }
@Override public MessageHandlerFactory apply(Void aVoid) { return GobblinClusterManager.this.getUserDefinedMessageHandlerFactory(); } }, this.eventBus, stopStatus) ;
/** * Build the {@link JobConfigurationManager} for the Application Master. */ private JobConfigurationManager buildJobConfigurationManager(Config config) { return create(config); }
@Override public TaskStateModel createNewStateModel(String resourceName, String partitionKey) { return new GobblinTaskStateModel(this.helixManager, this.taskFactoryRegistry, this.taskExecutor); } }
public GobblinHelixMessagingService(HelixManager manager) { super(manager); _manager = manager; _gobblinHelixCriteriaEvaluator = new GobblinHelixCriteriaEvaluator(); }
/** * Creates and returns a {@link MessageHandlerFactory} for handling of Helix * {@link org.apache.helix.model.Message.MessageType#USER_DEFINE_MSG}s. * * @returns a {@link MessageHandlerFactory}. */ protected MessageHandlerFactory getUserDefinedMessageHandlerFactory() { return new ParticipantUserDefinedMessageHandlerFactory(); }
@Override public TaskRunnerSuiteBase build() { return new TaskRunnerSuiteForJobTagTest(this); } }
/** * Find the job output directory * @return a {@link File} if directory found, otherwise null */ private File getJobOutputDir() { return getFileFromGlob( _testDirPath + "/job-output/" + CLASS_NAME_BASED_PATH, "*_append"); } }
@Override public TaskRunnerSuiteBase build() { return new TaskRunnerSuiteForJobFactoryTest(this); } }
@Override public void run() { fworker.start(); } });