Class SortUtility
- java.lang.Object
-
- org.teiid.query.processor.relational.SortUtility
-
public class SortUtility extends Object
Implements several modes of a multi-pass sort. TODO: could consider using an index for dup_removal and maintaining a separate output buffer TODO: release the tuple buffer in the last merge pass if sublists will fit in processing batch size
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SortUtility.Mode
-
Constructor Summary
Constructors Constructor Description SortUtility(TupleSource ts, List<? extends Expression> expressions, List<Boolean> types, SortUtility.Mode mode, BufferManager bufferManager, String connectionID, List schema)
SortUtility(TupleSource sourceID, List<OrderByItem> items, SortUtility.Mode mode, BufferManager bufferMgr, String groupName, List<? extends Expression> schema)
SortUtility(TupleSource sourceID, SortUtility.Mode mode, BufferManager bufferMgr, String groupName, List<? extends Expression> schema, List<Boolean> sortTypes, List<SortSpecification.NullOrdering> nullOrderings, int[] cols)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doMerge(int rowLimit)
protected void
initialSort(boolean onePass, boolean lowLatency, int rowLimit)
creates sorted sublists stored in tuplebuffersboolean
isDistinct()
boolean
isDoneReading()
protected void
mergePhase(int rowLimit)
List<TupleBuffer>
onePassSort(boolean lowLatency)
void
remove()
void
setNonBlocking(boolean b)
void
setStableSort(boolean stableSort)
void
setWorkingBuffer(TupleBuffer workingBuffer)
TupleBuffer
sort()
TupleBuffer
sort(int rowLimit)
-
-
-
Constructor Detail
-
SortUtility
public SortUtility(TupleSource sourceID, List<OrderByItem> items, SortUtility.Mode mode, BufferManager bufferMgr, String groupName, List<? extends Expression> schema)
-
SortUtility
public SortUtility(TupleSource sourceID, SortUtility.Mode mode, BufferManager bufferMgr, String groupName, List<? extends Expression> schema, List<Boolean> sortTypes, List<SortSpecification.NullOrdering> nullOrderings, int[] cols)
-
SortUtility
public SortUtility(TupleSource ts, List<? extends Expression> expressions, List<Boolean> types, SortUtility.Mode mode, BufferManager bufferManager, String connectionID, List schema)
-
-
Method Detail
-
sort
public TupleBuffer sort() throws TeiidComponentException, TeiidProcessingException
-
sort
public TupleBuffer sort(int rowLimit) throws TeiidComponentException, TeiidProcessingException
-
onePassSort
public List<TupleBuffer> onePassSort(boolean lowLatency) throws TeiidComponentException, TeiidProcessingException
-
initialSort
protected void initialSort(boolean onePass, boolean lowLatency, int rowLimit) throws TeiidComponentException, TeiidProcessingException
creates sorted sublists stored in tuplebuffers
-
setWorkingBuffer
public void setWorkingBuffer(TupleBuffer workingBuffer)
-
mergePhase
protected void mergePhase(int rowLimit) throws TeiidComponentException, TeiidProcessingException
-
doMerge
protected void doMerge(int rowLimit) throws TeiidComponentException, TeiidProcessingException
-
isDistinct
public boolean isDistinct()
-
remove
public void remove()
-
setNonBlocking
public void setNonBlocking(boolean b)
-
setStableSort
public void setStableSort(boolean stableSort)
-
isDoneReading
public boolean isDoneReading()
-
-