diff options
author | Jon Bratseth <bratseth@oath.com> | 2018-12-04 11:51:58 -0800 |
---|---|---|
committer | gjoranv <gv@oath.com> | 2019-01-21 15:09:29 +0100 |
commit | 0f63b23a4ea60b78ad97f1c19245023fb29545c0 (patch) | |
tree | f5652cf65362d9debf5d2ebfdc514d9886ce40e7 /orchestrator | |
parent | a18658fca16b994786f1b60d50f9d2f5f2ceb679 (diff) |
Nonfunctional changes only
Diffstat (limited to 'orchestrator')
9 files changed, 24 insertions, 19 deletions
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/Host.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/Host.java index 8e06f3b342a..bda9505d72b 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/Host.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/Host.java @@ -9,6 +9,7 @@ import com.yahoo.vespa.orchestrator.status.HostStatus; import java.util.List; public class Host { + private final HostName hostName; private final HostStatus hostStatus; private final ApplicationInstanceReference applicationInstanceReference; @@ -39,4 +40,5 @@ public class Host { public List<ServiceInstance> getServiceInstances() { return serviceInstances; } + } diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/Orchestrator.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/Orchestrator.java index df124f2f690..a639d07e504 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/Orchestrator.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/Orchestrator.java @@ -33,8 +33,6 @@ public interface Orchestrator { /** * Get orchestrator information related to a host. - * - * @throws HostNameNotFoundException */ Host getHost(HostName hostName) throws HostNameNotFoundException; diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorImpl.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorImpl.java index 77bb1e99e19..33cfa310a68 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorImpl.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/OrchestratorImpl.java @@ -45,6 +45,7 @@ import java.util.stream.Collectors; * @author smorgrav */ public class OrchestratorImpl implements Orchestrator { + private static final Logger log = Logger.getLogger(OrchestratorImpl.class.getName()); private final Policy policy; @@ -185,10 +186,9 @@ public class OrchestratorImpl implements Orchestrator { return; } - ApplicationApi applicationApi = new ApplicationApiImpl( - nodeGroup, - hostStatusRegistry, - clusterControllerClientFactory); + ApplicationApi applicationApi = new ApplicationApiImpl(nodeGroup, + hostStatusRegistry, + clusterControllerClientFactory); policy.grantSuspensionRequest(context.createSubcontextWithinLock(), applicationApi); } } @@ -386,4 +386,5 @@ public class OrchestratorImpl implements Orchestrator { throw new RuntimeException("Unexpectedly interrupted", e); } } + } diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApi.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApi.java index e2f371a5ce1..2e85713d323 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApi.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApi.java @@ -13,8 +13,9 @@ import java.util.List; * The API a Policy has access to */ public interface ApplicationApi { + /** - * @return The 3-part application ID of the form tenant:name:instance. + * Returns the 3-part application ID of the form tenant:name:instance. */ ApplicationId applicationId(); @@ -33,4 +34,5 @@ public interface ApplicationApi { List<StorageNode> getStorageNodesInGroupInClusterOrder(); List<StorageNode> getUpStorageNodesInGroupInClusterOrder(); List<StorageNode> getStorageNodesAllowedToBeDownInGroupInReverseClusterOrder(); + } diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiImpl.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiImpl.java index 9ec1697a45f..5800b48da75 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiImpl.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiImpl.java @@ -26,6 +26,7 @@ import java.util.stream.Collectors; import static com.yahoo.vespa.orchestrator.OrchestratorUtil.getHostsUsedByApplicationInstance; public class ApplicationApiImpl implements ApplicationApi { + private final ApplicationInstance applicationInstance; private final NodeGroup nodeGroup; private final MutableStatusRegistry hostStatusService; @@ -145,4 +146,5 @@ public class ApplicationApiImpl implements ApplicationApi { return serviceClustersInGroup; } + } diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaPolicy.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaPolicy.java index 4aa0f3452e3..b6e7014cac0 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaPolicy.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaPolicy.java @@ -20,7 +20,6 @@ import java.util.logging.Logger; /** * @author oyving */ - public class HostedVespaPolicy implements Policy { public static final String APPLICATION_SUSPENDED_CONSTRAINT = "application-suspended"; @@ -29,8 +28,6 @@ public class HostedVespaPolicy implements Policy { public static final String CLUSTER_CONTROLLER_AVAILABLE_CONSTRAINT = "controller-available"; public static final String DEADLINE_CONSTRAINT = "deadline"; - private static final Logger log = Logger.getLogger(HostedVespaPolicy.class.getName()); - private final HostedVespaClusterPolicy clusterPolicy; private final ClusterControllerClientFactory clusterControllerClientFactory; diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/Policy.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/Policy.java index 9938d244657..e2487301326 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/Policy.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/Policy.java @@ -11,6 +11,7 @@ import com.yahoo.vespa.orchestrator.status.MutableStatusRegistry; * @author oyving */ public interface Policy { + /** * Decide whether to grant a request for temporarily suspending the services on all hosts in the group. */ @@ -20,9 +21,6 @@ public interface Policy { /** * Give all hosts in a group permission to be removed from the application. - * - * @param context - * @param applicationApi */ void acquirePermissionToRemove(OrchestratorContext context, ApplicationApi applicationApi) throws HostStateChangeDeniedException; @@ -35,4 +33,5 @@ public interface Policy { OrchestratorContext context, ApplicationInstance applicationInstance, HostName hostName, MutableStatusRegistry hostStatusService) throws HostStateChangeDeniedException; + } diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/InstanceResource.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/InstanceResource.java index 7f0227df4c5..6984389b688 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/InstanceResource.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/InstanceResource.java @@ -146,4 +146,5 @@ public class InstanceResource { throw new WebApplicationException( Response.status(Response.Status.BAD_REQUEST).entity(message).build()); } + } diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/ZookeeperStatusService.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/ZookeeperStatusService.java index 3360a12c32e..c56ff661bba 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/ZookeeperStatusService.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/status/ZookeeperStatusService.java @@ -215,14 +215,14 @@ public class ZookeeperStatusService implements StatusService { } private class ZkMutableStatusRegistry implements MutableStatusRegistry { + private final Lock lock; private final ApplicationInstanceReference applicationInstanceReference; private final boolean probe; - public ZkMutableStatusRegistry( - Lock lock, - ApplicationInstanceReference applicationInstanceReference, - boolean probe) { + public ZkMutableStatusRegistry(Lock lock, + ApplicationInstanceReference applicationInstanceReference, + boolean probe) { this.lock = lock; this.applicationInstanceReference = applicationInstanceReference; this.probe = probe; @@ -275,9 +275,12 @@ public class ZookeeperStatusService implements StatusService { lock.close(); } catch (RuntimeException e) { // We may want to avoid logging some exceptions that may be expected, like when session expires. - log.log(LogLevel.WARNING, "Failed to close application lock for " + - ZookeeperStatusService.class.getSimpleName() + ", will ignore and continue", e); + log.log(LogLevel.WARNING, + "Failed to close application lock for " + + ZookeeperStatusService.class.getSimpleName() + ", will ignore and continue", + e); } } } + } |