Search in sources :

Example 1 with ApplicationApiImpl

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);
}
Also used : ApplicationApi(com.yahoo.vespa.orchestrator.model.ApplicationApi) ApplicationApiImpl(com.yahoo.vespa.orchestrator.model.ApplicationApiImpl) NodeGroup(com.yahoo.vespa.orchestrator.model.NodeGroup)

Example 2 with ApplicationApiImpl

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);
    }
}
Also used : ApplicationApi(com.yahoo.vespa.orchestrator.model.ApplicationApi) ApplicationApiImpl(com.yahoo.vespa.orchestrator.model.ApplicationApiImpl) MutableStatusRegistry(com.yahoo.vespa.orchestrator.status.MutableStatusRegistry) ApplicationInstanceStatus(com.yahoo.vespa.orchestrator.status.ApplicationInstanceStatus) ApplicationInstanceReference(com.yahoo.vespa.applicationmodel.ApplicationInstanceReference)

Example 3 with ApplicationApiImpl

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);
    }
}
Also used : ApplicationInstance(com.yahoo.vespa.applicationmodel.ApplicationInstance) ApplicationApi(com.yahoo.vespa.orchestrator.model.ApplicationApi) ApplicationApiImpl(com.yahoo.vespa.orchestrator.model.ApplicationApiImpl) MutableStatusRegistry(com.yahoo.vespa.orchestrator.status.MutableStatusRegistry) NodeGroup(com.yahoo.vespa.orchestrator.model.NodeGroup)

Example 4 with ApplicationApiImpl

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);
}
Also used : ApplicationApi(com.yahoo.vespa.orchestrator.model.ApplicationApi) ApplicationApiImpl(com.yahoo.vespa.orchestrator.model.ApplicationApiImpl) NodeGroup(com.yahoo.vespa.orchestrator.model.NodeGroup)

Aggregations

ApplicationApi (com.yahoo.vespa.orchestrator.model.ApplicationApi)4 ApplicationApiImpl (com.yahoo.vespa.orchestrator.model.ApplicationApiImpl)4 NodeGroup (com.yahoo.vespa.orchestrator.model.NodeGroup)3 MutableStatusRegistry (com.yahoo.vespa.orchestrator.status.MutableStatusRegistry)2 ApplicationInstance (com.yahoo.vespa.applicationmodel.ApplicationInstance)1 ApplicationInstanceReference (com.yahoo.vespa.applicationmodel.ApplicationInstanceReference)1 ApplicationInstanceStatus (com.yahoo.vespa.orchestrator.status.ApplicationInstanceStatus)1