Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Zookeeper, mail # dev - Re: Review Request: ZOOKEEPER-1346: Handle 4lws and monitoring on separate port (creating jetty server)


Copy link to this message
-
Re: Review Request: ZOOKEEPER-1346: Handle 4lws and monitoring on separate port (creating jetty server)
Edward Ribeiro 2013-01-16, 03:25

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

src/java/main/org/apache/zookeeper/server/WatchManager.java
<https://reviews.apache.org/r/8094/#comment33076>

    What about rewrite the lines 196-202 to:
    
      Map<String, Set<Long>> path2ids = new HashMap<String, Set<Long>>();
      for (Map.Entry<String,Set<Long>> e : watchTable.entrySet()) {
          String path = e.getKey();
          Set<Long> ids = new HashSet<Long>(e.getValue().size());
          path2ids.put(path, ids);
          for (Watcher watcher : e.getValue()) {
              ids.add(((ServerCnxn) watcher).getSessionId());
          }
      }
    
    It's not a must to rewrite, but the creation of "ids" variable would be very cool. Just a suggestion tough (as everything I wrote before). Please, compare these suggestions with your original code to see if it's correct *and* worth rewrite.
- Edward Ribeiro
On Jan. 4, 2013, 2:17 a.m., Skye Wanderman-Milne wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/8094/
> -----------------------------------------------------------
>
> (Updated Jan. 4, 2013, 2:17 a.m.)
>
>
> Review request for zookeeper, Patrick Hunt, Camille Fournier, and Henry Robinson.
>
>
> Description
> -------
>
> See my comment in ZOOKEEPER-1346.
>
>
> This addresses bug ZOOKEEPER-1346.
>     https://issues.apache.org/jira/browse/ZOOKEEPER-1346
>
>
> Diffs
> -----
>
>   ivy.xml fadf4f4
>   src/docs/src/documentation/content/xdocs/zookeeperAdmin.xml 47190a8
>   src/java/main/org/apache/zookeeper/server/DataTree.java d6c7773
>   src/java/main/org/apache/zookeeper/server/ExpiryQueue.java 130c58e
>   src/java/main/org/apache/zookeeper/server/NIOServerCnxnFactory.java 9422538
>   src/java/main/org/apache/zookeeper/server/NettyServerCnxnFactory.java eec2f2a
>   src/java/main/org/apache/zookeeper/server/ServerCnxn.java 35ea301
>   src/java/main/org/apache/zookeeper/server/ServerCnxnFactory.java 267dbdf
>   src/java/main/org/apache/zookeeper/server/ServerStats.java aa0d93f
>   src/java/main/org/apache/zookeeper/server/SessionTracker.java 3535e1b
>   src/java/main/org/apache/zookeeper/server/SessionTrackerImpl.java 137862e
>   src/java/main/org/apache/zookeeper/server/WatchManager.java 0e7c815
>   src/java/main/org/apache/zookeeper/server/ZKDatabase.java d6c0c05
>   src/java/main/org/apache/zookeeper/server/ZooKeeperServer.java 14e754b
>   src/java/main/org/apache/zookeeper/server/ZooKeeperServerMain.java 369e621
>   src/java/main/org/apache/zookeeper/server/ZooTrace.java ac14fe2
>   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 8a432ff
>   src/java/main/org/apache/zookeeper/server/quorum/Learner.java e8d548b
>   src/java/main/org/apache/zookeeper/server/quorum/LearnerSessionTracker.java 3182419
>   src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java 9c17f5e
>   src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerMain.java deae926
>   src/java/main/org/apache/zookeeper/server/quorum/ReadOnlyZooKeeperServer.java d3f1492