mirror of https://github.com/apache/lucene.git
LUCENE-1009: Fix merge slowdown with LogByteSizeMergePolicy when autoCommit=false and documents are using stored fields and/or term vectors
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@580646 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8315089cdd
commit
8df6312a30
|
@ -119,6 +119,10 @@ Bug fixes
|
|||
This bug was introduced with LUCENE-984. (Andi Vajda via Mike
|
||||
McCandless)
|
||||
|
||||
19. LUCENE-1009: Fix merge slowdown with LogByteSizeMergePolicy when
|
||||
autoCommit=false and documents are using stored fields and/or term
|
||||
vectors. (Mark Miller via Mike McCandless)
|
||||
|
||||
New features
|
||||
|
||||
1. LUCENE-906: Elision filter for French.
|
||||
|
|
|
@ -182,4 +182,16 @@ final class IndexFileNames {
|
|||
return base + "_" + Long.toString(gen, Character.MAX_RADIX) + extension;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the provided filename is one of the doc
|
||||
* store files (ends with an extension in
|
||||
* STORE_INDEX_EXTENSIONS).
|
||||
*/
|
||||
static final boolean isDocStoreFile(String fileName) {
|
||||
for(int i=0;i<STORE_INDEX_EXTENSIONS.length;i++)
|
||||
if (fileName.endsWith(STORE_INDEX_EXTENSIONS[i]))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -208,8 +208,13 @@ final class SegmentInfo {
|
|||
List files = files();
|
||||
final int size = files.size();
|
||||
sizeInBytes = 0;
|
||||
for(int i=0;i<size;i++)
|
||||
sizeInBytes += dir.fileLength((String) files.get(i));
|
||||
for(int i=0;i<size;i++) {
|
||||
final String fileName = (String) files.get(i);
|
||||
// We don't count bytes used by a shared doc store
|
||||
// against this segment:
|
||||
if (docStoreOffset == -1 || !IndexFileNames.isDocStoreFile(fileName))
|
||||
sizeInBytes += dir.fileLength(fileName);
|
||||
}
|
||||
}
|
||||
return sizeInBytes;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue