@Test public void parentNodesAreCreatedWhenMissing() throws Exception { ZooReaderWriter zReaderWriter = createMock(ZooReaderWriter.class); String zRoot = "/accumulo"; expect(zReaderWriter.exists(zRoot + ReplicationConstants.ZOO_TSERVERS, null)).andReturn(false) .once(); zReaderWriter.mkdirs(zRoot + ReplicationConstants.ZOO_TSERVERS); expectLastCall().once(); expect(zReaderWriter.exists(zRoot + ReplicationConstants.ZOO_WORK_QUEUE, null)).andReturn(false) .once(); zReaderWriter.mkdirs(zRoot + ReplicationConstants.ZOO_WORK_QUEUE); expectLastCall().once(); replay(zReaderWriter); ZooKeeperInitialization.ensureZooKeeperInitialized(zReaderWriter, zRoot); verify(zReaderWriter); }
public static void ensureZooKeeperInitialized(final ZooReaderWriter zooReaderWriter, final String zRoot) throws KeeperException, InterruptedException { if (!zooReaderWriter.exists(zRoot + ReplicationConstants.ZOO_TSERVERS, null)) { zooReaderWriter.mkdirs(zRoot + ReplicationConstants.ZOO_TSERVERS); } if (!zooReaderWriter.exists(zRoot + ReplicationConstants.ZOO_WORK_QUEUE, null)) { zooReaderWriter.mkdirs(zRoot + ReplicationConstants.ZOO_WORK_QUEUE); } }
ZooKeeperInitialization { public static void ensureZooKeeperInitialized(final ZooReaderWriter zooReaderWriter, final String zRoot) throws KeeperException, InterruptedException { if (!zooReaderWriter.exists(zRoot + ReplicationConstants.ZOO_TSERVERS, null)) { zooReaderWriter.mkdirs(zRoot + ReplicationConstants.ZOO_TSERVERS); } if (!zooReaderWriter.exists(zRoot + ReplicationConstants.ZOO_WORK_QUEUE, null)) { zooReaderWriter.mkdirs(zRoot + ReplicationConstants.ZOO_WORK_QUEUE); } } }
ZooKeeperInitialization { public static void ensureZooKeeperInitialized(final ZooReaderWriter zooReaderWriter, final String zRoot) throws KeeperException, InterruptedException { if (!zooReaderWriter.exists(zRoot + ReplicationConstants.ZOO_TSERVERS, null)) { zooReaderWriter.mkdirs(zRoot + ReplicationConstants.ZOO_TSERVERS); } if (!zooReaderWriter.exists(zRoot + ReplicationConstants.ZOO_WORK_QUEUE, null)) { zooReaderWriter.mkdirs(zRoot + ReplicationConstants.ZOO_WORK_QUEUE); } }  }
ZooKeeperInitialization { public static void ensureZooKeeperInitialized(final ZooReaderWriter zooReaderWriter, final String zRoot) throws KeeperException, InterruptedException { if (!zooReaderWriter.exists(zRoot + ReplicationConstants.ZOO_TSERVERS, null)) { zooReaderWriter.mkdirs(zRoot + ReplicationConstants.ZOO_TSERVERS); } if (!zooReaderWriter.exists(zRoot + ReplicationConstants.ZOO_WORK_QUEUE, null)) { zooReaderWriter.mkdirs(zRoot + ReplicationConstants.ZOO_WORK_QUEUE); } }  static void ensureZooKeeperInitialized(final ZooReaderWriter zooReaderWriter,
      final String zRoot); }
ZooKeeperInitialization { public static void ensureZooKeeperInitialized(final ZooReaderWriter zooReaderWriter, final String zRoot) throws KeeperException, InterruptedException { if (!zooReaderWriter.exists(zRoot + ReplicationConstants.ZOO_TSERVERS, null)) { zooReaderWriter.mkdirs(zRoot + ReplicationConstants.ZOO_TSERVERS); } if (!zooReaderWriter.exists(zRoot + ReplicationConstants.ZOO_WORK_QUEUE, null)) { zooReaderWriter.mkdirs(zRoot + ReplicationConstants.ZOO_WORK_QUEUE); } }  static void ensureZooKeeperInitialized(final ZooReaderWriter zooReaderWriter,
      final String zRoot);  }