use of com.yahoo.vespa.orchestrator.model.ApplicationApiImpl in project vespa by vespa-engine.
the class HostedVespaPolicy method grantSuspensionRequest.
// TODO: Remove later - currently used for backward compatibility testing
@Override
public void grantSuspensionRequest(ApplicationInstance applicationInstance, HostName hostName, MutableStatusRegistry hostStatusService) throws HostStateChangeDeniedException {
NodeGroup nodeGroup = new NodeGroup(applicationInstance);
nodeGroup.addNode(hostName);
ApplicationApi applicationApi = new ApplicationApiImpl(nodeGroup, hostStatusService, clusterControllerClientFactory);
grantSuspensionRequest(applicationApi);
}
use of com.yahoo.vespa.orchestrator.model.ApplicationApiImpl in project vespa by vespa-engine.
the class OrchestratorImpl method suspendGroup.
// Public for testing purposes
@Override
public void suspendGroup(NodeGroup nodeGroup) throws HostStateChangeDeniedException, HostNameNotFoundException {
ApplicationInstanceReference applicationReference = nodeGroup.getApplicationReference();
try (MutableStatusRegistry hostStatusRegistry = statusService.lockApplicationInstance_forCurrentThreadOnly(applicationReference)) {
ApplicationInstanceStatus appStatus = statusService.forApplicationInstance(applicationReference).getApplicationInstanceStatus();
if (appStatus == ApplicationInstanceStatus.ALLOWED_TO_BE_DOWN) {
return;
}
ApplicationApi applicationApi = new ApplicationApiImpl(nodeGroup, hostStatusRegistry, clusterControllerClientFactory);
policy.grantSuspensionRequest(applicationApi);
}
}
use of com.yahoo.vespa.orchestrator.model.ApplicationApiImpl in project vespa by vespa-engine.
the class OrchestratorImpl method acquirePermissionToRemove.
@Override
public void acquirePermissionToRemove(HostName hostName) throws OrchestrationException {
ApplicationInstance appInstance = getApplicationInstance(hostName);
NodeGroup nodeGroup = new NodeGroup(appInstance, hostName);
try (MutableStatusRegistry statusRegistry = statusService.lockApplicationInstance_forCurrentThreadOnly(appInstance.reference())) {
ApplicationApi applicationApi = new ApplicationApiImpl(nodeGroup, statusRegistry, clusterControllerClientFactory);
policy.acquirePermissionToRemove(applicationApi);
}
}
use of com.yahoo.vespa.orchestrator.model.ApplicationApiImpl in project vespa by vespa-engine.
the class HostedVespaPolicy method releaseSuspensionGrant.
// TODO: Remove later - currently used for backward compatibility testing
@Override
public void releaseSuspensionGrant(ApplicationInstance applicationInstance, HostName hostName, MutableStatusRegistry hostStatusService) throws HostStateChangeDeniedException {
NodeGroup nodeGroup = new NodeGroup(applicationInstance, hostName);
ApplicationApi applicationApi = new ApplicationApiImpl(nodeGroup, hostStatusService, clusterControllerClientFactory);
releaseSuspensionGrant(applicationApi);
}
Aggregations