Examples of ZNode


Examples of com.linkedin.helix.store.zk.ZNode

  {
    String parentPath = new File(path).getParent();
    String childName = new File(path).getName();
    addToParentChildSet(parentPath, childName);
   
    ZNode znode = _cache.get(path);
    if (znode == null)
    {
      _cache.put(path, new ZNode(path, data, stat));
    }
    else
    {
      znode.setData(data);
      znode.setStat(stat);
    }
  }
View Full Code Here

Examples of com.trendmicro.codi.ZNode

            }

            myConsole.logResponse("starting `%s' ... ", broker_ip);
            String lockPath = "/locks/brk_" + broker_ip;
            ZLock brokerLock = new ZLock(lockPath);
            ZNode brokerNode = new ZNode("/broker/" + broker_ip);
            try{

                brokerLock.acquire(LockType.WRITE_LOCK);
                ZooKeeperInfo.Broker.Builder brkBuilder = ZooKeeperInfo.Broker.newBuilder();
                TextFormat.merge(new String(brokerNode.getContent()), brkBuilder);
                brkBuilder.clearStatus().setStatus(ZooKeeperInfo.Broker.Status.ONLINE);
                brokerNode.setContent(brkBuilder.build().toString().getBytes());
                myConsole.logResponseNL("success");
            }
            catch(Exception e){
                myConsole.logResponseNL("failed");
                myConsole.logResponseNL(e.toString());
View Full Code Here

Examples of com.trendmicro.codi.ZNode

            }

            myConsole.logResponse("stopping `%s' ...%n", broker_ip);
            String lockPath = "/locks/brk_" + broker_ip;
            ZLock brokerLock = new ZLock(lockPath);
            ZNode brokerNode = new ZNode("/broker/" + broker_ip);
            try {
                brokerLock.acquire(LockType.WRITE_LOCK);
                ZooKeeperInfo.Broker.Builder brkBuilder = ZooKeeperInfo.Broker.newBuilder();
                TextFormat.merge(new String(brokerNode.getContent()), brkBuilder);
                brkBuilder.clearStatus().setStatus(ZooKeeperInfo.Broker.Status.OFFLINE);
                brokerNode.setContent(brkBuilder.build().toString().getBytes());

                if(availBrkCnt > 1) {
                    BrokerSpy brokerSpy = new BrokerSpy(broker_ip);
                    ArrayList<Exchange> exchangeList = brokerSpy.getAllExchangeMetadata();
View Full Code Here

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

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setParent(ZNode newParent) {
    ZNode oldParent = parent;
    parent = newParent;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, HadoopPackage.ZOO_KEEPER_SERVER__PARENT, oldParent, parent));
  }
View Full Code Here

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

      List<String> children = client.getChildren(node.getPath(), false, nodeStat);
      copyFromStat(nodeStat, node);

      if (children != null) {
        for (String child : children) {
          ZNode cNode = HadoopFactory.eINSTANCE.createZNode();
          cNode.setNodeName(child);
          cNode.setParent(node);
          Stat exists = client.exists(cNode.getPath(), false);
          if (exists != null) {
            copyFromStat(exists, cNode);
            childNodes.add(cNode);
          }
        }
View Full Code Here

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

  /**
   * <!-- begin-user-doc --> <!-- end-user-doc -->
   * @generated
   */
  public void setParent(ZNode newParent) {
    ZNode oldParent = parent;
    parent = newParent;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, HadoopPackage.ZNODE__PARENT, oldParent, parent));
  }
View Full Code Here

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

    if (adaptableObject instanceof HDFSFileStore) {
      HDFSFileStore fs = (HDFSFileStore) adaptableObject;
      if (adapterType == IPropertySource.class)
        return new HDFSFileStorePropertySource(fs);
    } else if (adaptableObject instanceof ZNode) {
      ZNode z = (ZNode) adaptableObject;
      return new ZNodePropertySource(z);
    }
    return null;
  }
View Full Code Here

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

          if (targetPart instanceof ProjectExplorer) {
            ProjectExplorer pe = (ProjectExplorer) targetPart;
            pe.getCommonViewer().refresh();
          }
        } else if (object instanceof ZNode) {
          ZNode zkn = (ZNode) object;
          if (logger.isDebugEnabled())
            logger.debug("Deleting: " + zkn);
          try {
            ZooKeeperClient client = ZooKeeperManager.INSTANCE.getClient(zkn.getServer());
            client.delete(zkn);
          } catch (CoreException e) {
            logger.error(e.getMessage(), e);
          } catch (IOException e) {
            logger.error(e.getMessage(), e);
View Full Code Here

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

        enabled = false;
        if (object instanceof ZooKeeperServer) {
          ZooKeeperServer server = (ZooKeeperServer) object;
          enabled = server != null;
        } else 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

      @SuppressWarnings("rawtypes")
      Iterator itr = sSelection.iterator();
      while (itr.hasNext()) {
        Object object = itr.next();
        if (object instanceof ZNode) {
          ZNode zkn = (ZNode) object;
          if (logger.isDebugEnabled())
            logger.debug("Opening: " + zkn);
          try {
            ZooKeeperClient client = ZooKeeperManager.INSTANCE.getClient(zkn.getServer());
            byte[] open = client.open(zkn);
            IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
            IEditorDescriptor defaultEditor = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(zkn.getNodeName());
            activePage.openEditor(new ZooKeeperNodeEditorInput(zkn, open), defaultEditor == null ? "org.eclipse.ui.DefaultTextEditor"
                : defaultEditor.getId(), true);
          } catch (CoreException e) {
            logger.error(e.getMessage(), e);
          } catch (IOException e) {
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.