Package org.apache.giraph.zk

Examples of org.apache.giraph.zk.ZooKeeperExt


        try {
            if (zkList == null) {
                return;
            }
            zooKeeperExt =
                new ZooKeeperExt(zkList, 30*1000, this);
            zooKeeperExt.deleteExt(BASE_PATH, -1, true);
        } catch (KeeperException.NoNodeException e) {
            System.out.println("Clean start: No node " + BASE_PATH);
        } catch (Exception e) {
            throw new RuntimeException(e);
View Full Code Here


        if (LOG.isInfoEnabled()) {
            LOG.info("BspService: Connecting to ZooKeeper with job " + jobId +
                     ", " + getTaskPartition() + " on " + serverPortList);
        }
        try {
            this.zk = new ZooKeeperExt(serverPortList, sessionMsecTimeout, this);
            connectedEvent.waitForever();
            this.fs = FileSystem.get(getConfiguration());
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

                }
            }
            if (zkList == null) {
                return;
            }
            ZooKeeperExt zooKeeperExt =
                new ZooKeeperExt(zkList, 30*1000, this);
            List<String> rootChildren = zooKeeperExt.getChildren("/", false);
            for (String rootChild : rootChildren) {
                if (rootChild.startsWith("_hadoopBsp")) {
                    List<String> children =
                        zooKeeperExt.getChildren("/" + rootChild, false);
                    for (String child: children) {
                        if (child.contains("job_local_")) {
                            System.out.println("Cleaning up /_hadoopBsp/" +
                                               child);
                            zooKeeperExt.deleteExt(
                                "/_hadoopBsp/" + child, -1, true);
                        }
                    }
                }
            }
            zooKeeperExt.close();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

    if (LOG.isInfoEnabled()) {
      LOG.info("BspService: Connecting to ZooKeeper with job " + jobId +
          ", " + getTaskPartition() + " on " + serverPortList);
    }
    try {
      this.zk = new ZooKeeperExt(serverPortList,
                                 sessionMsecTimeout,
                                 conf.getZookeeperOpsMaxAttempts(),
                                 conf.getZookeeperOpsRetryWaitMsecs(),
                                 this,
                                 context);
View Full Code Here

      cleanupTemporaryFiles();

      if (zkList == null) {
        return;
      }
      ZooKeeperExt zooKeeperExt =
          new ZooKeeperExt(zkList, 30 * 1000, 0, 0, this);
      List<String> rootChildren =
          zooKeeperExt.getChildrenExt("/", false, false, true);
      for (String rootChild : rootChildren) {
        if (rootChild.startsWith("/_hadoopBsp")) {
          List<String> children =
              zooKeeperExt.getChildrenExt(rootChild, false, false, true);
          for (String child: children) {
            if (child.contains("job_local_")) {
              System.out.println("Cleaning up " + child);
              zooKeeperExt.deleteExt(child, -1, true);
            }
          }
        }
      }
      zooKeeperExt.close();
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

    try {
      if (zkList == null) {
        return;
      }
      zooKeeperExt =
          new ZooKeeperExt(zkList, 30 * 1000, 0, 0, this);
      zooKeeperExt.deleteExt(BASE_PATH, -1, true);
    } catch (KeeperException.NoNodeException e) {
      System.out.println("Clean start: No node " + BASE_PATH);
    } catch (Exception e) {
      throw new RuntimeException(e);
View Full Code Here

    baos = new ByteArrayOutputStream();
    dos = new DataOutputStream(baos);
    String first = "node.testx.com\tnode.LOCAL.com\tnode.testy.com";
    Text.writeString(dos, first);
    byte[] local = baos.toByteArray();
    ZooKeeperExt zk = mock(ZooKeeperExt.class);
    when(zk.getChildrenExt(testListName, false, false, true)).
        thenReturn(testList);
    when(zk.getData("remote1", false, null)).thenReturn(remote1);
    when(zk.getData("remote2", false, null)).thenReturn(remote2);
    when(zk.getData("local", false, null)).thenReturn(local);
    InputSplitPathOrganizer lis =
      new InputSplitPathOrganizer(zk, testListName, localHost, true);
    final List<String> resultList = Lists.newArrayList(lis.getPathList());
    assertEquals("local", resultList.get(0));
  }
View Full Code Here

      vlabel = GIRAPH_REXSTER_VLABEL.get(conf);
      txsize = GIRAPH_REXSTER_OUTPUT_V_TXSIZE.get(conf);
      startConnection();

      /* set the barrier */
      zk = new ZooKeeperExt(conf.getZookeeperList(),
          conf.getZooKeeperSessionTimeout(), conf.getZookeeperOpsMaxAttempts(),
          conf.getZookeeperOpsRetryWaitMsecs(), this, context);
    }
View Full Code Here

    if (LOG.isInfoEnabled()) {
      LOG.info("BspService: Connecting to ZooKeeper with job " + jobId +
          ", " + getTaskPartition() + " on " + serverPortList);
    }
    try {
      this.zk = new ZooKeeperExt(serverPortList,
                                 conf.getZooKeeperSessionTimeout(),
                                 conf.getZookeeperOpsMaxAttempts(),
                                 conf.getZookeeperOpsRetryWaitMsecs(),
                                 this,
                                 context);
View Full Code Here

      cleanupTemporaryFiles();

      if (zkList == null) {
        return;
      }
      ZooKeeperExt zooKeeperExt =
          new ZooKeeperExt(zkList, 30 * 1000, 0, 0, this);
      List<String> rootChildren =
          zooKeeperExt.getChildrenExt("/", false, false, true);
      for (String rootChild : rootChildren) {
        if (rootChild.startsWith("/_hadoopBsp")) {
          List<String> children =
              zooKeeperExt.getChildrenExt(rootChild, false, false, true);
          for (String child: children) {
            if (child.contains("job_local_")) {
              System.out.println("Cleaning up " + child);
              zooKeeperExt.deleteExt(child, -1, true);
            }
          }
        }
      }
      zooKeeperExt.close();
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.giraph.zk.ZooKeeperExt

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.