Examples of ZooKeeperClient


Examples of com.twitter.common.zookeeper.ZooKeeperClient

    protected ZookeeperConnector() {
    }

    public ZookeeperConnector(SecorConfig config) {
        mConfig = config;
        mZookeeperClient = new ZooKeeperClient(Amount.of(1, Time.DAYS), getZookeeperAddresses());
        mLocks = new HashMap<String, DistributedLock>();
    }
View Full Code Here

Examples of org.apache.blur.zookeeper.ZooKeeperClient

      InterruptedException, KeeperException {
    final BlurConfiguration localConf = getBlurConfiguration(configuration);
    int shardPort = localConf.getInt(BLUR_SHARD_BIND_PORT, 40020);
    String nodeNameHostname = ThriftServer.getNodeName(configuration, BLUR_SHARD_HOSTNAME);
    String nodeName = nodeNameHostname + ":" + (shardPort + shardServer);
    ZooKeeper zk = new ZooKeeperClient(getZkConnectionString(), 30000, new Watcher() {
      @Override
      public void process(WatchedEvent event) {

      }
    });
    String onlineShardsPath = ZookeeperPathConstants
        .getOnlineShardsPath(org.apache.blur.utils.BlurConstants.BLUR_CLUSTER);
    String path = onlineShardsPath + "/" + nodeName;
    zk.delete(path, -1);
    zk.close();
  }
View Full Code Here

Examples of org.apache.blur.zookeeper.ZooKeeperClient

    MiniCluster.shutdownZooKeeper();
  }

  @Before
  public void setup() throws KeeperException, InterruptedException, IOException {
    zooKeeper = new ZooKeeperClient(MiniCluster.getZkConnectionString(), 30000, new Watcher() {
      @Override
      public void process(WatchedEvent event) {

      }
    });
View Full Code Here

Examples of org.apache.blur.zookeeper.ZooKeeperClient

      InterruptedException, KeeperException {
    ThriftServer thriftServer = shards.get(shardServer);
    int shardPort = thriftServer.getServerTransport().getServerSocket().getLocalPort();
    String nodeNameHostname = ThriftServer.getNodeName(configuration, BLUR_SHARD_HOSTNAME);
    String nodeName = nodeNameHostname + ":" + shardPort;
    ZooKeeper zk = new ZooKeeperClient(getZkConnectionString(), 30000, new Watcher() {
      @Override
      public void process(WatchedEvent event) {

      }
    });
    String onlineShardsPath = ZookeeperPathConstants
        .getOnlineShardsPath(org.apache.blur.utils.BlurConstants.BLUR_CLUSTER);
    String path = onlineShardsPath + "/" + nodeName;
    zk.delete(path, -1);
    zk.close();
  }
View Full Code Here

Examples of org.apache.blur.zookeeper.ZooKeeperClient

    miniCluster.shutdownZooKeeper();
  }

  @Before
  public void setup() throws KeeperException, InterruptedException, IOException {
    zooKeeper1 = new ZooKeeperClient(miniCluster.getZkConnectionString(), 30000, new Watcher() {
      @Override
      public void process(WatchedEvent event) {

      }
    });
    BlurUtil.setupZookeeper(zooKeeper1, DEFAULT);
    zooKeeper2 = new ZooKeeperClient(miniCluster.getZkConnectionString(), 30000, new Watcher() {
      @Override
      public void process(WatchedEvent event) {

      }
    });
View Full Code Here

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

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

        } 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

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

        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

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

  @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

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

          } 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
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.