> On July 10, 2014, 3:22 p.m., Raul Gutierrez Segales wrote:
> > src/java/main/org/apache/zookeeper/server/DataTree.java, line 1320
> > <https://reviews.apache.org/r/23259/diff/2/?file=626603#file626603line1320>
> >
> >     nit: "created by that session" is redundant i think, it's already 
> > implied by "mapping of session ID to ephemeral znodes".
> >     
> >     if you want to be extra clear, maybe:
> >     
> >     "Return a mapping of session ID to its ephemeral znodes"
> >     
> >     ?

No problem, I'll update it.


> On July 10, 2014, 3:22 p.m., Raul Gutierrez Segales wrote:
> > src/java/main/org/apache/zookeeper/server/DataTree.java, line 1330
> > <https://reviews.apache.org/r/23259/diff/2/?file=626603#file626603line1330>
> >
> >     hmm, why do we need to copy here? why not Collections.unmodifiableMap?

I think the intent here is to take a snapshot of the ephemerals. 
Collections.unmodifiableMap gives you a read-only view of the underlying map, 
but that underlying map can still change (that is, it doesn't do a copy).


> On July 10, 2014, 3:22 p.m., Raul Gutierrez Segales wrote:
> > src/java/main/org/apache/zookeeper/server/WatchesReport.java, line 41
> > <https://reviews.apache.org/r/23259/diff/2/?file=626614#file626614line41>
> >
> >     ditto

As above :)


> On July 10, 2014, 3:22 p.m., Raul Gutierrez Segales wrote:
> > src/java/main/org/apache/zookeeper/server/WatchesPathReport.java, line 41
> > <https://reviews.apache.org/r/23259/diff/2/?file=626613#file626613line41>
> >
> >     why do we need to copy?

As a defensive copy, to prevent a caller who retains a reference to path2Ids 
from making changes that become visible in the report object, which is supposed 
to be immutable. As above, Collections.unmodifiableMap doesn't make a copy.


> On July 10, 2014, 3:22 p.m., Raul Gutierrez Segales wrote:
> > src/java/main/org/apache/zookeeper/server/ZooKeeperServer.java, line 204
> > <https://reviews.apache.org/r/23259/diff/2/?file=626617#file626617line204>
> >
> >     i think Conf should be an object too... with a toMap() method.

Oh that's where Conf is - you mentioned it in your last review but I didn't see 
where it was. I'll update that too!


> On July 10, 2014, 3:22 p.m., Raul Gutierrez Segales wrote:
> > src/java/main/org/apache/zookeeper/server/ZooKeeperServerMain.java, line 73
> > <https://reviews.apache.org/r/23259/diff/2/?file=626618#file626618line73>
> >
> >     Mind printing the exception on stderr too so the startup script reports 
> > the failure? (i.e.: i am thinking of cases were the 8080 is taken and such, 
> > it would be good to make it obvious as to why startup failed).

The exception is logged in the ZooKeeperServerMain log4j log - is that 
sufficient? That's what happens with other exceptions caught right above this. 
(If it isn't sufficient, the other ones should do it too.)


> On July 10, 2014, 3:22 p.m., Raul Gutierrez Segales wrote:
> > src/java/main/org/apache/zookeeper/server/admin/JettyAdminServer.java, line 
> > 94
> > <https://reviews.apache.org/r/23259/diff/2/?file=626627#file626627line94>
> >
> >     nit: LOG.info already does variable extrapolation for you, no need for 
> > String.format.

Is that a log4j 2 thing? I don't see how to do it in log4j 1 (and it would be 
awesome).


> On July 10, 2014, 3:22 p.m., Raul Gutierrez Segales wrote:
> > src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerMain.java, line 
> > 95
> > <https://reviews.apache.org/r/23259/diff/2/?file=626634#file626634line95>
> >
> >     i'd say print the exception on stderr too (i think)

Same as above, it's logged already. Is that sufficient?


