Fennel: ExternalSortRunAccessor Class Reference (original) (raw)
ExternalSortRunAccessor manages I/O for storing runs and reading them back. More...
#include <[ExternalSortRunAccessor.h](ExternalSortRunAccessor%5F8h-source.html)>
Inheritance diagram for ExternalSortRunAccessor:

| Public Member Functions | |
|---|---|
| ExternalSortRunAccessor (ExternalSortInfo &) | |
| virtual | ~ExternalSortRunAccessor () |
| void | initRead () |
| Prepares this accessor to read (but does not specify a particular stored run yet). | |
| void | startRead (SharedSegStreamAllocation pStoredRunInit) |
| Begins reading a particular run. | |
| void | resetRead () |
| Terminates read for the current run if any. | |
| void | storeRun (ExternalSortSubStream &subStream) |
| Stores a run. | |
| SharedSegStreamAllocation | getStoredRun () |
| **Returns:**information about run created by storeRun() | |
| void | releaseResources () |
| Releases any resources acquired by this accessor. | |
| virtual ExternalSortFetchArray & | bindFetchArray () |
| Binds the fetch array which will be used implicitly by subsequent calls to fetch(). | |
| virtual ExternalSortRC | fetch (uint nTuplesRequested) |
| Fetches tuples via the previously bound fetch array. | |
| Private Member Functions | |
| void | clearFetch () |
| Private Attributes | |
| ExternalSortInfo & | sortInfo |
| Global information. | |
| TupleAccessor | tupleAccessor |
| ExternalSortFetchArray | fetchArray |
| Array used to return fetch results. | |
| PBuffer | ppTupleBuffers [EXTSORT_FETCH_ARRAY_SIZE] |
| Pointer array used to return fetch results. | |
| SharedSegInputStream | pSegInputStream |
| Helper used for reading stored runs. | |
| SharedSegOutputStream | pSegOutputStream |
| Helper used for writing stored runs. | |
| SharedSegStreamAllocation | pStoredRun |
| Information about run being accessed. |
Detailed Description
ExternalSortRunAccessor manages I/O for storing runs and reading them back.
Definition at line 37 of file ExternalSortRunAccessor.h.
Constructor & Destructor Documentation
| ExternalSortRunAccessor::ExternalSortRunAccessor | ( | ExternalSortInfo & | | ) | [explicit] | | ------------------------------------------------ | - | ------------------------------------------------- | | - | ------------ |
| ExternalSortRunAccessor::~ExternalSortRunAccessor | ( | | ) | [virtual] | | -------------------------------------------------- | - | | - | ----------- |
Member Function Documentation
| void ExternalSortRunAccessor::clearFetch | ( | | ) | [inline, private] | | ---------------------------------------- | - | | - | ------------------- |
| void ExternalSortRunAccessor::initRead | ( | | ) | | -------------------------------------- | - | | - |
| void ExternalSortRunAccessor::resetRead | ( | | ) | | --------------------------------------- | - | | - |
Stores a run.
Parameters:
| subStream | substream whose contents are to be fetched and stored as a run |
|---|
Definition at line 76 of file ExternalSortRunAccessor.cpp.
References ExternalSortSubStream::bindFetchArray(), ExternalSortInfo::externalSegmentAccessor, EXTSORT_ENDOFDATA, EXTSORT_FETCH_ARRAY_SIZE, EXTSORT_SUCCESS, ExternalSortSubStream::fetch(), fetchArray, TupleAccessor::getBufferByteCount(), SegOutputStream::newSegOutputStream(), SegStreamAllocation::newSegStreamAllocation(), ExternalSortFetchArray::nTuples, ExternalSortFetchArray::ppTupleBuffers, pSegOutputStream, pStoredRun, sortInfo, and tupleAccessor.
| void ExternalSortRunAccessor::releaseResources | ( | | ) | | ---------------------------------------------- | - | | - |
Fetches tuples via the previously bound fetch array.
Parameters:
| nTuplesRequested | maximum number of tuples to be returned from fetch (actual count may be less at callee's discretion; this does not indicate end of stream) |
|---|
Returns:
result of fetch (either EXTSORT_ENDOFDATA or EXTSORT_SUCCESS)
Implements ExternalSortSubStream.
Definition at line 113 of file ExternalSortRunAccessor.cpp.
References ExecStream::checkAbort(), EXTSORT_ENDOFDATA, EXTSORT_FETCH_ARRAY_SIZE, EXTSORT_SUCCESS, fetchArray, TupleAccessor::getBufferByteCount(), ExternalSortFetchArray::nTuples, ppTupleBuffers, pSegInputStream, pStoredRun, sortInfo, ExternalSortInfo::stream, and tupleAccessor.
Member Data Documentation
Pointer array used to return fetch results.
These pointers get bound to contiguous tuples on stored run pages as they are read in.
Definition at line 58 of file ExternalSortRunAccessor.h.
Referenced by fetch().
The documentation for this class was generated from the following files:
- /home/pub/open/dev/fennel/sorter/ExternalSortRunAccessor.h
- /home/pub/open/dev/fennel/sorter/ExternalSortRunAccessor.cpp
