summaryrefslogtreecommitdiffstats
path: root/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/Task.java
blob: 4d40ac02440de0ebf49fa825b7199c36e91abf5b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.node.admin.task;

import com.yahoo.vespa.hosted.node.admin.io.FileSystem;

public interface Task {
    interface TaskContext {
        FileSystem getFileSystem();
        boolean executeSubtask(Task task);
    }

    /**
     * @return Returns false if task was a no-op. Used for informational purposes only.
     * @throws RuntimeException if task could not be completed.
     */
    boolean execute(TaskContext context);
}