jhuan31 commented on a change in pull request #849: ZOOKEEPER-3305: Add Quorum 
Packet metrics
URL: https://github.com/apache/zookeeper/pull/849#discussion_r266094269
 
 

 ##########
 File path: 
zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/LearnerHandler.java
 ##########
 @@ -155,12 +176,42 @@ public synchronized boolean check(long time) {
 
     private SyncLimitCheck syncLimitCheck = new SyncLimitCheck();
 
+    private static class MarkerQuorumPacket extends QuorumPacket {
+        long time;
+        MarkerQuorumPacket(long time) {
+            this.time = time;
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hash(super.hashCode(), time);
+        }
+
+        @Override
+        public boolean equals(Object o) {
+            if (this == o) return true;
+            if (o == null || getClass() != o.getClass()) return false;
+            if (!super.equals(o)) return false;
+            MarkerQuorumPacket that = (MarkerQuorumPacket) o;
+            return time == that.time;
+        }
+    };
+
     private BinaryInputArchive ia;
 
     private BinaryOutputArchive oa;
 
+    //for test only
+    protected void setOutputArchive(BinaryOutputArchive oa) {
+        this.oa = oa;
+    }
+
     private final BufferedInputStream bufferedInput;
     private BufferedOutputStream bufferedOutput;
+    //for test only
 
 Review comment:
   done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to