Skip to content

Commit

Permalink
Remove IndexSamplingConfig from NativeIndexProvider with friends
Browse files Browse the repository at this point in the history
  • Loading branch information
burqen committed Sep 20, 2018
1 parent efcfe8e commit 25316bc
Show file tree
Hide file tree
Showing 59 changed files with 151 additions and 260 deletions.
Expand Up @@ -29,7 +29,6 @@
import org.neo4j.io.pagecache.IOLimiter; import org.neo4j.io.pagecache.IOLimiter;
import org.neo4j.io.pagecache.PageCache; import org.neo4j.io.pagecache.PageCache;
import org.neo4j.kernel.api.index.IndexProvider; import org.neo4j.kernel.api.index.IndexProvider;
import org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig;
import org.neo4j.kernel.impl.index.schema.config.IndexSpecificSpaceFillingCurveSettingsCache; import org.neo4j.kernel.impl.index.schema.config.IndexSpecificSpaceFillingCurveSettingsCache;
import org.neo4j.kernel.impl.index.schema.config.SpaceFillingCurveSettingsWriter; import org.neo4j.kernel.impl.index.schema.config.SpaceFillingCurveSettingsWriter;
import org.neo4j.kernel.impl.util.Validator; import org.neo4j.kernel.impl.util.Validator;
Expand All @@ -45,10 +44,9 @@ class GenericNativeIndexAccessor extends NativeIndexAccessor<CompositeGenericKey


