-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from diegopacheco/dev
Cluster Failover check and REST API
- Loading branch information
Showing
12 changed files
with
451 additions
and
289 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
13 changes: 13 additions & 0 deletions
13
...hecker/src/main/java/com/github/diegopacheco/dynomite/cluster/checker/DynomiteConfig.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,13 @@ | ||
package com.github.diegopacheco.dynomite.cluster.checker; | ||
|
||
public class DynomiteConfig { | ||
|
||
public static String CLUSTER_NAME = "dyn_o_mite"; | ||
public static String CLIENT_NAME = "DynomiteClusterChecker"; | ||
|
||
public static String TEST_KEY = "DCC_dynomite_123_kt"; | ||
public static String TEST_VALUE = "DCC_replication_works"; | ||
|
||
public static String TEST_FAILOVER_KEY = "DCC_dynomite_failoiverk"; | ||
public static String TEST_FAILOVER_VALUE = "DCC_dynomite_failoiver_works"; | ||
} |
8 changes: 0 additions & 8 deletions
8
...er-checker/src/main/java/com/github/diegopacheco/dynomite/cluster/checker/KeysConfig.java
This file was deleted.
Oops, something went wrong.
63 changes: 63 additions & 0 deletions
63
...-checker/src/main/java/com/github/diegopacheco/dynomite/cluster/checker/ResultReport.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,63 @@ | ||
package com.github.diegopacheco.dynomite.cluster.checker; | ||
|
||
import java.util.List; | ||
|
||
public class ResultReport { | ||
|
||
private String failoverStatus; | ||
private List<CheckerResponse> nodesReport; | ||
|
||
public ResultReport() {} | ||
|
||
public String getFailoverStatus() { | ||
return failoverStatus; | ||
} | ||
public void setFailoverStatus(String failoverStatus) { | ||
this.failoverStatus = failoverStatus; | ||
} | ||
|
||
public List<CheckerResponse> getNodesReport() { | ||
return nodesReport; | ||
} | ||
public void setNodesReport(List<CheckerResponse> nodesReport) { | ||
this.nodesReport = nodesReport; | ||
} | ||
|
||
|
||
@Override | ||
public String toString() { | ||
return "ResultReport [failoverStatus=" + failoverStatus + ", nodesReport=" + nodesReport + "]"; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
final int prime = 31; | ||
int result = 1; | ||
result = prime * result + ((failoverStatus == null) ? 0 : failoverStatus.hashCode()); | ||
result = prime * result + ((nodesReport == null) ? 0 : nodesReport.hashCode()); | ||
return result; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) | ||
return true; | ||
if (obj == null) | ||
return false; | ||
if (getClass() != obj.getClass()) | ||
return false; | ||
ResultReport other = (ResultReport) obj; | ||
if (failoverStatus == null) { | ||
if (other.failoverStatus != null) | ||
return false; | ||
} else if (!failoverStatus.equals(other.failoverStatus)) | ||
return false; | ||
if (nodesReport == null) { | ||
if (other.nodesReport != null) | ||
return false; | ||
} else if (!nodesReport.equals(other.nodesReport)) | ||
return false; | ||
return true; | ||
} | ||
|
||
} |
Oops, something went wrong.