Skip to content
This repository was archived by the owner on May 18, 2021. It is now read-only.

Commit

Permalink
move to io.airlift (step 2)
Browse files Browse the repository at this point in the history
  • Loading branch information
martint committed Jul 25, 2012
1 parent 7ef71ad commit 8cce195
Show file tree
Hide file tree
Showing 250 changed files with 1,350 additions and 1,350 deletions.
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
galaxy
airship
2 changes: 1 addition & 1 deletion airship-agent/README.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
galaxy-agent
airship-agent
16 changes: 8 additions & 8 deletions airship-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
</parent>

<properties>
<main-class>com.proofpoint.galaxy.agent.AgentMain</main-class>
<main-class>io.airlift.airship.agent.AgentMain</main-class>
</properties>

<groupId>com.proofpoint.galaxy</groupId>
<artifactId>galaxy-agent</artifactId>
<groupId>io.airlift.airship</groupId>
<artifactId>airship-agent</artifactId>
<version>0.9-SNAPSHOT</version>
<name>galaxy-agent</name>
<name>airship-agent</name>

<distributionManagement>
<snapshotRepository>
Expand All @@ -31,8 +31,8 @@

<dependencies>
<dependency>
<groupId>com.proofpoint.galaxy</groupId>
<artifactId>galaxy-shared</artifactId>
<groupId>io.airlift.airship</groupId>
<artifactId>airship-shared</artifactId>
<version>0.9-SNAPSHOT</version>
</dependency>

Expand Down Expand Up @@ -171,8 +171,8 @@
</dependency>

<dependency>
<groupId>com.proofpoint.galaxy</groupId>
<artifactId>galaxy-shared</artifactId>
<groupId>io.airlift.airship</groupId>
<artifactId>airship-shared</artifactId>
<version>0.9-SNAPSHOT</version>
<type>test-jar</type>
<scope>test</scope>
Expand Down
14 changes: 7 additions & 7 deletions airship-agent/src/main/java/io/airlift/airship/agent/Agent.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.proofpoint.galaxy.agent;
package io.airlift.airship.agent;

import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableList.Builder;
import com.google.common.collect.ImmutableMap;
import com.google.common.io.Closeables;
import com.google.inject.Inject;
import com.proofpoint.galaxy.shared.AgentStatus;
import com.proofpoint.galaxy.shared.Installation;
import com.proofpoint.galaxy.shared.SlotStatus;
import io.airlift.airship.shared.AgentStatus;
import io.airlift.airship.shared.Installation;
import io.airlift.airship.shared.SlotStatus;
import com.proofpoint.http.server.HttpServerInfo;
import com.proofpoint.node.NodeInfo;
import com.proofpoint.units.Duration;
Expand All @@ -38,9 +38,9 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

import static com.proofpoint.galaxy.shared.AgentLifecycleState.ONLINE;
import static com.proofpoint.galaxy.shared.HttpUriBuilder.uriBuilderFrom;
import static com.proofpoint.galaxy.shared.SlotLifecycleState.TERMINATED;
import static io.airlift.airship.shared.AgentLifecycleState.ONLINE;
import static io.airlift.airship.shared.HttpUriBuilder.uriBuilderFrom;
import static io.airlift.airship.shared.SlotLifecycleState.TERMINATED;
import static java.lang.String.format;

public class Agent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.proofpoint.galaxy.agent;
package io.airlift.airship.agent;

import com.google.common.base.Preconditions;
import com.proofpoint.configuration.Config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.proofpoint.galaxy.agent;
package io.airlift.airship.agent;

import com.proofpoint.bootstrap.Bootstrap;
import com.proofpoint.discovery.client.DiscoveryModule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.proofpoint.galaxy.agent;
package io.airlift.airship.agent;

