Skip to content

Commit

Permalink
Refers to LabelIndex setting directly
Browse files Browse the repository at this point in the history
  • Loading branch information
tinwelint committed Jan 31, 2017
1 parent 2325aff commit 067d366
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 19 deletions.
Expand Up @@ -39,7 +39,7 @@
public class NativeLabelScanStoreExtension extends public class NativeLabelScanStoreExtension extends
KernelExtensionFactory<NativeLabelScanStoreExtension.Dependencies> KernelExtensionFactory<NativeLabelScanStoreExtension.Dependencies>
{ {
public static final String LABEL_SCAN_STORE_NAME = LabelIndex.NATIVE.name(); private static final String NAME = LabelIndex.NATIVE.name();
private final LabelScanStore.Monitor monitor; private final LabelScanStore.Monitor monitor;


public interface Dependencies public interface Dependencies
Expand All @@ -60,7 +60,7 @@ public NativeLabelScanStoreExtension()


public NativeLabelScanStoreExtension( LabelScanStore.Monitor monitor ) public NativeLabelScanStoreExtension( LabelScanStore.Monitor monitor )
{ {
super( LABEL_SCAN_STORE_NAME ); super( NAME );
this.monitor = monitor; this.monitor = monitor;
} }


Expand All @@ -75,6 +75,6 @@ public Lifecycle newInstance( KernelContext context, Dependencies dependencies )
new FullLabelStream( dependencies.indexStoreView() ), new FullLabelStream( dependencies.indexStoreView() ),
dependencies.getConfig().get( GraphDatabaseSettings.read_only ), dependencies.getConfig().get( GraphDatabaseSettings.read_only ),
monitor ); monitor );
return new LabelScanStoreProvider( LABEL_SCAN_STORE_NAME, labelScanStore ); return new LabelScanStoreProvider( NAME, labelScanStore );
} }
} }
Expand Up @@ -23,7 +23,7 @@


import org.neo4j.graphdb.LabelScanStoreChaosIT; import org.neo4j.graphdb.LabelScanStoreChaosIT;
import org.neo4j.graphdb.factory.GraphDatabaseBuilder; import org.neo4j.graphdb.factory.GraphDatabaseBuilder;
import org.neo4j.kernel.impl.api.scan.NativeLabelScanStoreExtension; import org.neo4j.graphdb.factory.GraphDatabaseSettings.LabelIndex;
import org.neo4j.test.rule.DatabaseRule.RestartAction; import org.neo4j.test.rule.DatabaseRule.RestartAction;


import static org.neo4j.graphdb.factory.GraphDatabaseSettings.label_index; import static org.neo4j.graphdb.factory.GraphDatabaseSettings.label_index;
Expand All @@ -50,6 +50,6 @@ private static File storeFile( File directory )
@Override @Override
protected void addSpecificConfig( GraphDatabaseBuilder builder ) protected void addSpecificConfig( GraphDatabaseBuilder builder )
{ {
builder.setConfig( label_index, NativeLabelScanStoreExtension.LABEL_SCAN_STORE_NAME ); builder.setConfig( label_index, LabelIndex.NATIVE.name() );
} }
} }
Expand Up @@ -24,8 +24,7 @@


import org.neo4j.graphdb.LabelScanStoreStartupIT; import org.neo4j.graphdb.LabelScanStoreStartupIT;
import org.neo4j.graphdb.factory.GraphDatabaseBuilder; import org.neo4j.graphdb.factory.GraphDatabaseBuilder;
import org.neo4j.kernel.impl.api.scan.NativeLabelScanStoreExtension; import org.neo4j.graphdb.factory.GraphDatabaseSettings.LabelIndex;

import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;


import static org.neo4j.graphdb.factory.GraphDatabaseSettings.label_index; import static org.neo4j.graphdb.factory.GraphDatabaseSettings.label_index;
Expand All @@ -35,7 +34,7 @@ public class NativeLabelScanStoreStartupIT extends LabelScanStoreStartupIT
@Override @Override
protected void addSpecificConfig( GraphDatabaseBuilder builder ) protected void addSpecificConfig( GraphDatabaseBuilder builder )
{ {
builder.setConfig( label_index, NativeLabelScanStoreExtension.LABEL_SCAN_STORE_NAME ); builder.setConfig( label_index, LabelIndex.NATIVE.name() );
} }


@Override @Override
Expand Down
Expand Up @@ -24,7 +24,7 @@
import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.LabelScanStoreUpdateIT; import org.neo4j.graphdb.LabelScanStoreUpdateIT;
import org.neo4j.graphdb.factory.GraphDatabaseBuilder; import org.neo4j.graphdb.factory.GraphDatabaseBuilder;
import org.neo4j.kernel.impl.api.scan.NativeLabelScanStoreExtension; import org.neo4j.graphdb.factory.GraphDatabaseSettings.LabelIndex;
import org.neo4j.test.rule.DatabaseRule; import org.neo4j.test.rule.DatabaseRule;
import org.neo4j.test.rule.ImpermanentDatabaseRule; import org.neo4j.test.rule.ImpermanentDatabaseRule;


Expand All @@ -38,7 +38,7 @@ public class NativeLabelScanStoreUpdateIT extends LabelScanStoreUpdateIT
@Override @Override
protected void configure( GraphDatabaseBuilder builder ) protected void configure( GraphDatabaseBuilder builder )
{ {
builder.setConfig( label_index, NativeLabelScanStoreExtension.LABEL_SCAN_STORE_NAME ); builder.setConfig( label_index, LabelIndex.NATIVE.name() );
} }
}; };


Expand Down
Expand Up @@ -44,7 +44,7 @@
@Service.Implementation(KernelExtensionFactory.class) @Service.Implementation(KernelExtensionFactory.class)
public class LuceneLabelScanStoreExtension extends KernelExtensionFactory<LuceneLabelScanStoreExtension.Dependencies> public class LuceneLabelScanStoreExtension extends KernelExtensionFactory<LuceneLabelScanStoreExtension.Dependencies>
{ {
public static final String LABEL_SCAN_STORE_NAME = LabelIndex.LUCENE.name(); private static final String NAME = LabelIndex.LUCENE.name();


private final Monitor monitor; private final Monitor monitor;


Expand Down Expand Up @@ -90,7 +90,7 @@ public LabelScanStoreProvider newInstance( KernelContext context, Dependencies d
LuceneLabelScanStore scanStore = new LuceneLabelScanStore( indexBuilder, LuceneLabelScanStore scanStore = new LuceneLabelScanStore( indexBuilder,
new FullLabelStream( dependencies.indexStoreView() ), loggingMonitor ); new FullLabelStream( dependencies.indexStoreView() ), loggingMonitor );


return new LabelScanStoreProvider( LABEL_SCAN_STORE_NAME, scanStore ); return new LabelScanStoreProvider( NAME, scanStore );
} }


private LuceneLabelScanIndexBuilder getIndexBuilder( KernelContext context, DirectoryFactory directoryFactory, private LuceneLabelScanIndexBuilder getIndexBuilder( KernelContext context, DirectoryFactory directoryFactory,
Expand Down
Expand Up @@ -25,8 +25,8 @@
import java.util.stream.Stream; import java.util.stream.Stream;


import org.neo4j.graphdb.factory.GraphDatabaseBuilder; import org.neo4j.graphdb.factory.GraphDatabaseBuilder;
import org.neo4j.graphdb.factory.GraphDatabaseSettings.LabelIndex;
import org.neo4j.kernel.api.impl.labelscan.LuceneLabelScanIndexBuilder; import org.neo4j.kernel.api.impl.labelscan.LuceneLabelScanIndexBuilder;
import org.neo4j.kernel.api.impl.labelscan.LuceneLabelScanStoreExtension;
import org.neo4j.test.rule.DatabaseRule; import org.neo4j.test.rule.DatabaseRule;


import static java.util.stream.Collectors.toList; import static java.util.stream.Collectors.toList;
Expand Down Expand Up @@ -82,6 +82,6 @@ private List<File> labelScanStoreIndexDirectories( File storeDirectory )
@Override @Override
protected void addSpecificConfig( GraphDatabaseBuilder builder ) protected void addSpecificConfig( GraphDatabaseBuilder builder )
{ {
builder.setConfig( label_index, LuceneLabelScanStoreExtension.LABEL_SCAN_STORE_NAME ); builder.setConfig( label_index, LabelIndex.LUCENE.name() );
} }
} }
Expand Up @@ -26,9 +26,8 @@
import java.util.stream.Stream; import java.util.stream.Stream;


import org.neo4j.graphdb.factory.GraphDatabaseBuilder; import org.neo4j.graphdb.factory.GraphDatabaseBuilder;
import org.neo4j.graphdb.factory.GraphDatabaseSettings.LabelIndex;
import org.neo4j.kernel.api.impl.labelscan.LuceneLabelScanIndexBuilder; import org.neo4j.kernel.api.impl.labelscan.LuceneLabelScanIndexBuilder;
import org.neo4j.kernel.api.impl.labelscan.LuceneLabelScanStoreExtension;

import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;


import static java.util.stream.Collectors.toList; import static java.util.stream.Collectors.toList;
Expand All @@ -41,7 +40,7 @@ public class LuceneLabelScanStoreStartupIT extends LabelScanStoreStartupIT
@Override @Override
protected void addSpecificConfig( GraphDatabaseBuilder builder ) protected void addSpecificConfig( GraphDatabaseBuilder builder )
{ {
builder.setConfig( label_index, LuceneLabelScanStoreExtension.LABEL_SCAN_STORE_NAME ); builder.setConfig( label_index, LabelIndex.LUCENE.name() );
} }


private List<File> labelScanStoreIndexDirectories( File storeDirectory ) private List<File> labelScanStoreIndexDirectories( File storeDirectory )
Expand Down
Expand Up @@ -22,7 +22,7 @@
import org.junit.ClassRule; import org.junit.ClassRule;


import org.neo4j.graphdb.factory.GraphDatabaseBuilder; import org.neo4j.graphdb.factory.GraphDatabaseBuilder;
import org.neo4j.kernel.api.impl.labelscan.LuceneLabelScanStoreExtension; import org.neo4j.graphdb.factory.GraphDatabaseSettings.LabelIndex;
import org.neo4j.test.rule.DatabaseRule; import org.neo4j.test.rule.DatabaseRule;
import org.neo4j.test.rule.ImpermanentDatabaseRule; import org.neo4j.test.rule.ImpermanentDatabaseRule;


Expand All @@ -36,7 +36,7 @@ public class LuceneLabelScanStoreUpdateIT extends LabelScanStoreUpdateIT
@Override @Override
protected void configure( GraphDatabaseBuilder builder ) protected void configure( GraphDatabaseBuilder builder )
{ {
builder.setConfig( label_index, LuceneLabelScanStoreExtension.LABEL_SCAN_STORE_NAME ); builder.setConfig( label_index, LabelIndex.LUCENE.name() );
} }
}; };


Expand Down

0 comments on commit 067d366

Please sign in to comment.