Skip to content

Commit 4b19ae8

Browse files
committed
Add configuration plus logging
1 parent dada348 commit 4b19ae8

File tree

5 files changed

+70
-5
lines changed

5 files changed

+70
-5
lines changed

src/main/java/com/spotify/reaper/ReaperApplicationConfiguration.java

+49-5
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,63 @@
44

55
import org.hibernate.validator.constraints.NotEmpty;
66

7+
import javax.validation.constraints.Max;
8+
import javax.validation.constraints.Min;
9+
710
import io.dropwizard.Configuration;
811

912
public class ReaperApplicationConfiguration extends Configuration {
1013

11-
private String testingValue;
14+
private int segmentCount;
15+
16+
@NotEmpty
17+
private String repairStrategy;
18+
19+
private boolean snapshotRepair;
20+
21+
private double repairIntensity;
22+
23+
24+
@JsonProperty
25+
public int getSegmentCount() {
26+
return segmentCount;
27+
}
28+
29+
@JsonProperty
30+
public void setSegmentCount(int segmentCount) {
31+
this.segmentCount = segmentCount;
32+
}
33+
34+
35+
@JsonProperty
36+
public String getRepairStrategy() {
37+
return repairStrategy;
38+
}
39+
40+
@JsonProperty
41+
public void setRepairStrategy(String repairStrategy) {
42+
this.repairStrategy = repairStrategy;
43+
}
44+
45+
46+
@JsonProperty
47+
public boolean getSnapshotRepair() {
48+
return snapshotRepair;
49+
}
50+
51+
@JsonProperty
52+
public void setSnapshotRepair(boolean snapshotRepair) {
53+
this.snapshotRepair = snapshotRepair;
54+
}
55+
1256

1357
@JsonProperty
14-
public String getTestingValue() {
15-
return testingValue;
58+
public double getRepairIntensity() {
59+
return repairIntensity;
1660
}
1761

1862
@JsonProperty
19-
public void setTestingValue(String testingValue) {
20-
this.testingValue = testingValue;
63+
public void setRepairIntensity(double repairIntensity) {
64+
this.repairIntensity = repairIntensity;
2165
}
2266
}

src/main/java/com/spotify/reaper/resources/AddClusterResource.java

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
import com.google.common.base.Optional;
44

5+
import org.slf4j.LoggerFactory;
6+
import org.slf4j.Logger;
7+
58
import javax.ws.rs.POST;
69
import javax.ws.rs.Path;
710
import javax.ws.rs.Produces;
@@ -12,8 +15,11 @@
1215
@Produces(MediaType.TEXT_PLAIN)
1316
public class AddClusterResource {
1417

18+
private static final Logger LOG = LoggerFactory.getLogger(AddClusterResource.class);
19+
1520
@POST
1621
public String addCluster(@QueryParam("host") Optional<String> host) {
22+
LOG.info("add_cluster called with host: {}", host);
1723
return String.format("Not implemented yet");
1824
}
1925

src/main/java/com/spotify/reaper/resources/AddTableResource.java

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public class AddTableResource {
1616
public String addTable(@QueryParam("host") Optional<String> host,
1717
@QueryParam("keyspace") Optional<String> keyspace,
1818
@QueryParam("table") Optional<String> table) {
19+
1920
return String.format("Not implemented yet");
2021
}
2122

src/main/java/com/spotify/reaper/resources/RepairTableResource.java

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public class RepairTableResource {
1414

1515
@POST
1616
public String addTable(@QueryParam("repair_run_id") Optional<String> repairRunID) {
17+
1718
return String.format("Not implemented yet");
1819
}
1920

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
segmentCount: 100
2+
repairStrategy: com.spotify.reaper.SequentialRepairStrategy
3+
snapshotRepair: false
4+
repairIntensity: 0.75
5+
6+
logging:
7+
level: INFO
8+
appenders:
9+
- type: syslog
10+
threshold: ALL
11+
timeZone: UTC
12+
facility: local0
13+
stackTracePrefix: \t

0 commit comments

Comments
 (0)