Skip to content

Commit

Permalink
fix enum name
Browse files Browse the repository at this point in the history
  • Loading branch information
leonchen83 committed Aug 23, 2016
1 parent 62732ad commit d423b0c
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ public void open() throws IOException {
send("PSYNC".getBytes(), configuration.getMasterRunId().getBytes(), String.valueOf(configuration.getOffset()).getBytes());
final String reply = (String) reply();

Sync syncMode = trySync(reply);
if (syncMode == Sync.PSYNC) {
SyncMode syncMode = trySync(reply);
if (syncMode == SyncMode.PSYNC) {
//heart beat send REPLCONF ACK ${slave offset}
heartBeat = new Timer("heart beat");
heartBeat.schedule(new TimerTask() {
Expand Down Expand Up @@ -144,7 +144,7 @@ public void handle(long len) {
}
}

private Sync trySync(final String reply) throws IOException {
private SyncMode trySync(final String reply) throws IOException {
logger.info(reply);
if (reply.startsWith("FULLRESYNC")) {
//sync dump
Expand All @@ -153,16 +153,16 @@ private Sync trySync(final String reply) throws IOException {
String[] ary = reply.split(" ");
configuration.setMasterRunId(ary[1]);
configuration.setOffset(Long.parseLong(ary[2]));
return Sync.PSYNC;
return SyncMode.PSYNC;
} else if (reply.equals("CONTINUE")) {
// do nothing
return Sync.PSYNC;
return SyncMode.PSYNC;
} else {
//server don't support psync
logger.info("SYNC");
send("SYNC".getBytes());
parseDump(this);
return Sync.SYNC;
return SyncMode.SYNC;
}
}

Expand Down Expand Up @@ -295,7 +295,7 @@ public void close() throws IOException {
if (logger.isInfoEnabled()) logger.info("channel closed");
}

private enum Sync {
private enum SyncMode {
SYNC, PSYNC
}
}

0 comments on commit d423b0c

Please sign in to comment.