Skip to content

Commit

Permalink
Use shard as a name of lucene index part
Browse files Browse the repository at this point in the history
Update storage layout name to reuse agreed terminology.
  • Loading branch information
MishaDemianenko committed Jan 21, 2016
1 parent 6fd1474 commit 3fb4c38
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 14 deletions.
Expand Up @@ -41,7 +41,7 @@ public IndexStorageFactory( DirectoryFactory directoryFactory, FileSystemAbstrac

public IndexStorage indexStorageOf(long indexId)
{
return new PartitionedIndexStorage( directoryFactory, fileSystem, indexRootFolder, indexId );
return new ShardedIndexStorage( directoryFactory, fileSystem, indexRootFolder, indexId );
}

public IndexStorage labelScanStorage()
Expand Down
Expand Up @@ -19,7 +19,6 @@
*/
package org.neo4j.kernel.api.impl.index.storage;

import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.store.AlreadyClosedException;
import org.apache.lucene.store.Directory;

Expand All @@ -31,12 +30,12 @@
import org.neo4j.io.fs.FileSystemAbstraction;
import org.neo4j.kernel.api.impl.index.storage.layout.IndexFolderLayout;

public class PartitionedIndexStorage extends IndexStorage
public class ShardedIndexStorage extends IndexStorage
{
private static final int partitions = 1;
private List<Directory> partitionDirectories = new ArrayList<>();

public PartitionedIndexStorage( DirectoryFactory directoryFactory, FileSystemAbstraction fileSystem,
public ShardedIndexStorage( DirectoryFactory directoryFactory, FileSystemAbstraction fileSystem,
File schemaIndexRootFolder, long indexId )
{
super( directoryFactory, fileSystem, new IndexFolderLayout( schemaIndexRootFolder, indexId ) );
Expand Down
Expand Up @@ -32,7 +32,7 @@
import org.neo4j.kernel.api.exceptions.schema.UnableToValidateConstraintKernelException;
import org.neo4j.kernel.api.impl.index.storage.DirectoryFactory;
import org.neo4j.kernel.api.impl.index.storage.IndexStorage;
import org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage;
import org.neo4j.kernel.api.impl.index.storage.ShardedIndexStorage;
import org.neo4j.test.TargetDirectory;
import org.neo4j.test.TestGraphDatabaseFactory;

Expand Down Expand Up @@ -104,7 +104,7 @@ private void dbWithConstraint()
private void storeIndexFailure( String failure ) throws IOException
{
File luceneRootDirectory = new File( storeDir.directory(), "schema/index/lucene" );
IndexStorage indexStorage = new PartitionedIndexStorage( DirectoryFactory.PERSISTENT, new
IndexStorage indexStorage = new ShardedIndexStorage( DirectoryFactory.PERSISTENT, new
DefaultFileSystemAbstraction(), luceneRootDirectory, 1 );
indexStorage.storeIndexFailure( failure );
}
Expand Down
Expand Up @@ -20,7 +20,6 @@
package org.neo4j.kernel.api.impl.index;

import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.store.Directory;
import org.junit.Test;

import java.io.File;
Expand All @@ -32,7 +31,7 @@
import org.neo4j.io.fs.FileSystemAbstraction;
import org.neo4j.kernel.api.impl.index.storage.DirectoryFactory;
import org.neo4j.kernel.api.impl.index.storage.IndexStorage;
import org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage;
import org.neo4j.kernel.api.impl.index.storage.ShardedIndexStorage;
import org.neo4j.kernel.api.index.IndexUpdater;

import static org.junit.Assert.assertEquals;
Expand Down Expand Up @@ -197,7 +196,7 @@ public void run()
private LuceneIndexAccessor createAccessor( LuceneIndexAccessor.LuceneReferenceManager<IndexSearcher> manager )
{
IndexStorage indexStorage =
new PartitionedIndexStorage( mock( DirectoryFactory.class ), mock( FileSystemAbstraction.class ), dir, 1 );
new ShardedIndexStorage( mock( DirectoryFactory.class ), mock( FileSystemAbstraction.class ), dir, 1 );
return new LuceneIndexAccessor( structure, writer, manager, indexStorage, 42 )
{
};
Expand Down
Expand Up @@ -42,7 +42,7 @@
import org.neo4j.kernel.api.exceptions.index.IndexNotFoundKernelException;
import org.neo4j.kernel.api.impl.index.storage.DirectoryFactory;
import org.neo4j.kernel.api.impl.index.storage.IndexStorage;
import org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage;
import org.neo4j.kernel.api.impl.index.storage.ShardedIndexStorage;
import org.neo4j.kernel.api.index.IndexUpdater;
import org.neo4j.kernel.api.index.NodePropertyUpdate;
import org.neo4j.kernel.impl.api.index.IndexUpdateMode;
Expand Down Expand Up @@ -120,7 +120,7 @@ public String toString()

private static IndexStorage getIndexStorage( DirectoryFactory dirFactory, File dir ) throws IOException
{
IndexStorage indexStorage = new PartitionedIndexStorage( dirFactory, new EphemeralFileSystemAbstraction(), dir, 1 );
IndexStorage indexStorage = new ShardedIndexStorage( dirFactory, new EphemeralFileSystemAbstraction(), dir, 1 );
indexStorage.prepareIndexStorage();
return indexStorage;
}
Expand Down
Expand Up @@ -35,7 +35,7 @@
import org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException;
import org.neo4j.kernel.api.impl.index.storage.DirectoryFactory;
import org.neo4j.kernel.api.impl.index.storage.IndexStorage;
import org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage;
import org.neo4j.kernel.api.impl.index.storage.ShardedIndexStorage;
import org.neo4j.kernel.api.index.IndexUpdater;
import org.neo4j.kernel.api.index.NodePropertyUpdate;
import org.neo4j.kernel.impl.api.index.IndexUpdateMode;
Expand Down Expand Up @@ -63,8 +63,7 @@ public class LuceneIndexIT
@Before
public void before() throws Exception
{

indexStorage = new PartitionedIndexStorage( DirectoryFactory.PERSISTENT, new DefaultFileSystemAbstraction(),
indexStorage = new ShardedIndexStorage( DirectoryFactory.PERSISTENT, new DefaultFileSystemAbstraction(),
testDir.directory(), 1 );
indexStorage.prepareIndexStorage();
accessor = new NonUniqueLuceneIndexAccessor( documentLogic, standard(), indexStorage, 100_000 );
Expand Down

0 comments on commit 3fb4c38

Please sign in to comment.