Examples of ZooKeeperExt


Examples of org.apache.giraph.zk.ZooKeeperExt

    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

Examples of org.apache.giraph.zk.ZooKeeperExt

      @Override
      public void superstep(long superstep, ImmutableClassesGiraphConfiguration<LongWritable, IntWritable, FloatWritable> conf) {
        if (superstep == checkpointSuperstep) {
          try {
            ZooKeeperExt zooKeeperExt = new ZooKeeperExt(conf.getZookeeperList(),
                conf.getZooKeeperSessionTimeout(),
                conf.getZookeeperOpsMaxAttempts(),
                conf.getZookeeperOpsRetryWaitMsecs(),
                TestCheckpointing.this);
            String basePath = ZooKeeperManager.getBasePath(conf) + BspService.BASE_DIR + "/" + conf.get("mapred.job.id");
            zooKeeperExt.createExt(
                basePath + BspService.FORCE_CHECKPOINT_USER_FLAG,
                null,
                ZooDefs.Ids.OPEN_ACL_UNSAFE,
                CreateMode.PERSISTENT,
                true);
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.