From 9e96dc0f30a9aa0b4084da6980b1cbc6ba9a6d75 Mon Sep 17 00:00:00 2001 From: lutovich Date: Tue, 19 Jan 2016 19:28:25 +0100 Subject: [PATCH] Added javadocs to new classes --- .../api/impl/index/AbstractLuceneIndex.java | 60 ++++++++++++++++--- .../api/impl/index/IndexWriterConfigs.java | 6 +- .../LuceneDocumentRetrievalException.java | 4 +- .../api/impl/index/LuceneIndexAccessor.java | 2 +- ...uceneIndexReaderAcquisitionException.java} | 8 ++- ...ceneIndexSearcherAcquisitionException.java | 33 ---------- .../api/impl/index/LuceneLabelScanIndex.java | 11 +++- .../LucenePartitionAllDocumentsReader.java | 3 + .../api/impl/index/LuceneSchemaIndex.java | 43 ++++++++++++- .../impl/index/PartitionedIndexWriter.java | 8 +++ .../PartitionedLuceneLabelScanWriter.java | 10 +++- .../SimpleLuceneLabelScanStoreReader.java | 7 ++- .../LuceneIndexSnapshotFileIterator.java | 12 +++- .../backup/SnapshotReleaseException.java | 12 +++- .../UnsupportedIndexDeletionPolicy.java | 11 +++- .../builder/AbstractLuceneIndexBuilder.java | 37 +++++++++++- .../builder/LuceneIndexStorageBuilder.java | 45 ++++++++++++++ .../builder/LuceneLabelScanIndexBuilder.java | 21 +++++++ .../builder/LuceneSchemaIndexBuilder.java | 43 ++++++++++--- .../impl/index/partition/IndexPartition.java | 17 ++++++ .../index/partition/PartitionSearcher.java | 4 ++ ....java => IndexSearcherCloseException.java} | 11 +++- .../index/reader/PartitionedIndexReader.java | 10 +++- .../impl/index/reader/SimpleIndexReader.java | 7 ++- .../index/sampler/LuceneIndexSampler.java | 17 ++++++ .../sampler/NonUniqueLuceneIndexSampler.java | 4 ++ .../sampler/UniqueLuceneIndexSampler.java | 4 ++ .../index/storage/layout/FolderLayout.java | 31 ++++++++++ .../storage/layout/IndexFolderLayout.java | 5 ++ 29 files changed, 410 insertions(+), 76 deletions(-) rename community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/{LuceneIndexAcquisitionException.java => LuceneIndexReaderAcquisitionException.java} (82%) delete mode 100644 community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneIndexSearcherAcquisitionException.java rename community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/reader/{IndexReaderCloseException.java => IndexSearcherCloseException.java} (71%) diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/AbstractLuceneIndex.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/AbstractLuceneIndex.java index bab8f552c3e00..ddd259df73064 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/AbstractLuceneIndex.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/AbstractLuceneIndex.java @@ -45,10 +45,17 @@ import static java.util.stream.Collectors.toList; +/** + * Abstract implementation of a partitioned index. + * Such index may consist of one or multiple separate Lucene indexes that are represented as independent + * {@link IndexPartition partitions}. + */ public abstract class AbstractLuceneIndex implements Closeable { + // lock used to guard commits and close of lucene indexes from separate threads protected final ReentrantLock commitCloseLock = new ReentrantLock(); - protected final ReentrantLock readWriteLock = new ReentrantLock(); + // lock guard concurrent creation of new partitions + protected final ReentrantLock partitionsLock = new ReentrantLock(); protected final PartitionedIndexStorage indexStorage; private List partitions = new CopyOnWriteArrayList<>(); @@ -63,8 +70,9 @@ public AbstractLuceneIndex( PartitionedIndexStorage indexStorage ) * Creates new index. * As part of creation process index will allocate all required folders, index failure storage * and will create its first partition. - *

+ *

* Index creation do not automatically open it. To be able to use index please open it first. + * * @throws IOException */ public void create() throws IOException @@ -77,6 +85,7 @@ public void create() throws IOException /** * Open index with all allocated partitions. + * * @throws IOException */ public void open() throws IOException @@ -96,6 +105,7 @@ boolean isOpen() /** * Check lucene index existence within all allocated partitions. + * * @return true if index exist in all partitions, false when index is empty or does not exist * @throws IOException */ @@ -120,6 +130,7 @@ public boolean exists() throws IOException * Verify state of the index. * If index is already open and in use method assume that index is valid since lucene already operating with it, * otherwise necessary checks perform. + * * @return true if lucene confirm that index is in valid clean state or index is already open. */ public boolean isValid() @@ -160,12 +171,22 @@ public boolean isValid() return true; } + /** + * Close index and deletes all it's partitions. + * + * @throws IOException + */ public void drop() throws IOException { close(); indexStorage.cleanupFolder( indexStorage.getIndexFolder() ); } + /** + * Commits all index partitions. + * + * @throws IOException + */ public void flush() throws IOException { commitCloseLock.lock(); @@ -199,10 +220,15 @@ public void close() throws IOException } } + /** + * Creates an iterable over all {@link org.apache.lucene.document.Document document}s in all partitions. + * + * @return LuceneAllDocumentsReader over all documents + */ public LuceneAllDocumentsReader allDocumentsReader() { ensureOpen(); - readWriteLock.lock(); + partitionsLock.lock(); try { List searchers = new ArrayList<>( partitions.size() ); @@ -227,10 +253,17 @@ public LuceneAllDocumentsReader allDocumentsReader() } finally { - readWriteLock.unlock(); + partitionsLock.unlock(); } } + /** + * Snapshot of all file in all index partitions. + * + * @return iterator over all index files. + * @throws IOException + * @see org.neo4j.kernel.api.impl.index.backup.LuceneIndexSnapshotFileIterator + */ public ResourceIterator snapshot() throws IOException { ensureOpen(); @@ -267,9 +300,14 @@ public ResourceIterator snapshot() throws IOException } } + /** + * Refresh all partitions to make newly inserted data visible for readers. + * + * @throws IOException + */ public void maybeRefreshBlocking() throws IOException { - readWriteLock.lock(); + partitionsLock.lock(); try { for ( IndexPartition partition : getPartitions() ) @@ -279,7 +317,7 @@ public void maybeRefreshBlocking() throws IOException } finally { - readWriteLock.unlock(); + partitionsLock.unlock(); } } @@ -289,10 +327,16 @@ List getPartitions() return partitions; } + /** + * Add new partition to the index. + * + * @return newly created partition + * @throws IOException + */ IndexPartition addNewPartition() throws IOException { ensureOpen(); - readWriteLock.lock(); + partitionsLock.lock(); try { File partitionFolder = createNewPartitionFolder(); @@ -303,7 +347,7 @@ IndexPartition addNewPartition() throws IOException } finally { - readWriteLock.unlock(); + partitionsLock.unlock(); } } diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/IndexWriterConfigs.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/IndexWriterConfigs.java index 9a4d93bfa0814..3ee65b95e93a2 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/IndexWriterConfigs.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/IndexWriterConfigs.java @@ -26,6 +26,9 @@ import org.neo4j.index.impl.lucene.legacy.MultipleBackupDeletionPolicy; import org.neo4j.unsafe.impl.internal.dragons.FeatureToggles; +/** + * Helper factory for standard lucene index writer configuration. + */ public final class IndexWriterConfigs { private static final int MAX_BUFFERED_DOCS = @@ -46,11 +49,10 @@ public static IndexWriterConfig standardConfig() { IndexWriterConfig writerConfig = new IndexWriterConfig( LuceneDataSource.KEYWORD_ANALYZER ); - writerConfig.setMaxBufferedDocs( MAX_BUFFERED_DOCS ); // TODO figure out depending on environment? + writerConfig.setMaxBufferedDocs( MAX_BUFFERED_DOCS ); writerConfig.setIndexDeletionPolicy( new MultipleBackupDeletionPolicy() ); writerConfig.setUseCompoundFile( true ); - // TODO: TieredMergePolicy & possibly SortingMergePolicy LogByteSizeMergePolicy mergePolicy = new LogByteSizeMergePolicy(); mergePolicy.setNoCFSRatio( MERGE_POLICY_NO_CFS_RATIO ); mergePolicy.setMinMergeMB( MERGE_POLICY_MIN_MERGE_MB ); diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneDocumentRetrievalException.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneDocumentRetrievalException.java index c0ca8e357e3b9..eeb95ad6e6354 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneDocumentRetrievalException.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneDocumentRetrievalException.java @@ -32,13 +32,13 @@ public class LuceneDocumentRetrievalException extends RuntimeException public LuceneDocumentRetrievalException( String message, long documentId, Throwable cause ) { - this(message, cause); + this( message, cause ); this.documentId = documentId; } public LuceneDocumentRetrievalException( String message, Throwable cause ) { - super(message, cause); + super( message, cause ); } public long getDocumentId() diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneIndexAccessor.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneIndexAccessor.java index f6cf240edf937..46aaad7653600 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneIndexAccessor.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneIndexAccessor.java @@ -93,7 +93,7 @@ public IndexReader newReader() } catch ( IOException e ) { - throw new LuceneIndexAcquisitionException("Can't acquire index reader"); + throw new LuceneIndexReaderAcquisitionException( "Can't acquire index reader", e ); } } diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneIndexAcquisitionException.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneIndexReaderAcquisitionException.java similarity index 82% rename from community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneIndexAcquisitionException.java rename to community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneIndexReaderAcquisitionException.java index 2db777b6b8638..a5d6b26a68c47 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneIndexAcquisitionException.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneIndexReaderAcquisitionException.java @@ -19,15 +19,17 @@ */ package org.neo4j.kernel.api.impl.index; +import java.io.IOException; + /** * Exception that will be thrown in case if encounter IOException during Lucene reader acquisition. * * @see org.apache.lucene.search.IndexSearcher */ -public class LuceneIndexAcquisitionException extends RuntimeException +public class LuceneIndexReaderAcquisitionException extends RuntimeException { - public LuceneIndexAcquisitionException( String message ) + public LuceneIndexReaderAcquisitionException( String message, IOException e ) { - super( message ); + super( message, e ); } } diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneIndexSearcherAcquisitionException.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneIndexSearcherAcquisitionException.java deleted file mode 100644 index 0b3ae86a3c2f2..0000000000000 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneIndexSearcherAcquisitionException.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2002-2016 "Neo Technology," - * Network Engine for Objects in Lund AB [http://neotechnology.com] - * - * This file is part of Neo4j. - * - * Neo4j is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.neo4j.kernel.api.impl.index; - -/** - * Exception that will be thrown in case if encounter IOException during Lucene searcher acquisition. - * - * @see org.apache.lucene.search.IndexSearcher - */ -public class LuceneIndexSearcherAcquisitionException extends RuntimeException -{ - public LuceneIndexSearcherAcquisitionException( String message, Throwable cause ) - { - super( message, cause ); - } -} diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneLabelScanIndex.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneLabelScanIndex.java index 12e831f6593c9..d7a7ca930e86f 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneLabelScanIndex.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneLabelScanIndex.java @@ -32,6 +32,12 @@ import org.neo4j.kernel.api.labelscan.NodeLabelRange; import org.neo4j.storageengine.api.schema.LabelScanReader; +/** + * Implementation of Lucene label scan store index that support multiple partitions. + *

+ * Each partition stores {@link org.apache.lucene.document.Document documents} according to the given + * {@link BitmapDocumentFormat} and {@link LabelScanStorageStrategy}. + */ public class LuceneLabelScanIndex extends AbstractLuceneIndex { private final BitmapDocumentFormat format; @@ -44,10 +50,11 @@ public LuceneLabelScanIndex( BitmapDocumentFormat format, PartitionedIndexStorag this.storageStrategy = new NodeRangeDocumentLabelScanStorageStrategy( format ); } + public LabelScanReader getLabelScanReader() { ensureOpen(); - readWriteLock.lock(); + partitionsLock.lock(); try { List partitions = getPartitions(); @@ -63,7 +70,7 @@ public LabelScanReader getLabelScanReader() } finally { - readWriteLock.unlock(); + partitionsLock.unlock(); } } diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LucenePartitionAllDocumentsReader.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LucenePartitionAllDocumentsReader.java index 371a7a61f4b0d..4c5d9773a19b2 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LucenePartitionAllDocumentsReader.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LucenePartitionAllDocumentsReader.java @@ -34,6 +34,9 @@ import org.neo4j.helpers.collection.PrefetchingIterator; import org.neo4j.kernel.api.impl.index.partition.PartitionSearcher; +/** + * Provides a view of all {@link Document}s in a single partition. + */ public class LucenePartitionAllDocumentsReader implements BoundedIterable { private final PartitionSearcher partitionSearcher; diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneSchemaIndex.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneSchemaIndex.java index bd6b13e995c2c..be7e3e7b2486f 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneSchemaIndex.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/LuceneSchemaIndex.java @@ -46,6 +46,9 @@ import static java.util.Collections.singletonMap; +/** + * Implementation of Lucene schema index that support multiple partitions. + */ public class LuceneSchemaIndex extends AbstractLuceneIndex { private static final String KEY_STATUS = "status"; @@ -74,7 +77,7 @@ public LuceneIndexWriter getIndexWriter() throws IOException public IndexReader getIndexReader() throws IOException { ensureOpen(); - readWriteLock.lock(); + partitionsLock.lock(); try { List partitions = getPartitions(); @@ -83,10 +86,19 @@ public IndexReader getIndexReader() throws IOException } finally { - readWriteLock.unlock(); + partitionsLock.unlock(); } } + /** + * Verifies uniqueness of property values present in this index. + * + * @param accessor the accessor to retrieve actual property values from the store. + * @param propertyKeyId the id of the property to verify. + * @throws IndexEntryConflictException if there are duplicates. + * @throws IOException + * @see UniquenessVerifier#verify(PropertyAccessor, int) + */ public void verifyUniqueness( PropertyAccessor accessor, int propertyKeyId ) throws IOException, IndexEntryConflictException { @@ -96,6 +108,16 @@ public void verifyUniqueness( PropertyAccessor accessor, int propertyKeyId ) } } + /** + * Verifies uniqueness of updated property values. + * + * @param accessor the accessor to retrieve actual property values from the store. + * @param propertyKeyId the id of the property to verify. + * @param updatedPropertyValues the values to check uniqueness for. + * @throws IndexEntryConflictException if there are duplicates. + * @throws IOException + * @see UniquenessVerifier#verify(PropertyAccessor, int, List) + */ public void verifyUniqueness( PropertyAccessor accessor, int propertyKeyId, List updatedPropertyValues ) throws IOException, IndexEntryConflictException { @@ -120,6 +142,12 @@ public void drop() throws IOException super.drop(); } + /** + * Check if this index is marked as online. + * + * @return true if index is online, false otherwise + * @throws IOException + */ public boolean isOnline() throws IOException { ensureOpen(); @@ -132,6 +160,11 @@ public boolean isOnline() throws IOException } } + /** + * Marks index as online by including "status" -> "online" map into commit metadata of the first partition. + * + * @throws IOException + */ public void markAsOnline() throws IOException { ensureOpen(); @@ -149,6 +182,12 @@ public void markAsOnline() throws IOException } } + /** + * Writes the given failure message to the failure storage. + * + * @param failure the failure message. + * @throws IOException + */ public void markAsFailed( String failure ) throws IOException { indexStorage.storeIndexFailure( failure ); diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/PartitionedIndexWriter.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/PartitionedIndexWriter.java index 3b2a85f5602b9..765ce5cd4a0fb 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/PartitionedIndexWriter.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/PartitionedIndexWriter.java @@ -30,6 +30,14 @@ import org.neo4j.kernel.api.impl.index.partition.IndexPartition; +/** + * Schema Lucene index writer implementation that supports writing into multiple partitions and creates partitions + * on-demand if needed. + *

+ * Writer threats partition as writable if partition has number of documents that is less then configured + * {@link #MAXIMUM_PARTITION_SIZE}. + * First observable partition that satisfy writer criteria is used for writing. + */ public class PartitionedIndexWriter implements LuceneIndexWriter { private LuceneSchemaIndex index; diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/PartitionedLuceneLabelScanWriter.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/PartitionedLuceneLabelScanWriter.java index 6638b90c52adf..483e637454565 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/PartitionedLuceneLabelScanWriter.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/PartitionedLuceneLabelScanWriter.java @@ -24,11 +24,9 @@ import org.apache.lucene.index.IndexableField; import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher; -import org.apache.lucene.search.SearcherManager; import org.apache.lucene.search.TermQuery; import java.io.IOException; -import java.io.UncheckedIOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -43,6 +41,14 @@ import static java.lang.String.format; +/** + * Label scan store Lucene index writer implementation that supports writing into multiple partitions and creates + * partitions on-demand if needed. + *

+ * Writer chooses writable partition based on the given nodeId and configured parameter + * {@link #MAXIMUM_PARTITION_SIZE}. + * Additional partitions are created on-demand, if needed. + */ public class PartitionedLuceneLabelScanWriter implements LabelScanWriter { diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/SimpleLuceneLabelScanStoreReader.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/SimpleLuceneLabelScanStoreReader.java index d1934f35d842c..b7fbf036abf7e 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/SimpleLuceneLabelScanStoreReader.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/SimpleLuceneLabelScanStoreReader.java @@ -24,9 +24,12 @@ import org.neo4j.collection.primitive.PrimitiveLongIterator; import org.neo4j.kernel.api.impl.index.partition.PartitionSearcher; -import org.neo4j.kernel.api.impl.index.reader.IndexReaderCloseException; +import org.neo4j.kernel.api.impl.index.reader.IndexSearcherCloseException; import org.neo4j.storageengine.api.schema.LabelScanReader; +/** + * Label scan index reader that is able to read/sample a single partition of a partitioned index. + */ public class SimpleLuceneLabelScanStoreReader implements LabelScanReader { private final PartitionSearcher partitionSearcher; @@ -59,7 +62,7 @@ public void close() } catch ( IOException e ) { - throw new IndexReaderCloseException( e ); + throw new IndexSearcherCloseException( e ); } } } diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/backup/LuceneIndexSnapshotFileIterator.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/backup/LuceneIndexSnapshotFileIterator.java index a074a7d323f57..b69bd44dd1878 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/backup/LuceneIndexSnapshotFileIterator.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/backup/LuceneIndexSnapshotFileIterator.java @@ -36,6 +36,14 @@ import static org.neo4j.helpers.collection.IteratorUtil.emptyIterator; +/** + * Iterator over Lucene index files for a particular {@link IndexCommit snapshot}. + * Applicable only to a single Lucene index partition. + * Internally uses {@link SnapshotDeletionPolicy#snapshot()} to create an {@link IndexCommit} that represents + * consistent state of the index for a particular point in time. + * + * Turns to be an empty iterator if index does not have any commits yet. + */ public class LuceneIndexSnapshotFileIterator extends PrefetchingIterator implements ResourceIterator { private final File indexDirectory; @@ -62,7 +70,7 @@ public static ResourceIterator forIndex( File indexFolder, IndexWriter ind } } - LuceneIndexSnapshotFileIterator( File indexDirectory, SnapshotDeletionPolicy snapshotDeletionPolicy ) + private LuceneIndexSnapshotFileIterator( File indexDirectory, SnapshotDeletionPolicy snapshotDeletionPolicy ) throws IOException { this.snapshot = snapshotDeletionPolicy.snapshot(); @@ -91,7 +99,7 @@ public void close() catch ( IOException e ) { throw new SnapshotReleaseException( "Unable to release lucene index snapshot for index in: " + - indexDirectory, e); + indexDirectory, e ); } } diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/backup/SnapshotReleaseException.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/backup/SnapshotReleaseException.java index 4089abfd188c7..7f6b2bd2402c6 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/backup/SnapshotReleaseException.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/backup/SnapshotReleaseException.java @@ -19,9 +19,17 @@ */ package org.neo4j.kernel.api.impl.index.backup; -public class SnapshotReleaseException extends RuntimeException +/** + * Exception that is thrown by {@link LuceneIndexSnapshotFileIterator} in case if exception + * occurred during index snapshot release + * + * @see LuceneIndexSnapshotFileIterator + * @see org.apache.lucene.index.SnapshotDeletionPolicy + * @see org.apache.lucene.index.IndexCommit + */ +class SnapshotReleaseException extends RuntimeException { - public SnapshotReleaseException( String message, Throwable e ) + SnapshotReleaseException( String message, Throwable e ) { super( message, e ); } diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/backup/UnsupportedIndexDeletionPolicy.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/backup/UnsupportedIndexDeletionPolicy.java index 22909e0754db9..ef7741a6c2a58 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/backup/UnsupportedIndexDeletionPolicy.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/backup/UnsupportedIndexDeletionPolicy.java @@ -19,9 +19,16 @@ */ package org.neo4j.kernel.api.impl.index.backup; -public class UnsupportedIndexDeletionPolicy extends RuntimeException +/** + * Exception that is throw by {@link LuceneIndexSnapshotFileIterator} in case if there is an attempt to create a + * snapshot on a index with index policy that does not support snapshots. + * + * @see LuceneIndexSnapshotFileIterator + * @see org.apache.lucene.index.SnapshotDeletionPolicy + */ +class UnsupportedIndexDeletionPolicy extends RuntimeException { - public UnsupportedIndexDeletionPolicy( String message ) + UnsupportedIndexDeletionPolicy( String message ) { super( message ); } diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/builder/AbstractLuceneIndexBuilder.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/builder/AbstractLuceneIndexBuilder.java index f94a354db6eb9..5e8320e9242be 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/builder/AbstractLuceneIndexBuilder.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/builder/AbstractLuceneIndexBuilder.java @@ -25,34 +25,69 @@ import org.neo4j.kernel.api.impl.index.storage.DirectoryFactory; import org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage; -abstract class AbstractLuceneIndexBuilder +/** + * Base class for lucene index builders. + * + * @param actual index type + */ +abstract class AbstractLuceneIndexBuilder> { protected LuceneIndexStorageBuilder storageBuilder = LuceneIndexStorageBuilder.create(); + /** + * Specify index storage + * + * @param indexStorage index storage + * @return index builder + */ public T withIndexStorage( PartitionedIndexStorage indexStorage ) { storageBuilder.withIndexStorage( indexStorage ); return (T) this; } + /** + * Specify directory factory + * + * @param directoryFactory directory factory + * @return index builder + */ public T withDirectoryFactory( DirectoryFactory directoryFactory ) { storageBuilder.withDirectoryFactory( directoryFactory ); return (T) this; } + /** + * Specify file system abstraction + * + * @param fileSystem file system abstraction + * @return index builder + */ public T withFileSystem( FileSystemAbstraction fileSystem ) { storageBuilder.withFileSystem( fileSystem ); return (T) this; } + /** + * Specify index root folder + * + * @param indexRootFolder root folder + * @return index builder + */ public T withIndexRootFolder( File indexRootFolder ) { storageBuilder.withIndexRootFolder( indexRootFolder ); return (T) this; } + /** + * Specify index identifier + * + * @param indexIdentifier identifier + * @return index builder + */ public T withIndexIdentifier( String indexIdentifier ) { storageBuilder.withIndexIdentifier( indexIdentifier ); diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/builder/LuceneIndexStorageBuilder.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/builder/LuceneIndexStorageBuilder.java index 8aa377bf25c52..6e936d0a64796 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/builder/LuceneIndexStorageBuilder.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/builder/LuceneIndexStorageBuilder.java @@ -27,6 +27,11 @@ import org.neo4j.kernel.api.impl.index.storage.DirectoryFactory; import org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage; +/** + * Helper builder class to simplify construction of lucene index storages. + * Most of the values already have most useful default value, that still can be overridden by corresponding + * builder methods. + */ public class LuceneIndexStorageBuilder { private DirectoryFactory directoryFactory = DirectoryFactory.PERSISTENT; @@ -39,11 +44,21 @@ private LuceneIndexStorageBuilder() { } + /** + * Create new lucene index storage builder + * + * @return index builder + */ public static LuceneIndexStorageBuilder create() { return new LuceneIndexStorageBuilder(); } + /** + * Build lucene index storage with specified configuration + * + * @return lucene index storage + */ public PartitionedIndexStorage build() { if ( indexStorage == null ) @@ -58,30 +73,60 @@ public PartitionedIndexStorage build() return indexStorage; } + /** + * Specify index identifier + * + * @param indexIdentifier identifier + * @return index storage builder + */ public LuceneIndexStorageBuilder withIndexIdentifier( String indexIdentifier ) { this.indexIdentifier = indexIdentifier; return this; } + /** + * Specify directory factory + * + * @param directoryFactory directory factory + * @return index storage builder + */ public LuceneIndexStorageBuilder withDirectoryFactory( DirectoryFactory directoryFactory ) { this.directoryFactory = directoryFactory; return this; } + /** + * Specify file system abstraction + * + * @param fileSystem file system abstraction + * @return index storage builder + */ public LuceneIndexStorageBuilder withFileSystem( FileSystemAbstraction fileSystem ) { this.fileSystem = fileSystem; return this; } + /** + * Specify index root folder + * + * @param indexRootFolder root folder + * @return index storage builder + */ public LuceneIndexStorageBuilder withIndexRootFolder( File indexRootFolder ) { this.indexRootFolder = indexRootFolder; return this; } + /** + * Specify partitioned index storage + * + * @param indexStorage index storage + * @return index storage builder + */ public LuceneIndexStorageBuilder withIndexStorage( PartitionedIndexStorage indexStorage ) { this.indexStorage = indexStorage; diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/builder/LuceneLabelScanIndexBuilder.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/builder/LuceneLabelScanIndexBuilder.java index 3812312856317..92cf66b4b9ca1 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/builder/LuceneLabelScanIndexBuilder.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/builder/LuceneLabelScanIndexBuilder.java @@ -22,6 +22,11 @@ import org.neo4j.kernel.api.impl.index.BitmapDocumentFormat; import org.neo4j.kernel.api.impl.index.LuceneLabelScanIndex; +/** + * Helper builder class to simplify construction and instantiation of lucene label scan indexes. + * Most of the values already have most useful default value, that still can be overridden by corresponding + * builder methods. + */ public class LuceneLabelScanIndexBuilder extends AbstractLuceneIndexBuilder { public static final String DEFAULT_INDEX_IDENTIFIER = "labelStore"; @@ -34,17 +39,33 @@ private LuceneLabelScanIndexBuilder() storageBuilder.withIndexIdentifier( DEFAULT_INDEX_IDENTIFIER ); } + /** + * Create new label scan store builder + * + * @return index builder + */ public static LuceneLabelScanIndexBuilder create() { return new LuceneLabelScanIndexBuilder(); } + /** + * Specify label scan store format + * + * @param format document format + * @return index builder + */ public LuceneLabelScanIndexBuilder withDocumentFormat( BitmapDocumentFormat format ) { this.format = format; return this; } + /** + * Build lucene label scan index with specified configuration + * + * @return lucene label scan index + */ public LuceneLabelScanIndex build() { return new LuceneLabelScanIndex( format, storageBuilder.build() ); diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/builder/LuceneSchemaIndexBuilder.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/builder/LuceneSchemaIndexBuilder.java index 8c95a84b8a49a..179ea6f200bcd 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/builder/LuceneSchemaIndexBuilder.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/builder/LuceneSchemaIndexBuilder.java @@ -29,6 +29,14 @@ import static org.neo4j.helpers.collection.MapUtil.stringMap; +/** + * Helper builder class to simplify construction and instantiation of lucene schema indexes. + * Most of the values already have most useful default value, that still can be overridden by corresponding + * builder methods. + * + * @see LuceneSchemaIndex + * @see AbstractLuceneIndexBuilder + */ public class LuceneSchemaIndexBuilder extends AbstractLuceneIndexBuilder { private IndexSamplingConfig samplingConfig = new IndexSamplingConfig( new Config() ); @@ -38,18 +46,32 @@ private LuceneSchemaIndexBuilder() { } + /** + * Create new lucene schema index builder. + * @return new LuceneSchemaIndexBuilder + */ public static LuceneSchemaIndexBuilder create() { return new LuceneSchemaIndexBuilder(); } + /** + * Specify lucene schema index sampling config + * @param samplingConfig sampling config + * @return index builder + */ public LuceneSchemaIndexBuilder withSamplingConfig( IndexSamplingConfig samplingConfig ) { this.samplingConfig = samplingConfig; return this; } - public LuceneSchemaIndexBuilder withSamplingBufferSize( int size ) + /** + * Specify lucene schema index sampling buffer size + * @param size sampling buffer size + * @return index builder + */ + public LuceneSchemaIndexBuilder withSamplingBufferSize( int size ) { Map params = stringMap( GraphDatabaseSettings.index_sampling_buffer_size.name(), size + "" ); Config config = new Config( params ); @@ -57,24 +79,31 @@ public LuceneSchemaIndexBuilder withSamplingBufferSize( int size ) return this; } - public LuceneSchemaIndexBuilder withSamplingConfig( Config config ) - { - this.samplingConfig = new IndexSamplingConfig( config ); - return this; - } - + /** + * Specify lucene schema index config + * @param indexConfig index config + * @return index builder + */ public LuceneSchemaIndexBuilder withIndexConfig( IndexConfiguration indexConfig ) { this.indexConfig = indexConfig; return this; } + /** + * Transform builder to build unique index + * @return index builder + */ public LuceneSchemaIndexBuilder uniqueIndex() { this.indexConfig = IndexConfiguration.UNIQUE; return this; } + /** + * Build lucene schema index with specified configuration + * @return lucene schema index + */ public LuceneSchemaIndex build() { return new LuceneSchemaIndex( storageBuilder.build(), indexConfig, samplingConfig ); diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/partition/IndexPartition.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/partition/IndexPartition.java index 37cf84626be2e..c5db2c3414b9d 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/partition/IndexPartition.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/partition/IndexPartition.java @@ -33,6 +33,11 @@ import org.neo4j.kernel.api.impl.index.IndexWriterConfigs; import org.neo4j.kernel.api.impl.index.backup.LuceneIndexSnapshotFileIterator; +/** + * Represents a single partition of a partitioned lucene index. Each partition is a separate Lucene index. + * Contains and manages lifecycle of the corresponding {@link Directory}, {@link IndexWriter writer} and + * {@link SearcherManager}. + */ public class IndexPartition implements Closeable { private final IndexWriter indexWriter; @@ -62,6 +67,7 @@ public Directory getDirectory() * Return searcher for requested partition. * There is no tracking of acquired searchers, so the expectation is that callers will call close on acquired * searchers to release resources. + * * @return partition searcher * @throws IOException if exception happened during searcher acquisition */ @@ -70,6 +76,11 @@ public PartitionSearcher acquireSearcher() throws IOException return new PartitionSearcher( searcherManager ); } + /** + * Refresh partition to make newly inserted data visible for readers. + * + * @throws IOException if refreshing fails. + */ public void maybeRefreshBlocking() throws IOException { searcherManager.maybeRefreshBlocking(); @@ -81,6 +92,12 @@ public void close() throws IOException IOUtils.closeAll( searcherManager, indexWriter, directory ); } + /** + * Retrieve list of consistent Lucene index files for this partition. + * + * @return the iterator over index files. + * @throws IOException if any IO operation fails. + */ public ResourceIterator snapshot() throws IOException { return LuceneIndexSnapshotFileIterator.forIndex( indexFolder, indexWriter ); diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/partition/PartitionSearcher.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/partition/PartitionSearcher.java index fdbf8d58beccf..88789cc68d88a 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/partition/PartitionSearcher.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/partition/PartitionSearcher.java @@ -25,6 +25,10 @@ import java.io.Closeable; import java.io.IOException; +/** + * Container for {@link IndexSearcher} of the particular {@link IndexPartition partition}. + * Manages lifecycle of the underlying {@link IndexSearcher searcher}. + */ public class PartitionSearcher implements Closeable { private IndexSearcher indexSearcher; diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/reader/IndexReaderCloseException.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/reader/IndexSearcherCloseException.java similarity index 71% rename from community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/reader/IndexReaderCloseException.java rename to community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/reader/IndexSearcherCloseException.java index 0baf0f04b2440..08d1ce7bab113 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/reader/IndexReaderCloseException.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/reader/IndexSearcherCloseException.java @@ -22,9 +22,16 @@ import java.io.IOException; import java.io.UncheckedIOException; -public class IndexReaderCloseException extends UncheckedIOException +/** + * Exception that will be thrown in case if there was a problem during index searcher close + * + * @see org.apache.lucene.search.IndexSearcher + * @see org.neo4j.kernel.api.impl.index.partition.PartitionSearcher + * @see SimpleIndexReader + */ +public class IndexSearcherCloseException extends UncheckedIOException { - public IndexReaderCloseException( IOException cause ) + public IndexSearcherCloseException( IOException cause ) { super( cause ); } diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/reader/PartitionedIndexReader.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/reader/PartitionedIndexReader.java index 6508108c7066f..c05d107110702 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/reader/PartitionedIndexReader.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/reader/PartitionedIndexReader.java @@ -32,6 +32,12 @@ import static java.util.stream.Collectors.toList; +/** + * Index reader that is able to read/sample multiple partitions of a partitioned Lucene index. + * Internally uses multiple {@link SimpleIndexReader}s for individual partitions. + * + * @see SimpleIndexReader + */ public class PartitionedIndexReader implements IndexReader { @@ -84,7 +90,7 @@ public IndexSampler createSampler() { return null; } - + public void close() { try @@ -93,7 +99,7 @@ public void close() } catch ( IOException e ) { - throw new IndexReaderCloseException( e ); + throw new IndexSearcherCloseException( e ); } } diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/reader/SimpleIndexReader.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/reader/SimpleIndexReader.java index 82aa6e23f78b8..89a8a6d6a8896 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/reader/SimpleIndexReader.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/reader/SimpleIndexReader.java @@ -43,6 +43,11 @@ import static org.neo4j.kernel.api.impl.index.LuceneDocumentStructure.NODE_ID_KEY; +/** + * Schema index reader that is able to read/sample a single partition of a partitioned Lucene index. + * + * @see PartitionedIndexReader + */ public class SimpleIndexReader implements IndexReader { private PartitionSearcher partitionSearcher; @@ -135,7 +140,7 @@ public void close() } catch ( IOException e ) { - throw new IndexReaderCloseException( e ); + throw new IndexSearcherCloseException( e ); } } diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/sampler/LuceneIndexSampler.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/sampler/LuceneIndexSampler.java index fb87d02beedd2..097db974db1e3 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/sampler/LuceneIndexSampler.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/sampler/LuceneIndexSampler.java @@ -20,10 +20,15 @@ package org.neo4j.kernel.api.impl.index.sampler; import org.neo4j.helpers.TaskControl; +import org.neo4j.helpers.TaskCoordinator; import org.neo4j.kernel.api.exceptions.index.IndexNotFoundKernelException; import org.neo4j.register.Register; import org.neo4j.storageengine.api.schema.IndexSampler; +/** + * Abstract implementation of a Lucene index sampler, that can react on sampling being canceled via + * {@link TaskCoordinator#cancel()} }. + */ public abstract class LuceneIndexSampler implements IndexSampler { private final TaskControl executionTicket; @@ -33,6 +38,13 @@ public LuceneIndexSampler( TaskControl taskControl ) this.executionTicket = taskControl; } + /** + * Perform actual sampling. + * + * @param result contains the unique values and the sampled size. + * @return the index size. + * @throws IndexNotFoundKernelException if the index is dropped while sampling. + */ protected abstract long performSampling( Register.DoubleLong.Out result ) throws IndexNotFoundKernelException; @Override @@ -48,6 +60,11 @@ public final long sampleIndex( Register.DoubleLong.Out result ) throws IndexNotF } } + /** + * Check if sampling was canceled. + * + * @throws IndexNotFoundKernelException if cancellation was requested. + */ protected void checkCancellation() throws IndexNotFoundKernelException { if ( executionTicket.cancellationRequested() ) diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/sampler/NonUniqueLuceneIndexSampler.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/sampler/NonUniqueLuceneIndexSampler.java index 951ea44882133..6df4fe1e849d1 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/sampler/NonUniqueLuceneIndexSampler.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/sampler/NonUniqueLuceneIndexSampler.java @@ -38,6 +38,10 @@ import static org.neo4j.kernel.api.impl.index.LuceneDocumentStructure.NODE_ID_KEY; +/** + * Sampler for non-unique Lucene schema index. + * Internally uses terms and their document frequencies for sampling. + */ public class NonUniqueLuceneIndexSampler extends LuceneIndexSampler { private final IndexSearcher indexSearcher; diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/sampler/UniqueLuceneIndexSampler.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/sampler/UniqueLuceneIndexSampler.java index 354e399fe1ddd..d1bb2586a6d47 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/sampler/UniqueLuceneIndexSampler.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/sampler/UniqueLuceneIndexSampler.java @@ -26,6 +26,10 @@ import org.neo4j.kernel.impl.api.index.sampling.UniqueIndexSampler; import org.neo4j.register.Register; +/** + * Sampler for unique Lucene schema index. + * Internally uses number of documents in the index for sampling. + */ public class UniqueLuceneIndexSampler extends LuceneIndexSampler { private final IndexSearcher indexSearcher; diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/storage/layout/FolderLayout.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/storage/layout/FolderLayout.java index 37854178b9fc3..46426871acbed 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/storage/layout/FolderLayout.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/storage/layout/FolderLayout.java @@ -21,9 +21,40 @@ import java.io.File; +/** + * Component that represent on-disk layout for partitioned lucene index. + *

+ * It's aware how files and partitions located on disk and knows how to map particular partition index into folder. + * Physically files for index with id indexId will be located in a index root folder indexId with + * separate sub-folder for each partition. + * Since each partition is separate lucene index all lucene index files will be located in a corresponding partition + * folder. + *

+ * As example for index with 3 partitions we will have following directory structure: + *

+ * ...indexId/
+ *    |-- 1
+ *    |   `-- partition index files
+ *    |-- 2
+ *    |   `-- partition index files
+ *    |-- 3
+ *        `-- partition index files
+ * 
+ */ public interface FolderLayout { + /** + * Get root folder of partitioned index + * + * @return the file that represent directory where whole index is located + */ File getIndexFolder(); + /** + * Get folder that contain particular partition + * + * @param partition index of partition to get folder for + * @return the file that represents directory where partition with given index is located. + */ File getPartitionFolder( int partition ); } diff --git a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/storage/layout/IndexFolderLayout.java b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/storage/layout/IndexFolderLayout.java index 7f6400694ca9c..42ee63541477d 100644 --- a/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/storage/layout/IndexFolderLayout.java +++ b/community/lucene-index/src/main/java/org/neo4j/kernel/api/impl/index/storage/layout/IndexFolderLayout.java @@ -21,6 +21,11 @@ import java.io.File; +/** + * Default implementation of {@link FolderLayout} for partitioned lucene index. + * + * @see FolderLayout + */ public class IndexFolderLayout implements FolderLayout { private final File indexFolder;