public class PersistingContext extends ForwardingTaskContext
TaskContext that serializes and persist tasks. Any call to TaskContext.evaluate(Task)
will persist the task and recurse to also do so for all input tasks. No task in the dependency
tree will actually be invoked. Instead TaskContext.evaluate(Task) will return a Value that
always fails.
After the returned Value has failed, all persisted file paths can be received through
getFiles().
TaskContext.Promise<T>, TaskContext.Value<T>| Modifier and Type | Field and Description |
|---|---|
private Path |
basePath |
private Map<TaskId,Path> |
files |
private static org.slf4j.Logger |
LOG |
delegate| Constructor and Description |
|---|
PersistingContext(Path basePath,
TaskContext delegate) |
| Modifier and Type | Method and Description |
|---|---|
static String |
cleanForFilename(TaskId taskId) |
static <T> T |
deserialize(Path filePath) |
<T> TaskContext.Value<T> |
evaluateInternal(Task<T> task,
TaskContext context) |
Map<TaskId,Path> |
getFiles() |
<T> TaskContext.Value<T> |
invokeProcessFn(TaskId taskId,
Fn<TaskContext.Value<T>> processFn) |
static void |
serialize(Object object,
Path file) |
private Path |
taskFile(TaskId taskId) |
immediateValue, promise, valueclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasync, currentTask, evaluate, inmemprivate static final org.slf4j.Logger LOG
private final Path basePath
public PersistingContext(Path basePath, TaskContext delegate)
public <T> TaskContext.Value<T> evaluateInternal(Task<T> task, TaskContext context)
evaluateInternal in interface TaskContextevaluateInternal in class ForwardingTaskContextpublic <T> TaskContext.Value<T> invokeProcessFn(TaskId taskId, Fn<TaskContext.Value<T>> processFn)
invokeProcessFn in interface TaskContextinvokeProcessFn in class ForwardingTaskContextCopyright © 2017. All Rights Reserved.