Package io.prestosql.operator
Class PagesIndex
- java.lang.Object
-
- io.prestosql.operator.PagesIndex
-
- All Implemented Interfaces:
it.unimi.dsi.fastutil.Swapper
public class PagesIndex extends Object implements it.unimi.dsi.fastutil.Swapper
PagesIndex a low-level data structure which contains the address of every value position of every channel. This data structure is not general purpose and is designed for a few specific uses:- Sort via the
sort(java.util.List<java.lang.Integer>, java.util.List<io.prestosql.spi.connector.SortOrder>)
method - Hash build via the
createLookupSourceSupplier(io.prestosql.Session, java.util.List<java.lang.Integer>)
method - Positional output via the
appendTo(int, int, io.prestosql.spi.block.BlockBuilder)
method
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PagesIndex.DefaultFactory
static interface
PagesIndex.Factory
static class
PagesIndex.TestingFactory
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPage(Page page)
void
appendTo(int channel, int position, BlockBuilder output)
int
buildPage(int position, int[] outputChannels, PageBuilder pageBuilder)
void
clear()
void
compact()
Supplier<LookupSource>
createLookupSourceSupplier(Session session, List<Integer> joinChannels)
LookupSourceSupplier
createLookupSourceSupplier(Session session, List<Integer> joinChannels, OptionalInt hashChannel, Optional<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> filterFunctionFactory, Optional<Integer> sortChannel, List<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> searchFunctionFactories)
LookupSourceSupplier
createLookupSourceSupplier(Session session, List<Integer> joinChannels, OptionalInt hashChannel, Optional<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> filterFunctionFactory, Optional<Integer> sortChannel, List<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> searchFunctionFactories, Optional<List<Integer>> outputChannels)
PagesHashStrategy
createPagesHashStrategy(List<Integer> joinChannels, OptionalInt hashChannel)
PagesHashStrategy
createPagesHashStrategy(List<Integer> joinChannels, OptionalInt hashChannel, Optional<List<Integer>> outputChannels)
PagesSpatialIndexSupplier
createPagesSpatialIndex(Session session, int geometryChannel, Optional<Integer> radiusChannel, Optional<Integer> partitionChannel, SpatialIndexBuilderOperator.SpatialPredicate spatialRelationshipTest, Optional<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> filterFunctionFactory, List<Integer> outputChannels, Map<Integer,Rectangle> partitions)
boolean
getBoolean(int channel, int position)
it.unimi.dsi.fastutil.objects.ObjectArrayList<Block>
getChannel(int channel)
double
getDouble(int channel, int position)
io.airlift.units.DataSize
getEstimatedSize()
long
getLong(int channel, int position)
Object
getObject(int channel, int position)
Iterator<Page>
getPages()
int
getPositionCount()
Block
getSingleValueBlock(int channel, int position)
io.airlift.slice.Slice
getSlice(int channel, int position)
Iterator<Page>
getSortedPages()
Type
getType(int channel)
List<Type>
getTypes()
it.unimi.dsi.fastutil.longs.LongArrayList
getValueAddresses()
boolean
isNull(int channel, int position)
boolean
positionEqualsPosition(PagesHashStrategy partitionHashStrategy, int leftPosition, int rightPosition)
boolean
positionEqualsRow(PagesHashStrategy pagesHashStrategy, int indexPosition, int rightPosition, Page rightPage)
void
sort(List<Integer> sortChannels, List<SortOrder> sortOrders)
void
sort(List<Integer> sortChannels, List<SortOrder> sortOrders, int startPosition, int endPosition)
void
swap(int a, int b)
String
toString()
-
-
-
Method Detail
-
getPositionCount
public int getPositionCount()
-
getValueAddresses
public it.unimi.dsi.fastutil.longs.LongArrayList getValueAddresses()
-
getChannel
public it.unimi.dsi.fastutil.objects.ObjectArrayList<Block> getChannel(int channel)
-
clear
public void clear()
-
addPage
public void addPage(Page page)
-
getEstimatedSize
public io.airlift.units.DataSize getEstimatedSize()
-
compact
public void compact()
-
getType
public Type getType(int channel)
-
swap
public void swap(int a, int b)
- Specified by:
swap
in interfaceit.unimi.dsi.fastutil.Swapper
-
buildPage
public int buildPage(int position, int[] outputChannels, PageBuilder pageBuilder)
-
appendTo
public void appendTo(int channel, int position, BlockBuilder output)
-
isNull
public boolean isNull(int channel, int position)
-
getBoolean
public boolean getBoolean(int channel, int position)
-
getLong
public long getLong(int channel, int position)
-
getDouble
public double getDouble(int channel, int position)
-
getSlice
public io.airlift.slice.Slice getSlice(int channel, int position)
-
getObject
public Object getObject(int channel, int position)
-
getSingleValueBlock
public Block getSingleValueBlock(int channel, int position)
-
sort
public void sort(List<Integer> sortChannels, List<SortOrder> sortOrders, int startPosition, int endPosition)
-
positionEqualsPosition
public boolean positionEqualsPosition(PagesHashStrategy partitionHashStrategy, int leftPosition, int rightPosition)
-
positionEqualsRow
public boolean positionEqualsRow(PagesHashStrategy pagesHashStrategy, int indexPosition, int rightPosition, Page rightPage)
-
createLookupSourceSupplier
public Supplier<LookupSource> createLookupSourceSupplier(Session session, List<Integer> joinChannels)
-
createPagesHashStrategy
public PagesHashStrategy createPagesHashStrategy(List<Integer> joinChannels, OptionalInt hashChannel)
-
createPagesHashStrategy
public PagesHashStrategy createPagesHashStrategy(List<Integer> joinChannels, OptionalInt hashChannel, Optional<List<Integer>> outputChannels)
-
createLookupSourceSupplier
public LookupSourceSupplier createLookupSourceSupplier(Session session, List<Integer> joinChannels, OptionalInt hashChannel, Optional<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> filterFunctionFactory, Optional<Integer> sortChannel, List<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> searchFunctionFactories)
-
createPagesSpatialIndex
public PagesSpatialIndexSupplier createPagesSpatialIndex(Session session, int geometryChannel, Optional<Integer> radiusChannel, Optional<Integer> partitionChannel, SpatialIndexBuilderOperator.SpatialPredicate spatialRelationshipTest, Optional<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> filterFunctionFactory, List<Integer> outputChannels, Map<Integer,Rectangle> partitions)
-
createLookupSourceSupplier
public LookupSourceSupplier createLookupSourceSupplier(Session session, List<Integer> joinChannels, OptionalInt hashChannel, Optional<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> filterFunctionFactory, Optional<Integer> sortChannel, List<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> searchFunctionFactories, Optional<List<Integer>> outputChannels)
-
-