zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anmolnar <...@git.apache.org>
Subject [GitHub] zookeeper pull request #440: ZOOKEEPER-2939 Deal with maxbuffer as it relate...
Date Wed, 24 Jan 2018 05:54:37 GMT
Github user anmolnar commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/440#discussion_r163458731
  
    --- Diff: src/java/main/org/apache/zookeeper/server/ZKDatabase.java ---
    @@ -264,19 +262,8 @@ public void addCommittedProposal(Request request) {
                     maxCommittedLog = request.zxid;
                 }
     
    -            ByteArrayOutputStream baos = new ByteArrayOutputStream();
    -            BinaryOutputArchive boa = BinaryOutputArchive.getArchive(baos);
    -            try {
    -                request.getHdr().serialize(boa, "hdr");
    -                if (request.getTxn() != null) {
    -                    request.getTxn().serialize(boa, "txn");
    -                }
    -                baos.close();
    -            } catch (IOException e) {
    -                LOG.error("This really should be impossible", e);
    -            }
    -            QuorumPacket pp = new QuorumPacket(Leader.PROPOSAL, request.zxid,
    -                    baos.toByteArray(), null);
    +            byte[] data = SerializeUtils.serializeRequest(request);
    --- End diff --
    
    Just a small refactoring. I'm happy to submit in another PR.


---

Mime
View raw message