GenericNativeIndexAccessor( PageCache pageCache, FileSystemAbstraction fs, File storeFile, IndexLayout<CompositeGenericKey,NativeIndexValue> layout, GenericNativeIndexAccessor( PageCache pageCache, FileSystemAbstraction fs, File storeFile, IndexLayout<CompositeGenericKey,NativeIndexValue> layout,
RecoveryCleanupWorkCollector recoveryCleanupWorkCollector, IndexProvider.Monitor monitor, StoreIndexDescriptor descriptor, RecoveryCleanupWorkCollector recoveryCleanupWorkCollector, IndexProvider.Monitor monitor, StoreIndexDescriptor descriptor,
IndexSamplingConfig samplingConfig, IndexSpecificSpaceFillingCurveSettingsCache spaceFillingCurveSettings, IndexSpecificSpaceFillingCurveSettingsCache spaceFillingCurveSettings, SpaceFillingCurveConfiguration configuration ) throws IOException
SpaceFillingCurveConfiguration configuration ) throws IOException
{ {
super( pageCache, fs, storeFile, layout, recoveryCleanupWorkCollector, monitor, descriptor, samplingConfig, super( pageCache, fs, storeFile, layout, recoveryCleanupWorkCollector, monitor, descriptor,
new SpaceFillingCurveSettingsWriter( spaceFillingCurveSettings ) ); new SpaceFillingCurveSettingsWriter( spaceFillingCurveSettings ) );
this.spaceFillingCurveSettings = spaceFillingCurveSettings; this.spaceFillingCurveSettings = spaceFillingCurveSettings;
this.configuration = configuration; this.configuration = configuration;
Expand All @@ -64,7 +62,7 @@ protected void afterTreeInstantiation( GBPTree<CompositeGenericKey,NativeIndexVa
@Override @Override
public IndexReader newReader() public IndexReader newReader()
{ {
return new GenericNativeIndexReader( tree, layout, samplingConfig, descriptor, spaceFillingCurveSettings, configuration ); return new GenericNativeIndexReader( tree, layout, descriptor, spaceFillingCurveSettings, configuration );
} }


@Override @Override
Expand Down
Expand Up @@ -22,11 +22,9 @@
import java.io.File; import java.io.File;


import org.neo4j.gis.spatial.index.curves.SpaceFillingCurveConfiguration; import org.neo4j.gis.spatial.index.curves.SpaceFillingCurveConfiguration;
import org.neo4j.index.internal.gbptree.Layout;
import org.neo4j.io.fs.FileSystemAbstraction; import org.neo4j.io.fs.FileSystemAbstraction;
import org.neo4j.io.pagecache.PageCache; import org.neo4j.io.pagecache.PageCache;
import org.neo4j.kernel.api.index.IndexProvider; import org.neo4j.kernel.api.index.IndexProvider;
import org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig;
import org.neo4j.kernel.impl.index.schema.config.IndexSpecificSpaceFillingCurveSettingsCache; import org.neo4j.kernel.impl.index.schema.config.IndexSpecificSpaceFillingCurveSettingsCache;
import org.neo4j.kernel.impl.index.schema.config.SpaceFillingCurveSettingsWriter; import org.neo4j.kernel.impl.index.schema.config.SpaceFillingCurveSettingsWriter;
import org.neo4j.storageengine.api.schema.IndexReader; import org.neo4j.storageengine.api.schema.IndexReader;
Expand All @@ -38,17 +36,17 @@ class GenericNativeIndexPopulator extends NativeIndexPopulator<CompositeGenericK
private final SpaceFillingCurveConfiguration configuration; private final SpaceFillingCurveConfiguration configuration;


GenericNativeIndexPopulator( PageCache pageCache, FileSystemAbstraction fs, File storeFile, IndexLayout<CompositeGenericKey,NativeIndexValue> layout, GenericNativeIndexPopulator( PageCache pageCache, FileSystemAbstraction fs, File storeFile, IndexLayout<CompositeGenericKey,NativeIndexValue> layout,
IndexProvider.Monitor monitor, StoreIndexDescriptor descriptor, IndexSamplingConfig samplingConfig, IndexProvider.Monitor monitor, StoreIndexDescriptor descriptor, IndexSpecificSpaceFillingCurveSettingsCache spatialSettings,
IndexSpecificSpaceFillingCurveSettingsCache spatialSettings, SpaceFillingCurveConfiguration configuration ) SpaceFillingCurveConfiguration configuration )
{ {
super( pageCache, fs, storeFile, layout, monitor, descriptor, samplingConfig, new SpaceFillingCurveSettingsWriter( spatialSettings ) ); super( pageCache, fs, storeFile, layout, monitor, descriptor, new SpaceFillingCurveSettingsWriter( spatialSettings ) );
this.spatialSettings = spatialSettings; this.spatialSettings = spatialSettings;
this.configuration = configuration; this.configuration = configuration;
} }


@Override @Override
IndexReader newReader() IndexReader newReader()
{ {
return new GenericNativeIndexReader( tree, layout, samplingConfig, descriptor, spatialSettings, configuration ); return new GenericNativeIndexReader( tree, layout, descriptor, spatialSettings, configuration );
} }
} }
Expand Up @@ -40,7 +40,6 @@
import org.neo4j.kernel.api.index.IndexDirectoryStructure; import org.neo4j.kernel.api.index.IndexDirectoryStructure;
import org.neo4j.kernel.api.index.IndexPopulator; import org.neo4j.kernel.api.index.IndexPopulator;
import org.neo4j.kernel.configuration.Config; import org.neo4j.kernel.configuration.Config;
import org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig;
import org.neo4j.kernel.impl.index.schema.config.ConfiguredSpaceFillingCurveSettingsCache; import org.neo4j.kernel.impl.index.schema.config.ConfiguredSpaceFillingCurveSettingsCache;
import org.neo4j.kernel.impl.index.schema.config.IndexSpecificSpaceFillingCurveSettingsCache; import org.neo4j.kernel.impl.index.schema.config.IndexSpecificSpaceFillingCurveSettingsCache;
import org.neo4j.kernel.impl.index.schema.config.SpaceFillingCurveSettings; import org.neo4j.kernel.impl.index.schema.config.SpaceFillingCurveSettings;
Expand Down Expand Up @@ -153,18 +152,16 @@ GenericLayout layout( StoreIndexDescriptor descriptor, File storeFile )
} }


