/** * Gets a runtime configuration value from diskbalancer instance. For * example : DiskBalancer bandwidth. * * @param key - String that represents the run time key value. * @return value of the key as a string. * @throws IOException - Throws if there is no such key */ @Override public String getDiskBalancerSetting(String key) throws IOException { checkSuperuserPrivilege(); Preconditions.checkNotNull(key); switch (key) { case DiskBalancerConstants.DISKBALANCER_VOLUME_NAME: return getDiskBalancer().getVolumeNames(); case DiskBalancerConstants.DISKBALANCER_BANDWIDTH : return Long.toString(getDiskBalancer().getBandwidth()); default: LOG.error("Disk Balancer - Unknown key in get balancer setting. Key: {}", key); throw new DiskBalancerException("Unknown key", DiskBalancerException.Result.UNKNOWN_KEY); } }