> On July 10, 2014, 3:22 p.m., Raul Gutierrez Segales wrote:
> > src/java/test/org/apache/zookeeper/server/admin/JettyAdminServerTest.java, 
> > line 106
> > <https://reviews.apache.org/r/23259/diff/2/?file=626642#file626642line106>
> >
> >     super nit: building this w/ String.format() is more readable than 
> > concatenating.

Will fix.


> On July 10, 2014, 3:22 p.m., Raul Gutierrez Segales wrote:
> > src/java/test/org/apache/zookeeper/server/admin/CommandsTest.java, line 139
> > <https://reviews.apache.org/r/23259/diff/2/?file=626641#file626641line139>
> >
> >     nit: maybe put the string & classes in a Map<String, Class> and then 
> > just call:
> >     
> >     ```
> >     testCommand("monitor", map.keys(), map.values())
> >     ```
> >     
> >     for readability?

I'll make that change, good idea.


> On July 10, 2014, 3:22 p.m., Raul Gutierrez Segales wrote:
> > src/java/test/org/apache/zookeeper/ZKTestCase.java, line 53
> > <https://reviews.apache.org/r/23259/diff/2/?file=626636#file626636line53>
> >
> >     what i commented before, maybe enableServer is enough (it's already 
> > namespaced under zookeeper.admin)

I'll change it.


> On July 10, 2014, 3:22 p.m., Raul Gutierrez Segales wrote:
> > src/docs/src/documentation/content/xdocs/zookeeperAdmin.xml, line 1331
> > <https://reviews.apache.org/r/23259/diff/2/?file=626602#file626602line1331>
> >
> >     nit (feel free to ignore): given this is already namespaced under 
> > zookeeper.admin, shouldn't it just be:
> >     
> >     ```
> >     zookeeper.admin.enableServer
> >     ```
> >     
> >     ?

Sounds fine to me. I'll change it.


- Bill


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/23259/#review47594
-----------------------------------------------------------


