static void addOnCompletition(TaskContext taskContext, final Function0<?> function) { taskContext.addTaskCompletionListener(new TaskCompletionListener() { @Override public void onTaskCompletion(TaskContext context) { function.apply(); } }); }
static void addOnCompletition(TaskContext taskContext, final Function0<?> function) { taskContext.addTaskCompletionListener(new TaskCompletionListener() { @Override public void onTaskCompletion(TaskContext context) { function.apply(); } }); }
taskContext.addTaskCompletionListener(context -> { cleanupResources(); });
taskContext.addTaskCompletionListener(context -> { cleanupResources(); });
taskContext.addTaskCompletionListener(context -> { cleanupResources(); });
@Override public void onTaskCompletion(TaskContext context) { context.isCompleted(); context.isInterrupted(); context.stageId(); context.stageAttemptNumber(); context.partitionId(); context.addTaskCompletionListener(this); } }
@Override public void onTaskCompletion(TaskContext context) { context.isCompleted(); context.isInterrupted(); context.stageId(); context.stageAttemptNumber(); context.partitionId(); context.addTaskCompletionListener(this); } }
@Override public void onTaskCompletion(TaskContext context) { context.isCompleted(); context.isInterrupted(); context.stageId(); context.stageAttemptNumber(); context.partitionId(); context.addTaskCompletionListener(this); } }
public static void test() { TaskContext tc = TaskContext.get(); tc.isCompleted(); tc.isInterrupted(); tc.addTaskCompletionListener(new JavaTaskCompletionListenerImpl()); tc.addTaskFailureListener(new JavaTaskFailureListenerImpl()); tc.attemptNumber(); tc.partitionId(); tc.stageId(); tc.stageAttemptNumber(); tc.taskAttemptId(); }
public static void test() { TaskContext tc = TaskContext.get(); tc.isCompleted(); tc.isInterrupted(); tc.addTaskCompletionListener(new JavaTaskCompletionListenerImpl()); tc.addTaskFailureListener(new JavaTaskFailureListenerImpl()); tc.attemptNumber(); tc.partitionId(); tc.stageId(); tc.stageAttemptNumber(); tc.taskAttemptId(); }
public static void test() { TaskContext tc = TaskContext.get(); tc.isCompleted(); tc.isInterrupted(); tc.addTaskCompletionListener(new JavaTaskCompletionListenerImpl()); tc.addTaskFailureListener(new JavaTaskFailureListenerImpl()); tc.attemptNumber(); tc.partitionId(); tc.stageId(); tc.stageAttemptNumber(); tc.taskAttemptId(); }
static void addOnCompletition(TaskContext taskContext, final Function0<?> function) { taskContext.addTaskCompletionListener(new TaskCompletionListener() { @Override public void onTaskCompletion(TaskContext context) { function.apply(); } }); }
static void addOnCompletition(TaskContext taskContext, final Function0<?> function) { taskContext.addTaskCompletionListener(new TaskCompletionListener() { @Override public void onTaskCompletion(TaskContext context) { function.apply(); } }); }
static void addOnCompletition(TaskContext taskContext, final Function0<?> function) { taskContext.addTaskCompletionListener(new TaskCompletionListener() { @Override public void onTaskCompletion(TaskContext context) { function.apply(); } }); }
taskContext.addTaskCompletionListener(context -> { free(); });
taskContext.addTaskCompletionListener(context -> { free(); });
taskContext.addTaskCompletionListener(context -> { free(); });
/** * Constructor for deserialization. Shouldn't be called directly. */ public DefaultSparkHttpServicePluginContext() throws IOException { this.runtimeContext = SparkRuntimeContextProvider.get(); this.pluginInstantiator = createPluginsInstantiator(runtimeContext); this.pluginConfigurer = null; this.extraPlugins = new HashMap<>(); // Each deserizliaed instance of this class should be used for the current task excution only, // hence we can do the cleanup on task completion. TaskContext.get().addTaskCompletionListener(new TaskCompletionListener() { @Override public void onTaskCompletion(TaskContext context) { Closeables.closeQuietly(pluginInstantiator); } }); }
/** * Constructor for deserialization. Shouldn't be called directly. */ public DefaultSparkHttpServicePluginContext() throws IOException { this.runtimeContext = SparkRuntimeContextProvider.get(); this.pluginInstantiator = createPluginsInstantiator(runtimeContext); this.pluginConfigurer = null; this.extraPlugins = new HashMap<>(); // Each deserizliaed instance of this class should be used for the current task excution only, // hence we can do the cleanup on task completion. TaskContext.get().addTaskCompletionListener(new TaskCompletionListener() { @Override public void onTaskCompletion(TaskContext context) { Closeables.closeQuietly(pluginInstantiator); } }); }
/** * Constructor for deserialization. Shouldn't be called directly. */ public DefaultSparkHttpServicePluginContext() throws IOException { this.runtimeContext = SparkRuntimeContextProvider.get(); this.pluginInstantiator = createPluginsInstantiator(runtimeContext); this.pluginConfigurer = null; this.extraPlugins = new HashMap<>(); // Each deserizliaed instance of this class should be used for the current task excution only, // hence we can do the cleanup on task completion. TaskContext.get().addTaskCompletionListener(new TaskCompletionListener() { @Override public void onTaskCompletion(TaskContext context) { Closeables.closeQuietly(pluginInstantiator); } }); }