lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject lucene-solr git commit: add time took for each index part during flush, like we do on merge; improve javadocs
Date Tue, 02 Feb 2016 17:15:05 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_5x 5dbe7d9a7 -> 61601ee20


add time took for each index part during flush, like we do on merge; improve javadocs

Conflicts:
	lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/61601ee2
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/61601ee2
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/61601ee2

Branch: refs/heads/branch_5x
Commit: 61601ee206e2ef427430755d0b4e7664c87e57db
Parents: 5dbe7d9
Author: Mike McCandless <mikemccand@apache.org>
Authored: Tue Feb 2 11:07:36 2016 -0500
Committer: Mike McCandless <mikemccand@apache.org>
Committed: Tue Feb 2 11:30:19 2016 -0500

----------------------------------------------------------------------
 .../lucene/index/DefaultIndexingChain.java      | 23 +++++++++++++++++++-
 .../apache/lucene/store/RAMOutputStream.java    |  2 +-
 2 files changed, 23 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/61601ee2/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java b/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java
index 1629024..4ff1cbd 100644
--- a/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java
+++ b/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java
@@ -89,15 +89,29 @@ final class DefaultIndexingChain extends DocConsumer {
     // aborting on any exception from this method
 
     int maxDoc = state.segmentInfo.maxDoc();
+    long t0 = System.nanoTime();
     writeNorms(state);
-    writeDocValues(state);
+    if (docState.infoStream.isEnabled("IW")) {
+      docState.infoStream.message("IW", ((System.nanoTime()-t0)/1000000) + " msec to write
norms");
+    }
     
+    t0 = System.nanoTime();
+    writeDocValues(state);
+    if (docState.infoStream.isEnabled("IW")) {
+      docState.infoStream.message("IW", ((System.nanoTime()-t0)/1000000) + " msec to write
docValues");
+    }
+
     // it's possible all docs hit non-aborting exceptions...
+    t0 = System.nanoTime();
     initStoredFieldsWriter();
     fillStoredFields(maxDoc);
     storedFieldsWriter.finish(state.fieldInfos, maxDoc);
     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<>();
     for (int i=0;i<fieldHash.length;i++) {
       PerField perField = fieldHash[i];
@@ -110,12 +124,19 @@ final class DefaultIndexingChain extends DocConsumer {
     }
 
     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
     // consumer can alter the FieldInfo* if necessary.  EG,
     // FreqProxTermsWriter does this with
     // FieldInfo.storePayload.
+    t0 = System.nanoTime();
     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 doc values (called from {@link #flush}). */

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/61601ee2/lucene/core/src/java/org/apache/lucene/store/RAMOutputStream.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/RAMOutputStream.java b/lucene/core/src/java/org/apache/lucene/store/RAMOutputStream.java
index c34ad7d..486131f 100644
--- a/lucene/core/src/java/org/apache/lucene/store/RAMOutputStream.java
+++ b/lucene/core/src/java/org/apache/lucene/store/RAMOutputStream.java
@@ -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 {
     flush();
     final long end = file.length;


Mime
View raw message