lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r780608 - in /lucene/java/trunk/src/java/org/apache/lucene: index/IndexWriter.java index/LogMergePolicy.java index/MergePolicy.java store/IndexOutput.java
Date Mon, 01 Jun 2009 10:27:11 GMT
Author: mikemccand
Date: Mon Jun  1 10:27:11 2009
New Revision: 780608

URL: http://svn.apache.org/viewvc?rev=780608&view=rev
Log:
LUCENE-1670: improve javadocs

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java
    lucene/java/trunk/src/java/org/apache/lucene/index/LogMergePolicy.java
    lucene/java/trunk/src/java/org/apache/lucene/index/MergePolicy.java
    lucene/java/trunk/src/java/org/apache/lucene/store/IndexOutput.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java?rev=780608&r1=780607&r2=780608&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java Mon Jun  1 10:27:11
2009
@@ -46,28 +46,24 @@
 /**
   An <code>IndexWriter</code> creates and maintains an index.
 
-  <p>The <code>create</code> argument to the 
-  <a href="#IndexWriter(org.apache.lucene.store.Directory, org.apache.lucene.analysis.Analyzer,
boolean)"><b>constructor</b></a>
-  determines whether a new index is created, or whether an existing index is
-  opened.  Note that you
-  can open an index with <code>create=true</code> even while readers are
-  using the index.  The old readers will continue to search
-  the "point in time" snapshot they had opened, and won't
-  see the newly created index until they re-open.  There are
-  also <a href="#IndexWriter(org.apache.lucene.store.Directory, org.apache.lucene.analysis.Analyzer)"><b>constructors</b></a>
-  with no <code>create</code> argument which
-  will create a new index if there is not already an index at the
-  provided path and otherwise open the existing index.</p>
-
-  <p>In either case, documents are added with <a
-  href="#addDocument(org.apache.lucene.document.Document)"><b>addDocument</b></a>
-  and removed with <a
-  href="#deleteDocuments(org.apache.lucene.index.Term)"><b>deleteDocuments(Term)</b></a>
-  or <a
-  href="#deleteDocuments(org.apache.lucene.search.Query)"><b>deleteDocuments(Query)</b></a>.
-  A document can be updated with <a href="#updateDocument(org.apache.lucene.index.Term,
org.apache.lucene.document.Document)"><b>updateDocument</b></a> 
-  (which just deletes and then adds the entire document).
-  When finished adding, deleting and updating documents, <a href="#close()"><b>close</b></a>
should be called.</p>
+  <p>The <code>create</code> argument to the {@link
+  #IndexWriter(Directory, Analyzer, boolean) constructor} determines 
+  whether a new index is created, or whether an existing index is
+  opened.  Note that you can open an index with <code>create=true</code>
+  even while readers are using the index.  The old readers will 
+  continue to search the "point in time" snapshot they had opened, 
+  and won't see the newly created index until they re-open.  There are
+  also {@link #IndexWriter(Directory, Analyzer) constructors}
+  with no <code>create</code> argument which will create a new index
+  if there is not already an index at the provided path and otherwise 
+  open the existing index.</p>
+
+  <p>In either case, documents are added with {@link #addDocument(Document)
+  addDocument} and removed with {@link #deleteDocuments(Term)} or {@link
+  #deleteDocuments(Query)}. A document can be updated with {@link
+  #updateDocument(Term, Document) updateDocument} (which just deletes
+  and then adds the entire document). When finished adding, deleting 
+  and updating documents, {@link #close() close} should be called.</p>
 
   <a name="flush"></a>
   <p>These changes are buffered in memory and periodically
@@ -90,23 +86,20 @@
   for changing the {@link MergeScheduler}).</p>
 
   <a name="autoCommit"></a>
-  <p>The optional <code>autoCommit</code> argument to the <a
-  href="#IndexWriter(org.apache.lucene.store.Directory,
-  boolean,
-  org.apache.lucene.analysis.Analyzer)"><b>constructors</b></a>
+  <p>The optional <code>autoCommit</code> argument to the {@link
+  #IndexWriter(Directory, boolean, Analyzer) constructors}
   controls visibility of the changes to {@link IndexReader}
   instances reading the same index.  When this is
   <code>false</code>, changes are not visible until {@link
   #close()} or {@link #commit()} is called.  Note that changes will still be
-  flushed to the {@link org.apache.lucene.store.Directory}
-  as new files, but are not committed (no new
-  <code>segments_N</code> file is written referencing the
-  new files, nor are the files sync'd to stable storage)
+  flushed to the {@link Directory} as new files, but are 
+  not committed (no new <code>segments_N</code> file is written 
+  referencing the new files, nor are the files sync'd to stable storage)
   until {@link #close()} or {@link #commit()} is called.  If something
   goes terribly wrong (for example the JVM crashes), then
   the index will reflect none of the changes made since the
   last commit, or the starting state if commit was not called.
-  You can also call {@link #rollback}, which closes the writer
+  You can also call {@link #rollback()}, which closes the writer
   without committing any changes, and removes any index
   files that had been flushed but are now unreferenced.
   This mode is useful for preventing readers from refreshing
@@ -142,7 +135,7 @@
   are not visible until the reader is re-opened.</p>
 
   <p>If an index will not have more documents added for a while and optimal search
-  performance is desired, then either the full <a href="#optimize()"><b>optimize</b></a>
+  performance is desired, then either the full {@link #optimize() optimize}
   method or partial {@link #optimize(int)} method should be
   called before the index is closed.</p>
 

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/LogMergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/LogMergePolicy.java?rev=780608&r1=780607&r2=780608&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/LogMergePolicy.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/LogMergePolicy.java Mon Jun  1 10:27:11
2009
@@ -22,9 +22,12 @@
 
 /** <p>This class implements a {@link MergePolicy} that tries
  *  to merge segments into levels of exponentially
- *  increasing size, where each level has < mergeFactor
- *  segments in it.  Whenever a given levle has mergeFactor
- *  segments or more in it, they will be merged.</p>
+ *  increasing size, where each level has fewer segments than
+ *  the value of the merge factor. Whenever extra segments
+ *  (beyond the merge factor upper bound) are encountered,
+ *  all segments within the level are merged. You can get or
+ *  set the merge factor using {@link #getMergeFactor()} and
+ *  {@link #setMergeFactor(int)} respectively.</p>
  *
  * <p>This class is abstract and requires a subclass to
  * define the {@link #size} method which specifies how a

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/MergePolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/MergePolicy.java?rev=780608&r1=780607&r2=780608&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/MergePolicy.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/MergePolicy.java Mon Jun  1 10:27:11
2009
@@ -55,7 +55,7 @@
  * (subject to change suddenly in the next release)</p>
  *
  * <p><b>NOTE</b>: This class typically requires access to
- * package-private APIs (eg, SegmentInfos) to do its job;
+ * package-private APIs (e.g. {@link SegmentInfo}s) to do its job;
  * if you implement your own MergePolicy, you'll need to put
  * it in package org.apache.lucene.index in order to use
  * these APIs.

Modified: lucene/java/trunk/src/java/org/apache/lucene/store/IndexOutput.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/store/IndexOutput.java?rev=780608&r1=780607&r2=780608&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/store/IndexOutput.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/store/IndexOutput.java Mon Jun  1 10:27:11
2009
@@ -162,6 +162,7 @@
 
   /** Copy numBytes bytes from input to ourself. */
   public void copyBytes(IndexInput input, long numBytes) throws IOException {
+    assert numBytes >= 0: "numBytes=" + numBytes;
     long left = numBytes;
     if (copyBuffer == null)
       copyBuffer = new byte[COPY_BUFFER_SIZE];



Mime
View raw message