-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix existing resource skeleton and database schema for cluster
- Loading branch information
1 parent
d778b18
commit 443b5b7
Showing
11 changed files
with
79 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 0 additions & 23 deletions
23
src/main/java/com/spotify/reaper/resources/AddTableResource.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 0 additions & 21 deletions
21
src/main/java/com/spotify/reaper/resources/RepairTableResource.java
This file was deleted.
Oops, something went wrong.
52 changes: 52 additions & 0 deletions
52
src/main/java/com/spotify/reaper/resources/TableResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.spotify.reaper.resources; | ||
|
||
import com.google.common.base.Optional; | ||
|
||
import com.spotify.reaper.core.Cluster; | ||
import com.spotify.reaper.storage.IStorage; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.POST; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.PathParam; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.QueryParam; | ||
import javax.ws.rs.core.MediaType; | ||
import javax.ws.rs.core.Response; | ||
|
||
@Path("/table") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
public class TableResource { | ||
|
||
private static final Logger LOG = LoggerFactory.getLogger(TableResource.class); | ||
|
||
private final IStorage storage; | ||
|
||
public TableResource(IStorage storage) { | ||
this.storage = storage; | ||
} | ||
|
||
@GET | ||
@Path("/{clusterName}/{keyspace}/{table}") | ||
public Response getCluster(@PathParam("clusterName") String clusterName, | ||
@PathParam("keyspace") String keyspace, | ||
@PathParam("table") String table) { | ||
LOG.info("get table called with: clusterName = {}, keyspace = {}, table = {}", | ||
clusterName, keyspace, table); | ||
return Response.ok().entity("not implemented yet").build(); | ||
} | ||
|
||
@POST | ||
public Response addTable(@QueryParam("clusterName") Optional<String> clusterName, | ||
@QueryParam("seedHost") Optional<String> seedHost, | ||
@QueryParam("keyspace") Optional<String> keyspace, | ||
@QueryParam("table") Optional<String> table) { | ||
LOG.info("add table called with: clusterName = {}, seedHost = {}, keyspace = {}, table = {}", | ||
clusterName, seedHost, keyspace, table); | ||
return Response.ok().entity("not implemented yet").build(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters