Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
Fix errors when building with JDK11
Browse files Browse the repository at this point in the history
* Upgrade various plugins whose old versions don't work on JDK11.
* Upgrade com.spotify:foss-root pom from 5 to 9.
* Fix various checkstyle and Javadoc errors resulting from upgrades of above.
  • Loading branch information
davidxia committed Oct 6, 2018
1 parent d9a4350 commit 931a1fd
Show file tree
Hide file tree
Showing 27 changed files with 74 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@

import static com.google.common.base.Preconditions.checkNotNull;

import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Random;
import javax.annotation.Nullable;

/**
* An {@link Iterator} of {@link Endpoint} that restarts when it reaches the end.
Expand Down Expand Up @@ -74,18 +71,4 @@ public Endpoint next() {
public void remove() {
throw new UnsupportedOperationException();
}

/**
* @return true if any endpoints' scheme is HTTPS.
*/
boolean hasHttps() {
return Iterables.any(endpoints, new Predicate<Endpoint>() {
@Override
public boolean apply(@Nullable Endpoint endpoint) {
return endpoint != null && endpoint.getUri() != null
&& endpoint.getUri().getScheme() != null
&& endpoint.getUri().getScheme().equalsIgnoreCase("https");
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class Deployment extends Descriptor {
private final String deploymentGroupName;

/**
* Constructor
* Constructor.
*
* @param jobId The id of the job.
* @param goal The desired state (i.e. goal) of the task/deployment.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public class DockerVersion {
private final String version;

/**
* Constructor.
*
* @param apiVersion The Docker api version supported.
* @param arch The architecture of the machine.
* @param gitCommit The git commit from which Docker was built.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ public class HostInfo extends Descriptor {
private final String dockerCertPath;

/**
* Constructor.
*
* @param hostname The hostname of the agent.
* @param uname The output of the uname command.
* @param architecture The architecture of the Agent.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private JobId(final String id) {
}

/**
* Private constructor for use by {@link #parse(String)}
* Private constructor for use by {@link #parse(String)}.
*
* @param name The name of the job.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ public Job getJob() {
}

/**
* @return a map of host to task status.
* Return a map of host to task status.
*/
public Map<String, TaskStatus> getTaskStatuses() {
return taskStatuses;
}

/**
* @return a map of host to deployment.
* Return a map of host to deployment.
*/
public Map<String, Deployment> getDeployments() {
return deployments;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ public enum State {
private final String containerError;

/**
* Constructor.
*
* @param job The job the task is running.
* @param goal The desired state of the task.
* @param state The state of the task.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@

package com.spotify.helios.common.descriptors;

import static com.spotify.helios.common.descriptors.RolloutOptions.DEFAULT_IGNORE_FAILURES;
import static com.spotify.helios.common.descriptors.RolloutOptions.DEFAULT_MIGRATE;
import static com.spotify.helios.common.descriptors.RolloutOptions.DEFAULT_TOKEN;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.core.Is.is;
Expand Down
2 changes: 1 addition & 1 deletion helios-services/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@

<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.3</version>
<version>3.1.0</version>
<configuration>
<descriptors>
<descriptor>${project.basedir}/src/assembly/helios-solo.xml</descriptor>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public boolean isDone() {
}

/**
* Get the current container id
* Get the current container id.
*
* @return The container id.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

package com.spotify.helios.master;


import static java.lang.String.format;

import com.spotify.helios.common.HeliosException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import com.google.common.io.Resources;
import com.google.common.util.concurrent.AbstractIdleService;
import com.spotify.helios.common.HeliosRuntimeException;
import com.spotify.helios.common.descriptors.TaskStatusEvent;
import com.spotify.helios.master.http.VersionResponseFilter;
import com.spotify.helios.master.metrics.HealthCheckGauge;
import com.spotify.helios.master.metrics.ReportingResourceMethodDispatchAdapter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
public interface ZooKeeperRegistrar {

/**
* Called upon startup
* Called upon startup.
*
* @throws Exception If an unexpected error occurs.
*/
void startUp() throws Exception;

/**
* Called upon shutdown
* Called upon shutdown.
*
* @throws Exception If an unexpected error occurs.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

package com.spotify.helios.rollingupdate;


import static org.junit.Assert.assertEquals;

import com.google.common.collect.ImmutableList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

package com.spotify.helios.rollingupdate;


import static org.junit.Assert.assertEquals;

import com.google.common.collect.ImmutableList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

package com.spotify.helios.system;


import static com.spotify.docker.client.DockerClient.LogsParam.stderr;
import static com.spotify.docker.client.DockerClient.LogsParam.stdout;
import static com.spotify.helios.common.descriptors.HostStatus.Status.UP;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
public class LabelTest extends SystemTestBase {

/**
* Get labels for a set of hosts.
*
* @param hosts Hostnames for which to get labels.
*
* @return a map whose keys are hostnames and values are maps of label key-vals.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class HeliosConfig {
public static final String APP_CONFIG_FILE = "helios.conf";

/**
* @return The root configuration loaded from the helios configuration files.
* Return the root configuration loaded from the helios configuration files.
*/
static Config loadConfig() {
final ConfigResolveOptions resolveOptions = ConfigResolveOptions
Expand All @@ -52,11 +52,11 @@ static Config loadConfig() {
}

/**
* Return the name of the default profile.
*
* @param profilePath The path at which the default profile is specified.
* @param profilesPath The path at which profiles are nested.
* @param rootConfig The config file root to read the default profile from.
*
* @return The name of the default profile.
*/
static Config getDefaultProfile(
final String profilePath, final String profilesPath, final Config rootConfig) {
Expand All @@ -69,11 +69,11 @@ static Config getDefaultProfile(
}

/**
* Return the requested configuration, or an empty configuration if profile is null.
*
* @param profilesPath The path at which profiles are nested.
* @param profile The name of the profile to load.
* @param rootConfig The config file root to load profiles from.
*
* @return The requested configuration, or an empty configuration if profile is null.
*/
static Config getProfile(
final String profilesPath, final String profile, final Config rootConfig) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,18 @@
* run.
*/
public interface HeliosDeployment extends AutoCloseable {

/**
* @return A helios client connected to the master(s) of this helios deployment.
* A helios client connected to the master(s) of this helios deployment.
*
* @return {@link HeliosClient}
*/
HeliosClient client();

/**
* Returns the host and port information that the deployment is available at.
* Returns the host and port information that the deployment is available at.
*
* @return {@link HostAndPort}
*/
// TODO (mbrown): should this be URI to capture scheme info also?
HostAndPort address();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public class HeliosDeploymentResource extends ExternalResource {
private final HeliosDeployment deployment;

/**
* Constructor.
*
* @param deployment The Helios deployment to expose to your JUnit tests.
*/
public HeliosDeploymentResource(final HeliosDeployment deployment) {
Expand Down Expand Up @@ -142,8 +144,10 @@ public void after() {
}

/**
* @return a Helios client connected to the Helios deployment supplied when instantiating the
* HeliosDeploymentResource.
* Return a Helios client connected to the Helios deployment supplied when instantiating the
* HeliosDeploymentResource.
*
* @return {@link HeliosClient}
*/
public HeliosClient client() {
return deployment.client();
Expand Down
Loading

0 comments on commit 931a1fd

Please sign in to comment.