Package org.apache.hdt.core.zookeeper

Examples of org.apache.hdt.core.zookeeper.ZooKeeperClient


    if (clientsMap.containsKey(server.getUri()))
      return clientsMap.get(server.getUri());
    else {
      IConfigurationElement[] elementsFor = Platform.getExtensionRegistry().getConfigurationElementsFor("org.apache.hdt.core.zookeeperClient");
      for (IConfigurationElement element : elementsFor) {
        ZooKeeperClient client = (ZooKeeperClient) element.createExecutableExtension("class");
        client.initialize(server.getUri());
        clientsMap.put(server.getUri(), new InterruptableZooKeeperClient(server, client));
      }
      return clientsMap.get(server.getUri());
    }
  }
View Full Code Here


        } 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);
          } catch (InterruptedException e) {
View Full Code Here

        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) {
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) {
        logger.error("Error getting children of node", e);
View Full Code Here

          } 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 (Exception e) {
              logger.error("Error occurred ", e);
              showError(e.getMessage());
            }
          }
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 (Exception e) {
        logger.error("Error getting children of node", e);
        MessageDialog.openError(Display.getDefault().getActiveShell(),
            "ZooKeeper Error",e.getMessage());
View Full Code Here

    if (clientsMap.containsKey(server.getUri()))
      return clientsMap.get(server.getUri());
    else {
      IConfigurationElement[] elementsFor = Platform.getExtensionRegistry().getConfigurationElementsFor("org.apache.hdt.core.zookeeperClient");
      for (IConfigurationElement element : elementsFor) {
        ZooKeeperClient client = (ZooKeeperClient) element.createExecutableExtension("class");
        client.initialize(server.getUri());
        clientsMap.put(server.getUri(), new InterruptableZooKeeperClient(server, client));
      }
      return clientsMap.get(server.getUri());
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.hdt.core.zookeeper.ZooKeeperClient

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.