Skip to content

Commit

Permalink
fixup: rename constants in ProtocolVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
kezhuw committed Sep 30, 2023
1 parent 76285b5 commit 290bf9a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1401,7 +1401,7 @@ public synchronized void processSync(Request r) {
if (p != null) {
p.pendingSyncs.add(r);
pendingSyncs.incrementAndGet();
} else if (followersProtocolVersion < ProtocolVersion.VERSION_3_10_0) {
} else if (followersProtocolVersion < ProtocolVersion.V3_10_0) {
sendSync(r);
} else {
p = createQuorumSyncProposal(r);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public Socket getSocket() {
protected InputArchive leaderIs;
protected OutputArchive leaderOs;
/** the protocol version of the leader */
protected int leaderProtocolVersion = ProtocolVersion.VERSION_ANCIENT;
protected int leaderProtocolVersion = ProtocolVersion.ANCIENT;

private static final int BUFFERED_MESSAGE_SIZE = 10;
protected final MessageTracker messageTracker = new MessageTracker(BUFFERED_MESSAGE_SIZE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ String getRemoteAddress() {
return sock == null ? "<null>" : sock.getRemoteSocketAddress().toString();
}

protected int version = ProtocolVersion.VERSION_ANCIENT;
protected int version = ProtocolVersion.ANCIENT;

int getVersion() {
return version;
Expand Down Expand Up @@ -524,7 +524,7 @@ public void run() {
long newEpoch = learnerMaster.getEpochToPropose(this.getSid(), lastAcceptedEpoch);
long newLeaderZxid = ZxidUtils.makeZxid(newEpoch, 0);

if (this.getVersion() < ProtocolVersion.VERSION_3_4_0) {
if (this.getVersion() < ProtocolVersion.V3_4_0) {
// we are going to have to extrapolate the epoch information
long epoch = ZxidUtils.getEpochFromZxid(zxid);
ss = new StateSummary(epoch, zxid);
Expand Down Expand Up @@ -596,7 +596,7 @@ public void run() {
// the version of this quorumVerifier will be set by leader.lead() in case
// the leader is just being established. waitForEpochAck makes sure that readyToStart is true if
// we got here, so the version was set
if (getVersion() < ProtocolVersion.VERSION_3_4_0) {
if (getVersion() < ProtocolVersion.V3_4_0) {
QuorumPacket newLeaderQP = new QuorumPacket(Leader.NEWLEADER, newLeaderZxid, null, null);
oa.writeRecord(newLeaderQP, "packet");
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ private ProtocolVersion() {}
/**
* Pre ZAB 1.0.
*/
public static final int VERSION_ANCIENT = 1;
public static final int ANCIENT = 1;

/**
* ZAB 1.0.
*/
public static final int VERSION_3_4_0 = 0x10000;
public static final int V3_4_0 = 0x10000;

/**
* Protocol changes:
* * Learner will piggyback whatever data leader attached in {@link Leader#PING} after session data.
* This way, leader is free to enhance {@link Leader#PING} in future without agreement from learner.
*/
public static final int VERSION_3_10_0 = 0x20000;
public static final int V3_10_0 = 0x20000;

/**
* Point to the newest coding version.
*/
public static final int CURRENT = VERSION_3_10_0;
public static final int CURRENT = V3_10_0;
}

0 comments on commit 290bf9a

Please sign in to comment.