import com.google.inject.Binder;
import com.google.inject.Module;
import com.google.inject.Scopes;
import com.proofpoint.configuration.ConfigurationModule;
import com.proofpoint.galaxy.shared.VersionConflictExceptionMapper;
import io.airlift.airship.shared.VersionConflictExceptionMapper;
import org.weakref.jmx.guice.MBeanModule;

public class AgentMainModule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.proofpoint.galaxy.agent;
package io.airlift.airship.agent;

import com.google.common.base.Preconditions;
import com.google.inject.Inject;
import com.proofpoint.galaxy.shared.AgentStatus;
import com.proofpoint.galaxy.shared.AgentStatusRepresentation;
import io.airlift.airship.shared.AgentStatus;
import io.airlift.airship.shared.AgentStatusRepresentation;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import static com.proofpoint.galaxy.shared.VersionsUtil.GALAXY_AGENT_VERSION_HEADER;
import static io.airlift.airship.shared.VersionsUtil.AIRSHIP_AGENT_VERSION_HEADER;

@Path("/v1/agent/")
public class AgentResource
Expand All @@ -46,7 +46,7 @@ public Response getAllSlotsStatus()
AgentStatus agentStatus = agent.getAgentStatus();
AgentStatusRepresentation agentStatusRepresentation = AgentStatusRepresentation.from(agentStatus);
return Response.ok(agentStatusRepresentation)
.header(GALAXY_AGENT_VERSION_HEADER, agentStatus.getVersion())
.header(AIRSHIP_AGENT_VERSION_HEADER, agentStatus.getVersion())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.proofpoint.galaxy.agent;
package io.airlift.airship.agent;

import com.google.common.base.Preconditions;
import com.google.inject.Inject;
import com.proofpoint.galaxy.shared.InstallationRepresentation;
import com.proofpoint.galaxy.shared.SlotStatus;
import com.proofpoint.galaxy.shared.SlotStatusRepresentation;
import io.airlift.airship.shared.InstallationRepresentation;
import io.airlift.airship.shared.SlotStatus;
import io.airlift.airship.shared.SlotStatusRepresentation;

import javax.ws.rs.Consumes;
import javax.ws.rs.HeaderParam;
Expand All @@ -30,10 +30,10 @@

import java.util.UUID;

import static com.proofpoint.galaxy.shared.VersionsUtil.checkAgentVersion;
import static com.proofpoint.galaxy.shared.VersionsUtil.checkSlotVersion;
import static com.proofpoint.galaxy.shared.VersionsUtil.GALAXY_AGENT_VERSION_HEADER;
import static com.proofpoint.galaxy.shared.VersionsUtil.GALAXY_SLOT_VERSION_HEADER;
import static io.airlift.airship.shared.VersionsUtil.checkAgentVersion;
import static io.airlift.airship.shared.VersionsUtil.checkSlotVersion;
import static io.airlift.airship.shared.VersionsUtil.AIRSHIP_AGENT_VERSION_HEADER;
import static io.airlift.airship.shared.VersionsUtil.AIRSHIP_SLOT_VERSION_HEADER;

