> On 6月 10, 2015, 11:17 a.m., Raul Gutierrez Segales wrote: > > src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java, line 128 > > <https://reviews.apache.org/r/35204/diff/2/?file=981274#file981274line128> > > > > this'll override the default type which is Participant: > > > > ```java > > public LearnerType type = LearnerType.PARTICIPANT; > > ``` > > > > so this should pass LearnerType.Participant instead of null.
I modified null to LearnerType.PARTICIPANT. > On 6月 10, 2015, 11:17 a.m., Raul Gutierrez Segales wrote: > > src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java, line 236 > > <https://reviews.apache.org/r/35204/diff/2/?file=981274#file981274line236> > > > > to avoid duplicating this code you could probably call the constructor > > from below here and just move the setType call to after the constructor, > > i.e.: > > > > ```java > > this(sid, addr, clientAddr, electionAddr, Participant); > > > > if (serverParts.length == 4) { > > setType(serverParts[3]); > > } > > ``` Constructor call must be the first statement in a constructor, so I created setMyAddrs() to avoid duplication of code. > On 6月 10, 2015, 11:17 a.m., Raul Gutierrez Segales wrote: > > src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java, line 330 > > <https://reviews.apache.org/r/35204/diff/2/?file=981274#file981274line330> > > > > this method doesn't have to be public. I modified public to private. > On 6月 10, 2015, 11:17 a.m., Raul Gutierrez Segales wrote: > > src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java, line 337 > > <https://reviews.apache.org/r/35204/diff/2/?file=981274#file981274line337> > > > > don't call new InetSocketAddress(0) from within the loop; do it once > > outside and use that. I moved InetSocketAddress(0) to outside the loop. - Yasuhito ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/35204/#review87340 ----------------------------------------------------------- On 6月 11, 2015, 4:59 p.m., Yasuhito Fukuda wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/35204/ > ----------------------------------------------------------- > > (Updated 6月 11, 2015, 4:59 p.m.) > > > Review request for zookeeper. > > > Bugs: ZOOKEEPER-2193 > https://issues.apache.org/jira/browse/ZOOKEEPER-2193 > > > Repository: zookeeper-git > > > Description > ------- > > See ZOOKEEPER-2193 > > > Diffs > ----- > > src/java/main/org/apache/zookeeper/server/PrepRequestProcessor.java > 73fa4e67a09806c90a6037d9a170179cb806b896 > src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java > f15f831701f9c8514db5003ebd550cd3880b48c7 > > Diff: https://reviews.apache.org/r/35204/diff/ > > > Testing > ------- > > > Thanks, > > Yasuhito Fukuda > >
