@Override public Void call() throws Exception { SerializationUtils.deserializeState(ParallelRunner.this.fs, inputFilePath, state); return null; } }), "Deserialize state from " + inputFilePath));
@Override public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException { WorkUnit workUnit = (value.toString().endsWith(MULTI_WORK_UNIT_FILE_EXTENSION) ? MultiWorkUnit.createEmpty() : WorkUnit.createEmpty()); SerializationUtils.deserializeState(this.fs, new Path(value.toString()), workUnit); if (workUnit instanceof MultiWorkUnit) { List<WorkUnit> flattenedWorkUnits = JobLauncherUtils.flattenWorkUnits(((MultiWorkUnit) workUnit).getWorkUnits()); this.workUnits.addAll(flattenedWorkUnits); } else { this.workUnits.add(workUnit); } } }
public GobblinHelixTask(TaskCallbackContext taskCallbackContext, Optional<ContainerMetrics> containerMetrics, TaskExecutor taskExecutor, TaskStateTracker taskStateTracker, FileSystem fs, Path appWorkDir, StateStores stateStores) throws IOException { this.taskExecutor = taskExecutor; this.taskStateTracker = taskStateTracker; this.taskConfig = taskCallbackContext.getTaskConfig(); this.jobName = this.taskConfig.getConfigMap().get(ConfigurationKeys.JOB_NAME_KEY); this.jobId = this.taskConfig.getConfigMap().get(ConfigurationKeys.JOB_ID_KEY); this.jobKey = Long.toString(Id.parse(this.jobId).getSequence()); this.participantId = taskCallbackContext.getManager().getInstanceName(); this.fs = fs; this.stateStores = stateStores; Path jobStateFilePath = new Path(appWorkDir, this.jobId + "." + AbstractJobLauncher.JOB_STATE_FILE_NAME); SerializationUtils.deserializeState(this.fs, jobStateFilePath, this.jobState); if (containerMetrics.isPresent()) { // This must be done after the jobState is deserialized from the jobStateFilePath // A reference to jobMetrics is required to ensure it is not evicted from the GobblinMetricsRegistry Cache this.jobMetrics = Optional.of(JobMetrics.get(this.jobState, containerMetrics.get().getMetricContext())); } else { this.jobMetrics = Optional.absent(); } }