Skip to content

Commit b0662c8

Browse files
authored
LUCENE-9907: Remove unused method PackedInts.Mutable#save
1 parent 2a7951c commit b0662c8

File tree

7 files changed

+1
-88
lines changed

7 files changed

+1
-88
lines changed

gradle/generation/moman/gen_Packed64SingleBlock.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,6 @@
215215
}
216216
}
217217
218-
@Override
219-
@SuppressWarnings("deprecation")
220-
protected PackedInts.Format getFormat() {
221-
return PackedInts.Format.PACKED_SINGLE_BLOCK;
222-
}
223-
224218
@Override
225219
public String toString() {
226220
return getClass().getSimpleName() + "(bitsPerValue=" + bitsPerValue

lucene/core/src/generated/checksums/utilGenPacked.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626
"lucene/core/src/java/org/apache/lucene/util/packed/BulkOperationPacked8.java": "bc5124047b26fc0be147db5bc855be038d306f65",
2727
"lucene/core/src/java/org/apache/lucene/util/packed/BulkOperationPacked9.java": "1121f69ea6d830ab6f4bd2f51d017b792c17d1b1",
2828
"lucene/core/src/java/org/apache/lucene/util/packed/BulkOperationPackedSingleBlock.java": "36984601502fcc812eb9d9a845fa10774e575653",
29-
"lucene/core/src/java/org/apache/lucene/util/packed/Packed64SingleBlock.java": "18c97614f29045519a8d440a35c685c50a5e9a34",
29+
"lucene/core/src/java/org/apache/lucene/util/packed/Packed64SingleBlock.java": "2703943d7980188a3da355490e7b72918910b369",
3030
"property:source": "https://github.com/jpbarrette/moman/archive/497c90e34e412b6494db6dabf0d95db8034bd325.zip"
3131
}

lucene/core/src/java/org/apache/lucene/util/packed/GrowableWriter.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
*/
1717
package org.apache.lucene.util.packed;
1818

19-
import java.io.IOException;
20-
import org.apache.lucene.store.DataOutput;
2119
import org.apache.lucene.util.RamUsageEstimator;
2220

2321
/**
@@ -135,9 +133,4 @@ public long ramBytesUsed() {
135133
+ Float.BYTES)
136134
+ current.ramBytesUsed();
137135
}
138-
139-
@Override
140-
public void save(DataOutput out) throws IOException {
141-
current.save(out);
142-
}
143136
}

lucene/core/src/java/org/apache/lucene/util/packed/Packed64SingleBlock.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,6 @@ public void fill(int fromIndex, int toIndex, long val) {
197197
}
198198
}
199199

200-
@Override
201-
@SuppressWarnings("deprecation")
202-
protected PackedInts.Format getFormat() {
203-
return PackedInts.Format.PACKED_SINGLE_BLOCK;
204-
}
205-
206200
@Override
207201
public String toString() {
208202
return getClass().getSimpleName()

lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -502,25 +502,6 @@ public void fill(int fromIndex, int toIndex, long val) {
502502
public void clear() {
503503
fill(0, size(), 0);
504504
}
505-
506-
/**
507-
* Save this mutable into <code>out</code>. This method does not write any metadata to the
508-
* stream, meaning that it is your responsibility to store it somewhere else in order to be able
509-
* to recover data from the stream later on.
510-
*/
511-
public void save(DataOutput out) throws IOException {
512-
Writer writer =
513-
getWriterNoHeader(out, getFormat(), size(), getBitsPerValue(), DEFAULT_BUFFER_SIZE);
514-
for (int i = 0; i < size(); ++i) {
515-
writer.add(get(i));
516-
}
517-
writer.finish();
518-
}
519-
520-
/** The underlying format. */
521-
Format getFormat() {
522-
return Format.PACKED;
523-
}
524505
}
525506

526507
/**

lucene/core/src/java/org/apache/lucene/util/packed/gen_Packed64SingleBlock.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,6 @@
215215
}
216216
}
217217
218-
@Override
219-
@SuppressWarnings("deprecation")
220-
protected PackedInts.Format getFormat() {
221-
return PackedInts.Format.PACKED_SINGLE_BLOCK;
222-
}
223-
224218
@Override
225219
public String toString() {
226220
return getClass().getSimpleName() + "(bitsPerValue=" + bitsPerValue

lucene/core/src/test/org/apache/lucene/util/packed/TestPackedInts.java

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import java.util.Locale;
2727
import java.util.Random;
2828
import org.apache.lucene.store.ByteArrayDataInput;
29-
import org.apache.lucene.store.ByteBuffersDirectory;
3029
import org.apache.lucene.store.DataInput;
3130
import org.apache.lucene.store.Directory;
3231
import org.apache.lucene.store.IOContext;
@@ -865,48 +864,6 @@ public void testPagedGrowableWriterOverflow() {
865864
}
866865
}
867866

868-
public void testSave() throws IOException {
869-
final int valueCount = TestUtil.nextInt(random(), 1, 2048);
870-
for (int bpv = 1; bpv <= 64; ++bpv) {
871-
final int maxValue = (int) Math.min(PackedInts.maxValue(31), PackedInts.maxValue(bpv));
872-
final Directory directory = new ByteBuffersDirectory();
873-
List<PackedInts.Mutable> packedInts = createPackedInts(valueCount, bpv);
874-
for (PackedInts.Mutable mutable : packedInts) {
875-
for (int i = 0; i < mutable.size(); ++i) {
876-
mutable.set(i, random().nextInt(maxValue));
877-
}
878-
879-
IndexOutput out = directory.createOutput("packed-ints.bin", IOContext.DEFAULT);
880-
mutable.save(out);
881-
out.close();
882-
883-
IndexInput in = directory.openInput("packed-ints.bin", IOContext.DEFAULT);
884-
PackedInts.Reader reader =
885-
PackedInts.getReaderNoHeader(
886-
in,
887-
mutable.getFormat(),
888-
PackedInts.VERSION_CURRENT,
889-
mutable.size(),
890-
mutable.getBitsPerValue());
891-
assertEquals(valueCount, reader.size());
892-
if (mutable instanceof Packed64SingleBlock) {
893-
// make sure that we used the right format so that the reader has
894-
// the same performance characteristics as the mutable that has been
895-
// serialized
896-
assertTrue(reader instanceof Packed64SingleBlock);
897-
} else {
898-
assertFalse(reader instanceof Packed64SingleBlock);
899-
}
900-
for (int i = 0; i < valueCount; ++i) {
901-
assertEquals(mutable.get(i), reader.get(i));
902-
}
903-
in.close();
904-
directory.deleteFile("packed-ints.bin");
905-
}
906-
directory.close();
907-
}
908-
}
909-
910867
public void testEncodeDecode() {
911868
for (PackedInts.Format format : PackedInts.Format.values()) {
912869
for (int bpv = 1; bpv <= 64; ++bpv) {

0 commit comments

Comments
 (0)