On July 9, 2014, 11:17 a.m., Bill Havanki wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/23259/
> -----------------------------------------------------------
> 
> (Updated July 9, 2014, 11:17 a.m.)
> 
> 
> Review request for zookeeper.
> 
> 
> Bugs: ZOOKEEPER-1346
>     https://issues.apache.org/jira/browse/ZOOKEEPER-1346
> 
> 
> Repository: zookeeper-git
> 
> 
> Description
> -------
> 
> Addition of new AdminServer, with implementation using Jetty, for RESTful 
> handling of commands.
> 
> Work done by Skye Wanderman-Milne; this patch is a rebase on trunk since the 
> last patch was provided early in 2013.
> 
> Suggested ordering for review:
> 
> 1. ServerCnxn, ServerCnxnFactory and implementations.
> 2. DataTree, WatchManager, ZKDatabase.
> 3. ExpiryQueue, SessionTracker and Impl, LeaderSessionTracker, 
> LearnerSessionTracker.
> 4. ZooKeeperServer.
> 5. org.apache.zookeeper.server.admin package
> 6. Everything else (integration with admin server).
> 
> 
> Diffs
> -----
> 
>   ivy.xml ad14b80 
>   src/docs/src/documentation/content/xdocs/zookeeperAdmin.xml bb16fa5 
>   src/java/main/org/apache/zookeeper/server/DataTree.java f2a4f86 
>   src/java/main/org/apache/zookeeper/server/ExpiryQueue.java 130c58e 
>   src/java/main/org/apache/zookeeper/server/NIOServerCnxnFactory.java 6e057a5 
>   src/java/main/org/apache/zookeeper/server/NettyServerCnxnFactory.java 
> 6b8d2a6 
>   src/java/main/org/apache/zookeeper/server/ServerCnxn.java 35ea301 
>   src/java/main/org/apache/zookeeper/server/ServerCnxnFactory.java b0f8130 
>   src/java/main/org/apache/zookeeper/server/ServerStats.java aa0d93f 
>   src/java/main/org/apache/zookeeper/server/SessionTracker.java 4875ead 
>   src/java/main/org/apache/zookeeper/server/SessionTrackerImpl.java c971b89 
>   src/java/main/org/apache/zookeeper/server/WatchManager.java 39bf82e 
>   src/java/main/org/apache/zookeeper/server/WatchesPathReport.java 
> PRE-CREATION 
>   src/java/main/org/apache/zookeeper/server/WatchesReport.java PRE-CREATION 
>   src/java/main/org/apache/zookeeper/server/WatchesSummary.java PRE-CREATION 
>   src/java/main/org/apache/zookeeper/server/ZKDatabase.java 91d6bce 
>   src/java/main/org/apache/zookeeper/server/ZooKeeperServer.java bee35c0 
>   src/java/main/org/apache/zookeeper/server/ZooKeeperServerMain.java 7bffaf0 
>   src/java/main/org/apache/zookeeper/server/ZooTrace.java 42417f5 
>   src/java/main/org/apache/zookeeper/server/admin/AdminServer.java 
> PRE-CREATION 
>   src/java/main/org/apache/zookeeper/server/admin/AdminServerFactory.java 
> PRE-CREATION 
>   src/java/main/org/apache/zookeeper/server/admin/Command.java PRE-CREATION 
>   src/java/main/org/apache/zookeeper/server/admin/CommandBase.java 
> PRE-CREATION 
>   src/java/main/org/apache/zookeeper/server/admin/CommandOutputter.java 
> PRE-CREATION 
>   src/java/main/org/apache/zookeeper/server/admin/Commands.java PRE-CREATION 
>   src/java/main/org/apache/zookeeper/server/admin/DummyAdminServer.java 
> PRE-CREATION 
>   src/java/main/org/apache/zookeeper/server/admin/JettyAdminServer.java 
> PRE-CREATION 
>   src/java/main/org/apache/zookeeper/server/admin/JsonOutputter.java 
> PRE-CREATION 
>   src/java/main/org/apache/zookeeper/server/quorum/Leader.java 3baf41a 
>   src/java/main/org/apache/zookeeper/server/quorum/LeaderSessionTracker.java 
> e746892 
>   src/java/main/org/apache/zookeeper/server/quorum/Learner.java 43e1b8b 
>   src/java/main/org/apache/zookeeper/server/quorum/LearnerSessionTracker.java 
> cf0ecfb 
>   src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java 4ec1f9a 
>   src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerMain.java 
> b374c29 
>   
> src/java/main/org/apache/zookeeper/server/quorum/ReadOnlyZooKeeperServer.java 
> 0369eb9 
>   src/java/test/org/apache/zookeeper/ZKTestCase.java 6ecfe8f 
>   src/java/test/org/apache/zookeeper/server/PrepRequestProcessorTest.java 
> b1b44fb 
>   src/java/test/org/apache/zookeeper/server/WatchesPathReportTest.java 
> PRE-CREATION 
>   src/java/test/org/apache/zookeeper/server/WatchesReportTest.java 
> PRE-CREATION 
>   src/java/test/org/apache/zookeeper/server/WatchesSummaryTest.java 
> PRE-CREATION 
>   src/java/test/org/apache/zookeeper/server/admin/CommandsTest.java 
> PRE-CREATION 
>   src/java/test/org/apache/zookeeper/server/admin/JettyAdminServerTest.java 
> PRE-CREATION 
>   src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java 
> b04d2bd 
>   src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerTestBase.java 
> f35e1cd 
>   src/java/test/org/apache/zookeeper/server/quorum/Zab1_0Test.java 0ea7f19 
> 
> Diff: https://reviews.apache.org/r/23259/diff/
> 
> 
> Testing
> -------
> 
> Compiles, unit tests pass. Tested commands "by hand" on running instance.
> 
> 
> Thanks,
> 
> Bill Havanki
> 
>

Reply via email to