LUCENE-3606: remove more SegmentReader cruft

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene3606@1210309 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2011-12-05 02:06:56 +00:00
parent 3843ac5b8b
commit 249883a232
1 changed files with 1 additions and 25 deletions

View File

@ -145,7 +145,7 @@ public class SegmentReader extends IndexReader implements Cloneable {
private void loadLiveDocs(IOContext context) throws IOException { private void loadLiveDocs(IOContext context) throws IOException {
// NOTE: the bitvector is stored using the regular directory, not cfs // NOTE: the bitvector is stored using the regular directory, not cfs
if (hasDeletions(si)) { if (si.hasDeletions()) {
liveDocs = new BitVector(directory(), si.getDelFileName(), new IOContext(context, true)); liveDocs = new BitVector(directory(), si.getDelFileName(), new IOContext(context, true));
liveDocsRef = new AtomicInteger(1); liveDocsRef = new AtomicInteger(1);
assert checkLiveCounts(); assert checkLiveCounts();
@ -156,17 +156,6 @@ public class SegmentReader extends IndexReader implements Cloneable {
assert si.getDelCount() == 0; assert si.getDelCount() == 0;
} }
/**
* Clones the norm bytes. May be overridden by subclasses. New and experimental.
* @param bytes Byte array to clone
* @return New BitVector
*/
protected byte[] cloneNormBytes(byte[] bytes) {
byte[] cloneBytes = new byte[bytes.length];
System.arraycopy(bytes, 0, cloneBytes, 0, bytes.length);
return cloneBytes;
}
/** /**
* Clones the deleteDocs BitVector. May be overridden by subclasses. New and experimental. * Clones the deleteDocs BitVector. May be overridden by subclasses. New and experimental.
* @param bv BitVector to clone * @param bv BitVector to clone
@ -352,25 +341,12 @@ public class SegmentReader extends IndexReader implements Cloneable {
} }
} }
static boolean hasDeletions(SegmentInfo si) throws IOException {
// Don't call ensureOpen() here (it could affect performance)
return si.hasDeletions();
}
@Override @Override
public boolean hasDeletions() { public boolean hasDeletions() {
// Don't call ensureOpen() here (it could affect performance) // Don't call ensureOpen() here (it could affect performance)
return liveDocs != null; return liveDocs != null;
} }
static boolean usesCompoundFile(SegmentInfo si) throws IOException {
return si.getUseCompoundFile();
}
static boolean hasSeparateNorms(SegmentInfo si) throws IOException {
return si.hasSeparateNorms();
}
// nocommit: remove deletions from SR // nocommit: remove deletions from SR
synchronized void deleteDocument(int docNum) throws IOException { synchronized void deleteDocument(int docNum) throws IOException {
ensureOpen(); ensureOpen();