|
@@ -18,7 +18,6 @@
|
|
|
*/
|
|
|
package org.elasticsearch.common.bytes;
|
|
|
|
|
|
-import org.apache.lucene.util.Accountable;
|
|
|
import org.apache.lucene.util.BytesRef;
|
|
|
import org.apache.lucene.util.BytesRefIterator;
|
|
|
import org.elasticsearch.common.io.stream.BytesStream;
|
|
@@ -38,7 +37,7 @@ import java.util.function.ToIntBiFunction;
|
|
|
/**
|
|
|
* A reference to bytes.
|
|
|
*/
|
|
|
-public abstract class BytesReference implements Accountable, Comparable<BytesReference>, ToXContentFragment {
|
|
|
+public abstract class BytesReference implements Comparable<BytesReference>, ToXContentFragment {
|
|
|
|
|
|
private Integer hash = null; // we cache the hash of this reference since it can be quite costly to re-calculated it
|
|
|
|
|
@@ -71,6 +70,11 @@ public abstract class BytesReference implements Accountable, Comparable<BytesRef
|
|
|
*/
|
|
|
public abstract BytesReference slice(int from, int length);
|
|
|
|
|
|
+ /**
|
|
|
+ * The amount of memory used by this BytesReference
|
|
|
+ */
|
|
|
+ public abstract long ramBytesUsed();
|
|
|
+
|
|
|
/**
|
|
|
* A stream input of the bytes.
|
|
|
*/
|