/** * Initialize the queuedWork set with the work already sent out */ @Override protected void initializeQueuedWork() { if (queuedWork != null) { return; } queuedWork = new HashSet<>(); while (true) { try { queuedWork.addAll(workQueue.getWorkQueued()); return; } catch (KeeperException e) { if (KeeperException.Code.NONODE.equals(e.code())) { log.warn("Could not find ZK root for replication work queue, will retry", e); sleepUninterruptibly(500, TimeUnit.MILLISECONDS); continue; } log.error("Error reading existing queued replication work from ZooKeeper", e); throw new RuntimeException("Error reading existing queued replication work from ZooKeeper", e); } catch (InterruptedException e) { log.error("Error reading existing queued replication work from ZooKeeper", e); throw new RuntimeException("Error reading existing queued replication work from ZooKeeper", e); } } }
List<String> existingWork; try { existingWork = workQueue.getWorkQueued(); } catch (KeeperException | InterruptedException e) { throw new RuntimeException("Error reading existing queued replication work", e);
public RecoveryManager(Master master) { this.master = master; executor = Executors.newScheduledThreadPool(4, new NamingThreadFactory("Walog sort starter ")); zooCache = new ZooCache(master.getContext().getZooReaderWriter(), null); try { List<String> workIDs = new DistributedWorkQueue( master.getZooKeeperRoot() + Constants.ZRECOVERY, master.getConfiguration()) .getWorkQueued(); sortsQueued.addAll(workIDs); } catch (Exception e) { log.warn("{}", e.getMessage(), e); } }
/** * Initialize the queuedWork set with the work already sent out */ @Override protected void initializeQueuedWork() { if (null != queuedWork) { return; } queuedWork = new HashSet<>(); while (true) { try { queuedWork.addAll(workQueue.getWorkQueued()); return; } catch (KeeperException e) { if (KeeperException.Code.NONODE.equals(e.code())) { log.warn("Could not find ZK root for replication work queue, will retry", e); sleepUninterruptibly(500, TimeUnit.MILLISECONDS); continue; } log.error("Error reading existing queued replication work from ZooKeeper", e); throw new RuntimeException("Error reading existing queued replication work from ZooKeeper", e); } catch (InterruptedException e) { log.error("Error reading existing queued replication work from ZooKeeper", e); throw new RuntimeException("Error reading existing queued replication work from ZooKeeper", e); } } }
List<String> existingWork; try { existingWork = workQueue.getWorkQueued(); } catch (KeeperException | InterruptedException e) { throw new RuntimeException("Error reading existing queued replication work", e);
public RecoveryManager(Master master) { this.master = master; executor = Executors.newScheduledThreadPool(4, new NamingThreadFactory("Walog sort starter ")); zooCache = new ZooCache(); try { List<String> workIDs = new DistributedWorkQueue(ZooUtil.getRoot(master.getInstance()) + Constants.ZRECOVERY).getWorkQueued(); sortsQueued.addAll(workIDs); } catch (Exception e) { log.warn(e, e); } }
public RecoveryManager(Master master) { this.master = master; executor = Executors.newScheduledThreadPool(4, new NamingThreadFactory("Walog sort starter ")); zooCache = new ZooCache(); try { AccumuloConfiguration aconf = master.getConfiguration(); List<String> workIDs = new DistributedWorkQueue( ZooUtil.getRoot(master.getInstance()) + Constants.ZRECOVERY, aconf).getWorkQueued(); sortsQueued.addAll(workIDs); } catch (Exception e) { log.warn("{}", e.getMessage(), e); } }
for (String queueKey : workQueue.getWorkQueued()) { Entry<String,ReplicationTarget> queueKeyPair = DistributedWorkQueueWorkAssignerHelper .fromQueueKey(queueKey);