/** * Total heap used in the cluster */ public ByteSizeValue getHeapUsed() { return new ByteSizeValue(heapUsed); }
/** * Maximum total heap available to the cluster */ public ByteSizeValue getHeapMax() { return new ByteSizeValue(heapMax); }
public ClusterStateResponse(ClusterName clusterName, ClusterState clusterState, long sizeInBytes, boolean waitForTimedOut) { this.clusterName = clusterName; this.clusterState = clusterState; this.totalCompressedSize = new ByteSizeValue(sizeInBytes); this.waitForTimedOut = waitForTimedOut; }
/** * returns the maximum heap size. 0 bytes signals unknown. */ public ByteSizeValue getHeapMax() { return new ByteSizeValue(heapMax); }
@Override public String toString() { return "[" + this.name + ",limit=" + this.limit + "/" + new ByteSizeValue(this.limit) + ",estimated=" + this.estimated + "/" + new ByteSizeValue(this.estimated) + ",overhead=" + this.overhead + ",tripped=" + this.trippedCount + "]"; }
public ByteSizeValue getPeakMax() { return new ByteSizeValue(peakMax); } }
public ByteSizeValue getDirectMemoryMax() { return new ByteSizeValue(directMemoryMax); } }
/** * Build the {@link BulkProcessor}. * * <p>Note: this is exposed for testing purposes. */ @VisibleForTesting protected BulkProcessor buildBulkProcessor(BulkProcessor.Listener listener) { checkNotNull(listener); BulkProcessor.Builder bulkProcessorBuilder = callBridge.createBulkProcessorBuilder(client, listener); // This makes flush() blocking bulkProcessorBuilder.setConcurrentRequests(0); if (bulkProcessorFlushMaxActions != null) { bulkProcessorBuilder.setBulkActions(bulkProcessorFlushMaxActions); } if (bulkProcessorFlushMaxSizeMb != null) { bulkProcessorBuilder.setBulkSize(new ByteSizeValue(bulkProcessorFlushMaxSizeMb, ByteSizeUnit.MB)); } if (bulkProcessorFlushIntervalMillis != null) { bulkProcessorBuilder.setFlushInterval(TimeValue.timeValueMillis(bulkProcessorFlushIntervalMillis)); } // if backoff retrying is disabled, bulkProcessorFlushBackoffPolicy will be null callBridge.configureBulkProcessorBackoff(bulkProcessorBuilder, bulkProcessorFlushBackoffPolicy); return bulkProcessorBuilder.build(); }
.setBulkSize(new ByteSizeValue(5, ByteSizeUnit.MB)) .setFlushInterval(TimeValue.timeValueSeconds(5)) .setConcurrentRequests(10)
private long noLimit(long bytes, String label) { long newUsed; newUsed = this.used.addAndGet(bytes); if (logger.isTraceEnabled()) { logger.trace("[{}] Adding [{}][{}] to used bytes [new used: [{}], limit: [-1b]]", this.name, new ByteSizeValue(bytes), label, new ByteSizeValue(newUsed)); } return newUsed; }
public RecoverFilesRecoveryException(StreamInput in) throws IOException{ super(in); numberOfFiles = in.readInt(); totalFilesSize = new ByteSizeValue(in); }
@Override public String toString() { return "[" + this.name + ",type=" + this.type.toString() + ",limit=" + this.limitBytes + "/" + new ByteSizeValue(this.limitBytes) + ",overhead=" + this.overhead + "]"; } }
@Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); builder.field(Fields.NAME, name); builder.humanReadableField(Fields.LENGTH_IN_BYTES, Fields.LENGTH, new ByteSizeValue(length)); builder.field(Fields.REUSED, reused); builder.humanReadableField(Fields.RECOVERED_IN_BYTES, Fields.RECOVERED, new ByteSizeValue(recovered)); builder.endObject(); return builder; }
@Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(Fields.TRANSPORT); builder.field(Fields.SERVER_OPEN, serverOpen); builder.field(Fields.RX_COUNT, rxCount); builder.humanReadableField(Fields.RX_SIZE_IN_BYTES, Fields.RX_SIZE, new ByteSizeValue(rxSize)); builder.field(Fields.TX_COUNT, txCount); builder.humanReadableField(Fields.TX_SIZE_IN_BYTES, Fields.TX_SIZE, new ByteSizeValue(txSize)); builder.endObject(); return builder; }
static Map<String, Boolean> evaluateConditions(final Collection<Condition> conditions, final DocsStats docsStats, final IndexMetaData metaData) { final long numDocs = docsStats == null ? 0 : docsStats.getCount(); final long indexSize = docsStats == null ? 0 : docsStats.getTotalSizeInBytes(); final Condition.Stats stats = new Condition.Stats(numDocs, metaData.getCreationDate(), new ByteSizeValue(indexSize)); return conditions.stream() .map(condition -> condition.evaluate(stats)) .collect(Collectors.toMap(result -> result.condition.toString(), result -> result.matched)); }
@Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject("translog"); builder.field("operations", numberOfOperations); builder.humanReadableField("size_in_bytes", "size", new ByteSizeValue(translogSizeInBytes)); builder.field("uncommitted_operations", uncommittedOperations); builder.humanReadableField("uncommitted_size_in_bytes", "uncommitted_size", new ByteSizeValue(uncommittedSizeInBytes)); builder.field("earliest_last_modified_age", earliestLastModifiedAge); builder.endObject(); return builder; }
@Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(name.toLowerCase(Locale.ROOT)); builder.field(Fields.LIMIT, limit); builder.field(Fields.LIMIT_HUMAN, new ByteSizeValue(limit)); builder.field(Fields.ESTIMATED, estimated); builder.field(Fields.ESTIMATED_HUMAN, new ByteSizeValue(estimated)); builder.field(Fields.OVERHEAD, overhead); builder.field(Fields.TRIPPED_COUNT, trippedCount); builder.endObject(); return builder; }
public FsBlobStore(Settings settings, Path path) throws IOException { this.path = path; this.readOnly = settings.getAsBoolean("readonly", false); if (!this.readOnly) { Files.createDirectories(path); } this.bufferSizeInBytes = (int) settings.getAsBytesSize("repositories.fs.buffer_size", new ByteSizeValue(100, ByteSizeUnit.KB)).getBytes(); }
@Override public String toString() { return "[" + nodeId + "][" + nodeName + "][" + path + "] free: " + new ByteSizeValue(getFreeBytes()) + "[" + Strings.format1Decimals(getFreeDiskAsPercentage(), "%") + "]"; } }
XContentBuilder toShortXContent(XContentBuilder builder) throws IOException { builder.field("path", this.path); builder.humanReadableField("total_bytes", "total", new ByteSizeValue(this.totalBytes)); builder.humanReadableField("used_bytes", "used", new ByteSizeValue(this.getUsedBytes())); builder.humanReadableField("free_bytes", "free", new ByteSizeValue(this.freeBytes)); builder.field("free_disk_percent", truncatePercent(this.getFreeDiskAsPercentage())); builder.field("used_disk_percent", truncatePercent(this.getUsedDiskAsPercentage())); return builder; }