/** * Opens all Block pools on a given volume. * * @param source Source * @param poolIters List of PoolIters to maintain. */ private void openPoolIters(FsVolumeSpi source, List<FsVolumeSpi .BlockIterator> poolIters) { Preconditions.checkNotNull(source); Preconditions.checkNotNull(poolIters); for (String blockPoolID : source.getBlockPoolList()) { poolIters.add(source.newBlockIterator(blockPoolID, "DiskBalancerSource")); } }
/** * Run this report compiler thread. * * @return the block info report list * @throws IOException if the block pool isn't found */ @Override public ScanInfoPerBlockPool call() throws IOException { String[] bpList = volume.getBlockPoolList(); ScanInfoPerBlockPool result = new ScanInfoPerBlockPool(bpList.length); perfTimer.start(); throttleTimer.start(); for (String bpid : bpList) { LinkedList<ScanInfo> report = new LinkedList<>(); perfTimer.reset().start(); throttleTimer.reset().start(); try { result.put(bpid, volume.compileReport(bpid, report, this)); } catch (InterruptedException ex) { // Exit quickly and flag the scanner to do the same result = null; break; } } return result; }
/** * Run this report compiler thread. * * @return the block info report list * @throws IOException if the block pool isn't found */ @Override public ScanInfoPerBlockPool call() throws IOException { String[] bpList = volume.getBlockPoolList(); ScanInfoPerBlockPool result = new ScanInfoPerBlockPool(bpList.length); for (String bpid : bpList) { LinkedList<ScanInfo> report = new LinkedList<>(); File bpFinalizedDir = volume.getFinalizedDir(bpid); perfTimer.start(); throttleTimer.start(); try { result.put(bpid, compileReport(volume, bpFinalizedDir, bpFinalizedDir, report)); } catch (InterruptedException ex) { // Exit quickly and flag the scanner to do the same result = null; break; } } return result; }
/** * Run this report compiler thread. * * @return the block info report list * @throws IOException if the block pool isn't found */ @Override public ScanInfoPerBlockPool call() throws IOException { String[] bpList = volume.getBlockPoolList(); ScanInfoPerBlockPool result = new ScanInfoPerBlockPool(bpList.length); for (String bpid : bpList) { LinkedList<ScanInfo> report = new LinkedList<>(); File bpFinalizedDir = volume.getFinalizedDir(bpid); perfTimer.start(); throttleTimer.start(); try { result.put(bpid, compileReport(volume, bpFinalizedDir, bpFinalizedDir, report)); } catch (InterruptedException ex) { // Exit quickly and flag the scanner to do the same result = null; break; } } return result; }