com.yahoo.vespa.hosted.provision.maintenance.retire.RetirementPolicyCache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of node-repository Show documentation
Show all versions of node-repository Show documentation
Keeps track of node assignment in a multi-application setup.
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.provision.maintenance.retire;
import com.yahoo.vespa.hosted.provision.Node;
import java.util.Optional;
/**
* @author freva
*/
public class RetirementPolicyCache implements RetirementPolicy {
private final RetirementPolicy policy;
private final boolean isActiveCached;
RetirementPolicyCache(RetirementPolicy policy) {
this.policy = policy;
this.isActiveCached = policy.isActive();
}
@Override
public boolean isActive() {
return isActiveCached;
}
public Optional shouldRetire(Node node) {
return policy.shouldRetire(node);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy