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 | |
parent | a18658fca16b994786f1b60d50f9d2f5f2ceb679 (diff) |
Nonfunctional changes only
20 files changed, 43 insertions, 27 deletions
diff --git a/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceType.java b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceType.java index 07f2cd604b4..f01d3c3b3fb 100644 --- a/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceType.java +++ b/application-model/src/main/java/com/yahoo/vespa/applicationmodel/ServiceType.java @@ -9,6 +9,7 @@ import java.util.Objects; * @author bjorncs */ public class ServiceType { + // Common service types. public static final ServiceType CONTAINER = new ServiceType("container"); public static final ServiceType SLOBROK = new ServiceType("slobrok"); diff --git a/container-search/src/main/java/com/yahoo/prelude/hitfield/FieldIterator.java b/container-search/src/main/java/com/yahoo/prelude/hitfield/FieldIterator.java index c8dc87aeb52..3c61678bbde 100644 --- a/container-search/src/main/java/com/yahoo/prelude/hitfield/FieldIterator.java +++ b/container-search/src/main/java/com/yahoo/prelude/hitfield/FieldIterator.java @@ -7,7 +7,7 @@ import java.util.ListIterator; /** * A specialized list iterator to manipulate FieldParts in HitField objects. * - * @author <a href="mailto:steinar@yahoo-inc.com">Steinar Knutsen</a> + * @author Steinar Knutsen */ public class FieldIterator implements ListIterator<FieldPart> { diff --git a/container-search/src/main/java/com/yahoo/prelude/hitfield/HitField.java b/container-search/src/main/java/com/yahoo/prelude/hitfield/HitField.java index f6619a32a2b..8778b09934c 100644 --- a/container-search/src/main/java/com/yahoo/prelude/hitfield/HitField.java +++ b/container-search/src/main/java/com/yahoo/prelude/hitfield/HitField.java @@ -372,8 +372,9 @@ public class HitField { } return xml.toString(); } + /** - * @return the content of the field, stripped of markup + * Returns the content of the field, stripped of markup */ public String bareContent(boolean XMLQuote, boolean inAttribute) { StringBuilder bareContent = new StringBuilder(); diff --git a/container-search/src/main/java/com/yahoo/prelude/hitfield/TokenFieldIterator.java b/container-search/src/main/java/com/yahoo/prelude/hitfield/TokenFieldIterator.java index 95100dd4d39..beda005152c 100644 --- a/container-search/src/main/java/com/yahoo/prelude/hitfield/TokenFieldIterator.java +++ b/container-search/src/main/java/com/yahoo/prelude/hitfield/TokenFieldIterator.java @@ -8,7 +8,7 @@ import java.util.NoSuchElementException; /** * A specialized list iterator to manipulate tokens in HitField objects. * - * @author <a href="mailto:steinar@yahoo-inc.com">Steinar Knutsen</a> + * @author Steinar Knutsen */ public class TokenFieldIterator implements ListIterator<FieldPart> { diff --git a/container-search/src/main/java/com/yahoo/search/result/Hit.java b/container-search/src/main/java/com/yahoo/search/result/Hit.java index bcff370685f..db5b3e69803 100644 --- a/container-search/src/main/java/com/yahoo/search/result/Hit.java +++ b/container-search/src/main/java/com/yahoo/search/result/Hit.java @@ -418,7 +418,7 @@ public class Hit extends ListenableFreezableClass implements Data, Comparable<Hi */ public void forEachFieldAsRaw(RawUtf8Consumer consumer) { if (fields == null) return; - fields.forEach(consumer); // No utf-8 fields available in Hit + fields.forEach(consumer); } /** Returns the fields of this as a read-only map. This is more costly than fieldIterator() */ @@ -680,8 +680,8 @@ public class Hit extends ListenableFreezableClass implements Data, Comparable<Hi * * @param fieldName the name of the field * @param utf8Data raw utf-8 data. The reciver <b>must not</b> modify this data - * @param offset the start index of the data to accept into the utf8Data array - * @param length the length of the data to accept into the utf8Data array + * @param offset the start index in the utf8Data array of the data to accept + * @param length the length starting from offset in the utf8Data array of the data to accept */ void accept(String fieldName, byte[] utf8Data, int offset, int length); 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); } } } + } diff --git a/service-monitor/README b/service-monitor/README index 4d69c8ef3be..26f94fb8026 100644 --- a/service-monitor/README +++ b/service-monitor/README @@ -1 +1,2 @@ -a service that gives a list of node/service and their status(up/down) for all instances in a zone +A service which provides the up/down status of all service instances ("nodes in a cluster") +in all applications in a system. diff --git a/service-monitor/src/main/java/com/yahoo/vespa/service/duper/ZoneApplication.java b/service-monitor/src/main/java/com/yahoo/vespa/service/duper/ZoneApplication.java index 70354c0f16d..bcf5f096e7f 100644 --- a/service-monitor/src/main/java/com/yahoo/vespa/service/duper/ZoneApplication.java +++ b/service-monitor/src/main/java/com/yahoo/vespa/service/duper/ZoneApplication.java @@ -21,6 +21,7 @@ import java.util.Objects; * 2) ZoneApplication has multiple clusters */ public class ZoneApplication { + private ZoneApplication() {} private static final ApplicationId ZONE_APPLICATION_ID = InfraApplication @@ -103,4 +104,5 @@ public class ZoneApplication { ApplicationInstanceGenerator.getClusterId(serviceInfo), ApplicationInstanceGenerator.toServiceType(serviceInfo)); } + } diff --git a/service-monitor/src/main/java/com/yahoo/vespa/service/monitor/ServiceModel.java b/service-monitor/src/main/java/com/yahoo/vespa/service/monitor/ServiceModel.java index a9071e3ab94..b62552188e1 100644 --- a/service-monitor/src/main/java/com/yahoo/vespa/service/monitor/ServiceModel.java +++ b/service-monitor/src/main/java/com/yahoo/vespa/service/monitor/ServiceModel.java @@ -17,8 +17,8 @@ import java.util.stream.Collectors; * also gives ServiceStatus on each service, and there may be * artificial applications like the config server "application". */ -// @Immutable public class ServiceModel { + private final Map<ApplicationInstanceReference, ApplicationInstance> applications; public ServiceModel(Map<ApplicationInstanceReference, ApplicationInstance> applications) { @@ -39,4 +39,5 @@ public class ServiceModel { .flatMap(cluster -> cluster.serviceInstances().stream()) .collect(Collectors.groupingBy(ServiceInstance::hostName, Collectors.toList())); } + } diff --git a/service-monitor/src/main/java/com/yahoo/vespa/service/monitor/ServiceMonitor.java b/service-monitor/src/main/java/com/yahoo/vespa/service/monitor/ServiceMonitor.java index ab32af39580..5ed34673da5 100644 --- a/service-monitor/src/main/java/com/yahoo/vespa/service/monitor/ServiceMonitor.java +++ b/service-monitor/src/main/java/com/yahoo/vespa/service/monitor/ServiceMonitor.java @@ -21,4 +21,5 @@ public interface ServiceMonitor { Map<ApplicationInstanceReference, ApplicationInstance> getAllApplicationInstances(); ServiceModel getServiceModelSnapshot(); + } diff --git a/service-monitor/src/main/java/com/yahoo/vespa/service/monitor/ServiceStatusProvider.java b/service-monitor/src/main/java/com/yahoo/vespa/service/monitor/ServiceStatusProvider.java index 88c72a7d47a..30a20cf9980 100644 --- a/service-monitor/src/main/java/com/yahoo/vespa/service/monitor/ServiceStatusProvider.java +++ b/service-monitor/src/main/java/com/yahoo/vespa/service/monitor/ServiceStatusProvider.java @@ -11,6 +11,7 @@ import com.yahoo.vespa.applicationmodel.ServiceType; * @author hakonhall */ public interface ServiceStatusProvider { + /** * Get the {@link ServiceStatus} of a particular service. * @@ -22,4 +23,5 @@ public interface ServiceStatusProvider { ClusterId clusterId, ServiceType serviceType, ConfigId configId); + } diff --git a/service-monitor/src/main/java/com/yahoo/vespa/service/monitor/SlobrokApi.java b/service-monitor/src/main/java/com/yahoo/vespa/service/monitor/SlobrokApi.java index dff605b888d..b0f0d734fe4 100644 --- a/service-monitor/src/main/java/com/yahoo/vespa/service/monitor/SlobrokApi.java +++ b/service-monitor/src/main/java/com/yahoo/vespa/service/monitor/SlobrokApi.java @@ -7,9 +7,11 @@ import com.yahoo.jrt.slobrok.api.Mirror; import java.util.List; public interface SlobrokApi extends ServiceStatusProvider { + /** * Get all Slobrok entries that has a name matching pattern as described in * Mirror::lookup. */ List<Mirror.Entry> lookup(ApplicationId application, String pattern); + } |