You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2014/10/27 17:33:24 UTC
svn commit: r1634588 - in /lucene/dev/branches/branch_5x: ./ lucene/
lucene/core/
lucene/core/src/java/org/apache/lucene/util/packed/AbstractPagedMutable.java
Author: rmuir
Date: Mon Oct 27 16:33:24 2014
New Revision: 1634588
URL: http://svn.apache.org/r1634588
Log:
LUCENE-6025: Give AbstractPagedMutable the accountable interface
Modified:
lucene/dev/branches/branch_5x/ (props changed)
lucene/dev/branches/branch_5x/lucene/ (props changed)
lucene/dev/branches/branch_5x/lucene/core/ (props changed)
lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/util/packed/AbstractPagedMutable.java
Modified: lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/util/packed/AbstractPagedMutable.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/util/packed/AbstractPagedMutable.java?rev=1634588&r1=1634587&r2=1634588&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/util/packed/AbstractPagedMutable.java (original)
+++ lucene/dev/branches/branch_5x/lucene/core/src/java/org/apache/lucene/util/packed/AbstractPagedMutable.java Mon Oct 27 16:33:24 2014
@@ -20,6 +20,9 @@ package org.apache.lucene.util.packed;
import static org.apache.lucene.util.packed.PackedInts.checkBlockSize;
import static org.apache.lucene.util.packed.PackedInts.numBlocks;
+import java.util.Collections;
+
+import org.apache.lucene.util.Accountable;
import org.apache.lucene.util.ArrayUtil;
import org.apache.lucene.util.LongValues;
import org.apache.lucene.util.RamUsageEstimator;
@@ -28,7 +31,7 @@ import org.apache.lucene.util.RamUsageEs
* Base implementation for {@link PagedMutable} and {@link PagedGrowableWriter}.
* @lucene.internal
*/
-abstract class AbstractPagedMutable<T extends AbstractPagedMutable<T>> extends LongValues {
+abstract class AbstractPagedMutable<T extends AbstractPagedMutable<T>> extends LongValues implements Accountable {
static final int MIN_BLOCK_SIZE = 1 << 6;
static final int MAX_BLOCK_SIZE = 1 << 30;
@@ -104,7 +107,7 @@ abstract class AbstractPagedMutable<T ex
+ 3 * RamUsageEstimator.NUM_BYTES_INT;
}
- /** Return the number of bytes used by this object. */
+ @Override
public long ramBytesUsed() {
long bytesUsed = RamUsageEstimator.alignObjectSize(baseRamBytesUsed());
bytesUsed += RamUsageEstimator.alignObjectSize(RamUsageEstimator.shallowSizeOf(subMutables));
@@ -113,6 +116,11 @@ abstract class AbstractPagedMutable<T ex
}
return bytesUsed;
}
+
+ @Override
+ public Iterable<? extends Accountable> getChildResources() {
+ return Collections.emptyList();
+ }
protected abstract T newUnfilledCopy(long newSize);