Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

remove dead code

Robert Muira1aacefde1cb
diff --git a/lucene/core/src/java/org/apache/lucene/util/BytesRefHash.java b/lucene/core/src/java/org/apache/lucene/util/BytesRefHash.java
index c1fc0ad117a..d8b110bff3a 100644
--- a/lucene/core/src/java/org/apache/lucene/util/BytesRefHash.java
+++ b/lucene/core/src/java/org/apache/lucene/util/BytesRefHash.java
@@ -129,7 +129,7 @@ public final class BytesRefHash {
* order to reuse this {@link BytesRefHash} instance.
* </p>
*/
- public int[] compact() {
+ private int[] compact() {
assert bytesStart != null : "Bytesstart is null - not initialized";
int upto = 0;
for (int i = 0; i < hashSize; i++) {
@@ -533,50 +533,6 @@ public final class BytesRefHash {
*/
public abstract Counter bytesUsed();
}
-
- /** A simple {@link BytesStartArray} that tracks all
- * memory allocation using a shared {@link Counter}
- * instance. */
- public static class TrackingDirectBytesStartArray extends BytesStartArray {
- protected final int initSize;
- private int[] bytesStart;
- protected final Counter bytesUsed;
-
- public TrackingDirectBytesStartArray(int initSize, Counter bytesUsed) {
- this.initSize = initSize;
- this.bytesUsed = bytesUsed;
- }
-
- @Override
- public int[] clear() {
- if (bytesStart != null) {
- bytesUsed.addAndGet(-bytesStart.length * RamUsageEstimator.NUM_BYTES_INT);
- }
- return bytesStart = null;
- }
-
- @Override
- public int[] grow() {
- assert bytesStart != null;
- final int oldSize = bytesStart.length;
- bytesStart = ArrayUtil.grow(bytesStart, bytesStart.length + 1);
- bytesUsed.addAndGet((bytesStart.length - oldSize) * RamUsageEstimator.NUM_BYTES_INT);
- return bytesStart;
- }
-
- @Override
- public int[] init() {
- bytesStart = new int[ArrayUtil.oversize(initSize,
- RamUsageEstimator.NUM_BYTES_INT)];
- bytesUsed.addAndGet((bytesStart.length) * RamUsageEstimator.NUM_BYTES_INT);
- return bytesStart;
- }
-
- @Override
- public Counter bytesUsed() {
- return bytesUsed;
- }
- }
/** A simple {@link BytesStartArray} that tracks
* memory allocation using a private {@link AtomicLong}
diff --git a/lucene/core/src/test/org/apache/lucene/util/TestBytesRefHash.java b/lucene/core/src/test/org/apache/lucene/util/TestBytesRefHash.java
index 3be9e6f151d..f3f61596bc9 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestBytesRefHash.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestBytesRefHash.java
@@ -133,6 +133,7 @@ public class TestBytesRefHash extends LuceneTestCase {
/**
* Test method for {@link org.apache.lucene.util.BytesRefHash#compact()}.
*/
+ /* nocommit: rewrite in terms of TestSort?
@Test
public void testCompact() {
BytesRef ref = new BytesRef();
@@ -169,7 +170,7 @@ public class TestBytesRefHash extends LuceneTestCase {
assertEquals(0, hash.size());
hash.reinit();
}
- }
+ }*/
/**
* Test method for