private static StringBuilder toString(StringBuilder dest, Accountable a, int depth) { for (int i = 1; i < depth; i++) { dest.append(" "); } if (depth > 0) { dest.append("|-- "); } dest.append(a.toString()); dest.append(": "); dest.append(RamUsageEstimator.humanReadableUnits(a.ramBytesUsed())); dest.append(System.lineSeparator()); for (Accountable child : a.getChildResources()) { toString(dest, child, depth + 1); } return dest; }
/** * Augments an existing accountable with the provided description. * <p> * The resource description is constructed in this format: * {@code description [toString()]} * <p> * This is a point-in-time type safe view: consumers * will not be able to cast or manipulate the resource in any way. */ public static Accountable namedAccountable(String description, Accountable in) { return namedAccountable(description + " [" + in + "]", in.getChildResources(), in.ramBytesUsed()); }
void writeRamTree(StreamOutput out, Accountable tree) throws IOException { out.writeString(tree.toString()); out.writeVLong(tree.ramBytesUsed()); Collection<Accountable> children = tree.getChildResources(); out.writeVInt(children.size()); for (Accountable child : children) { writeRamTree(out, child); } }
private static void toXContent(XContentBuilder builder, Accountable tree) throws IOException { builder.startObject(); builder.field(Fields.DESCRIPTION, tree.toString()); builder.humanReadableField(Fields.SIZE_IN_BYTES, Fields.SIZE, new ByteSizeValue(tree.ramBytesUsed())); Collection<Accountable> children = tree.getChildResources(); if (children.isEmpty() == false) { builder.startArray(Fields.CHILDREN); for (Accountable child : children) { toXContent(builder, child); } builder.endArray(); } builder.endObject(); }
for (Accountable child : segment.ramTree.getChildResources()) { toXContent(builder, child);
private static StringBuilder toString(StringBuilder dest, Accountable a, int depth) { for (int i = 1; i < depth; i++) { dest.append(" "); } if (depth > 0) { dest.append("|-- "); } dest.append(a.toString()); dest.append(": "); dest.append(RamUsageEstimator.humanReadableUnits(a.ramBytesUsed())); dest.append(System.lineSeparator()); for (Accountable child : a.getChildResources()) { toString(dest, child, depth + 1); } return dest; }
private static StringBuilder toString(StringBuilder dest, Accountable a, int depth) { for (int i = 1; i < depth; i++) { dest.append(" "); } if (depth > 0) { dest.append("|-- "); } dest.append(a.toString()); dest.append(": "); dest.append(RamUsageEstimator.humanReadableUnits(a.ramBytesUsed())); dest.append(System.lineSeparator()); for (Accountable child : a.getChildResources()) { toString(dest, child, depth + 1); } return dest; }
private static StringBuilder toString(StringBuilder dest, Accountable a, int depth) { for (int i = 1; i < depth; i++) { dest.append(" "); } if (depth > 0) { dest.append("|-- "); } dest.append(a.toString()); dest.append(": "); dest.append(RamUsageEstimator.humanReadableUnits(a.ramBytesUsed())); dest.append(System.lineSeparator()); for (Accountable child : a.getChildResources()) { toString(dest, child, depth + 1); } return dest; }
/** * Augments an existing accountable with the provided description. * <p> * The resource description is constructed in this format: * {@code description [toString()]} * <p> * This is a point-in-time type safe view: consumers * will not be able to cast or manipulate the resource in any way. */ public static Accountable namedAccountable(String description, Accountable in) { return namedAccountable(description + " [" + in + "]", in.getChildResources(), in.ramBytesUsed()); }
/** * Augments an existing accountable with the provided description. * <p> * The resource description is constructed in this format: * {@code description [toString()]} * <p> * This is a point-in-time type safe view: consumers * will not be able to cast or manipulate the resource in any way. */ public static Accountable namedAccountable(String description, Accountable in) { return namedAccountable(description + " [" + in + "]", in.getChildResources(), in.ramBytesUsed()); }
/** * Augments an existing accountable with the provided description. * <p> * The resource description is constructed in this format: * {@code description [toString()]} * <p> * This is a point-in-time type safe view: consumers * will not be able to cast or manipulate the resource in any way. */ public static Accountable namedAccountable(String description, Accountable in) { return namedAccountable(description + " [" + in + "]", in.getChildResources(), in.ramBytesUsed()); }
void writeRamTree(StreamOutput out, Accountable tree) throws IOException { out.writeString(tree.toString()); out.writeVLong(tree.ramBytesUsed()); Collection<Accountable> children = tree.getChildResources(); out.writeVInt(children.size()); for (Accountable child : children) { writeRamTree(out, child); } }
void writeRamTree(StreamOutput out, Accountable tree) throws IOException { out.writeString(tree.toString()); out.writeVLong(tree.ramBytesUsed()); Collection<Accountable> children = tree.getChildResources(); out.writeVInt(children.size()); for (Accountable child : children) { writeRamTree(out, child); } }
void writeRamTree(StreamOutput out, Accountable tree) throws IOException { out.writeString(tree.toString()); out.writeVLong(tree.ramBytesUsed()); Collection<Accountable> children = tree.getChildResources(); out.writeVInt(children.size()); for (Accountable child : children) { writeRamTree(out, child); } }
void writeRamTree(StreamOutput out, Accountable tree) throws IOException { out.writeString(tree.toString()); out.writeVLong(tree.ramBytesUsed()); Collection<Accountable> children = tree.getChildResources(); out.writeVInt(children.size()); for (Accountable child : children) { writeRamTree(out, child); } }
private static void toXContent(XContentBuilder builder, Accountable tree) throws IOException { builder.startObject(); builder.field(Fields.DESCRIPTION, tree.toString()); builder.humanReadableField(Fields.SIZE_IN_BYTES, Fields.SIZE, new ByteSizeValue(tree.ramBytesUsed())); Collection<Accountable> children = tree.getChildResources(); if (children.isEmpty() == false) { builder.startArray(Fields.CHILDREN); for (Accountable child : children) { toXContent(builder, child); } builder.endArray(); } builder.endObject(); }
static void toXContent(XContentBuilder builder, Accountable tree) throws IOException { builder.startObject(); builder.field(Fields.DESCRIPTION, tree.toString()); builder.byteSizeField(Fields.SIZE_IN_BYTES, Fields.SIZE, new ByteSizeValue(tree.ramBytesUsed())); Collection<Accountable> children = tree.getChildResources(); if (children.isEmpty() == false) { builder.startArray(Fields.CHILDREN); for (Accountable child : children) { toXContent(builder, child); } builder.endArray(); } builder.endObject(); }
private static void toXContent(XContentBuilder builder, Accountable tree) throws IOException { builder.startObject(); builder.field(Fields.DESCRIPTION, tree.toString()); builder.humanReadableField(Fields.SIZE_IN_BYTES, Fields.SIZE, new ByteSizeValue(tree.ramBytesUsed())); Collection<Accountable> children = tree.getChildResources(); if (children.isEmpty() == false) { builder.startArray(Fields.CHILDREN); for (Accountable child : children) { toXContent(builder, child); } builder.endArray(); } builder.endObject(); }
static void toXContent(XContentBuilder builder, Accountable tree) throws IOException { builder.startObject(); builder.field(Fields.DESCRIPTION, tree.toString()); builder.byteSizeField(Fields.SIZE_IN_BYTES, Fields.SIZE, new ByteSizeValue(tree.ramBytesUsed())); Collection<Accountable> children = tree.getChildResources(); if (children.isEmpty() == false) { builder.startArray(Fields.CHILDREN); for (Accountable child : children) { toXContent(builder, child); } builder.endArray(); } builder.endObject(); }
for (Accountable child : segment.ramTree.getChildResources()) { toXContent(builder, child);