blob: 956302dcdcc5b94900e5981f8b3a38a985c5028d (
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 2019 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.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();
}
|