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

Commit

Permalink
Revert "Revert "Undeploy a deployment group's job from hosts that are…
Browse files Browse the repository at this point in the history
… removed""
  • Loading branch information
negz authored and Nic Cope committed Oct 6, 2016
1 parent 3758b14 commit be94e12
Show file tree
Hide file tree
Showing 30 changed files with 413 additions and 246 deletions.
Expand Up @@ -17,6 +17,8 @@

package com.spotify.helios.client;

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

import com.google.common.base.Joiner;
import com.google.common.base.Supplier;
import com.google.common.collect.ImmutableList;
Expand All @@ -31,8 +33,6 @@
import java.net.UnknownHostException;
import java.util.List;

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

/**
* A class that provides static factory methods for {@link Endpoint}.
*/
Expand Down
Expand Up @@ -17,12 +17,12 @@

package com.spotify.helios.client;

import static java.nio.charset.StandardCharsets.UTF_8;

import java.net.URI;
import java.util.List;
import java.util.Map;

import static java.nio.charset.StandardCharsets.UTF_8;

class Response {

private final String method;
Expand Down
Expand Up @@ -17,7 +17,10 @@

package com.spotify.helios;

import com.google.common.collect.ImmutableList;
import static com.spotify.helios.Utils.agentImage;
import static com.spotify.helios.Utils.masterImage;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;

import com.spotify.helios.Utils.AgentStatusProber;
import com.spotify.helios.common.protocol.CreateJobResponse;
Expand All @@ -30,16 +33,13 @@
import com.spotify.helios.testing.TemporaryJobBuilder;
import com.spotify.helios.testing.TemporaryJobs;

import com.google.common.collect.ImmutableList;

import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;

import static com.spotify.helios.Utils.agentImage;
import static com.spotify.helios.Utils.masterImage;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;

public class HeliosIT {

@ClassRule
Expand Down
Expand Up @@ -17,13 +17,20 @@

package com.spotify.helios;

import com.google.common.net.HostAndPort;
import static com.spotify.helios.system.SystemTestBase.ALPINE;
import static com.spotify.helios.system.SystemTestBase.NGINX;
import static java.util.Arrays.asList;
import static java.util.concurrent.TimeUnit.MINUTES;
import static org.hamcrest.Matchers.containsString;
import static org.junit.Assert.assertThat;

import com.spotify.helios.testing.HeliosDeploymentResource;
import com.spotify.helios.testing.HeliosSoloDeployment;
import com.spotify.helios.testing.InMemoryLogStreamProvider;
import com.spotify.helios.testing.TemporaryJob;
import com.spotify.helios.testing.TemporaryJobs;
import com.spotify.helios.testing.InMemoryLogStreamProvider;

import com.google.common.net.HostAndPort;

import org.apache.commons.io.IOUtils;
import org.junit.ClassRule;
Expand All @@ -33,13 +40,6 @@

import java.net.Socket;

import static com.spotify.helios.system.SystemTestBase.ALPINE;
import static com.spotify.helios.system.SystemTestBase.NGINX;
import static java.util.Arrays.asList;
import static java.util.concurrent.TimeUnit.MINUTES;
import static org.hamcrest.Matchers.containsString;
import static org.junit.Assert.assertThat;

public class HeliosSoloIT {

@Rule
Expand Down
Expand Up @@ -17,17 +17,20 @@

package com.spotify.helios;

import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableList;
import static com.fasterxml.jackson.databind.node.JsonNodeType.STRING;
import static java.util.Arrays.asList;

import com.fasterxml.jackson.databind.JsonNode;
import com.spotify.helios.cli.CliMain;
import com.spotify.helios.client.HeliosClient;
import com.spotify.helios.common.Json;
import com.spotify.helios.common.descriptors.HostStatus;
import com.spotify.helios.common.descriptors.PortMapping;
import com.spotify.helios.testing.Prober;

import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableList;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
Expand All @@ -38,9 +41,6 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

import static com.fasterxml.jackson.databind.node.JsonNodeType.STRING;
import static java.util.Arrays.asList;

public class Utils {

public static final String DEFAULT_IMAGE_INFO_PATH = "../helios-services/target/test-classes/";
Expand Down
@@ -0,0 +1,42 @@
/*
* Copyright (c) 2016 Spotify AB.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package com.spotify.helios.master;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.Sets;

import java.util.List;
import java.util.Set;

class HostChanges {
private final List<String> added;
private final List<String> removed;

HostChanges(final Set<String> newHosts, final Set<String> currentHosts) {
this.added = ImmutableList.copyOf(Sets.difference(newHosts, currentHosts));
this.removed = ImmutableList.copyOf(Sets.difference(currentHosts, newHosts));
}

List<String> added() {
return this.added;
}

List<String> removed() {
return this.removed;
}
}
Expand Up @@ -18,6 +18,7 @@
package com.spotify.helios.master;

import com.spotify.helios.master.resources.RequestUser;

import com.sun.jersey.api.core.HttpContext;
import com.sun.jersey.core.spi.component.ComponentContext;
import com.sun.jersey.core.spi.component.ComponentScope;
Expand Down

0 comments on commit be94e12

Please sign in to comment.