Package org.apache.hdt.core.internal.model

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


      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

  /**
   * <!-- 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

    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

          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

        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

      @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

      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

        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

  }

  @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

TOP

Related Classes of org.apache.hdt.core.internal.model.ZNode

Copyright © 2018 www.massapicom. 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.