@Override @Override
protected IndexPopulator newIndexPopulator( File storeFile, GenericLayout layout, StoreIndexDescriptor descriptor, protected IndexPopulator newIndexPopulator( File storeFile, GenericLayout layout, StoreIndexDescriptor descriptor )
IndexSamplingConfig samplingConfig )
{ {
return new GenericNativeIndexPopulator( pageCache, fs, storeFile, layout, monitor, descriptor, samplingConfig, return new GenericNativeIndexPopulator( pageCache, fs, storeFile, layout, monitor, descriptor,
layout.getSpaceFillingCurveSettings(), configuration ); layout.getSpaceFillingCurveSettings(), configuration );
} }


@Override @Override
protected IndexAccessor newIndexAccessor( File storeFile, GenericLayout layout, StoreIndexDescriptor descriptor, protected IndexAccessor newIndexAccessor( File storeFile, GenericLayout layout, StoreIndexDescriptor descriptor ) throws IOException
IndexSamplingConfig samplingConfig ) throws IOException
{ {
return new GenericNativeIndexAccessor( pageCache, fs, storeFile, layout, recoveryCleanupWorkCollector, monitor, descriptor, samplingConfig, return new GenericNativeIndexAccessor( pageCache, fs, storeFile, layout, recoveryCleanupWorkCollector, monitor, descriptor,
layout.getSpaceFillingCurveSettings(), configuration ); layout.getSpaceFillingCurveSettings(), configuration );
} }


Expand Down
Expand Up @@ -29,7 +29,6 @@
import org.neo4j.internal.kernel.api.IndexQuery.ExactPredicate; import org.neo4j.internal.kernel.api.IndexQuery.ExactPredicate;
import org.neo4j.internal.kernel.api.IndexQuery.RangePredicate; import org.neo4j.internal.kernel.api.IndexQuery.RangePredicate;
import org.neo4j.internal.kernel.api.IndexQuery.StringPrefixPredicate; import org.neo4j.internal.kernel.api.IndexQuery.StringPrefixPredicate;
import org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig;
import org.neo4j.kernel.impl.api.schema.BridgingIndexProgressor; import org.neo4j.kernel.impl.api.schema.BridgingIndexProgressor;
import org.neo4j.kernel.impl.index.schema.config.IndexSpecificSpaceFillingCurveSettingsCache; import org.neo4j.kernel.impl.index.schema.config.IndexSpecificSpaceFillingCurveSettingsCache;
import org.neo4j.storageengine.api.schema.IndexDescriptor; import org.neo4j.storageengine.api.schema.IndexDescriptor;
Expand All @@ -49,10 +48,10 @@ class GenericNativeIndexReader extends NativeIndexReader<CompositeGenericKey,Nat
private final SpaceFillingCurveConfiguration configuration; private final SpaceFillingCurveConfiguration configuration;


GenericNativeIndexReader( GBPTree<CompositeGenericKey,NativeIndexValue> tree, IndexLayout<CompositeGenericKey,NativeIndexValue> layout, GenericNativeIndexReader( GBPTree<CompositeGenericKey,NativeIndexValue> tree, IndexLayout<CompositeGenericKey,NativeIndexValue> layout,
IndexSamplingConfig samplingConfig, IndexDescriptor descriptor, IndexSpecificSpaceFillingCurveSettingsCache spaceFillingCurveSettings, IndexDescriptor descriptor, IndexSpecificSpaceFillingCurveSettingsCache spaceFillingCurveSettings,
SpaceFillingCurveConfiguration configuration ) SpaceFillingCurveConfiguration configuration )
{ {
super( tree, layout, samplingConfig, descriptor ); super( tree, layout, descriptor );
this.spaceFillingCurveSettings = spaceFillingCurveSettings; this.spaceFillingCurveSettings = spaceFillingCurveSettings;
this.configuration = configuration; this.configuration = configuration;
} }
Expand Down
Expand Up @@ -35,7 +35,6 @@
import org.neo4j.kernel.api.index.IndexProvider; import org.neo4j.kernel.api.index.IndexProvider;
import org.neo4j.kernel.api.index.NodePropertyAccessor; import org.neo4j.kernel.api.index.NodePropertyAccessor;
import org.neo4j.kernel.impl.api.index.IndexUpdateMode; import org.neo4j.kernel.impl.api.index.IndexUpdateMode;
import org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig;
import org.neo4j.storageengine.api.schema.IndexReader; import org.neo4j.storageengine.api.schema.IndexReader;
import org.neo4j.storageengine.api.schema.StoreIndexDescriptor; import org.neo4j.storageengine.api.schema.StoreIndexDescriptor;


