Example usage for org.apache.lucene.util Accountables namedAccountable

List of usage examples for org.apache.lucene.util Accountables namedAccountable

Introduction

In this page you can find the example usage for org.apache.lucene.util Accountables namedAccountable.

Prototype

public static Accountable namedAccountable(String description, long bytes) 

Source Link

Document

Returns an accountable with the provided description and bytes.

Usage

From source file:com.rocana.lucene.codec.v1.RocanaBlockTreeTermsReader.java

License:Apache License

@Override
public Collection<Accountable> getChildResources() {
    List<Accountable> resources = new ArrayList<>();
    resources.addAll(Accountables.namedAccountables("field", fields));
    resources.add(Accountables.namedAccountable("delegate", postingsReader));
    return Collections.unmodifiableList(resources);
}

From source file:com.rocana.lucene.codec.v1.RocanaFieldReader.java

License:Apache License

@Override
public Collection<Accountable> getChildResources() {
    if (index == null) {
        return Collections.emptyList();
    } else {/*from   www. jav  a 2  s  .  c  o m*/
        return Collections.singleton(Accountables.namedAccountable("term index", index));
    }
}

From source file:it.agilelab.bigdata.spark.search.impl.BigChunksRAMOutputStream.java

License:Apache License

@Override
public Collection<Accountable> getChildResources() {
    return Collections.singleton(Accountables.namedAccountable("file", file));
}

From source file:org.elasticsearch.index.engine.Segment.java

License:Apache License

Accountable readRamTree(StreamInput in) throws IOException {
    final String name = in.readString();
    final long bytes = in.readVLong();
    int numChildren = in.readVInt();
    if (numChildren == 0) {
        return Accountables.namedAccountable(name, bytes);
    }//from  w  ww  .  j  a va  2  s .co  m
    List<Accountable> children = new ArrayList(numChildren);
    while (numChildren-- > 0) {
        children.add(readRamTree(in));
    }
    return Accountables.namedAccountable(name, children, bytes);
}