mirror of https://github.com/apache/lucene.git
Remove FSTReader.size() (#12802)
* Move size() to FSTStore * Remove size() completely --------- Co-authored-by: Michael McCandless <mikemccand@apache.org>
This commit is contained in:
parent
d0e0f6090e
commit
4309917215
|
@ -308,11 +308,6 @@ class BytesStore extends DataOutput implements FSTReader {
|
|||
return ((long) blocks.size() - 1) * blockSize + nextWrite;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long size() {
|
||||
return getPosition();
|
||||
}
|
||||
|
||||
/** Set the position of this BytesStore, truncating or expanding if needed */
|
||||
public void setPosition(long newLen) {
|
||||
assert newLen >= 0;
|
||||
|
|
|
@ -827,7 +827,7 @@ public class FSTCompiler<T> {
|
|||
}
|
||||
|
||||
void finish(long newStartNode) {
|
||||
assert newStartNode <= bytes.size();
|
||||
assert newStartNode <= bytes.getPosition();
|
||||
if (fst.metadata.startNode != -1) {
|
||||
throw new IllegalStateException("already finished");
|
||||
}
|
||||
|
|
|
@ -23,13 +23,6 @@ import org.apache.lucene.util.Accountable;
|
|||
/** Abstraction for reading bytes necessary for FST. */
|
||||
public interface FSTReader extends Accountable {
|
||||
|
||||
/**
|
||||
* The raw size in bytes of the FST
|
||||
*
|
||||
* @return the FST size
|
||||
*/
|
||||
long size();
|
||||
|
||||
/**
|
||||
* Get the reverse BytesReader for this FST
|
||||
*
|
||||
|
|
|
@ -56,7 +56,6 @@ public final class OffHeapFSTStore implements FSTStore {
|
|||
return BASE_RAM_BYTES_USED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long size() {
|
||||
return numBytes;
|
||||
}
|
||||
|
|
|
@ -64,15 +64,6 @@ public final class OnHeapFSTStore implements FSTStore {
|
|||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long size() {
|
||||
if (bytesArray != null) {
|
||||
return bytesArray.length;
|
||||
} else {
|
||||
return bytes.getPosition();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long ramBytesUsed() {
|
||||
long size = BASE_RAM_BYTES_USED;
|
||||
|
|
Loading…
Reference in New Issue