You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by th...@apache.org on 2015/08/12 16:29:59 UTC

svn commit: r1695535 - /jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/OakDirectory.java

Author: thomasm
Date: Wed Aug 12 14:29:59 2015
New Revision: 1695535

URL: http://svn.apache.org/r1695535
Log:
OAK-2808 Active deletion of 'deleted' Lucene index files / add javadocs

Modified:
    jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/OakDirectory.java

Modified: jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/OakDirectory.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/OakDirectory.java?rev=1695535&r1=1695534&r2=1695535&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/OakDirectory.java (original)
+++ jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/OakDirectory.java Wed Aug 12 14:29:59 2015
@@ -195,26 +195,64 @@ class OakDirectory extends Directory {
      */
     static final int DEFAULT_BLOB_SIZE = 32 * 1024;
 
+    /**
+     * A file, which might be split into multiple blobs.
+     */
     private static class OakIndexFile {
 
+        /**
+         * The file name.
+         */
         private final String name;
 
+        /**
+         * The node that contains the data for this file.
+         */
         private final NodeBuilder file;
 
+        /**
+         * The maximum size of each blob.
+         */
         private final int blobSize;
-
+        
+        /**
+         * The current position within the file (for positioned read and write
+         * operations).
+         */
         private long position = 0;
 
+        /**
+         * The length of the file.
+         */
         private long length;
 
+        /**
+         * The list of blobs (might be empty).
+         * The last blob has a size of 1 up to blobSize.
+         * All other blobs have a size of blobSize.
+         */
         private List<Blob> data;
 
+        /**
+         * Whether the data was modified since it was last flushed. If yes, on a
+         * flush, the metadata, and the list of blobs need to be stored.
+         */
         private boolean dataModified = false;
 
+        /**
+         * The index of the currently loaded blob.
+         */
         private int index = -1;
 
+        /**
+         * The data of the currently loaded blob.
+         */
         private byte[] blob;
 
+        /**
+         * Whether the currently loaded blob was modified since the blob was
+         * flushed.
+         */
         private boolean blobModified = false;
 
         public OakIndexFile(String name, NodeBuilder file) {