@Override public String toString() { return "[" + nodeId + "][" + nodeName + "][" + path + "] free: " + new ByteSizeValue(getFreeBytes()) + "[" + Strings.format1Decimals(getFreeDiskAsPercentage(), "%") + "]"; } }
/** * Warn about the given disk usage if the low or high watermark has been passed */ private void warnAboutDiskIfNeeded(DiskUsage usage) { // Check absolute disk values if (usage.getFreeBytes() < diskThresholdSettings.getFreeBytesThresholdFloodStage().getBytes()) { logger.warn("flood stage disk watermark [{}] exceeded on {}, all indices on this node will be marked read-only", diskThresholdSettings.getFreeBytesThresholdFloodStage(), usage); } else if (usage.getFreeBytes() < diskThresholdSettings.getFreeBytesThresholdHigh().getBytes()) { logger.warn("high disk watermark [{}] exceeded on {}, shards will be relocated away from this node", diskThresholdSettings.getFreeBytesThresholdHigh(), usage); } else if (usage.getFreeBytes() < diskThresholdSettings.getFreeBytesThresholdLow().getBytes()) { logger.info("low disk watermark [{}] exceeded on {}, replicas will not be assigned to this node", diskThresholdSettings.getFreeBytesThresholdLow(), usage); } // Check percentage disk values if (usage.getFreeDiskAsPercentage() < diskThresholdSettings.getFreeDiskThresholdFloodStage()) { logger.warn("flood stage disk watermark [{}] exceeded on {}, all indices on this node will be marked read-only", Strings.format1Decimals(100.0 - diskThresholdSettings.getFreeDiskThresholdFloodStage(), "%"), usage); } else if (usage.getFreeDiskAsPercentage() < diskThresholdSettings.getFreeDiskThresholdHigh()) { logger.warn("high disk watermark [{}] exceeded on {}, shards will be relocated away from this node", Strings.format1Decimals(100.0 - diskThresholdSettings.getFreeDiskThresholdHigh(), "%"), usage); } else if (usage.getFreeDiskAsPercentage() < diskThresholdSettings.getFreeDiskThresholdLow()) { logger.info("low disk watermark [{}] exceeded on {}, replicas will not be assigned to this node", Strings.format1Decimals(100.0 - diskThresholdSettings.getFreeDiskThresholdLow(), "%"), usage); } }
@Override public String toString() { long singles = singles(); double value = singles; String suffix = ""; if (singles >= SizeUnit.C5) { value = petaFrac(); suffix = "p"; } else if (singles >= SizeUnit.C4) { value = teraFrac(); suffix = "t"; } else if (singles >= SizeUnit.C3) { value = gigaFrac(); suffix = "g"; } else if (singles >= SizeUnit.C2) { value = megaFrac(); suffix = "m"; } else if (singles >= SizeUnit.C1) { value = kiloFrac(); suffix = "k"; } return Strings.format1Decimals(value, suffix); }
if (logger.isDebugEnabled()) { logger.debug("more than the allowed {} used disk threshold ({} used) on node [{}], preventing allocation", Strings.format1Decimals(usedDiskThresholdLow, "%"), Strings.format1Decimals(usedDiskPercentage, "%"), node.nodeId()); logger.debug("more than the allowed {} used disk threshold ({} used) on node [{}], " + "but allowing allocation because primary has never been allocated", Strings.format1Decimals(usedDiskThresholdLow, "%"), Strings.format1Decimals(usedDiskPercentage, "%"), node.nodeId()); logger.debug("less than the required {} free bytes threshold ({} bytes free) on node {}, " + "preventing allocation even though primary has never been allocated", Strings.format1Decimals(diskThresholdSettings.getFreeDiskThresholdHigh(), "%"), Strings.format1Decimals(freeDiskPercentage, "%"), node.nodeId()); logger.warn("after allocating, node [{}] would have more than the allowed " + "{} free disk threshold ({} free), preventing allocation", node.nodeId(), Strings.format1Decimals(diskThresholdSettings.getFreeDiskThresholdHigh(), "%"), Strings.format1Decimals(freeSpaceAfterShard, "%")); return allocation.decision(Decision.NO, NAME, "allocating the shard to this node will bring the node above the high watermark cluster setting [%s=%s] " +
@Override public String toString() { long bytes = getBytes(); double value = bytes; String suffix = ByteSizeUnit.BYTES.getSuffix(); if (bytes >= ByteSizeUnit.C5) { value = getPbFrac(); suffix = ByteSizeUnit.PB.getSuffix(); } else if (bytes >= ByteSizeUnit.C4) { value = getTbFrac(); suffix = ByteSizeUnit.TB.getSuffix(); } else if (bytes >= ByteSizeUnit.C3) { value = getGbFrac(); suffix = ByteSizeUnit.GB.getSuffix(); } else if (bytes >= ByteSizeUnit.C2) { value = getMbFrac(); suffix = ByteSizeUnit.MB.getSuffix(); } else if (bytes >= ByteSizeUnit.C1) { value = getKbFrac(); suffix = ByteSizeUnit.KB.getSuffix(); } return Strings.format1Decimals(value, suffix); }
@Override public String toString() { return "[" + nodeId + "][" + nodeName + "][" + path + "] free: " + new ByteSizeValue(getFreeBytes()) + "[" + Strings.format1Decimals(getFreeDiskAsPercentage(), "%") + "]"; } }
@Override public String toString() { return "[" + nodeId + "][" + nodeName + "][" + path + "] free: " + new ByteSizeValue(getFreeBytes()) + "[" + Strings.format1Decimals(getFreeDiskAsPercentage(), "%") + "]"; } }
@Override public String toString() { return "[" + nodeId + "][" + nodeName + "][" + path + "] free: " + new ByteSizeValue(getFreeBytes()) + "[" + Strings.format1Decimals(getFreeDiskAsPercentage(), "%") + "]"; } }
@Override public String toString() { return "[" + nodeId + "][" + nodeName + "][" + path + "] free: " + new ByteSizeValue(getFreeBytes()) + "[" + Strings.format1Decimals(getFreeDiskAsPercentage(), "%") + "]"; } }
/** * Warn about the given disk usage if the low or high watermark has been passed */ private void warnAboutDiskIfNeeded(DiskUsage usage) { // Check absolute disk values if (usage.getFreeBytes() < diskThresholdSettings.getFreeBytesThresholdHigh().getBytes()) { logger.warn("high disk watermark [{}] exceeded on {}, shards will be relocated away from this node", diskThresholdSettings.getFreeBytesThresholdHigh(), usage); } else if (usage.getFreeBytes() < diskThresholdSettings.getFreeBytesThresholdLow().getBytes()) { logger.info("low disk watermark [{}] exceeded on {}, replicas will not be assigned to this node", diskThresholdSettings.getFreeBytesThresholdLow(), usage); } // Check percentage disk values if (usage.getFreeDiskAsPercentage() < diskThresholdSettings.getFreeDiskThresholdHigh()) { logger.warn("high disk watermark [{}] exceeded on {}, shards will be relocated away from this node", Strings.format1Decimals(100.0 - diskThresholdSettings.getFreeDiskThresholdHigh(), "%"), usage); } else if (usage.getFreeDiskAsPercentage() < diskThresholdSettings.getFreeDiskThresholdLow()) { logger.info("low disk watermark [{}] exceeded on {}, replicas will not be assigned to this node", Strings.format1Decimals(100.0 - diskThresholdSettings.getFreeDiskThresholdLow(), "%"), usage); } }
/** * Warn about the given disk usage if the low or high watermark has been passed */ private void warnAboutDiskIfNeeded(DiskUsage usage) { // Check absolute disk values if (usage.getFreeBytes() < diskThresholdSettings.getFreeBytesThresholdFloodStage().getBytes()) { logger.warn("flood stage disk watermark [{}] exceeded on {}, all indices on this node will be marked read-only", diskThresholdSettings.getFreeBytesThresholdFloodStage(), usage); } else if (usage.getFreeBytes() < diskThresholdSettings.getFreeBytesThresholdHigh().getBytes()) { logger.warn("high disk watermark [{}] exceeded on {}, shards will be relocated away from this node", diskThresholdSettings.getFreeBytesThresholdHigh(), usage); } else if (usage.getFreeBytes() < diskThresholdSettings.getFreeBytesThresholdLow().getBytes()) { logger.info("low disk watermark [{}] exceeded on {}, replicas will not be assigned to this node", diskThresholdSettings.getFreeBytesThresholdLow(), usage); } // Check percentage disk values if (usage.getFreeDiskAsPercentage() < diskThresholdSettings.getFreeDiskThresholdFloodStage()) { logger.warn("flood stage disk watermark [{}] exceeded on {}, all indices on this node will be marked read-only", Strings.format1Decimals(100.0 - diskThresholdSettings.getFreeDiskThresholdFloodStage(), "%"), usage); } else if (usage.getFreeDiskAsPercentage() < diskThresholdSettings.getFreeDiskThresholdHigh()) { logger.warn("high disk watermark [{}] exceeded on {}, shards will be relocated away from this node", Strings.format1Decimals(100.0 - diskThresholdSettings.getFreeDiskThresholdHigh(), "%"), usage); } else if (usage.getFreeDiskAsPercentage() < diskThresholdSettings.getFreeDiskThresholdLow()) { logger.info("low disk watermark [{}] exceeded on {}, replicas will not be assigned to this node", Strings.format1Decimals(100.0 - diskThresholdSettings.getFreeDiskThresholdLow(), "%"), usage); } }
/** * Warn about the given disk usage if the low or high watermark has been passed */ private void warnAboutDiskIfNeeded(DiskUsage usage) { // Check absolute disk values if (usage.getFreeBytes() < DiskThresholdDecider.this.freeBytesThresholdHigh.bytes()) { logger.warn("high disk watermark [{}] exceeded on {}, shards will be relocated away from this node", DiskThresholdDecider.this.freeBytesThresholdHigh, usage); } else if (usage.getFreeBytes() < DiskThresholdDecider.this.freeBytesThresholdLow.bytes()) { logger.info("low disk watermark [{}] exceeded on {}, replicas will not be assigned to this node", DiskThresholdDecider.this.freeBytesThresholdLow, usage); } // Check percentage disk values if (usage.getFreeDiskAsPercentage() < DiskThresholdDecider.this.freeDiskThresholdHigh) { logger.warn("high disk watermark [{}] exceeded on {}, shards will be relocated away from this node", Strings.format1Decimals(100.0 - DiskThresholdDecider.this.freeDiskThresholdHigh, "%"), usage); } else if (usage.getFreeDiskAsPercentage() < DiskThresholdDecider.this.freeDiskThresholdLow) { logger.info("low disk watermark [{}] exceeded on {}, replicas will not be assigned to this node", Strings.format1Decimals(100.0 - DiskThresholdDecider.this.freeDiskThresholdLow, "%"), usage); } }
@Override public String toString() { long bytes = getBytes(); double value = bytes; String suffix = "b"; if (bytes >= ByteSizeUnit.C5) { value = getPbFrac(); suffix = "pb"; } else if (bytes >= ByteSizeUnit.C4) { value = getTbFrac(); suffix = "tb"; } else if (bytes >= ByteSizeUnit.C3) { value = getGbFrac(); suffix = "gb"; } else if (bytes >= ByteSizeUnit.C2) { value = getMbFrac(); suffix = "mb"; } else if (bytes >= ByteSizeUnit.C1) { value = getKbFrac(); suffix = "kb"; } return Strings.format1Decimals(value, suffix); }
@Override public String toString() { long singles = singles(); double value = singles; String suffix = ""; if (singles >= SizeUnit.C5) { value = petaFrac(); suffix = "p"; } else if (singles >= SizeUnit.C4) { value = teraFrac(); suffix = "t"; } else if (singles >= SizeUnit.C3) { value = gigaFrac(); suffix = "g"; } else if (singles >= SizeUnit.C2) { value = megaFrac(); suffix = "m"; } else if (singles >= SizeUnit.C1) { value = kiloFrac(); suffix = "k"; } return Strings.format1Decimals(value, suffix); }
@Override public String toString() { long bytes = bytes(); double value = bytes; String suffix = "b"; if (bytes >= ByteSizeUnit.C5) { value = pbFrac(); suffix = "pb"; } else if (bytes >= ByteSizeUnit.C4) { value = tbFrac(); suffix = "tb"; } else if (bytes >= ByteSizeUnit.C3) { value = gbFrac(); suffix = "gb"; } else if (bytes >= ByteSizeUnit.C2) { value = mbFrac(); suffix = "mb"; } else if (bytes >= ByteSizeUnit.C1) { value = kbFrac(); suffix = "kb"; } return Strings.format1Decimals(value, suffix); }
@Override public String toString() { long singles = singles(); double value = singles; String suffix = ""; if (singles >= SizeUnit.C5) { value = petaFrac(); suffix = "p"; } else if (singles >= SizeUnit.C4) { value = teraFrac(); suffix = "t"; } else if (singles >= SizeUnit.C3) { value = gigaFrac(); suffix = "g"; } else if (singles >= SizeUnit.C2) { value = megaFrac(); suffix = "m"; } else if (singles >= SizeUnit.C1) { value = kiloFrac(); suffix = "k"; } return Strings.format1Decimals(value, suffix); }
@Override public String toString() { long singles = singles(); double value = singles; String suffix = ""; if (singles >= SizeUnit.C5) { value = petaFrac(); suffix = "p"; } else if (singles >= SizeUnit.C4) { value = teraFrac(); suffix = "t"; } else if (singles >= SizeUnit.C3) { value = gigaFrac(); suffix = "g"; } else if (singles >= SizeUnit.C2) { value = megaFrac(); suffix = "m"; } else if (singles >= SizeUnit.C1) { value = kiloFrac(); suffix = "k"; } return Strings.format1Decimals(value, suffix); }
@Override public String toString() { long singles = singles(); double value = singles; String suffix = ""; if (singles >= SizeUnit.C5) { value = petaFrac(); suffix = "p"; } else if (singles >= SizeUnit.C4) { value = teraFrac(); suffix = "t"; } else if (singles >= SizeUnit.C3) { value = gigaFrac(); suffix = "g"; } else if (singles >= SizeUnit.C2) { value = megaFrac(); suffix = "m"; } else if (singles >= SizeUnit.C1) { value = kiloFrac(); suffix = "k"; } return Strings.format1Decimals(value, suffix); }
@Override public String toString() { long bytes = getBytes(); double value = bytes; String suffix = ByteSizeUnit.BYTES.getSuffix(); if (bytes >= ByteSizeUnit.C5) { value = getPbFrac(); suffix = ByteSizeUnit.PB.getSuffix(); } else if (bytes >= ByteSizeUnit.C4) { value = getTbFrac(); suffix = ByteSizeUnit.TB.getSuffix(); } else if (bytes >= ByteSizeUnit.C3) { value = getGbFrac(); suffix = ByteSizeUnit.GB.getSuffix(); } else if (bytes >= ByteSizeUnit.C2) { value = getMbFrac(); suffix = ByteSizeUnit.MB.getSuffix(); } else if (bytes >= ByteSizeUnit.C1) { value = getKbFrac(); suffix = ByteSizeUnit.KB.getSuffix(); } return Strings.format1Decimals(value, suffix); }
@Override public String toString() { long bytes = getBytes(); double value = bytes; String suffix = ByteSizeUnit.BYTES.getSuffix(); if (bytes >= ByteSizeUnit.C5) { value = getPbFrac(); suffix = ByteSizeUnit.PB.getSuffix(); } else if (bytes >= ByteSizeUnit.C4) { value = getTbFrac(); suffix = ByteSizeUnit.TB.getSuffix(); } else if (bytes >= ByteSizeUnit.C3) { value = getGbFrac(); suffix = ByteSizeUnit.GB.getSuffix(); } else if (bytes >= ByteSizeUnit.C2) { value = getMbFrac(); suffix = ByteSizeUnit.MB.getSuffix(); } else if (bytes >= ByteSizeUnit.C1) { value = getKbFrac(); suffix = ByteSizeUnit.KB.getSuffix(); } return Strings.format1Decimals(value, suffix); }