Package org.apache.hadoop.metrics2.util
Class Metrics2Util.TopN
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractQueue<E>
java.util.PriorityQueue<Metrics2Util.NameValuePair>
org.apache.hadoop.metrics2.util.Metrics2Util.TopN
- All Implemented Interfaces:
Serializable,Iterable<Metrics2Util.NameValuePair>,Collection<Metrics2Util.NameValuePair>,Queue<Metrics2Util.NameValuePair>
- Enclosing class:
- Metrics2Util
A fixed-size priority queue, used to retrieve top-n of offered entries.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetTotal()booleanoffer(Metrics2Util.NameValuePair entry) Methods inherited from class java.util.PriorityQueue
add, clear, comparator, contains, forEach, iterator, peek, poll, remove, removeAll, removeIf, retainAll, size, spliterator, toArray, toArrayMethods inherited from class java.util.AbstractQueue
addAll, element, removeMethods inherited from class java.util.AbstractCollection
containsAll, isEmpty, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
containsAll, equals, hashCode, isEmpty, parallelStream, stream, toArray
-
Constructor Details
-
TopN
public TopN(int n)
-
-
Method Details
-
offer
- Specified by:
offerin interfaceQueue<Metrics2Util.NameValuePair>- Overrides:
offerin classPriorityQueue<Metrics2Util.NameValuePair>
-
getTotal
public long getTotal()
-