aboutsummaryrefslogtreecommitdiffstats
path: root/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentScheduler.java
blob: 540601ffa4fe426888c96cc5f7ae4cbe42e7b50e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// 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;

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

    /** Schedule a tick for NodeAgent to run with the given NodeAgentContext */
     void scheduleTickWith(NodeAgentContext context);

    /**
     * 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);
}