@Path("/v1/agent/slot/{slotId}/assignment")
public class AssignmentResource
Expand All @@ -51,8 +51,8 @@ public AssignmentResource(Agent agent)
@PUT
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response assign(@HeaderParam(GALAXY_AGENT_VERSION_HEADER) String agentVersion,
@HeaderParam(GALAXY_SLOT_VERSION_HEADER) String slotVersion,
public Response assign(@HeaderParam(AIRSHIP_AGENT_VERSION_HEADER) String agentVersion,
@HeaderParam(AIRSHIP_SLOT_VERSION_HEADER) String slotVersion,
@PathParam("slotId") UUID slotId,
InstallationRepresentation installation)
{
Expand All @@ -69,8 +69,8 @@ public Response assign(@HeaderParam(GALAXY_AGENT_VERSION_HEADER) String agentVer

SlotStatus status = slot.assign(installation.toInstallation());
return Response.ok(SlotStatusRepresentation.from(status))
.header(GALAXY_AGENT_VERSION_HEADER, agent.getAgentStatus().getVersion())
.header(GALAXY_SLOT_VERSION_HEADER, status.getVersion())
.header(AIRSHIP_AGENT_VERSION_HEADER, agent.getAgentStatus().getVersion())
.header(AIRSHIP_SLOT_VERSION_HEADER, status.getVersion())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.proofpoint.galaxy.agent;
package io.airlift.airship.agent;

import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import com.proofpoint.galaxy.shared.Assignment;
import io.airlift.airship.shared.Assignment;

import javax.annotation.concurrent.Immutable;
import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.proofpoint.galaxy.agent;
package io.airlift.airship.agent;

import com.proofpoint.galaxy.shared.Installation;
import io.airlift.airship.shared.Installation;

import java.util.UUID;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.proofpoint.galaxy.agent;
package io.airlift.airship.agent;

import com.proofpoint.galaxy.shared.Installation;
import io.airlift.airship.shared.Installation;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.proofpoint.galaxy.agent;
package io.airlift.airship.agent;

import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import com.proofpoint.galaxy.shared.AssignmentRepresentation;
import io.airlift.airship.shared.AssignmentRepresentation;
import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonProperty;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.proofpoint.galaxy.agent;
package io.airlift.airship.agent;

import com.google.common.base.Preconditions;
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.proofpoint.galaxy.shared.SlotLifecycleState;
import com.proofpoint.galaxy.shared.SlotStatus;
import com.proofpoint.galaxy.shared.Installation;
import io.airlift.airship.shared.SlotLifecycleState;
import io.airlift.airship.shared.SlotStatus;
import io.airlift.airship.shared.Installation;
import com.proofpoint.log.Logger;
import com.proofpoint.units.Duration;

Expand All @@ -30,10 +30,10 @@
import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.locks.ReentrantLock;

import static com.proofpoint.galaxy.shared.SlotLifecycleState.STOPPED;
import static com.proofpoint.galaxy.shared.SlotLifecycleState.TERMINATED;
import static com.proofpoint.galaxy.shared.SlotLifecycleState.UNKNOWN;
import static com.proofpoint.galaxy.shared.SlotStatus.createSlotStatus;
import static io.airlift.airship.shared.SlotLifecycleState.STOPPED;
import static io.airlift.airship.shared.SlotLifecycleState.TERMINATED;
import static io.airlift.airship.shared.SlotLifecycleState.UNKNOWN;
import static io.airlift.airship.shared.SlotStatus.createSlotStatus;

public class DeploymentSlot implements Slot
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.proofpoint.galaxy.agent;
package io.airlift.airship.agent;

import com.google.common.base.Preconditions;
import com.google.common.io.Files;
import com.google.common.io.Resources;
import com.proofpoint.galaxy.shared.ConfigUtils;
import io.airlift.airship.shared.ConfigUtils;
import com.proofpoint.json.JsonCodec;
import com.proofpoint.galaxy.shared.Assignment;
import com.proofpoint.galaxy.shared.CommandFailedException;
import com.proofpoint.galaxy.shared.Installation;
import io.airlift.airship.shared.Assignment;
import io.airlift.airship.shared.CommandFailedException;
import io.airlift.airship.shared.Installation;
import com.proofpoint.log.Logger;
import com.proofpoint.units.Duration;

Expand All @@ -19,10 +19,10 @@

import static com.google.common.base.Charsets.UTF_8;
import static com.proofpoint.json.JsonCodec.jsonCodec;
import static com.proofpoint.galaxy.shared.FileUtils.createTempDir;
import static com.proofpoint.galaxy.shared.FileUtils.deleteRecursively;
import static com.proofpoint.galaxy.shared.FileUtils.extractTar;
import static com.proofpoint.galaxy.shared.FileUtils.listFiles;
import static io.airlift.airship.shared.FileUtils.createTempDir;
import static io.airlift.airship.shared.FileUtils.deleteRecursively;
import static io.airlift.airship.shared.FileUtils.extractTar;
import static io.airlift.airship.shared.FileUtils.listFiles;

public class DirectoryDeploymentManager implements DeploymentManager
{
Expand Down Expand Up @@ -50,7 +50,7 @@ public DirectoryDeploymentManager(File baseDir, String location, Duration tarTim
this.baseDir = baseDir;

// verify deployment file is readable and writable
deploymentFile = new File(baseDir, "galaxy-deployment.json");
deploymentFile = new File(baseDir, "airship-deployment.json");
if (deploymentFile.exists()) {
Preconditions.checkArgument(deploymentFile.canRead(), "Can not read slot-id file %s", deploymentFile.getAbsolutePath());
Preconditions.checkArgument(deploymentFile.canWrite(), "Can not write slot-id file %s", deploymentFile.getAbsolutePath());
Expand All @@ -69,7 +69,7 @@ public DirectoryDeploymentManager(File baseDir, String location, Duration tarTim
}

// load slot-id
File slotIdFile = new File(baseDir, "galaxy-slot-id.txt");
File slotIdFile = new File(baseDir, "airship-slot-id.txt");
UUID uuid = null;
if (slotIdFile.exists()) {
Preconditions.checkArgument(slotIdFile.canRead(), "can not read " + slotIdFile.getAbsolutePath());
Expand All @@ -82,7 +82,7 @@ public DirectoryDeploymentManager(File baseDir, String location, Duration tarTim

}
if (uuid == null) {
log.warn("Invalid slot id [" + slotIdString + "]: attempting to delete galaxy-slot-id.txt file and recreating a new one");
log.warn("Invalid slot id [" + slotIdString + "]: attempting to delete airship-slot-id.txt file and recreating a new one");
slotIdFile.delete();
}
}
Expand Down Expand Up @@ -130,7 +130,7 @@ public Deployment install(Installation installation)
File tempDir = createTempDir(baseDir, "tmp-install");
try {
// download the binary
File binary = new File(tempDir, "galaxy-binary.tar.gz");
File binary = new File(tempDir, "airship-binary.tar.gz");
try {
Files.copy(Resources.newInputStreamSupplier(installation.getBinaryFile().toURL()), binary);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.proofpoint.galaxy.agent;
package io.airlift.airship.agent;

import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.inject.Inject;
import com.proofpoint.galaxy.shared.FileUtils;
import com.proofpoint.galaxy.shared.Installation;
import com.proofpoint.galaxy.shared.MavenCoordinates;
import io.airlift.airship.shared.FileUtils;
import io.airlift.airship.shared.Installation;
import io.airlift.airship.shared.MavenCoordinates;
import com.proofpoint.node.NodeInfo;
import com.proofpoint.units.Duration;

Expand All @@ -17,7 +17,7 @@
import java.util.List;
import java.util.Set;

import static com.proofpoint.galaxy.shared.FileUtils.listFiles;
import static io.airlift.airship.shared.FileUtils.listFiles;

public class DirectoryDeploymentManagerFactory implements DeploymentManagerFactory
{
Expand Down Expand Up @@ -53,7 +53,7 @@ public List<DeploymentManager> loadSlots()
{
ImmutableList.Builder<DeploymentManager> builder = ImmutableList.builder();
for (File dir : listFiles(slotDir)) {
if (dir.isDirectory() && new File(dir, "galaxy-slot-id.txt").canRead()) {
if (dir.isDirectory() && new File(dir, "airship-slot-id.txt").canRead()) {
DirectoryDeploymentManager deploymentManager = new DirectoryDeploymentManager(dir, location + "/" + dir.getName(), tarTimeout);
builder.add(deploymentManager);
}
Expand Down
Loading

0 comments on commit 8cce195

Please sign in to comment.