Skip to content

Instantly share code, notes, and snippets.

@narendly
Created July 16, 2018 05:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save narendly/57c4e957c639cf1738b6e6be70fd9977 to your computer and use it in GitHub Desktop.
Save narendly/57c4e957c639cf1738b6e6be70fd9977 to your computer and use it in GitHub Desktop.
TaskFactory implementation by Espresso
public class BackupTaskFactory implements TaskFactory {
/**
* Returns a {@link Task} instance.
* @param context Contextual information for the task, including task and job configurations
* @return A {@link Task} instance.
*/
Task createNewTask(TaskCallbackContext context) {
String targetPartition = taskContext.getTaskConfig().getTargetPartition();
return new BackupTask(partition);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment