/** * Attempts to parse the watermark into a percentage, returning 100.0% if * it cannot be parsed. */ private static double thresholdPercentageFromWatermark(String watermark) { return thresholdPercentageFromWatermark(watermark, true); }
private static void doValidateAsPercentage(final String low, final String high, final String flood) { final double lowWatermarkThreshold = thresholdPercentageFromWatermark(low, false); final double highWatermarkThreshold = thresholdPercentageFromWatermark(high, false); final double floodThreshold = thresholdPercentageFromWatermark(flood, false); if (lowWatermarkThreshold > highWatermarkThreshold) { throw new IllegalArgumentException( "low disk watermark [" + low + "] more than high disk watermark [" + high + "]"); } if (highWatermarkThreshold > floodThreshold) { throw new IllegalArgumentException( "high disk watermark [" + high + "] more than flood stage disk watermark [" + flood + "]"); } }
private void setHighWatermark(String highWatermark) { // Watermark is expressed in terms of used data, but we need "free" data watermark this.highWatermarkRaw = highWatermark; this.freeDiskThresholdHigh = 100.0 - thresholdPercentageFromWatermark(highWatermark); this.freeBytesThresholdHigh = thresholdBytesFromWatermark(highWatermark, CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK_SETTING.getKey()); }
private void setFloodStageRaw(String floodStageRaw) { // Watermark is expressed in terms of used data, but we need "free" data watermark this.floodStageRaw = floodStageRaw; this.freeDiskThresholdFloodStage = 100.0 - thresholdPercentageFromWatermark(floodStageRaw); this.freeBytesThresholdFloodStage = thresholdBytesFromWatermark(floodStageRaw, CLUSTER_ROUTING_ALLOCATION_DISK_FLOOD_STAGE_WATERMARK_SETTING.getKey()); }
private void setLowWatermark(String lowWatermark) { // Watermark is expressed in terms of used data, but we need "free" data watermark this.lowWatermarkRaw = lowWatermark; this.freeDiskThresholdLow = 100.0 - thresholdPercentageFromWatermark(lowWatermark); this.freeBytesThresholdLow = thresholdBytesFromWatermark(lowWatermark, CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK_SETTING.getKey()); }
/** * Attempts to parse the watermark into a percentage, returning 100.0% if * it cannot be parsed. */ private static double thresholdPercentageFromWatermark(String watermark) { return thresholdPercentageFromWatermark(watermark, true); }
/** * Attempts to parse the watermark into a percentage, returning 100.0% if * it cannot be parsed. */ private static double thresholdPercentageFromWatermark(String watermark) { return thresholdPercentageFromWatermark(watermark, true); }
private static void doValidateAsPercentage(final String low, final String high, final String flood) { final double lowWatermarkThreshold = thresholdPercentageFromWatermark(low, false); final double highWatermarkThreshold = thresholdPercentageFromWatermark(high, false); final double floodThreshold = thresholdPercentageFromWatermark(flood, false); if (lowWatermarkThreshold > highWatermarkThreshold) { throw new IllegalArgumentException( "low disk watermark [" + low + "] more than high disk watermark [" + high + "]"); } if (highWatermarkThreshold > floodThreshold) { throw new IllegalArgumentException( "high disk watermark [" + high + "] more than flood stage disk watermark [" + flood + "]"); } }
private static void doValidateAsPercentage(final String low, final String high, final String flood) { final double lowWatermarkThreshold = thresholdPercentageFromWatermark(low, false); final double highWatermarkThreshold = thresholdPercentageFromWatermark(high, false); final double floodThreshold = thresholdPercentageFromWatermark(flood, false); if (lowWatermarkThreshold > highWatermarkThreshold) { throw new IllegalArgumentException( "low disk watermark [" + low + "] more than high disk watermark [" + high + "]"); } if (highWatermarkThreshold > floodThreshold) { throw new IllegalArgumentException( "high disk watermark [" + high + "] more than flood stage disk watermark [" + flood + "]"); } }
private void setLowWatermark(String lowWatermark) { // Watermark is expressed in terms of used data, but we need "free" data watermark this.lowWatermarkRaw = lowWatermark; this.freeDiskThresholdLow = 100.0 - thresholdPercentageFromWatermark(lowWatermark); this.freeBytesThresholdLow = thresholdBytesFromWatermark(lowWatermark, CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK_SETTING.getKey()); }
private void setLowWatermark(String lowWatermark) { // Watermark is expressed in terms of used data, but we need "free" data watermark this.lowWatermarkRaw = lowWatermark; this.freeDiskThresholdLow = 100.0 - thresholdPercentageFromWatermark(lowWatermark); this.freeBytesThresholdLow = thresholdBytesFromWatermark(lowWatermark, CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK_SETTING.getKey()); }
private void setFloodStageRaw(String floodStageRaw) { // Watermark is expressed in terms of used data, but we need "free" data watermark this.floodStageRaw = floodStageRaw; this.freeDiskThresholdFloodStage = 100.0 - thresholdPercentageFromWatermark(floodStageRaw); this.freeBytesThresholdFloodStage = thresholdBytesFromWatermark(floodStageRaw, CLUSTER_ROUTING_ALLOCATION_DISK_FLOOD_STAGE_WATERMARK_SETTING.getKey()); }
private void setLowWatermark(String lowWatermark) { // Watermark is expressed in terms of used data, but we need "free" data watermark this.lowWatermarkRaw = lowWatermark; this.freeDiskThresholdLow = 100.0 - thresholdPercentageFromWatermark(lowWatermark); this.freeBytesThresholdLow = thresholdBytesFromWatermark(lowWatermark, CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK_SETTING.getKey()); }
private void setHighWatermark(String highWatermark) { // Watermark is expressed in terms of used data, but we need "free" data watermark this.highWatermarkRaw = highWatermark; this.freeDiskThresholdHigh = 100.0 - thresholdPercentageFromWatermark(highWatermark); this.freeBytesThresholdHigh = thresholdBytesFromWatermark(highWatermark, CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK_SETTING.getKey()); }
private void setFloodStageRaw(String floodStageRaw) { // Watermark is expressed in terms of used data, but we need "free" data watermark this.floodStageRaw = floodStageRaw; this.freeDiskThresholdFloodStage = 100.0 - thresholdPercentageFromWatermark(floodStageRaw); this.freeBytesThresholdFloodStage = thresholdBytesFromWatermark(floodStageRaw, CLUSTER_ROUTING_ALLOCATION_DISK_FLOOD_STAGE_WATERMARK_SETTING.getKey()); }
private void setHighWatermark(String highWatermark) { // Watermark is expressed in terms of used data, but we need "free" data watermark this.highWatermarkRaw = highWatermark; this.freeDiskThresholdHigh = 100.0 - thresholdPercentageFromWatermark(highWatermark); this.freeBytesThresholdHigh = thresholdBytesFromWatermark(highWatermark, CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK_SETTING.getKey()); }
private void setHighWatermark(String highWatermark) { // Watermark is expressed in terms of used data, but we need "free" data watermark this.highWatermarkRaw = highWatermark; this.freeDiskThresholdHigh = 100.0 - thresholdPercentageFromWatermark(highWatermark); this.freeBytesThresholdHigh = thresholdBytesFromWatermark(highWatermark, CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK_SETTING.getKey()); }