Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 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;
      }
    }
    list.add(path);
  }
    }

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
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB