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
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;

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

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

Expand All @@ -75,6 +75,6 @@ public Lifecycle newInstance( KernelContext context, Dependencies dependencies )
new FullLabelStream( dependencies.indexStoreView() ),
dependencies.getConfig().get( GraphDatabaseSettings.read_only ),
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.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 static org.neo4j.graphdb.factory.GraphDatabaseSettings.label_index;
Expand All @@ -50,6 +50,6 @@ private static File storeFile( File directory )
@Override
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.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.neo4j.graphdb.factory.GraphDatabaseSettings.label_index;
Expand All @@ -35,7 +34,7 @@ public class NativeLabelScanStoreStartupIT extends LabelScanStoreStartupIT
@Override
protected void addSpecificConfig( GraphDatabaseBuilder builder )
{
builder.setConfig( label_index, NativeLabelScanStoreExtension.LABEL_SCAN_STORE_NAME );
builder.setConfig( label_index, LabelIndex.NATIVE.name() );
}

@Override
Expand Down
Expand Up @@ -24,7 +24,7 @@
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.LabelScanStoreUpdateIT;
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.ImpermanentDatabaseRule;

Expand All @@ -38,7 +38,7 @@ public class NativeLabelScanStoreUpdateIT extends LabelScanStoreUpdateIT
@Override
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)
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;

Expand Down Expand Up @@ -90,7 +90,7 @@ public LabelScanStoreProvider newInstance( KernelContext context, Dependencies d
LuceneLabelScanStore scanStore = new LuceneLabelScanStore( indexBuilder,
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,
Expand Down
Expand Up @@ -25,8 +25,8 @@
import java.util.stream.Stream;

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.LuceneLabelScanStoreExtension;
import org.neo4j.test.rule.DatabaseRule;

import static java.util.stream.Collectors.toList;
Expand Down Expand Up @@ -82,6 +82,6 @@ private List<File> labelScanStoreIndexDirectories( File storeDirectory )
@Override
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 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.LuceneLabelScanStoreExtension;

import static org.junit.Assert.assertTrue;

import static java.util.stream.Collectors.toList;
Expand All @@ -41,7 +40,7 @@ public class LuceneLabelScanStoreStartupIT extends LabelScanStoreStartupIT
@Override
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 )
Expand Down
Expand Up @@ -22,7 +22,7 @@
import org.junit.ClassRule;

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.ImpermanentDatabaseRule;

Expand All @@ -36,7 +36,7 @@ public class LuceneLabelScanStoreUpdateIT extends LabelScanStoreUpdateIT
@Override
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.