aboutsummaryrefslogtreecommitdiffstats
path: root/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentScheduler.java
blob: 59b3086988eb8aa20ea4775b2490e041e14e3af3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.node.admin.nodeagent;

import java.time.Duration;
import java.time.Instant;

/**
 * @author freva
 */
public interface NodeAgentScheduler {

    /** Schedule a tick for NodeAgent to run with the given NodeAgentContext, at no earlier than given instant */
     void scheduleTickWith(NodeAgentContext context, Instant at);

    /**
     * Will eventually freeze/unfreeze the node agent
     * @param frozen whether node agent should be frozen
     * @param timeout maximum duration this method should block while waiting for NodeAgent to reach target state
     * @return True if node agent has converged to the desired state
     */
    boolean setFrozen(boolean frozen, Duration timeout);

    /** @return the last scheduled context or a default value */
    NodeAgentContext currentContext();
}