mirror of https://github.com/apache/lucene.git
add time took for each index part during flush, like we do on merge; improve javadocs
This commit is contained in:
parent
274febf021
commit
a48ba5090b
|
@ -91,16 +91,35 @@ final class DefaultIndexingChain extends DocConsumer {
|
||||||
// aborting on any exception from this method
|
// aborting on any exception from this method
|
||||||
|
|
||||||
int maxDoc = state.segmentInfo.maxDoc();
|
int maxDoc = state.segmentInfo.maxDoc();
|
||||||
|
long t0 = System.nanoTime();
|
||||||
writeNorms(state);
|
writeNorms(state);
|
||||||
|
if (docState.infoStream.isEnabled("IW")) {
|
||||||
|
docState.infoStream.message("IW", ((System.nanoTime()-t0)/1000000) + " msec to write norms");
|
||||||
|
}
|
||||||
|
|
||||||
|
t0 = System.nanoTime();
|
||||||
writeDocValues(state);
|
writeDocValues(state);
|
||||||
|
if (docState.infoStream.isEnabled("IW")) {
|
||||||
|
docState.infoStream.message("IW", ((System.nanoTime()-t0)/1000000) + " msec to write docValues");
|
||||||
|
}
|
||||||
|
|
||||||
|
t0 = System.nanoTime();
|
||||||
writePoints(state);
|
writePoints(state);
|
||||||
|
if (docState.infoStream.isEnabled("IW")) {
|
||||||
|
docState.infoStream.message("IW", ((System.nanoTime()-t0)/1000000) + " msec to write points");
|
||||||
|
}
|
||||||
|
|
||||||
// it's possible all docs hit non-aborting exceptions...
|
// it's possible all docs hit non-aborting exceptions...
|
||||||
|
t0 = System.nanoTime();
|
||||||
initStoredFieldsWriter();
|
initStoredFieldsWriter();
|
||||||
fillStoredFields(maxDoc);
|
fillStoredFields(maxDoc);
|
||||||
storedFieldsWriter.finish(state.fieldInfos, maxDoc);
|
storedFieldsWriter.finish(state.fieldInfos, maxDoc);
|
||||||
storedFieldsWriter.close();
|
storedFieldsWriter.close();
|
||||||
|
if (docState.infoStream.isEnabled("IW")) {
|
||||||
|
docState.infoStream.message("IW", ((System.nanoTime()-t0)/1000000) + " msec to finish stored fields");
|
||||||
|
}
|
||||||
|
|
||||||
|
t0 = System.nanoTime();
|
||||||
Map<String,TermsHashPerField> fieldsToFlush = new HashMap<>();
|
Map<String,TermsHashPerField> fieldsToFlush = new HashMap<>();
|
||||||
for (int i=0;i<fieldHash.length;i++) {
|
for (int i=0;i<fieldHash.length;i++) {
|
||||||
PerField perField = fieldHash[i];
|
PerField perField = fieldHash[i];
|
||||||
|
@ -113,12 +132,19 @@ final class DefaultIndexingChain extends DocConsumer {
|
||||||
}
|
}
|
||||||
|
|
||||||
termsHash.flush(fieldsToFlush, state);
|
termsHash.flush(fieldsToFlush, state);
|
||||||
|
if (docState.infoStream.isEnabled("IW")) {
|
||||||
|
docState.infoStream.message("IW", ((System.nanoTime()-t0)/1000000) + " msec to write postings and finish vectors");
|
||||||
|
}
|
||||||
|
|
||||||
// Important to save after asking consumer to flush so
|
// Important to save after asking consumer to flush so
|
||||||
// consumer can alter the FieldInfo* if necessary. EG,
|
// consumer can alter the FieldInfo* if necessary. EG,
|
||||||
// FreqProxTermsWriter does this with
|
// FreqProxTermsWriter does this with
|
||||||
// FieldInfo.storePayload.
|
// FieldInfo.storePayload.
|
||||||
|
t0 = System.nanoTime();
|
||||||
docWriter.codec.fieldInfosFormat().write(state.directory, state.segmentInfo, "", state.fieldInfos, IOContext.DEFAULT);
|
docWriter.codec.fieldInfosFormat().write(state.directory, state.segmentInfo, "", state.fieldInfos, IOContext.DEFAULT);
|
||||||
|
if (docState.infoStream.isEnabled("IW")) {
|
||||||
|
docState.infoStream.message("IW", ((System.nanoTime()-t0)/1000000) + " msec to write fieldInfos");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Writes all buffered points. */
|
/** Writes all buffered points. */
|
||||||
|
|
|
@ -71,7 +71,7 @@ public class RAMOutputStream extends IndexOutput implements Accountable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Copy the current contents of this buffer to the named output. */
|
/** Copy the current contents of this buffer to the provided {@link DataOutput}. */
|
||||||
public void writeTo(DataOutput out) throws IOException {
|
public void writeTo(DataOutput out) throws IOException {
|
||||||
flush();
|
flush();
|
||||||
final long end = file.length;
|
final long end = file.length;
|
||||||
|
|
Loading…
Reference in New Issue