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

Switch to Threaded View
Zookeeper >> mail # dev >> DataTree

In our branch, where we did a lot conversion from synchronize to atomic
variables or concurrent data structure. Our DataTree.createNode() calls
this method to update ephemeral map

private void addEphemeralPath(String path, long ephemeralOwner) {
  if (ephemeralOwner != 0) {
    Set<String> list = ephemerals.get(ephemeralOwner);
    if (list == null) {
      Set<String> newList = Collections.newSetFromMap(
          new ConcurrentHashMap<String, Boolean>(4, 0.75f, 2));
      list = ephemerals.putIfAbsent(ephemeralOwner, newList);
      if (list == null) {
        list = newList;

However, race-condition respect to write-request is not possible at the
moment due to ZOOKEEPER-1505. The new CommitProcessor only allow 1 write
request at any given time. So there can be only one thread that can modify
the DataTree  (unless we remove that constraint in the future)
Thawan Kooburat