Skip to content

Commit

Permalink
Renamed DeferredConstraintVerificationUniqueLuceneIndexPopulator
Browse files Browse the repository at this point in the history
New name is UniqueLuceneIndexPopulator. Corresponding test is also renamed.
  • Loading branch information
lutovich committed Feb 15, 2016
1 parent 35f416d commit 05d7a2c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
Expand Up @@ -34,8 +34,8 @@
import org.neo4j.kernel.api.impl.index.storage.DirectoryFactory; import org.neo4j.kernel.api.impl.index.storage.DirectoryFactory;
import org.neo4j.kernel.api.impl.index.storage.IndexStorageFactory; import org.neo4j.kernel.api.impl.index.storage.IndexStorageFactory;
import org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage; import org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage;
import org.neo4j.kernel.api.impl.schema.populator.DeferredConstraintVerificationUniqueLuceneIndexPopulator;
import org.neo4j.kernel.api.impl.schema.populator.NonUniqueLuceneIndexPopulator; import org.neo4j.kernel.api.impl.schema.populator.NonUniqueLuceneIndexPopulator;
import org.neo4j.kernel.api.impl.schema.populator.UniqueLuceneIndexPopulator;
import org.neo4j.kernel.api.index.IndexAccessor; import org.neo4j.kernel.api.index.IndexAccessor;
import org.neo4j.kernel.api.index.IndexConfiguration; import org.neo4j.kernel.api.index.IndexConfiguration;
import org.neo4j.kernel.api.index.IndexDescriptor; import org.neo4j.kernel.api.index.IndexDescriptor;
Expand Down Expand Up @@ -81,7 +81,7 @@ public IndexPopulator getPopulator( long indexId, IndexDescriptor descriptor,
.build(); .build();
if ( config.isUnique() ) if ( config.isUnique() )
{ {
return new DeferredConstraintVerificationUniqueLuceneIndexPopulator( luceneIndex, descriptor ); return new UniqueLuceneIndexPopulator( luceneIndex, descriptor );
} }
else else
{ {
Expand Down
Expand Up @@ -34,12 +34,12 @@
import org.neo4j.kernel.impl.api.index.sampling.UniqueIndexSampler; import org.neo4j.kernel.impl.api.index.sampling.UniqueIndexSampler;
import org.neo4j.register.Register.DoubleLong; import org.neo4j.register.Register.DoubleLong;


public class DeferredConstraintVerificationUniqueLuceneIndexPopulator extends LuceneIndexPopulator public class UniqueLuceneIndexPopulator extends LuceneIndexPopulator
{ {
private final IndexDescriptor descriptor; private final IndexDescriptor descriptor;
private final UniqueIndexSampler sampler; private final UniqueIndexSampler sampler;


public DeferredConstraintVerificationUniqueLuceneIndexPopulator(LuceneSchemaIndex index, IndexDescriptor descriptor ) public UniqueLuceneIndexPopulator(LuceneSchemaIndex index, IndexDescriptor descriptor )
{ {
super( index ); super( index );
this.descriptor = descriptor; this.descriptor = descriptor;
Expand Down
Expand Up @@ -32,9 +32,9 @@
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;


class AllNodesCollector extends SimpleCollector public class AllNodesCollector extends SimpleCollector
{ {
static List<Long> getAllNodes( Directory directory, Object propertyValue ) throws IOException public static List<Long> getAllNodes( Directory directory, Object propertyValue ) throws IOException
{ {
try ( SearcherManager manager = new SearcherManager( directory, new SearcherFactory() ) ) try ( SearcherManager manager = new SearcherManager( directory, new SearcherFactory() ) )
{ {
Expand Down
Expand Up @@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.neo4j.kernel.api.impl.schema; package org.neo4j.kernel.api.impl.schema.populator;


import org.apache.lucene.store.Directory; import org.apache.lucene.store.Directory;
import org.junit.After; import org.junit.After;
Expand All @@ -37,7 +37,8 @@
import org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException; 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.DirectoryFactory;
import org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage; import org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage;
import org.neo4j.kernel.api.impl.schema.populator.DeferredConstraintVerificationUniqueLuceneIndexPopulator; import org.neo4j.kernel.api.impl.schema.LuceneSchemaIndex;
import org.neo4j.kernel.api.impl.schema.LuceneSchemaIndexBuilder;
import org.neo4j.kernel.api.index.IndexDescriptor; import org.neo4j.kernel.api.index.IndexDescriptor;
import org.neo4j.kernel.api.index.IndexUpdater; import org.neo4j.kernel.api.index.IndexUpdater;
import org.neo4j.kernel.api.index.NodePropertyUpdate; import org.neo4j.kernel.api.index.NodePropertyUpdate;
Expand All @@ -63,7 +64,7 @@
import static org.neo4j.kernel.api.properties.Property.longProperty; import static org.neo4j.kernel.api.properties.Property.longProperty;
import static org.neo4j.kernel.api.properties.Property.stringProperty; import static org.neo4j.kernel.api.properties.Property.stringProperty;


public class DeferredConstraintVerificationUniqueLuceneIndexPopulatorTest public class UniqueLuceneIndexPopulatorTest
{ {
@Rule @Rule
public final CleanupRule cleanup = new CleanupRule(); public final CleanupRule cleanup = new CleanupRule();
Expand All @@ -81,7 +82,7 @@ public class DeferredConstraintVerificationUniqueLuceneIndexPopulatorTest


private PartitionedIndexStorage indexStorage; private PartitionedIndexStorage indexStorage;
private LuceneSchemaIndex index; private LuceneSchemaIndex index;
private DeferredConstraintVerificationUniqueLuceneIndexPopulator populator; private UniqueLuceneIndexPopulator populator;


@Before @Before
public void setUp() throws Exception public void setUp() throws Exception
Expand Down Expand Up @@ -547,16 +548,15 @@ public void addUpdates() throws Exception
} }
} }


private DeferredConstraintVerificationUniqueLuceneIndexPopulator newPopulator() throws IOException private UniqueLuceneIndexPopulator newPopulator() throws IOException
{ {
DeferredConstraintVerificationUniqueLuceneIndexPopulator populator = UniqueLuceneIndexPopulator populator = new UniqueLuceneIndexPopulator( index, descriptor );
new DeferredConstraintVerificationUniqueLuceneIndexPopulator( index, descriptor );
populator.create(); populator.create();
return populator; return populator;
} }


private static void addUpdate( DeferredConstraintVerificationUniqueLuceneIndexPopulator populator, long nodeId, private static void addUpdate( UniqueLuceneIndexPopulator populator, long nodeId, Object value )
Object value ) throws IOException, IndexEntryConflictException throws IOException, IndexEntryConflictException
{ {
NodePropertyUpdate update = NodePropertyUpdate.add( nodeId, 0, value, new long[]{0} ); NodePropertyUpdate update = NodePropertyUpdate.add( nodeId, 0, value, new long[]{0} );
populator.add( Collections.singletonList( update ) ); populator.add( Collections.singletonList( update ) );
Expand Down

0 comments on commit 05d7a2c

Please sign in to comment.