/** * Returns the current bandwidth. * * @return string representation of bandwidth. * @throws DiskBalancerException */ public long getBandwidth() throws DiskBalancerException { lock.lock(); try { checkDiskBalancerEnabled(); return this.bandwidth; } finally { lock.unlock(); } }
boolean needShutdown = false; try { checkDiskBalancerEnabled(); if (this.planID == null || !this.planID.equals(planID) ||
/** * Returns a volume ID to Volume base path map. * * @return Json string of the volume map. * @throws DiskBalancerException */ public String getVolumeNames() throws DiskBalancerException { lock.lock(); try { checkDiskBalancerEnabled(); return JsonUtil.toJsonString(getStorageIDToVolumeBasePathMap()); } catch (DiskBalancerException ex) { throw ex; } catch (IOException e) { throw new DiskBalancerException("Internal error, Unable to " + "create JSON string.", e, DiskBalancerException.Result.INTERNAL_ERROR); } finally { lock.unlock(); } }
lock.lock(); try { checkDiskBalancerEnabled();
lock.lock(); try { checkDiskBalancerEnabled(); if ((this.future != null) && (!this.future.isDone())) { LOG.error("Disk Balancer - Executing another plan, submitPlan failed.");