Expand All @@ -47,16 +46,14 @@ public abstract class NativeIndexAccessor<KEY extends NativeIndexKey<KEY>, VALUE
implements IndexAccessor implements IndexAccessor
{ {
private final NativeIndexUpdater<KEY,VALUE> singleUpdater; private final NativeIndexUpdater<KEY,VALUE> singleUpdater;
final IndexSamplingConfig samplingConfig;
final NativeIndexHeaderWriter headerWriter; final NativeIndexHeaderWriter headerWriter;


NativeIndexAccessor( PageCache pageCache, FileSystemAbstraction fs, File storeFile, IndexLayout<KEY,VALUE> layout, NativeIndexAccessor( PageCache pageCache, FileSystemAbstraction fs, File storeFile, IndexLayout<KEY,VALUE> layout,
RecoveryCleanupWorkCollector recoveryCleanupWorkCollector, IndexProvider.Monitor monitor, StoreIndexDescriptor descriptor, RecoveryCleanupWorkCollector recoveryCleanupWorkCollector, IndexProvider.Monitor monitor, StoreIndexDescriptor descriptor,
IndexSamplingConfig samplingConfig, Consumer<PageCursor> additionalHeaderWriter ) throws IOException Consumer<PageCursor> additionalHeaderWriter ) throws IOException
{ {
super( pageCache, fs, storeFile, layout, monitor, descriptor ); super( pageCache, fs, storeFile, layout, monitor, descriptor );
singleUpdater = new NativeIndexUpdater<>( layout.newKey(), layout.newValue() ); singleUpdater = new NativeIndexUpdater<>( layout.newKey(), layout.newValue() );
this.samplingConfig = samplingConfig;
headerWriter = new NativeIndexHeaderWriter( BYTE_ONLINE, additionalHeaderWriter ); headerWriter = new NativeIndexHeaderWriter( BYTE_ONLINE, additionalHeaderWriter );
} }


Expand Down
Expand Up @@ -44,7 +44,6 @@
import org.neo4j.kernel.api.index.IndexProvider; import org.neo4j.kernel.api.index.IndexProvider;
import org.neo4j.kernel.api.index.IndexUpdater; import org.neo4j.kernel.api.index.IndexUpdater;
import org.neo4j.kernel.api.index.NodePropertyAccessor; import org.neo4j.kernel.api.index.NodePropertyAccessor;
import org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig;
import org.neo4j.kernel.impl.api.index.sampling.UniqueIndexSampler; import org.neo4j.kernel.impl.api.index.sampling.UniqueIndexSampler;
import org.neo4j.storageengine.api.schema.IndexReader; import org.neo4j.storageengine.api.schema.IndexReader;
import org.neo4j.storageengine.api.schema.IndexSample; import org.neo4j.storageengine.api.schema.IndexSample;
Expand Down Expand Up @@ -72,7 +71,6 @@ public abstract class NativeIndexPopulator<KEY extends NativeIndexKey<KEY>, VALU
private final KEY treeKey; private final KEY treeKey;
private final VALUE treeValue; private final VALUE treeValue;
private final UniqueIndexSampler uniqueSampler; private final UniqueIndexSampler uniqueSampler;
final IndexSamplingConfig samplingConfig;
private final Consumer<PageCursor> additionalHeaderWriter; private final Consumer<PageCursor> additionalHeaderWriter;


private WorkSync<IndexUpdateApply<KEY,VALUE>,IndexUpdateWork<KEY,VALUE>> additionsWorkSync; private WorkSync<IndexUpdateApply<KEY,VALUE>,IndexUpdateWork<KEY,VALUE>> additionsWorkSync;
Expand All @@ -83,12 +81,11 @@ public abstract class NativeIndexPopulator<KEY extends NativeIndexKey<KEY>, VALU
private boolean closed; private boolean closed;


NativeIndexPopulator( PageCache pageCache, FileSystemAbstraction fs, File storeFile, IndexLayout<KEY,VALUE> layout, IndexProvider.Monitor monitor, NativeIndexPopulator( PageCache pageCache, FileSystemAbstraction fs, File storeFile, IndexLayout<KEY,VALUE> layout, IndexProvider.Monitor monitor,
StoreIndexDescriptor descriptor, IndexSamplingConfig samplingConfig, Consumer<PageCursor> additionalHeaderWriter ) StoreIndexDescriptor descriptor, Consumer<PageCursor> additionalHeaderWriter )
{ {
super( pageCache, fs, storeFile, layout, monitor, descriptor ); super( pageCache, fs, storeFile, layout, monitor, descriptor );
this.treeKey = layout.newKey(); this.treeKey = layout.newKey();
this.treeValue = layout.newValue(); this.treeValue = layout.newValue();
this.samplingConfig = samplingConfig;
this.additionalHeaderWriter = additionalHeaderWriter; this.additionalHeaderWriter = additionalHeaderWriter;
switch ( descriptor.type() ) switch ( descriptor.type() )
{ {
Expand Down
Expand Up @@ -75,21 +75,19 @@ public IndexPopulator getPopulator( StoreIndexDescriptor descriptor, IndexSampli
} }


File storeFile = nativeIndexFileFromIndexId( descriptor.getId() ); File storeFile = nativeIndexFileFromIndexId( descriptor.getId() );
return newIndexPopulator( storeFile, layout( descriptor, storeFile ), descriptor, samplingConfig ); return newIndexPopulator( storeFile, layout( descriptor, storeFile ), descriptor );
} }


protected abstract IndexPopulator newIndexPopulator( File storeFile, LAYOUT layout, StoreIndexDescriptor descriptor, protected abstract IndexPopulator newIndexPopulator( File storeFile, LAYOUT layout, StoreIndexDescriptor descriptor );
IndexSamplingConfig samplingConfig );


@Override @Override
public IndexAccessor getOnlineAccessor( StoreIndexDescriptor descriptor, IndexSamplingConfig samplingConfig ) throws IOException public IndexAccessor getOnlineAccessor( StoreIndexDescriptor descriptor, IndexSamplingConfig samplingConfig ) throws IOException
{ {
File storeFile = nativeIndexFileFromIndexId( descriptor.getId() ); File storeFile = nativeIndexFileFromIndexId( descriptor.getId() );
return newIndexAccessor( storeFile, layout( descriptor, storeFile ), descriptor, samplingConfig ); return newIndexAccessor( storeFile, layout( descriptor, storeFile ), descriptor );
} }


protected abstract IndexAccessor newIndexAccessor( File storeFile, LAYOUT layout, StoreIndexDescriptor descriptor, protected abstract IndexAccessor newIndexAccessor( File storeFile, LAYOUT layout, StoreIndexDescriptor descriptor ) throws IOException;
IndexSamplingConfig samplingConfig ) throws IOException;


@Override @Override
public String getPopulationFailure( StoreIndexDescriptor descriptor ) throws IllegalStateException public String getPopulationFailure( StoreIndexDescriptor descriptor ) throws IllegalStateException
Expand Down
Expand Up @@ -31,7 +31,6 @@
import org.neo4j.internal.kernel.api.IndexOrder; import org.neo4j.internal.kernel.api.IndexOrder;
import org.neo4j.internal.kernel.api.IndexQuery; import org.neo4j.internal.kernel.api.IndexQuery;
import org.neo4j.io.IOUtils; import org.neo4j.io.IOUtils;
import org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig;
import org.neo4j.storageengine.api.schema.IndexDescriptor; import org.neo4j.storageengine.api.schema.IndexDescriptor;
import org.neo4j.storageengine.api.schema.IndexProgressor; import org.neo4j.storageengine.api.schema.IndexProgressor;
import org.neo4j.storageengine.api.schema.IndexReader; import org.neo4j.storageengine.api.schema.IndexReader;
Expand All @@ -48,15 +47,11 @@ abstract class NativeIndexReader<KEY extends NativeIndexKey<KEY>, VALUE extends
final IndexLayout<KEY,VALUE> layout; final IndexLayout<KEY,VALUE> layout;
final Set<RawCursor<Hit<KEY,VALUE>,IOException>> openSeekers; final Set<RawCursor<Hit<KEY,VALUE>,IOException>> openSeekers;
private final GBPTree<KEY,VALUE> tree; private final GBPTree<KEY,VALUE> tree;
private final IndexSamplingConfig samplingConfig;


NativeIndexReader( GBPTree<KEY,VALUE> tree, IndexLayout<KEY,VALUE> layout, NativeIndexReader( GBPTree<KEY,VALUE> tree, IndexLayout<KEY,VALUE> layout, IndexDescriptor descriptor )
IndexSamplingConfig samplingConfig,
IndexDescriptor descriptor )
{ {
this.tree = tree; this.tree = tree;
this.layout = layout; this.layout = layout;
this.samplingConfig = samplingConfig;
this.descriptor = descriptor; this.descriptor = descriptor;
this.openSeekers = new HashSet<>(); this.openSeekers = new HashSet<>();
} }
Expand Down
Expand Up @@ -26,7 +26,6 @@
import org.neo4j.io.fs.FileSystemAbstraction; import org.neo4j.io.fs.FileSystemAbstraction;
import org.neo4j.io.pagecache.PageCache; import org.neo4j.io.pagecache.PageCache;
import org.neo4j.kernel.api.index.IndexProvider; import org.neo4j.kernel.api.index.IndexProvider;
import org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig;
import org.neo4j.storageengine.api.schema.IndexReader; import org.neo4j.storageengine.api.schema.IndexReader;
import org.neo4j.storageengine.api.schema.StoreIndexDescriptor; import org.neo4j.storageengine.api.schema.StoreIndexDescriptor;


Expand All @@ -35,17 +34,16 @@
public class NumberIndexAccessor extends NativeIndexAccessor<NumberIndexKey,NativeIndexValue> public class NumberIndexAccessor extends NativeIndexAccessor<NumberIndexKey,NativeIndexValue>
{ {
NumberIndexAccessor( PageCache pageCache, FileSystemAbstraction fs, File storeFile, IndexLayout<NumberIndexKey,NativeIndexValue> layout, NumberIndexAccessor( PageCache pageCache, FileSystemAbstraction fs, File storeFile, IndexLayout<NumberIndexKey,NativeIndexValue> layout,
RecoveryCleanupWorkCollector recoveryCleanupWorkCollector, IndexProvider.Monitor monitor, StoreIndexDescriptor descriptor, RecoveryCleanupWorkCollector recoveryCleanupWorkCollector, IndexProvider.Monitor monitor, StoreIndexDescriptor descriptor ) throws IOException
IndexSamplingConfig samplingConfig ) throws IOException
{ {
super( pageCache, fs, storeFile, layout, recoveryCleanupWorkCollector, monitor, descriptor, samplingConfig, NO_HEADER_WRITER ); super( pageCache, fs, storeFile, layout, recoveryCleanupWorkCollector, monitor, descriptor, NO_HEADER_WRITER );
instantiateTree( recoveryCleanupWorkCollector, headerWriter ); instantiateTree( recoveryCleanupWorkCollector, headerWriter );
} }


@Override @Override
public IndexReader newReader() public IndexReader newReader()
{ {
assertOpen(); assertOpen();
return new NumberIndexReader<>( tree, layout, samplingConfig, descriptor ); return new NumberIndexReader<>( tree, layout, descriptor );
} }
} }
Expand Up @@ -24,7 +24,6 @@
import org.neo4j.io.fs.FileSystemAbstraction; import org.neo4j.io.fs.FileSystemAbstraction;
import org.neo4j.io.pagecache.PageCache; import org.neo4j.io.pagecache.PageCache;
import org.neo4j.kernel.api.index.IndexProvider; import org.neo4j.kernel.api.index.IndexProvider;
import org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig;
import org.neo4j.storageengine.api.schema.IndexReader; import org.neo4j.storageengine.api.schema.IndexReader;
import org.neo4j.storageengine.api.schema.StoreIndexDescriptor; import org.neo4j.storageengine.api.schema.StoreIndexDescriptor;


Expand All @@ -33,14 +32,14 @@
class NumberIndexPopulator extends NativeIndexPopulator<NumberIndexKey,NativeIndexValue> class NumberIndexPopulator extends NativeIndexPopulator<NumberIndexKey,NativeIndexValue>
{ {
NumberIndexPopulator( PageCache pageCache, FileSystemAbstraction fs, File storeFile, IndexLayout<NumberIndexKey,NativeIndexValue> layout, NumberIndexPopulator( PageCache pageCache, FileSystemAbstraction fs, File storeFile, IndexLayout<NumberIndexKey,NativeIndexValue> layout,
IndexProvider.Monitor monitor, StoreIndexDescriptor descriptor, IndexSamplingConfig samplingConfig ) IndexProvider.Monitor monitor, StoreIndexDescriptor descriptor )
{ {
super( pageCache, fs, storeFile, layout, monitor, descriptor, samplingConfig, NO_HEADER_WRITER ); super( pageCache, fs, storeFile, layout, monitor, descriptor, NO_HEADER_WRITER );
} }


@Override @Override
IndexReader newReader() IndexReader newReader()
{ {
return new NumberIndexReader<>( tree, layout, samplingConfig, descriptor ); return new NumberIndexReader<>( tree, layout, descriptor );
} }
} }
Expand Up @@ -33,7 +33,6 @@
import org.neo4j.kernel.api.index.IndexAccessor; import org.neo4j.kernel.api.index.IndexAccessor;
import org.neo4j.kernel.api.index.IndexDirectoryStructure; import org.neo4j.kernel.api.index.IndexDirectoryStructure;
import org.neo4j.kernel.api.index.IndexPopulator; import org.neo4j.kernel.api.index.IndexPopulator;
import org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig;
import org.neo4j.storageengine.api.schema.StoreIndexDescriptor; import org.neo4j.storageengine.api.schema.StoreIndexDescriptor;
import org.neo4j.values.storable.ValueCategory; import org.neo4j.values.storable.ValueCategory;


Expand All @@ -46,9 +45,8 @@ public class NumberIndexProvider extends NativeIndexProvider<NumberIndexKey,Nati
public static final IndexProviderDescriptor NATIVE_PROVIDER_DESCRIPTOR = new IndexProviderDescriptor( KEY, "1.0" ); public static final IndexProviderDescriptor NATIVE_PROVIDER_DESCRIPTOR = new IndexProviderDescriptor( KEY, "1.0" );
static final IndexCapability CAPABILITY = new NumberIndexCapability(); static final IndexCapability CAPABILITY = new NumberIndexCapability();


public NumberIndexProvider( PageCache pageCache, FileSystemAbstraction fs, public NumberIndexProvider( PageCache pageCache, FileSystemAbstraction fs, IndexDirectoryStructure.Factory directoryStructure, Monitor monitor,
IndexDirectoryStructure.Factory directoryStructure, Monitor monitor, RecoveryCleanupWorkCollector recoveryCleanupWorkCollector, RecoveryCleanupWorkCollector recoveryCleanupWorkCollector, boolean readOnly )
boolean readOnly )
{ {
super( NATIVE_PROVIDER_DESCRIPTOR, 0, directoryStructure, pageCache, fs, monitor, recoveryCleanupWorkCollector, readOnly ); super( NATIVE_PROVIDER_DESCRIPTOR, 0, directoryStructure, pageCache, fs, monitor, recoveryCleanupWorkCollector, readOnly );
} }
Expand All @@ -69,18 +67,15 @@ NumberLayout layout( StoreIndexDescriptor descriptor, File storeFile )
} }


@Override @Override
protected IndexPopulator newIndexPopulator( File storeFile, NumberLayout layout, StoreIndexDescriptor descriptor, protected IndexPopulator newIndexPopulator( File storeFile, NumberLayout layout, StoreIndexDescriptor descriptor )
IndexSamplingConfig samplingConfig )
{ {
return new NumberIndexPopulator( pageCache, fs, storeFile, layout, monitor, descriptor, samplingConfig ); return new NumberIndexPopulator( pageCache, fs, storeFile, layout, monitor, descriptor );
} }


@Override @Override
protected IndexAccessor newIndexAccessor( File storeFile, NumberLayout layout, StoreIndexDescriptor descriptor, protected IndexAccessor newIndexAccessor( File storeFile, NumberLayout layout, StoreIndexDescriptor descriptor ) throws IOException
IndexSamplingConfig samplingConfig ) throws IOException
{ {
return new NumberIndexAccessor( pageCache, fs, storeFile, layout, recoveryCleanupWorkCollector, monitor, descriptor, return new NumberIndexAccessor( pageCache, fs, storeFile, layout, recoveryCleanupWorkCollector, monitor, descriptor );
samplingConfig );
} }


@Override @Override
Expand Down
Expand Up @@ -24,18 +24,16 @@
import org.neo4j.internal.kernel.api.IndexQuery; import org.neo4j.internal.kernel.api.IndexQuery;
import org.neo4j.internal.kernel.api.IndexQuery.ExactPredicate; import org.neo4j.internal.kernel.api.IndexQuery.ExactPredicate;
import org.neo4j.internal.kernel.api.IndexQuery.RangePredicate; import org.neo4j.internal.kernel.api.IndexQuery.RangePredicate;
import org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig;
import org.neo4j.storageengine.api.schema.IndexDescriptor; import org.neo4j.storageengine.api.schema.IndexDescriptor;
import org.neo4j.values.storable.Value; import org.neo4j.values.storable.Value;
import org.neo4j.values.storable.ValueGroup; import org.neo4j.values.storable.ValueGroup;
import org.neo4j.values.storable.Values; import org.neo4j.values.storable.Values;


class NumberIndexReader<VALUE extends NativeIndexValue> extends NativeIndexReader<NumberIndexKey,VALUE> class NumberIndexReader<VALUE extends NativeIndexValue> extends NativeIndexReader<NumberIndexKey,VALUE>
{ {
NumberIndexReader( GBPTree<NumberIndexKey,VALUE> tree, IndexLayout<NumberIndexKey,VALUE> layout, NumberIndexReader( GBPTree<NumberIndexKey,VALUE> tree, IndexLayout<NumberIndexKey,VALUE> layout, IndexDescriptor descriptor )
IndexSamplingConfig samplingConfig, IndexDescriptor descriptor )
{ {
super( tree, layout, samplingConfig, descriptor ); super( tree, layout, descriptor );
} }


@Override @Override
Expand Down

0 comments on commit 25316bc

Please sign in to comment.