Examples of ZNode


Examples of org.apache.hdt.core.internal.model.ZNode

      Iterator itr = sSelection.iterator();
      while (itr.hasNext()) {
        Object object = itr.next();
        enabled = false;
        if (object instanceof ZNode) {
          ZNode zkn = (ZNode) object;
          enabled = zkn != null;
        }
      }
    } else
      enabled = false;
View Full Code Here

Examples of org.apache.hdt.core.internal.model.ZNode

        decoration.addOverlay(org.apache.hdt.ui.Activator.IMAGE_ONLINE_OVR);

      // Text decorations
      decoration.addSuffix("  " + zks.getUri());
    } else if (element instanceof ZNode) {
      ZNode zkn = (ZNode) element;
      if (zkn.getVersion() > -1) {
        decoration.addSuffix("  [v=" + zkn.getVersion() + "]");
      }
      if (zkn.isEphermeral())
        decoration.addOverlay(Activator.IMAGE_ZOOKEEPER_EPHERMERAL, IDecoration.BOTTOM_RIGHT);
    }
  }
View Full Code Here

Examples of org.apache.hdt.core.internal.model.ZNode

  }

  @Override
  public Object[] getChildren(Object parentElement) {
    if (parentElement instanceof ZNode) {
      ZNode zkn = (ZNode) parentElement;
      try {
        ZooKeeperClient client = ZooKeeperManager.INSTANCE.getClient(zkn.getServer());
        List<ZNode> zkChildren = client.getChildren(zkn);
        return zkChildren.toArray();
      } catch (CoreException e) {
        logger.error("Error getting children of node", e);
      } catch (IOException e) {
View Full Code Here

Examples of org.apache.hdt.core.internal.model.ZNode

  }

  @Override
  public Object getParent(Object element) {
    if (element instanceof ZNode) {
      ZNode zkn = (ZNode) element;
      return zkn.getParent();
    }
    return null;
  }
View Full Code Here

Examples of org.apache.helix.store.zk.ZNode

    _cache = new ConcurrentHashMap<String, ZNode>();
  }

  public void addToParentChildSet(String parentPath, String childName)
  {
    ZNode znode = _cache.get(parentPath);
    if (znode != null)
    {
      znode.addChild(childName);
    }
  }
View Full Code Here

Examples of org.apache.helix.store.zk.ZNode

  public void addToParentChildSet(String parentPath, List<String> childNames)
  {
    if (childNames != null && !childNames.isEmpty())
    {
      ZNode znode = _cache.get(parentPath);
      if (znode != null)
      {
        znode.addChildren(childNames);
      }
    }
  }
View Full Code Here

Examples of org.apache.helix.store.zk.ZNode

    }
  }

  public void removeFromParentChildSet(String parentPath, String name)
  {
    ZNode zNode = _cache.get(parentPath);
    if (zNode != null)
    {
      zNode.removeChild(name);
    }
  }
View Full Code Here

Examples of org.apache.helix.store.zk.ZNode

      String parentPath = new File(path).getParent();
      String name = new File(path).getName();
      removeFromParentChildSet(parentPath, name);

      ZNode znode = _cache.remove(path);
      if (znode != null)
      {
        // recursively remove children nodes
        Set<String> childNames = znode.getChildSet();
        for (String childName : childNames)
        {
          String childPath = path + "/" + childName;
          purgeRecursive(childPath);
        }
View Full Code Here

Examples of org.apache.helix.store.zk.ZNode

    Cache<T> cache = getCache(serverPath);
    if (cache != null)
    {
      T record = null;
      ZNode znode = cache.get(serverPath);

      if (znode != null)
      {
        // TODO: shall return a deep copy instead of reference
        record = ((T) znode.getData());
        if (stat != null)
        {
          DataTree.copyStat(znode.getStat(), stat);
        }
        return record;

      }
      else
View Full Code Here

Examples of org.apache.helix.store.zk.ZNode

    Cache<T> cache = getCache(serverPath);
    if (cache != null)
    {
      Stat stat = new Stat();
      ZNode znode = cache.get(serverPath);

      if (znode != null)
      {
        return znode.getStat();

      }
      else
      {
        // if cache miss, fall back to zk and update cache
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.