Skip to content

Commit

Permalink
Cheaper sampling for native index population
Browse files Browse the repository at this point in the history
By doing one pass over the raw index keys in the end
instead of keeping a map of unique values where both
the map as well as materializing the values into it
are expensive.
  • Loading branch information
tinwelint committed Aug 29, 2018
1 parent 2a78edd commit 041911f
Show file tree
Hide file tree
Showing 50 changed files with 91 additions and 144 deletions.
Expand Up @@ -25,7 +25,7 @@
/** /**
* {@link Layout} for dates. * {@link Layout} for dates.
*/ */
class DateLayout extends IndexLayout<DateIndexKey> class DateLayout extends IndexLayout<DateIndexKey,NativeIndexValue>
{ {
DateLayout() DateLayout()
{ {
Expand Down
Expand Up @@ -25,7 +25,7 @@
/** /**
* {@link Layout} for durations. * {@link Layout} for durations.
*/ */
class DurationLayout extends IndexLayout<DurationIndexKey> class DurationLayout extends IndexLayout<DurationIndexKey,NativeIndexValue>
{ {
DurationLayout() DurationLayout()
{ {
Expand Down
Expand Up @@ -25,9 +25,6 @@
import org.neo4j.cursor.RawCursor; import org.neo4j.cursor.RawCursor;
import org.neo4j.index.internal.gbptree.GBPTree; import org.neo4j.index.internal.gbptree.GBPTree;
import org.neo4j.index.internal.gbptree.Hit; import org.neo4j.index.internal.gbptree.Hit;
import org.neo4j.index.internal.gbptree.Layout;
import org.neo4j.kernel.impl.api.index.sampling.DefaultNonUniqueIndexSampler;
import org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig;
import org.neo4j.kernel.impl.api.index.sampling.NonUniqueIndexSampler; import org.neo4j.kernel.impl.api.index.sampling.NonUniqueIndexSampler;
import org.neo4j.storageengine.api.schema.IndexSample; import org.neo4j.storageengine.api.schema.IndexSample;


Expand All @@ -41,15 +38,12 @@ class FullScanNonUniqueIndexSampler<KEY extends NativeIndexKey<KEY>, VALUE exten
extends NonUniqueIndexSampler.Adapter extends NonUniqueIndexSampler.Adapter
{ {
private final GBPTree<KEY,VALUE> gbpTree; private final GBPTree<KEY,VALUE> gbpTree;
private final Layout<KEY,VALUE> layout; private final IndexLayout<KEY,VALUE> layout;
private final IndexSamplingConfig samplingConfig;


FullScanNonUniqueIndexSampler( GBPTree<KEY,VALUE> gbpTree, Layout<KEY,VALUE> layout, FullScanNonUniqueIndexSampler( GBPTree<KEY,VALUE> gbpTree, IndexLayout<KEY,VALUE> layout )
IndexSamplingConfig samplingConfig )
{ {
this.gbpTree = gbpTree; this.gbpTree = gbpTree;
this.layout = layout; this.layout = layout;
this.samplingConfig = samplingConfig;
} }


@Override @Override
Expand All @@ -61,15 +55,33 @@ public IndexSample result()
KEY highest = layout.newKey(); KEY highest = layout.newKey();
highest.initialize( Long.MAX_VALUE ); highest.initialize( Long.MAX_VALUE );
highest.initValuesAsHighest(); highest.initValuesAsHighest();
KEY prev = layout.newKey();
try ( RawCursor<Hit<KEY,VALUE>,IOException> seek = gbpTree.seek( lowest, highest ) ) try ( RawCursor<Hit<KEY,VALUE>,IOException> seek = gbpTree.seek( lowest, highest ) )
{ {
NonUniqueIndexSampler sampler = new DefaultNonUniqueIndexSampler( samplingConfig.sampleSizeLimit() ); long sampledValues = 0;
while ( seek.next() ) long uniqueValues = 0;

// Get the first one so that prev gets initialized
if ( seek.next() )
{ {
Hit<KEY,VALUE> hit = seek.get(); prev = layout.copyKey( seek.get().key(), prev );
sampler.include( hit.key().propertiesAsString() ); sampledValues++;
uniqueValues++;

// Then do the rest
while ( seek.next() )
{
Hit<KEY,VALUE> hit = seek.get();
if ( layout.compareValue( prev, hit.key() ) != 0 )
{
uniqueValues++;
layout.copyKey( hit.key(), prev );
}
// else this is a duplicate of the previous one
sampledValues++;
}
} }
return sampler.result(); return new IndexSample( sampledValues, uniqueValues, sampledValues );
} }
catch ( IOException e ) catch ( IOException e )
{ {
Expand Down
Expand Up @@ -28,7 +28,7 @@


import static java.util.Comparator.comparing; import static java.util.Comparator.comparing;


class GenericLayout extends IndexLayout<CompositeGenericKey> class GenericLayout extends IndexLayout<CompositeGenericKey,NativeIndexValue>
{ {
static final Comparator<Type> TYPE_COMPARATOR = comparing( t -> t.valueGroup ); static final Comparator<Type> TYPE_COMPARATOR = comparing( t -> t.valueGroup );
private final int numberOfSlots; private final int numberOfSlots;
Expand Down
Expand Up @@ -23,7 +23,6 @@
import java.io.IOException; import java.io.IOException;


import org.neo4j.index.internal.gbptree.GBPTree; import org.neo4j.index.internal.gbptree.GBPTree;
import org.neo4j.index.internal.gbptree.Layout;
import org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector; import org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector;
import org.neo4j.io.fs.FileSystemAbstraction; import org.neo4j.io.fs.FileSystemAbstraction;
import org.neo4j.io.pagecache.PageCache; import org.neo4j.io.pagecache.PageCache;
Expand All @@ -38,7 +37,7 @@ class GenericNativeIndexAccessor extends NativeIndexAccessor<CompositeGenericKey
{ {
private Validator<Value[]> validator; private Validator<Value[]> validator;


GenericNativeIndexAccessor( PageCache pageCache, FileSystemAbstraction fs, File storeFile, Layout<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 ) throws IOException IndexSamplingConfig samplingConfig ) throws IOException
{ {
Expand Down
Expand Up @@ -21,7 +21,6 @@


import java.io.File; import java.io.File;


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;
Expand All @@ -31,7 +30,7 @@


class GenericNativeIndexPopulator extends NativeIndexPopulator<CompositeGenericKey,NativeIndexValue> class GenericNativeIndexPopulator extends NativeIndexPopulator<CompositeGenericKey,NativeIndexValue>
{ {
GenericNativeIndexPopulator( PageCache pageCache, FileSystemAbstraction fs, File storeFile, Layout<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, IndexSamplingConfig samplingConfig )
{ {
super( pageCache, fs, storeFile, layout, monitor, descriptor, samplingConfig ); super( pageCache, fs, storeFile, layout, monitor, descriptor, samplingConfig );
Expand Down
Expand Up @@ -23,7 +23,6 @@
import java.io.IOException; import java.io.IOException;


import org.neo4j.graphdb.factory.GraphDatabaseSettings; import org.neo4j.graphdb.factory.GraphDatabaseSettings;
import org.neo4j.index.internal.gbptree.Layout;
import org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector; import org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector;
import org.neo4j.internal.kernel.api.IndexCapability; import org.neo4j.internal.kernel.api.IndexCapability;
import org.neo4j.internal.kernel.api.IndexOrder; import org.neo4j.internal.kernel.api.IndexOrder;
Expand Down Expand Up @@ -118,21 +117,21 @@ public GenericNativeIndexProvider( int priority, IndexDirectoryStructure.Factory
} }


@Override @Override
Layout<CompositeGenericKey,NativeIndexValue> layout( StoreIndexDescriptor descriptor ) IndexLayout<CompositeGenericKey,NativeIndexValue> layout( StoreIndexDescriptor descriptor )
{ {
int numberOfSlots = descriptor.properties().length; int numberOfSlots = descriptor.properties().length;
return new GenericLayout( numberOfSlots ); return new GenericLayout( numberOfSlots );
} }


@Override @Override
protected IndexPopulator newIndexPopulator( File storeFile, Layout<CompositeGenericKey,NativeIndexValue> layout, StoreIndexDescriptor descriptor, protected IndexPopulator newIndexPopulator( File storeFile, IndexLayout<CompositeGenericKey,NativeIndexValue> layout, StoreIndexDescriptor descriptor,
IndexSamplingConfig samplingConfig ) IndexSamplingConfig samplingConfig )
{ {
return new GenericNativeIndexPopulator( pageCache, fs, storeFile, layout, monitor, descriptor, samplingConfig ); return new GenericNativeIndexPopulator( pageCache, fs, storeFile, layout, monitor, descriptor, samplingConfig );
} }


@Override @Override
protected IndexAccessor newIndexAccessor( File storeFile, Layout<CompositeGenericKey,NativeIndexValue> layout, StoreIndexDescriptor descriptor, protected IndexAccessor newIndexAccessor( File storeFile, IndexLayout<CompositeGenericKey,NativeIndexValue> layout, StoreIndexDescriptor descriptor,
IndexSamplingConfig samplingConfig ) 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, samplingConfig );
Expand Down
Expand Up @@ -20,7 +20,6 @@
package org.neo4j.kernel.impl.index.schema; package org.neo4j.kernel.impl.index.schema;


import org.neo4j.index.internal.gbptree.GBPTree; import org.neo4j.index.internal.gbptree.GBPTree;
import org.neo4j.index.internal.gbptree.Layout;
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.internal.kernel.api.IndexQuery.ExactPredicate; import org.neo4j.internal.kernel.api.IndexQuery.ExactPredicate;
Expand All @@ -38,7 +37,7 @@


class GenericNativeIndexReader extends NativeIndexReader<CompositeGenericKey,NativeIndexValue> class GenericNativeIndexReader extends NativeIndexReader<CompositeGenericKey,NativeIndexValue>
{ {
GenericNativeIndexReader( GBPTree<CompositeGenericKey,NativeIndexValue> tree, Layout<CompositeGenericKey,NativeIndexValue> layout, GenericNativeIndexReader( GBPTree<CompositeGenericKey,NativeIndexValue> tree, IndexLayout<CompositeGenericKey,NativeIndexValue> layout,
IndexSamplingConfig samplingConfig, IndexDescriptor descriptor ) IndexSamplingConfig samplingConfig, IndexDescriptor descriptor )
{ {
super( tree, layout, samplingConfig, descriptor ); super( tree, layout, samplingConfig, descriptor );
Expand Down
Expand Up @@ -22,7 +22,7 @@
import org.neo4j.index.internal.gbptree.Layout; import org.neo4j.index.internal.gbptree.Layout;
import org.neo4j.io.pagecache.PageCursor; import org.neo4j.io.pagecache.PageCursor;


abstract class IndexLayout<KEY extends NativeIndexKey<KEY>> extends Layout.Adapter<KEY,NativeIndexValue> abstract class IndexLayout<KEY extends NativeIndexKey<KEY>, VALUE extends NativeIndexValue> extends Layout.Adapter<KEY,VALUE>
{ {
private final long identifier; private final long identifier;
private final int majorVersion; private final int majorVersion;
Expand All @@ -42,9 +42,9 @@ abstract class IndexLayout<KEY extends NativeIndexKey<KEY>> extends Layout.Adapt
} }


@Override @Override
public NativeIndexValue newValue() public VALUE newValue()
{ {
return NativeIndexValue.INSTANCE; return (VALUE) NativeIndexValue.INSTANCE;
} }


@Override @Override
Expand Down
Expand Up @@ -25,7 +25,7 @@
/** /**
* {@link Layout} for local date times. * {@link Layout} for local date times.
*/ */
class LocalDateTimeLayout extends IndexLayout<LocalDateTimeIndexKey> class LocalDateTimeLayout extends IndexLayout<LocalDateTimeIndexKey,NativeIndexValue>
{ {
LocalDateTimeLayout() LocalDateTimeLayout()
{ {
Expand Down
Expand Up @@ -25,7 +25,7 @@
/** /**
* {@link Layout} for local times. * {@link Layout} for local times.
*/ */
class LocalTimeLayout extends IndexLayout<LocalTimeIndexKey> class LocalTimeLayout extends IndexLayout<LocalTimeIndexKey,NativeIndexValue>
{ {
LocalTimeLayout() LocalTimeLayout()
{ {
Expand Down
Expand Up @@ -25,7 +25,6 @@
import java.util.function.Consumer; import java.util.function.Consumer;


import org.neo4j.index.internal.gbptree.GBPTree; import org.neo4j.index.internal.gbptree.GBPTree;
import org.neo4j.index.internal.gbptree.Layout;
import org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector; import org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector;
import org.neo4j.io.IOUtils; import org.neo4j.io.IOUtils;
import org.neo4j.io.fs.FileSystemAbstraction; import org.neo4j.io.fs.FileSystemAbstraction;
Expand All @@ -41,14 +40,14 @@ abstract class NativeIndex<KEY extends NativeIndexKey<KEY>, VALUE extends Native
{ {
final PageCache pageCache; final PageCache pageCache;
final File storeFile; final File storeFile;
final Layout<KEY,VALUE> layout; final IndexLayout<KEY,VALUE> layout;
final FileSystemAbstraction fileSystem; final FileSystemAbstraction fileSystem;
final IndexDescriptor descriptor; final IndexDescriptor descriptor;
private final IndexProvider.Monitor monitor; private final IndexProvider.Monitor monitor;


protected GBPTree<KEY,VALUE> tree; protected GBPTree<KEY,VALUE> tree;


NativeIndex( PageCache pageCache, FileSystemAbstraction fs, File storeFile, Layout<KEY,VALUE> layout, IndexProvider.Monitor monitor, NativeIndex( PageCache pageCache, FileSystemAbstraction fs, File storeFile, IndexLayout<KEY,VALUE> layout, IndexProvider.Monitor monitor,
StoreIndexDescriptor descriptor ) StoreIndexDescriptor descriptor )
{ {
this.pageCache = pageCache; this.pageCache = pageCache;
Expand Down
Expand Up @@ -25,7 +25,6 @@


import org.neo4j.graphdb.ResourceIterator; import org.neo4j.graphdb.ResourceIterator;
import org.neo4j.helpers.collection.BoundedIterable; import org.neo4j.helpers.collection.BoundedIterable;
import org.neo4j.index.internal.gbptree.Layout;
import org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector; import org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector;
import org.neo4j.io.fs.FileSystemAbstraction; import org.neo4j.io.fs.FileSystemAbstraction;
import org.neo4j.io.pagecache.IOLimiter; import org.neo4j.io.pagecache.IOLimiter;
Expand All @@ -48,7 +47,7 @@ public abstract class NativeIndexAccessor<KEY extends NativeIndexKey<KEY>, VALUE
private final NativeIndexUpdater<KEY,VALUE> singleUpdater; private final NativeIndexUpdater<KEY,VALUE> singleUpdater;
final IndexSamplingConfig samplingConfig; final IndexSamplingConfig samplingConfig;


NativeIndexAccessor( PageCache pageCache, FileSystemAbstraction fs, File storeFile, Layout<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 ) throws IOException IndexSamplingConfig samplingConfig ) throws IOException
{ {
Expand Down
Expand Up @@ -32,7 +32,6 @@
import java.util.function.Consumer; import java.util.function.Consumer;


import org.neo4j.index.internal.gbptree.GBPTree; import org.neo4j.index.internal.gbptree.GBPTree;
import org.neo4j.index.internal.gbptree.Layout;
import org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector; import org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector;
import org.neo4j.index.internal.gbptree.Writer; import org.neo4j.index.internal.gbptree.Writer;
import org.neo4j.io.fs.FileSystemAbstraction; import org.neo4j.io.fs.FileSystemAbstraction;
Expand All @@ -45,9 +44,7 @@
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.DefaultNonUniqueIndexSampler;
import org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig; import org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig;
import org.neo4j.kernel.impl.api.index.sampling.NonUniqueIndexSampler;
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 @@ -75,7 +72,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;
private final NonUniqueIndexSampler nonUniqueSampler;
final IndexSamplingConfig samplingConfig; final IndexSamplingConfig samplingConfig;


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


NativeIndexPopulator( PageCache pageCache, FileSystemAbstraction fs, File storeFile, Layout<KEY,VALUE> layout, IndexProvider.Monitor monitor, NativeIndexPopulator( PageCache pageCache, FileSystemAbstraction fs, File storeFile, IndexLayout<KEY,VALUE> layout, IndexProvider.Monitor monitor,
StoreIndexDescriptor descriptor, IndexSamplingConfig samplingConfig ) StoreIndexDescriptor descriptor, IndexSamplingConfig samplingConfig )
{ {
super( pageCache, fs, storeFile, layout, monitor, descriptor ); super( pageCache, fs, storeFile, layout, monitor, descriptor );
Expand All @@ -96,11 +92,9 @@ public abstract class NativeIndexPopulator<KEY extends NativeIndexKey<KEY>, VALU
{ {
case GENERAL: case GENERAL:
uniqueSampler = null; uniqueSampler = null;
nonUniqueSampler = new DefaultNonUniqueIndexSampler( samplingConfig.sampleSizeLimit() );
break; break;
case UNIQUE: case UNIQUE:
uniqueSampler = new UniqueIndexSampler(); uniqueSampler = new UniqueIndexSampler();
nonUniqueSampler = null;
break; break;
default: default:
throw new IllegalArgumentException( "Unexpected index type " + descriptor.type() ); throw new IllegalArgumentException( "Unexpected index type " + descriptor.type() );
Expand Down Expand Up @@ -366,7 +360,7 @@ public void includeSample( IndexEntryUpdate<?> update )
switch ( descriptor.type() ) switch ( descriptor.type() )
{ {
case GENERAL: case GENERAL:
updateNonUniqueSample( update ); // Don't do anything here, we'll do a scan in the end instead
break; break;
case UNIQUE: case UNIQUE:
updateUniqueSample( update ); updateUniqueSample( update );
Expand All @@ -393,33 +387,13 @@ private void updateUniqueSample( IndexEntryUpdate<?> update )
} }
} }


private void updateNonUniqueSample( IndexEntryUpdate<?> update )
{
String encodedValues = SamplingUtil.encodedStringValuesForSampling( (Object[]) update.values() );
switch ( update.updateMode() )
{
case ADDED:
nonUniqueSampler.include( encodedValues );
break;
case REMOVED:
nonUniqueSampler.exclude( encodedValues );
break;
case CHANGED:
nonUniqueSampler.exclude( SamplingUtil.encodedStringValuesForSampling( (Object[]) update.beforeValues() ) );
nonUniqueSampler.include( encodedValues );
break;
default:
throw new IllegalArgumentException( "Unsupported update mode type:" + update.updateMode() );
}
}

@Override @Override
public IndexSample sampleResult() public IndexSample sampleResult()
{ {
switch ( descriptor.type() ) switch ( descriptor.type() )
{ {
case GENERAL: case GENERAL:
return nonUniqueSampler.result(); return new FullScanNonUniqueIndexSampler<>( tree, layout ).result();
case UNIQUE: case UNIQUE:
return uniqueSampler.result(); return uniqueSampler.result();
default: default:
Expand Down
Expand Up @@ -23,7 +23,6 @@
import java.io.IOException; import java.io.IOException;


import org.neo4j.index.internal.gbptree.GBPTree; import org.neo4j.index.internal.gbptree.GBPTree;
import org.neo4j.index.internal.gbptree.Layout;
import org.neo4j.index.internal.gbptree.MetadataMismatchException; import org.neo4j.index.internal.gbptree.MetadataMismatchException;
import org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector; import org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector;
import org.neo4j.internal.kernel.api.InternalIndexState; import org.neo4j.internal.kernel.api.InternalIndexState;
Expand Down Expand Up @@ -63,7 +62,7 @@ protected NativeIndexProvider( IndexProviderDescriptor descriptor, int priority,
this.readOnly = readOnly; this.readOnly = readOnly;
} }


abstract Layout<KEY,VALUE> layout( StoreIndexDescriptor descriptor ); abstract IndexLayout<KEY,VALUE> layout( StoreIndexDescriptor descriptor );


@Override @Override
public IndexPopulator getPopulator( StoreIndexDescriptor descriptor, IndexSamplingConfig samplingConfig ) public IndexPopulator getPopulator( StoreIndexDescriptor descriptor, IndexSamplingConfig samplingConfig )
Expand All @@ -77,7 +76,7 @@ public IndexPopulator getPopulator( StoreIndexDescriptor descriptor, IndexSampli
return newIndexPopulator( storeFile, layout( descriptor ), descriptor, samplingConfig ); return newIndexPopulator( storeFile, layout( descriptor ), descriptor, samplingConfig );
} }


protected abstract IndexPopulator newIndexPopulator( File storeFile, Layout<KEY,VALUE> layout, StoreIndexDescriptor descriptor, protected abstract IndexPopulator newIndexPopulator( File storeFile, IndexLayout<KEY,VALUE> layout, StoreIndexDescriptor descriptor,
IndexSamplingConfig samplingConfig ); IndexSamplingConfig samplingConfig );


@Override @Override
Expand All @@ -87,7 +86,7 @@ public IndexAccessor getOnlineAccessor( StoreIndexDescriptor descriptor, IndexSa
return newIndexAccessor( storeFile, layout( descriptor ), descriptor, samplingConfig ); return newIndexAccessor( storeFile, layout( descriptor ), descriptor, samplingConfig );
} }


protected abstract IndexAccessor newIndexAccessor( File storeFile, Layout<KEY,VALUE> layout, StoreIndexDescriptor descriptor, protected abstract IndexAccessor newIndexAccessor( File storeFile, IndexLayout<KEY,VALUE> layout, StoreIndexDescriptor descriptor,
IndexSamplingConfig samplingConfig ) throws IOException; IndexSamplingConfig samplingConfig ) throws IOException;


@Override @Override
Expand Down

0 comments on commit 041911f

Please sign in to comment.