#include <LbmSearchExecStream.h>
Inheritance diagram for LbmSearchExecStream:
Public Member Functions | |
virtual void | prepare (LbmSearchExecStreamParams const ¶ms) |
virtual void | prepare (BTreePrefetchSearchExecStreamParams const ¶ms) |
void | prepare (BTreeSearchExecStreamParams const ¶ms) |
virtual void | prepare (BTreeReadExecStreamParams const ¶ms) |
virtual void | prepare (BTreeExecStreamParams const ¶ms) |
virtual void | prepare (SingleOutputExecStreamParams const ¶ms) |
virtual void | prepare (ExecStreamParams const ¶ms) |
Prepares this stream for execution. | |
virtual void | prepare (ConduitExecStreamParams const ¶ms) |
virtual void | prepare (SingleInputExecStreamParams const ¶ms) |
virtual void | getResourceRequirements (ExecStreamResourceQuantity &minQuantity, ExecStreamResourceQuantity &optQuantity, ExecStreamResourceSettingType &optType) |
Determines resource requirements for this stream. | |
virtual void | getResourceRequirements (ExecStreamResourceQuantity &minQuantity, ExecStreamResourceQuantity &optQuantity) |
virtual void | setResourceAllocation (ExecStreamResourceQuantity &quantity) |
Sets current resource allocation for this stream. | |
virtual void | open (bool restart) |
Opens this stream, acquiring any resources needed in order to be able to fetch data. | |
virtual ExecStreamResult | execute (ExecStreamQuantum const &quantum) |
Executes this stream. | |
virtual void | initPrefetchEntry (BTreePrefetchSearchKey &searchKey) |
Initializes a specific entry in the pre-fetch queue. | |
virtual PageId | getNextPageForPrefetch (BTreePrefetchSearchKey &searchKey, bool &found) |
Retrieves the next pageId to be pre-fetched, also filling in context- specific information associated with the page. | |
virtual void | closeImpl () |
Implements ClosableObject. | |
virtual void | setInputBufAccessors (std::vector< SharedExecStreamBufAccessor > const &inAccessors) |
Initializes the buffer accessors for inputs to this stream. | |
virtual void | setInputBufAccessors (std::vector< SharedExecStreamBufAccessor > const &inAccessors) |
Initializes the buffer accessors for inputs to this stream. | |
virtual void | setOutputBufAccessors (std::vector< SharedExecStreamBufAccessor > const &outAccessors) |
Initializes the buffer accessors for outputs from this stream. | |
virtual void | setOutputBufAccessors (std::vector< SharedExecStreamBufAccessor > const &outAccessors) |
Initializes the buffer accessors for outputs from this stream. | |
virtual ExecStreamBufProvision | getOutputBufProvision () const |
Queries the BufferProvision which this stream is capable of when producing tuples. | |
virtual bool | canEarlyClose () |
| |
ExecStreamGraph & | getGraph () const |
| |
ExecStreamId | getStreamId () const |
| |
virtual void | setName (std::string const &) |
Sets unique name of this stream. | |
virtual std::string const & | getName () const |
| |
virtual bool | mayBlock () const |
Queries whether this stream's implementation may block when execute() is called. | |
virtual void | checkAbort () const |
Checks whether there is an abort request for this stream's scheduler. | |
virtual ExecStreamBufProvision | getOutputBufConversion () const |
Queries the BufferProvision to which this stream needs its output to be converted, if any. | |
virtual ExecStreamBufProvision | getInputBufProvision () const |
Queries the BufferProvision which this stream requires of its inputs when consuming their tuples. | |
virtual ExecStreamBufProvision | getInputBufProvision () const |
Queries the BufferProvision which this stream requires of its inputs when consuming their tuples. | |
bool | isClosed () const |
| |
void | close () |
Closes this object, releasing any unallocated resources. | |
virtual void | initTraceSource (SharedTraceTarget pTraceTarget, std::string name) |
For use when initialization has to be deferred until after construction. | |
void | trace (TraceLevel level, std::string message) const |
Records a trace message. | |
bool | isTracing () const |
| |
bool | isTracingLevel (TraceLevel level) const |
Determines whether a particular level is being traced. | |
TraceTarget & | getTraceTarget () const |
| |
SharedTraceTarget | getSharedTraceTarget () const |
| |
std::string | getTraceSourceName () const |
Gets the name of this source. | |
void | setTraceSourceName (std::string const &n) |
Sets the name of this source. | |
TraceLevel | getMinimumTraceLevel () const |
void | disableTracing () |
virtual void | initErrorSource (SharedErrorTarget pErrorTarget, const std::string &name) |
For use when initialization has to be deferred until after construction. | |
void | postError (ErrorLevel level, const std::string &message, void *address, long capacity, int index) |
Posts an exception, such as a row exception. | |
void | postError (ErrorLevel level, const std::string &message, const TupleDescriptor &errorDesc, const TupleData &errorTuple, int index) |
Posts an exception, such as a row exception. | |
bool | hasTarget () const |
| |
ErrorTarget & | getErrorTarget () const |
| |
SharedErrorTarget | getSharedErrorTarget () const |
| |
std::string | getErrorSourceName () const |
Gets the name of this source. | |
void | setErrorSourceName (std::string const &n) |
Sets the name of this source. | |
void | disableTarget () |
Static Public Member Functions | |
static SharedBTreeWriter | newWriter (BTreeExecStreamParams const ¶ms) |
static void | copyParamsToDescriptor (BTreeDescriptor &, BTreeParams const &, SharedCacheAccessor const &) |
Protected Member Functions | |
virtual SharedBTreeReader | newReader () |
Allocates a new BTreeNonLeafReader. | |
void | allocateScratchPages () |
Allocates the scratch pages that will be used to store search key information. | |
bool | innerSearchLoop () |
Searches individual leaf pages. | |
void | getPrefetchSearchKey () |
Reads the search directives and keys from the input stream, and initializes the data for use in the btree searches used to pre-fetch leaf pages. | |
void | setUpSearchKey (BTreePrefetchSearchKey const &searchKey) |
Sets up the search key for the current leaf page search using data stored away by a pre-fetch. | |
void | setSearchKeyData (bool newSearch, BTreePrefetchSearchKey &searchKey) |
Saves away the search key data corresponding to a pre-fetched page. | |
bool | testNonLeafInterval () |
Determines if the current key just read from a non-leaf page contains the last matching page in the search interval. | |
ExecStreamResult | innerFetchLoop (ExecStreamQuantum const &quantum, uint &nTuples) |
void | readDirectives () |
bool | testInterval () |
void | readSearchKey () |
Reads the search key either from the input stream or dynamic parameters. | |
void | readUpperBoundKey () |
Reads the upper bound key either from the input stream or dynamic parameters. | |
bool | checkNextKey () |
Determines if the next key value is within the upper bound search range. | |
bool | searchForKey () |
Searches the btree for a specific key. | |
SharedBTreeWriter | newWriter (bool monotonic=false) |
virtual void | endSearch () |
Forgets the current reader or writer's search, releasing any page locks. | |
ExecStreamResult | precheckConduitBuffers () |
Checks the state of the input and output buffers. | |
Protected Attributes | |
SegPageEntryIter< BTreePrefetchSearchKey > | leafPageQueue |
Iterator that provides the pre-fetched leaf pages. | |
SharedBTreeLeafReader | pLeafReader |
Reader used to search/read leaf pages from the btree. | |
SharedBTreeNonLeafReader | pNonLeafReader |
Reader used to search/read non-leaf pages from the btree. | |
TupleAccessor | savedLowerBoundAccessor |
Accessor used to reference a saved lower bound search key that will be used to search a leaf page. | |
TupleAccessor | savedUpperBoundAccessor |
Accessor used to reference a saved upper bound search key used in a leaf page search. | |
SearchEndpoint | pfLowerBoundDirective |
Lower bound directive used when searching non-leaf nodes to pre-fetch leaf pages. | |
SearchEndpoint | pfUpperBoundDirective |
Upper bound directive used when searching non-leaf nodes to pre-fetch leaf pages. | |
TupleData | pfLowerBoundData |
Lower bound key used when searching non-leaf nodes to pre-fetch leaf pages. | |
TupleData | pfUpperBoundData |
Upper bound key used when searching non-leaf nodes to pre-fetch leaf pages. | |
bool | endOnNextKey |
If true, abort search of non-leaf page when positioning to the next key. | |
BTreePageLock | scratchLock |
Page lock used to allocate scratch pages used to store search key information associated with pre-fetched leaf pages. | |
uint | scratchPageSize |
Space available on a single scratch page. | |
uint | nMiscCachePages |
Number of cache pages needed, including pages needed for pre-fetches, but excluding scratch pages used to store search key information. | |
uint | nPrefetchScratchPages |
Number of scratch pages available to store search key information. | |
uint | keyValuesSize |
Size of space occupied by lower and upper bound key values. | |
uint | nEntriesPerScratchPage |
Number of search key entries per scratch page. | |
bool | bigMaxKey |
True if the maximum key size is such that potentially only a single key can be stored on a page. | |
std::vector< PBuffer > | scratchPages |
Vector of pointers to scratch pages allocated. | |
uint | currPage |
Index into scratch pages vector, indicating the current page whose space is being used to initialize pre-fetch entries. | |
uint | currPageEntry |
Index into the current scratch page whose space is being used to initialize pre-fetch entries. | |
bool | initialPrefetchDone |
True if first pre-fetch needs to be initiated. | |
bool | processingDone |
True if all input search ranges have been processed. | |
bool | prevLeafSearchRc |
Boolean return code from the previous leaf page search. | |
bool | rootOnly |
True if the btree is a root-only tree. | |
bool | returnedRoot |
True if the root, leaf page has been returned as a pre-fetch page for the current search range. | |
TupleProjectionAccessor | inputKeyAccessor |
TupleProjectionAccessor | inputJoinAccessor |
TupleProjectionAccessor | readerKeyAccessor |
TupleProjectionAccessor | directiveAccessor |
TupleProjectionAccessor | upperBoundAccessor |
TupleDescriptor | inputKeyDesc |
TupleDescriptor | upperBoundDesc |
TupleData | inputKeyData |
TupleData | upperBoundData |
TupleData | readerKeyData |
TupleData | directiveData |
TupleData * | pSearchKey |
bool | outerJoin |
bool | preFilterNulls |
uint | nJoinAttributes |
SearchEndpoint | lowerBoundDirective |
SearchEndpoint | upperBoundDirective |
bool | leastUpper |
std::vector< BTreeSearchKeyParameter > | searchKeyParams |
boost::scoped_array< FixedBuffer > | searchKeyBuffer |
bool | dynamicKeysRead |
TupleProjection | searchKeyProj |
TupleProjection | upperBoundKeyProj |
SharedBTreeReader | pReader |
TupleProjectionAccessor | projAccessor |
TupleData | tupleData |
TupleProjection | outputProj |
BTreeDescriptor | treeDescriptor |
SegmentAccessor | scratchAccessor |
BTreeOwnerRootMap * | pRootMap |
SharedBTreeAccessBase | pBTreeAccessBase |
SharedBTreeReader | pBTreeReader |
DynamicParamId | rootPageIdParamId |
SharedExecStreamBufAccessor | pOutAccessor |
bool | isOpen |
Whether this stream is currently open. | |
ExecStreamGraph * | pGraph |
Dataflow graph containing this stream. | |
ExecStreamId | id |
Identifier for this stream; local to its containing graph. | |
std::string | name |
Name of stream, as known by optimizer. | |
SharedDynamicParamManager | pDynamicParamManager |
The dynamic parameter manager available to this stream. | |
SharedLogicalTxn | pTxn |
The transaction embracing the stream. | |
ExecStreamResourceQuantity | resourceAllocation |
Resource quantities currently allocated to this stream. | |
SharedCacheAccessor | pQuotaAccessor |
CacheAccessor used for quota tracking. | |
SharedCacheAccessor | pScratchQuotaAccessor |
CacheAccessor used for scratch page quota tracking. | |
bool | needsClose |
SharedExecStreamBufAccessor | pInAccessor |
Private Member Functions | |
virtual bool | reachedTupleLimit (uint nTuples) |
Checks if number of tuples produced has reached limit. | |
virtual void | setAdditionalKeys () |
Sets the startrid value in the btree search key, in the case where the rid can be part of the btree search key. | |
virtual void | setLowerBoundKey (PConstBuffer buf) |
Sets the lower bound key, taking into account the rid search key. | |
Private Attributes | |
bool | ridInKey |
True if the rid key is included in the btree search key. | |
DynamicParamId | rowLimitParamId |
Parameter id representing the dynamic parameter used to limit the number of rows to produce on a single execute. | |
bool | ignoreRowLimit |
True if row limit does not apply. | |
DynamicParamId | startRidParamId |
Parameter id representing the dynamic parameter used to set the starting rid value for bitmap entries. | |
RecordNum | rowLimit |
Number of rows that can be produced. | |
LcsRid | startRid |
Desired starting rid value for bitmap entries. | |
TupleDatum | rowLimitDatum |
Tuple datum used to store dynamic paramter for rowLimit. | |
TupleDatum | startRidDatum |
Tuple datum used to store dynamic parameter for startRid. | |
TupleData | ridSearchKeyData |
Tuple data used as search key that includes rid. | |
bool | ridKeySetup |
True if the search key for this stream already has the rid key setup in the descriptor, in the case where the startrid dynamic parameter is used to skip ahead in the btree search. |
Definition at line 56 of file LbmSearchExecStream.h.
bool LbmSearchExecStream::reachedTupleLimit | ( | uint | nTuples | ) | [private, virtual] |
Checks if number of tuples produced has reached limit.
Always returns false if "ignoreRowLimit" parameter is true.
Reimplemented from BTreeSearchExecStream.
Definition at line 72 of file LbmSearchExecStream.cpp.
References ignoreRowLimit, ExecStream::pDynamicParamManager, rowLimit, rowLimitDatum, and rowLimitParamId.
00073 { 00074 if (ignoreRowLimit) { 00075 return false; 00076 } 00077 00078 // read the parameter the first time through 00079 if (nTuples == 0) { 00080 pDynamicParamManager->readParam(rowLimitParamId, rowLimitDatum); 00081 } 00082 // a row limit of 0 indicates that the scan should read till EOS 00083 if (rowLimit == 0) { 00084 return false; 00085 } 00086 return (nTuples >= rowLimit); 00087 }
void LbmSearchExecStream::setAdditionalKeys | ( | ) | [private, virtual] |
Sets the startrid value in the btree search key, in the case where the rid can be part of the btree search key.
Reimplemented from BTreePrefetchSearchExecStream.
Definition at line 89 of file LbmSearchExecStream.cpp.
References BTreeSearchExecStream::inputKeyData, BTreeSearchExecStream::lowerBoundDirective, ExecStream::pDynamicParamManager, BTreeSearchExecStream::pSearchKey, ridInKey, ridKeySetup, ridSearchKeyData, SEARCH_CLOSED_LOWER, SEARCH_CLOSED_UPPER, SEARCH_UNBOUNDED_UPPER, startRid, startRidDatum, startRidParamId, and BTreeSearchExecStream::upperBoundDirective.
00090 { 00091 if (ridInKey) { 00092 // If the rid key was not setup in farrago, need to copy the keys 00093 // that precede the rid. Also make sure that in this case, the search 00094 // is an equality one. Otherwise, in the case where the key was setup, 00095 // the search is a greater than equal search. 00096 assert(lowerBoundDirective == SEARCH_CLOSED_LOWER); 00097 if (ridKeySetup) { 00098 assert(upperBoundDirective == SEARCH_UNBOUNDED_UPPER); 00099 } else { 00100 assert(upperBoundDirective == SEARCH_CLOSED_UPPER); 00101 00102 for (uint i = 0; i < inputKeyData.size(); i++) { 00103 ridSearchKeyData[i] = inputKeyData[i]; 00104 } 00105 } 00106 // rid is the last key; note that this needs to be reset each time 00107 // because the rid key value originates from a dynamic parameter 00108 // rather than the key buffer passed into setLowerBoundKey() 00109 ridSearchKeyData[ridSearchKeyData.size() - 1].pData = 00110 (PConstBuffer) &startRid; 00111 pDynamicParamManager->readParam(startRidParamId, startRidDatum); 00112 pSearchKey = &ridSearchKeyData; 00113 00114 } else { 00115 pSearchKey = &inputKeyData; 00116 } 00117 }
void LbmSearchExecStream::setLowerBoundKey | ( | PConstBuffer | buf | ) | [private, virtual] |
Sets the lower bound key, taking into account the rid search key.
buf | the buffer containing the lower bound key |
Reimplemented from BTreePrefetchSearchExecStream.
Definition at line 119 of file LbmSearchExecStream.cpp.
References BTreeSearchExecStream::inputKeyData, BTreeSearchExecStream::pSearchKey, ridInKey, ridSearchKeyData, BTreePrefetchSearchExecStream::savedLowerBoundAccessor, TupleAccessor::setCurrentTupleBuf(), and TupleAccessor::unmarshal().
00120 { 00121 savedLowerBoundAccessor.setCurrentTupleBuf(buf); 00122 if (ridInKey) { 00123 savedLowerBoundAccessor.unmarshal(ridSearchKeyData); 00124 pSearchKey = &ridSearchKeyData; 00125 } else { 00126 savedLowerBoundAccessor.unmarshal(inputKeyData); 00127 pSearchKey = &inputKeyData; 00128 } 00129 }
void LbmSearchExecStream::prepare | ( | LbmSearchExecStreamParams const & | params | ) | [virtual] |
Definition at line 29 of file LbmSearchExecStream.cpp.
References TupleDatum::cbData, TupleData::compute(), TupleAccessor::compute(), ignoreRowLimit, BTreeSearchExecStream::inputKeyDesc, BTreeDescriptor::keyProjection, BTreeSearchExecStream::leastUpper, TupleDatum::pData, BTreePrefetchSearchExecStream::pfLowerBoundData, BTreePrefetchSearchExecStream::prepare(), ridInKey, ridKeySetup, ridSearchKeyData, rowLimit, rowLimitDatum, LbmSearchExecStreamParams::rowLimitParamId, rowLimitParamId, BTreePrefetchSearchExecStream::savedLowerBoundAccessor, STANDARD_TYPE_RECORDNUM, startRid, startRidDatum, LbmSearchExecStreamParams::startRidParamId, startRidParamId, and BTreeExecStream::treeDescriptor.
00030 { 00031 BTreePrefetchSearchExecStream::prepare(params); 00032 00033 rowLimitParamId = params.rowLimitParamId; 00034 ignoreRowLimit = (rowLimitParamId == DynamicParamId(0)); 00035 if (!ignoreRowLimit) { 00036 // tupledatum for dynamic parameter 00037 rowLimitDatum.pData = (PConstBuffer) &rowLimit; 00038 rowLimitDatum.cbData = sizeof(rowLimit); 00039 } 00040 00041 startRidParamId = params.startRidParamId; 00042 ridInKey = (startRidParamId > DynamicParamId(0)); 00043 if (ridInKey) { 00044 startRidDatum.pData = (PConstBuffer) &startRid; 00045 startRidDatum.cbData = sizeof(startRid); 00046 00047 // add on the rid to the btree search key if the key hasn't already 00048 // been setup 00049 TupleDescriptor ridKeyDesc = inputKeyDesc; 00050 if (inputKeyDesc.size() == treeDescriptor.keyProjection.size() - 1) { 00051 StandardTypeDescriptorFactory stdTypeFactory; 00052 TupleAttributeDescriptor attrDesc( 00053 stdTypeFactory.newDataType(STANDARD_TYPE_RECORDNUM)); 00054 ridKeyDesc.push_back(attrDesc); 00055 ridKeySetup = false; 00056 } else { 00057 assert( 00058 inputKeyDesc.size() == 1 && 00059 inputKeyDesc.size() == treeDescriptor.keyProjection.size()); 00060 ridKeySetup = true; 00061 } 00062 00063 savedLowerBoundAccessor.compute(ridKeyDesc); 00064 ridSearchKeyData.compute(ridKeyDesc); 00065 pfLowerBoundData.compute(ridKeyDesc); 00066 00067 // need to look for greatest lower bound if searching on rid 00068 leastUpper = false; 00069 } 00070 }
SharedBTreeReader BTreePrefetchSearchExecStream::newReader | ( | ) | [protected, virtual, inherited] |
Allocates a new BTreeNonLeafReader.
Reimplemented from BTreeExecStream.
Definition at line 126 of file BTreePrefetchSearchExecStream.cpp.
References BTreeExecStream::pBTreeAccessBase, BTreeExecStream::pBTreeReader, BTreePrefetchSearchExecStream::pLeafReader, and BTreeExecStream::treeDescriptor.
00127 { 00128 pLeafReader = SharedBTreeLeafReader(new BTreeLeafReader(treeDescriptor)); 00129 pBTreeAccessBase = pBTreeReader = pLeafReader; 00130 return pBTreeReader; 00131 }
void BTreePrefetchSearchExecStream::allocateScratchPages | ( | ) | [protected, inherited] |
Allocates the scratch pages that will be used to store search key information.
Definition at line 133 of file BTreePrefetchSearchExecStream.cpp.
References SegNodeLock< Node >::allocatePage(), BTreePrefetchSearchExecStream::currPage, BTreePrefetchSearchExecStream::currPageEntry, SegPageLock::getPage(), CachePage::getWritableData(), BTreePrefetchSearchExecStream::nPrefetchScratchPages, BTreePrefetchSearchExecStream::scratchLock, and BTreePrefetchSearchExecStream::scratchPages.
Referenced by BTreePrefetchSearchExecStream::open().
00134 { 00135 for (uint i = 0; i < nPrefetchScratchPages; i++) { 00136 scratchLock.allocatePage(); 00137 PBuffer page = scratchLock.getPage().getWritableData(); 00138 scratchPages.push_back(page); 00139 } 00140 currPage = 0; 00141 currPageEntry = 0; 00142 }
bool BTreePrefetchSearchExecStream::innerSearchLoop | ( | ) | [protected, inherited] |
Searches individual leaf pages.
Reimplemented from BTreeSearchExecStream.
Definition at line 190 of file BTreePrefetchSearchExecStream.cpp.
References EXECBUF_EOS, BTreePrefetchSearchExecStream::getPrefetchSearchKey(), BTreePrefetchSearchExecStream::initialPrefetchDone, BTreePrefetchSearchExecStream::leafPageQueue, SegPageEntryIter< EntryT >::mapRange(), NULL_PAGE_ID, SingleInputExecStream::pInAccessor, BTreePrefetchSearchExecStream::pLeafReader, BTreeReadExecStream::pReader, BTreePrefetchSearchExecStream::prevLeafSearchRc, BTreePrefetchSearchExecStream::processingDone, BTreeReadExecStream::projAccessor, BTreeSearchExecStream::searchForKey(), BTreeDescriptor::segmentAccessor, BTreePrefetchSearchExecStream::setUpSearchKey(), BTreeSearchExecStream::testInterval(), BTreeExecStream::treeDescriptor, BTreeReadExecStream::tupleData, and TupleProjectionAccessor::unmarshal().
Referenced by BTreePrefetchSearchExecStream::execute().
00191 { 00192 // If we're already positioned within a leaf page, then nothing further 00193 // needs to be done here. 00194 while (!pReader->isPositioned()) { 00195 // Make sure there's input available, in case we're going to 00196 // pre-fetch some pages. 00197 if (pInAccessor->getState() != EXECBUF_EOS && 00198 !pInAccessor->demandData()) 00199 { 00200 return false; 00201 } 00202 00203 if (!initialPrefetchDone) { 00204 if (pInAccessor->getState() == EXECBUF_EOS) { 00205 processingDone = true; 00206 break; 00207 } 00208 getPrefetchSearchKey(); 00209 leafPageQueue.mapRange( 00210 treeDescriptor.segmentAccessor, 00211 NULL_PAGE_ID); 00212 initialPrefetchDone = true; 00213 } else { 00214 ++leafPageQueue; 00215 } 00216 00217 std::pair<PageId, BTreePrefetchSearchKey> &prefetchEntry = 00218 *leafPageQueue; 00219 // When we hit the terminating page, then all input search ranges 00220 // have been processed. 00221 if (prefetchEntry.first == NULL_PAGE_ID) { 00222 processingDone = true; 00223 break; 00224 } 00225 00226 // Setup the search directives and keys to match the criteria 00227 // used to locate the pre-fetch page. Note that we need to do 00228 // this even in the case where we don't need to search the 00229 // page because the directives and bounds are still needed to 00230 // determine where to end the search. 00231 setUpSearchKey(prefetchEntry.second); 00232 pLeafReader->setCurrentPageId(prefetchEntry.first); 00233 00234 // If the previous leaf search yielded a non-match, then we need 00235 // to search the current page, even though this is a continuation 00236 // of a previous search. Otherwise, just start at the first key 00237 // in the new page. 00238 if (prefetchEntry.second.newSearch || !prevLeafSearchRc) { 00239 prevLeafSearchRc = searchForKey(); 00240 if (prevLeafSearchRc) { 00241 break; 00242 } 00243 } else { 00244 if (pReader->searchFirst() && testInterval()) { 00245 projAccessor.unmarshal(tupleData.begin()); 00246 break; 00247 } 00248 } 00249 // If the current leaf page yielded no matches, end the search on it, 00250 // and loop back to search the next leaf page. 00251 pReader->endSearch(); 00252 } 00253 return true; 00254 }
void BTreePrefetchSearchExecStream::getPrefetchSearchKey | ( | ) | [protected, inherited] |
Reads the search directives and keys from the input stream, and initializes the data for use in the btree searches used to pre-fetch leaf pages.
Definition at line 256 of file BTreePrefetchSearchExecStream.cpp.
References BTreeSearchExecStream::lowerBoundDirective, BTreePrefetchSearchExecStream::pfLowerBoundData, BTreePrefetchSearchExecStream::pfLowerBoundDirective, BTreePrefetchSearchExecStream::pfUpperBoundData, BTreePrefetchSearchExecStream::pfUpperBoundDirective, BTreeSearchExecStream::pSearchKey, BTreeSearchExecStream::readDirectives(), BTreeSearchExecStream::readSearchKey(), BTreeSearchExecStream::readUpperBoundKey(), BTreePrefetchSearchExecStream::setAdditionalKeys(), BTreeSearchExecStream::upperBoundData, and BTreeSearchExecStream::upperBoundDirective.
Referenced by BTreePrefetchSearchExecStream::getNextPageForPrefetch(), and BTreePrefetchSearchExecStream::innerSearchLoop().
00257 { 00258 readSearchKey(); 00259 readDirectives(); 00260 setAdditionalKeys(); 00261 readUpperBoundKey(); 00262 pfLowerBoundDirective = lowerBoundDirective; 00263 pfUpperBoundDirective = upperBoundDirective; 00264 pfLowerBoundData = *pSearchKey; 00265 pfUpperBoundData = upperBoundData; 00266 }
void BTreePrefetchSearchExecStream::setUpSearchKey | ( | BTreePrefetchSearchKey const & | searchKey | ) | [protected, inherited] |
Sets up the search key for the current leaf page search using data stored away by a pre-fetch.
[in,out] | searchKey | the data used to setup the search key |
Definition at line 268 of file BTreePrefetchSearchExecStream.cpp.
References BTreePrefetchSearchKey::lowerBoundDirective, BTreeSearchExecStream::lowerBoundDirective, BTreePrefetchSearchKey::lowerKeyBuffer, BTreePrefetchSearchExecStream::savedUpperBoundAccessor, TupleAccessor::setCurrentTupleBuf(), BTreePrefetchSearchExecStream::setLowerBoundKey(), TupleAccessor::unmarshal(), BTreeSearchExecStream::upperBoundData, BTreePrefetchSearchKey::upperBoundDirective, BTreeSearchExecStream::upperBoundDirective, and BTreePrefetchSearchKey::upperKeyBuffer.
Referenced by BTreePrefetchSearchExecStream::innerSearchLoop().
00270 { 00271 lowerBoundDirective = searchKey.lowerBoundDirective; 00272 upperBoundDirective = searchKey.upperBoundDirective; 00273 setLowerBoundKey(searchKey.lowerKeyBuffer); 00274 savedUpperBoundAccessor.setCurrentTupleBuf(searchKey.upperKeyBuffer); 00275 savedUpperBoundAccessor.unmarshal(upperBoundData); 00276 }
void BTreePrefetchSearchExecStream::setSearchKeyData | ( | bool | newSearch, | |
BTreePrefetchSearchKey & | searchKey | |||
) | [protected, inherited] |
Saves away the search key data corresponding to a pre-fetched page.
newSearch | whether a new search yielded the page, or the page is a continuation of a previous search | |
[in,out] | searchKey | the search key information to be filled in |
Definition at line 387 of file BTreePrefetchSearchExecStream.cpp.
References BTreePrefetchSearchExecStream::bigMaxKey, TupleAccessor::getByteCount(), BTreePrefetchSearchExecStream::keyValuesSize, BTreePrefetchSearchKey::lowerBoundDirective, BTreePrefetchSearchKey::lowerKeyBuffer, TupleAccessor::marshal(), BTreePrefetchSearchKey::newSearch, BTreePrefetchSearchExecStream::pfLowerBoundData, BTreePrefetchSearchExecStream::pfLowerBoundDirective, BTreePrefetchSearchExecStream::pfUpperBoundData, BTreePrefetchSearchExecStream::pfUpperBoundDirective, BTreePrefetchSearchExecStream::savedLowerBoundAccessor, BTreePrefetchSearchExecStream::savedUpperBoundAccessor, BTreePrefetchSearchKey::upperBoundDirective, and BTreePrefetchSearchKey::upperKeyBuffer.
Referenced by BTreePrefetchSearchExecStream::getNextPageForPrefetch().
00390 { 00391 searchKey.newSearch = newSearch; 00392 searchKey.lowerBoundDirective = 00393 pfLowerBoundDirective; 00394 searchKey.upperBoundDirective = 00395 pfUpperBoundDirective; 00396 if (bigMaxKey) { 00397 assert( 00398 savedLowerBoundAccessor.getByteCount(pfLowerBoundData) 00399 <= keyValuesSize); 00400 assert( 00401 savedUpperBoundAccessor.getByteCount(pfUpperBoundData) 00402 <= keyValuesSize); 00403 } 00404 savedLowerBoundAccessor.marshal(pfLowerBoundData, searchKey.lowerKeyBuffer); 00405 savedUpperBoundAccessor.marshal(pfUpperBoundData, searchKey.upperKeyBuffer); 00406 }
bool BTreePrefetchSearchExecStream::testNonLeafInterval | ( | ) | [protected, inherited] |
Determines if the current key just read from a non-leaf page contains the last matching page in the search interval.
Definition at line 408 of file BTreePrefetchSearchExecStream.cpp.
References TupleDescriptor::compareTuples(), TupleDescriptor::compareTuplesKey(), BTreeSearchExecStream::inputKeyDesc, BTreePrefetchSearchExecStream::pfLowerBoundData, BTreePrefetchSearchExecStream::pfUpperBoundData, BTreePrefetchSearchExecStream::pfUpperBoundDirective, BTreePrefetchSearchExecStream::pNonLeafReader, BTreeSearchExecStream::readerKeyData, SEARCH_OPEN_UPPER, SEARCH_UNBOUNDED_UPPER, and BTreeNodeAccessor::unmarshalKey().
Referenced by BTreePrefetchSearchExecStream::getNextPageForPrefetch().
00409 { 00410 // If the search has positioned all the way to the right-most node, then 00411 // this is the last non-leaf key. 00412 if (pNonLeafReader->isPositionedOnInfinityKey()) { 00413 return true; 00414 } 00415 00416 BTreeNodeAccessor &nodeAccessor = 00417 pNonLeafReader->getNonLeafNodeAccessor(); 00418 if (pfUpperBoundDirective == SEARCH_UNBOUNDED_UPPER) { 00419 // If there is more one search key in an unbounded search, then the 00420 // first part of the key is an equality. In this case, we have 00421 // to check the equality part of the key to determine whether this 00422 // will be the last matching key. 00423 if (pfLowerBoundData.size() > 1) { 00424 nodeAccessor.unmarshalKey(readerKeyData); 00425 int c = 00426 inputKeyDesc.compareTuplesKey( 00427 pfLowerBoundData, 00428 readerKeyData, 00429 pfLowerBoundData.size() - 1); 00430 // Should never hit c > 0 because the lower bound search should 00431 // not position on a key that the lower bound is greater than. 00432 permAssert(c <= 0); 00433 return (c < 0); 00434 } else { 00435 return false; 00436 } 00437 } else { 00438 nodeAccessor.unmarshalKey(readerKeyData); 00439 int c = inputKeyDesc.compareTuples(pfUpperBoundData, readerKeyData); 00440 // If the upper bound is less than, or equal to the non-leaf key in 00441 // an open upper search, then this is the last possible matching key. 00442 if (c == 0) { 00443 if (pfUpperBoundDirective == SEARCH_OPEN_UPPER) { 00444 c = -1; 00445 } 00446 } 00447 return (c < 0); 00448 } 00449 }
void BTreePrefetchSearchExecStream::prepare | ( | BTreePrefetchSearchExecStreamParams const & | params | ) | [virtual, inherited] |
Definition at line 40 of file BTreePrefetchSearchExecStream.cpp.
References SegPageLock::accessSegment(), TupleData::compute(), TupleAccessor::compute(), BTreeSearchExecStream::inputKeyDesc, BTreePrefetchSearchExecStream::pfLowerBoundData, BTreePrefetchSearchExecStream::pfUpperBoundData, BTreeSearchExecStream::prepare(), SegmentAccessor::pSegment, BTreePrefetchSearchExecStream::savedLowerBoundAccessor, BTreePrefetchSearchExecStream::savedUpperBoundAccessor, BTreeExecStream::scratchAccessor, BTreePrefetchSearchExecStream::scratchLock, BTreePrefetchSearchExecStream::scratchPageSize, and BTreeSearchExecStream::upperBoundDesc.
Referenced by prepare().
00042 { 00043 BTreeSearchExecStream::prepare(params); 00044 00045 savedLowerBoundAccessor.compute(inputKeyDesc); 00046 pfLowerBoundData.compute(inputKeyDesc); 00047 if (upperBoundDesc.size() == 0) { 00048 savedUpperBoundAccessor.compute(inputKeyDesc); 00049 pfUpperBoundData.compute(inputKeyDesc); 00050 } else { 00051 savedUpperBoundAccessor.compute(upperBoundDesc); 00052 pfUpperBoundData.compute(upperBoundDesc); 00053 } 00054 00055 scratchLock.accessSegment(scratchAccessor); 00056 scratchPageSize = scratchAccessor.pSegment->getUsablePageSize(); 00057 }
void BTreeSearchExecStream::prepare | ( | BTreeSearchExecStreamParams const & | params | ) | [inherited] |
Reimplemented in BTreeSearchUniqueExecStream.
Definition at line 32 of file BTreeSearchExecStream.cpp.
References TupleProjectionAccessor::bind(), TupleData::compute(), TupleDescriptor::containsNullable(), BTreeSearchExecStream::directiveAccessor, BTreeSearchExecStream::directiveData, BTreeSearchExecStreamParams::inputDirectiveProj, BTreeSearchExecStream::inputJoinAccessor, BTreeSearchExecStreamParams::inputJoinProj, BTreeSearchExecStream::inputKeyAccessor, BTreeSearchExecStream::inputKeyData, BTreeSearchExecStream::inputKeyDesc, BTreeSearchExecStreamParams::inputKeyProj, BTreeDescriptor::keyProjection, BTreeSearchExecStream::leastUpper, BTreeSearchExecStream::LOWER_BOUND_DIRECTIVE, StandardTypeDescriptorFactory::newDataType(), BTreeSearchExecStream::nJoinAttributes, BTreeSearchExecStreamParams::outerJoin, BTreeSearchExecStream::outerJoin, BTreeReadExecStreamParams::outputProj, SingleOutputExecStreamParams::outputTupleDesc, SingleInputExecStream::pInAccessor, BTreeSearchExecStream::preFilterNulls, ConduitExecStream::prepare(), BTreeReadExecStream::prepare(), TupleDescriptor::projectFrom(), BTreeSearchExecStream::readerKeyData, BTreeSearchExecStreamParams::searchKeyParams, BTreeSearchExecStream::searchKeyParams, BTreeSearchExecStream::searchKeyProj, STANDARD_TYPE_CHAR, BTreeExecStream::treeDescriptor, BTreeSearchExecStream::UPPER_BOUND_DIRECTIVE, BTreeSearchExecStream::upperBoundAccessor, BTreeSearchExecStream::upperBoundData, BTreeSearchExecStream::upperBoundDesc, and BTreeSearchExecStream::upperBoundKeyProj.
Referenced by BTreeSearchUniqueExecStream::prepare(), and BTreePrefetchSearchExecStream::prepare().
00033 { 00034 BTreeReadExecStream::prepare(params); 00035 ConduitExecStream::prepare(params); 00036 00037 leastUpper = true; 00038 outerJoin = params.outerJoin; 00039 searchKeyParams = params.searchKeyParams; 00040 00041 // TODO: assert inputDesc is a prefix of BTree key 00042 00043 TupleDescriptor const &inputDesc = pInAccessor->getTupleDesc(); 00044 00045 TupleAccessor &inputAccessor = pInAccessor->getConsumptionTupleAccessor(); 00046 00047 if (params.inputDirectiveProj.size()) { 00048 assert(params.inputDirectiveProj.size() == 2); 00049 // If a directive is present, we must be projecting the keys, otherwise 00050 // the directives and keys would be overlapping, which doesn't make 00051 // sense. Also, there should be an even number of keys, because 00052 // lower and upper bounds come together in the same tuple. 00053 assert(params.inputKeyProj.size() > 0); 00054 assert((params.inputKeyProj.size() % 2) == 0); 00055 directiveAccessor.bind(inputAccessor, params.inputDirectiveProj); 00056 TupleDescriptor inputDirectiveDesc; 00057 inputDirectiveDesc.projectFrom(inputDesc, params.inputDirectiveProj); 00058 00059 // verify that the directive attribute has the correct datatype 00060 StandardTypeDescriptorFactory stdTypeFactory; 00061 TupleAttributeDescriptor expectedDirectiveDesc( 00062 stdTypeFactory.newDataType(STANDARD_TYPE_CHAR)); 00063 expectedDirectiveDesc.cbStorage = 1; 00064 assert( 00065 inputDirectiveDesc[LOWER_BOUND_DIRECTIVE] == expectedDirectiveDesc); 00066 assert( 00067 inputDirectiveDesc[UPPER_BOUND_DIRECTIVE] == expectedDirectiveDesc); 00068 00069 directiveData.compute(inputDirectiveDesc); 00070 } 00071 00072 if (params.inputKeyProj.size()) { 00073 TupleProjection inputKeyProj = params.inputKeyProj; 00074 if (params.inputDirectiveProj.size()) { 00075 // The inputKeyProj gives us both lower and upper bounds; 00076 // split them because we will access them separately. 00077 TupleProjection upperBoundProj; 00078 int n = inputKeyProj.size() / 2; 00079 // This resize extends... 00080 upperBoundProj.resize(n); 00081 // ...so we have space to copy... 00082 std::copy( 00083 inputKeyProj.begin() + n, 00084 inputKeyProj.end(), 00085 upperBoundProj.begin()); 00086 // ...whereas this one truncates what was copied. 00087 inputKeyProj.resize(n); 00088 00089 upperBoundAccessor.bind(inputAccessor, upperBoundProj); 00090 upperBoundDesc.projectFrom(inputDesc, upperBoundProj); 00091 upperBoundData.compute(upperBoundDesc); 00092 00093 assert( 00094 searchKeyParams.size() == 0 || 00095 (searchKeyParams.size() >= (n-1)*2+1 && 00096 searchKeyParams.size() <= n*2)); 00097 } else { 00098 assert(searchKeyParams.size() == 0); 00099 } 00100 inputKeyAccessor.bind(inputAccessor,inputKeyProj); 00101 inputKeyDesc.projectFrom(inputDesc,inputKeyProj); 00102 } else { 00103 inputKeyDesc = inputDesc; 00104 assert(searchKeyParams.size() == 0); 00105 } 00106 inputKeyData.compute(inputKeyDesc); 00107 00108 if (upperBoundDesc.size()) { 00109 // Verify that all the splitting above came out with the same 00110 // key type for both lower and upper bounds. 00111 assert(upperBoundDesc == inputKeyDesc); 00112 } 00113 00114 preFilterNulls = false; 00115 if ((outerJoin && inputKeyDesc.containsNullable()) || 00116 searchKeyParams.size() > 0) 00117 { 00118 // When we're doing an outer join or a lookup via dynamic parameters, 00119 // the input keys have not had nulls eliminated yet, so we have to 00120 // treat those cases specially. 00121 preFilterNulls = true; 00122 00123 // Setup a projection of the search key. In the case of a dynamic 00124 // parameter search, this will be done later when we read the 00125 // parameters 00126 if (searchKeyParams.size() == 0) { 00127 for (uint i = 0; i < inputKeyData.size(); i++) { 00128 searchKeyProj.push_back(i); 00129 upperBoundKeyProj.push_back(i); 00130 } 00131 } 00132 } 00133 00134 inputJoinAccessor.bind(inputAccessor,params.inputJoinProj); 00135 00136 TupleDescriptor joinDescriptor; 00137 joinDescriptor.projectFrom(inputDesc,params.inputJoinProj); 00138 00139 TupleProjection readerKeyProj = treeDescriptor.keyProjection; 00140 readerKeyProj.resize(inputKeyDesc.size()); 00141 readerKeyData.compute(inputKeyDesc); 00142 00143 nJoinAttributes = params.outputTupleDesc.size() - params.outputProj.size(); 00144 }
void BTreeReadExecStream::prepare | ( | BTreeReadExecStreamParams const & | params | ) | [virtual, inherited] |
Definition at line 31 of file BTreeReadExecStream.cpp.
References TupleData::compute(), BTreeReadExecStreamParams::outputProj, BTreeReadExecStream::outputProj, SingleOutputExecStreamParams::outputTupleDesc, BTreeExecStream::prepare(), and BTreeReadExecStream::tupleData.
Referenced by BTreeSearchExecStream::prepare(), and BTreeScanExecStream::prepare().
00032 { 00033 BTreeExecStream::prepare(params); 00034 outputProj.assign(params.outputProj.begin(), params.outputProj.end()); 00035 tupleData.compute(params.outputTupleDesc); 00036 }
void BTreeExecStream::prepare | ( | BTreeExecStreamParams const & | params | ) | [virtual, inherited] |
Definition at line 30 of file BTreeExecStream.cpp.
References BTreeExecStream::copyParamsToDescriptor(), ExecStreamParams::pCacheAccessor, SingleOutputExecStream::prepare(), BTreeParams::pRootMap, BTreeExecStream::pRootMap, BTreeParams::rootPageIdParamId, BTreeExecStream::rootPageIdParamId, ExecStreamParams::scratchAccessor, BTreeExecStream::scratchAccessor, and BTreeExecStream::treeDescriptor.
Referenced by LcsClusterAppendExecStream::prepare(), LbmGeneratorExecStream::prepare(), BTreeReadExecStream::prepare(), and BTreeInsertExecStream::prepare().
00031 { 00032 SingleOutputExecStream::prepare(params); 00033 00034 copyParamsToDescriptor(treeDescriptor,params,params.pCacheAccessor); 00035 scratchAccessor = params.scratchAccessor; 00036 pRootMap = params.pRootMap; 00037 rootPageIdParamId = params.rootPageIdParamId; 00038 }
void SingleOutputExecStream::prepare | ( | SingleOutputExecStreamParams const & | params | ) | [virtual, inherited] |
Definition at line 48 of file SingleOutputExecStream.cpp.
References SingleOutputExecStream::getOutputBufProvision(), SingleOutputExecStreamParams::outputTupleDesc, SingleOutputExecStreamParams::outputTupleFormat, SingleOutputExecStream::pOutAccessor, and ExecStream::prepare().
Referenced by BTreeExecStream::prepare(), FlatFileExecStreamImpl::prepare(), ValuesExecStream::prepare(), MockResourceExecStream::prepare(), MockProducerExecStream::prepare(), ConfluenceExecStream::prepare(), and ConduitExecStream::prepare().
00049 { 00050 ExecStream::prepare(params); 00051 assert(pOutAccessor); 00052 assert(pOutAccessor->getProvision() == getOutputBufProvision()); 00053 if (pOutAccessor->getTupleDesc().empty()) { 00054 assert(!params.outputTupleDesc.empty()); 00055 pOutAccessor->setTupleShape( 00056 params.outputTupleDesc, 00057 params.outputTupleFormat); 00058 } 00059 }
void ExecStream::prepare | ( | ExecStreamParams const & | params | ) | [virtual, inherited] |
Prepares this stream for execution.
A precondition is that input streams must already be defined and prepared. As an effect of this call, the tuple shape should be defined for all output buffers and remain unchanged for the lifetime of the stream. This method is only ever called once, before the first open. Although this method is virtual, derived classes may choose to define an overloaded version instead with a specialized covariant parameter class.
params | instance of stream parameterization class which should be used to prepare this stream |
Definition at line 84 of file ExecStream.cpp.
References ExecStreamGraph::getDynamicParamManager(), SegmentAccessor::pCacheAccessor, ExecStreamParams::pCacheAccessor, ExecStream::pDynamicParamManager, ExecStream::pGraph, ExecStream::pQuotaAccessor, ExecStream::pScratchQuotaAccessor, and ExecStreamParams::scratchAccessor.
Referenced by JavaTransformExecStream::prepare(), SingleOutputExecStream::prepare(), and SingleInputExecStream::prepare().
00085 { 00086 if (pGraph) { 00087 pDynamicParamManager = pGraph->getDynamicParamManager(); 00088 } 00089 pQuotaAccessor = params.pCacheAccessor; 00090 pScratchQuotaAccessor = params.scratchAccessor.pCacheAccessor; 00091 }
void ConduitExecStream::prepare | ( | ConduitExecStreamParams const & | params | ) | [virtual, inherited] |
Definition at line 42 of file ConduitExecStream.cpp.
References SingleInputExecStream::pInAccessor, SingleOutputExecStream::pOutAccessor, SingleOutputExecStream::prepare(), and SingleInputExecStream::prepare().
Referenced by ExternalSortExecStreamImpl::prepare(), LcsClusterAppendExecStream::prepare(), LbmNormalizerExecStream::prepare(), LhxAggExecStream::prepare(), FtrsTableWriterExecStream::prepare(), BTreeSearchExecStream::prepare(), BTreeInsertExecStream::prepare(), UncollectExecStream::prepare(), SortedAggExecStream::prepare(), SegBufferReaderExecStream::prepare(), SegBufferExecStream::prepare(), ScratchBufferExecStream::prepare(), ReshapeExecStream::prepare(), DoubleBufferExecStream::prepare(), CopyExecStream::prepare(), CollectExecStream::prepare(), BernoulliSamplingExecStream::prepare(), and CalcExecStream::prepare().
00043 { 00044 SingleInputExecStream::prepare(params); 00045 00046 if (params.outputTupleDesc.empty()) { 00047 pOutAccessor->setTupleShape( 00048 pInAccessor->getTupleDesc(), 00049 pInAccessor->getTupleFormat()); 00050 } 00051 00052 SingleOutputExecStream::prepare(params); 00053 }
void SingleInputExecStream::prepare | ( | SingleInputExecStreamParams const & | params | ) | [virtual, inherited] |
Definition at line 44 of file SingleInputExecStream.cpp.
References SingleInputExecStream::getInputBufProvision(), SingleInputExecStream::pInAccessor, and ExecStream::prepare().
Referenced by JavaSinkExecStream::prepare(), MockConsumerExecStream::prepare(), DiffluenceExecStream::prepare(), and ConduitExecStream::prepare().
00045 { 00046 ExecStream::prepare(params); 00047 00048 assert(pInAccessor); 00049 assert(pInAccessor->getProvision() == getInputBufProvision()); 00050 }
void BTreePrefetchSearchExecStream::getResourceRequirements | ( | ExecStreamResourceQuantity & | minQuantity, | |
ExecStreamResourceQuantity & | optQuantity, | |||
ExecStreamResourceSettingType & | optType | |||
) | [virtual, inherited] |
Determines resource requirements for this stream.
Default implementation declares zero resource requirements.
minQuantity | receives the minimum resource quantity needed by this stream in order to execute | |
optQuantity | receives the resource quantity needed by this stream in order to execute optimally | |
optType | Receives the value indicating the accuracy of the optQuantity parameter. This parameter is optional and defaults to EXEC_RESOURCE_ACCURATE if omitted. If the optimum setting is an estimate or no value can be specified (e.g., due to lack of statistics), then this parameter needs to be used to indicate a non-accurate optimum resource setting. |
Reimplemented from ExecStream.
Definition at line 59 of file BTreePrefetchSearchExecStream.cpp.
References BTreePrefetchSearchExecStream::bigMaxKey, EXEC_RESOURCE_ACCURATE, TupleAccessor::getMaxByteCount(), BTreeReadExecStream::getResourceRequirements(), BTreePrefetchSearchExecStream::keyValuesSize, ExecStreamResourceQuantity::nCachePages, BTreePrefetchSearchExecStream::nEntriesPerScratchPage, BTreePrefetchSearchExecStream::nMiscCachePages, BTreePrefetchSearchExecStream::savedLowerBoundAccessor, and BTreePrefetchSearchExecStream::scratchPageSize.
00063 { 00064 BTreeSearchExecStream::getResourceRequirements(minQuantity, optQuantity); 00065 00066 // Need one more page because there are two btree readers 00067 minQuantity.nCachePages += 1; 00068 optQuantity.nCachePages += 1; 00069 nMiscCachePages = minQuantity.nCachePages; 00070 00071 // Set aside pages for storing search key information associated with 00072 // pre-fetched index leaf pages. At a minimum, we need one page, but ask 00073 // for extra if it's available, based on the space required for the 00074 // search key information, up to a max of 8K pre-fetch entries. 00075 minQuantity.nCachePages += 1; 00076 keyValuesSize = savedLowerBoundAccessor.getMaxByteCount() * 2; 00077 00078 // The actual size of the keys should never exceed a page size, but we're 00079 // trying to store at least 2 keys on each page. If the max size is such 00080 // that we can only store a single key on a page, then set aside 2 entire 00081 // pages, one per key. 00082 if (keyValuesSize > scratchPageSize) { 00083 bigMaxKey = true; 00084 keyValuesSize = scratchPageSize; 00085 minQuantity.nCachePages += 1; 00086 } else { 00087 bigMaxKey = false; 00088 } 00089 00090 nEntriesPerScratchPage = scratchPageSize / keyValuesSize; 00091 uint optNumPages = (uint) ceil(8192.0 / nEntriesPerScratchPage); 00092 assert(optNumPages >= 1); 00093 optQuantity.nCachePages += optNumPages; 00094 optType = EXEC_RESOURCE_ACCURATE; 00095 }
void BTreeReadExecStream::getResourceRequirements | ( | ExecStreamResourceQuantity & | minQuantity, | |
ExecStreamResourceQuantity & | optQuantity | |||
) | [virtual, inherited] |
Reimplemented from ExecStream.
Definition at line 38 of file BTreeReadExecStream.cpp.
References ExecStream::getResourceRequirements(), and ExecStreamResourceQuantity::nCachePages.
Referenced by BTreePrefetchSearchExecStream::getResourceRequirements().
00041 { 00042 BTreeExecStream::getResourceRequirements(minQuantity,optQuantity); 00043 00044 // one page for BTreeReader 00045 minQuantity.nCachePages += 1; 00046 00047 // TODO: use opt to govern prefetch and come up with a good formula 00048 optQuantity = minQuantity; 00049 }
void BTreePrefetchSearchExecStream::setResourceAllocation | ( | ExecStreamResourceQuantity & | quantity | ) | [virtual, inherited] |
Sets current resource allocation for this stream.
If called while the stream is open, this indicates a request for the stream to dynamically adjust its memory usage. If the stream is incapable of honoring the request, it should update quantity with the actual amounts still in use.
quantity | allocated resource quantity |
Reimplemented from ExecStream.
Definition at line 97 of file BTreePrefetchSearchExecStream.cpp.
References ExecStreamResourceQuantity::nCachePages, BTreePrefetchSearchExecStream::nMiscCachePages, BTreePrefetchSearchExecStream::nPrefetchScratchPages, and ExecStream::setResourceAllocation().
00099 { 00100 BTreeSearchExecStream::setResourceAllocation(quantity); 00101 nPrefetchScratchPages = quantity.nCachePages - nMiscCachePages; 00102 }
void BTreePrefetchSearchExecStream::open | ( | bool | restart | ) | [virtual, inherited] |
Opens this stream, acquiring any resources needed in order to be able to fetch data.
A precondition is that input streams must already be opened. A stream can be closed and reopened.
restart | if true, the stream must be already open, and should reset itself to start from the beginning of its result set |
Reimplemented from BTreeSearchExecStream.
Definition at line 104 of file BTreePrefetchSearchExecStream.cpp.
References BTreePrefetchSearchExecStream::allocateScratchPages(), BTreePrefetchSearchExecStream::bigMaxKey, BTreePrefetchSearchExecStream::initialPrefetchDone, BTreePrefetchSearchExecStream::leafPageQueue, BTreePrefetchSearchExecStream::nEntriesPerScratchPage, BTreePrefetchSearchExecStream::nPrefetchScratchPages, BTreeSearchExecStream::open(), BTreePrefetchSearchExecStream::pNonLeafReader, BTreePrefetchSearchExecStream::prevLeafSearchRc, BTreePrefetchSearchExecStream::processingDone, SegPageEntryIter< EntryT >::resize(), BTreePrefetchSearchExecStream::returnedRoot, BTreePrefetchSearchExecStream::rootOnly, SegPageEntryIter< EntryT >::setPrefetchSource(), and BTreeExecStream::treeDescriptor.
00105 { 00106 BTreeSearchExecStream::open(restart); 00107 pNonLeafReader = 00108 SharedBTreeNonLeafReader(new BTreeNonLeafReader(treeDescriptor)); 00109 initialPrefetchDone = false; 00110 processingDone = false; 00111 prevLeafSearchRc = true; 00112 returnedRoot = false; 00113 rootOnly = (pNonLeafReader->isRootOnly()); 00114 00115 if (!restart) { 00116 uint nPrefetchEntries = 00117 (bigMaxKey) ? 00118 nPrefetchScratchPages / 2 : 00119 nPrefetchScratchPages * nEntriesPerScratchPage; 00120 leafPageQueue.resize(nPrefetchEntries); 00121 allocateScratchPages(); 00122 leafPageQueue.setPrefetchSource(*this); 00123 } 00124 }
ExecStreamResult BTreePrefetchSearchExecStream::execute | ( | ExecStreamQuantum const & | quantum | ) | [virtual, inherited] |
Executes this stream.
quantum | governs the maximum amount of execution to perform |
Reimplemented from BTreeSearchExecStream.
Definition at line 161 of file BTreePrefetchSearchExecStream.cpp.
References EXECBUF_EOS, EXECRC_BUF_UNDERFLOW, EXECRC_EOS, EXECRC_YIELD, BTreeSearchExecStream::innerFetchLoop(), BTreePrefetchSearchExecStream::innerSearchLoop(), SingleInputExecStream::pInAccessor, SingleOutputExecStream::pOutAccessor, and BTreePrefetchSearchExecStream::processingDone.
00163 { 00164 uint nTuples = 0; 00165 00166 // Iterate over each input search key, locating and pre-fetching 00167 // leaf pages that contain matching keys. 00168 for (;;) { 00169 // Position within a pre-fetched leaf page. 00170 if (!innerSearchLoop()) { 00171 return EXECRC_BUF_UNDERFLOW; 00172 } 00173 00174 // If there are no more search keys in the input and all input has 00175 // been processed, then we've completed execution. 00176 if (pInAccessor->getState() == EXECBUF_EOS && processingDone) { 00177 pOutAccessor->markEOS(); 00178 return EXECRC_EOS; 00179 } 00180 00181 // Then, fetch matching records from that leaf page until we hit 00182 // a record outside the desired search range. 00183 ExecStreamResult rc = innerFetchLoop(quantum, nTuples); 00184 if (rc != EXECRC_YIELD) { 00185 return rc; 00186 } 00187 } 00188 }
void BTreePrefetchSearchExecStream::initPrefetchEntry | ( | BTreePrefetchSearchKey & | searchKey | ) | [virtual, inherited] |
Initializes a specific entry in the pre-fetch queue.
entry | the entry that will be initialized |
Reimplemented from SegPageEntryIterSource< BTreePrefetchSearchKey >.
Definition at line 144 of file BTreePrefetchSearchExecStream.cpp.
References BTreePrefetchSearchExecStream::bigMaxKey, BTreePrefetchSearchExecStream::currPage, BTreePrefetchSearchExecStream::currPageEntry, BTreePrefetchSearchExecStream::keyValuesSize, BTreePrefetchSearchKey::lowerKeyBuffer, BTreePrefetchSearchExecStream::nEntriesPerScratchPage, BTreePrefetchSearchExecStream::scratchPages, and BTreePrefetchSearchKey::upperKeyBuffer.
00146 { 00147 if (bigMaxKey) { 00148 searchKey.lowerKeyBuffer = scratchPages[currPage++]; 00149 searchKey.upperKeyBuffer = scratchPages[currPage++]; 00150 } else { 00151 searchKey.lowerKeyBuffer = 00152 scratchPages[currPage] + currPageEntry * keyValuesSize; 00153 searchKey.upperKeyBuffer = searchKey.lowerKeyBuffer + keyValuesSize / 2; 00154 if (++currPageEntry == nEntriesPerScratchPage) { 00155 currPage++; 00156 currPageEntry = 0; 00157 } 00158 } 00159 }
PageId BTreePrefetchSearchExecStream::getNextPageForPrefetch | ( | BTreePrefetchSearchKey & | searchKey, | |
bool & | found | |||
) | [virtual, inherited] |
Retrieves the next pageId to be pre-fetched, also filling in context- specific information associated with the page.
[in,out] | entry | the context-specific information to be filled in |
[out] | found | true if a pageId has been found and should be added to the pre-fetch queue |
Implements SegPageEntryIterSource< BTreePrefetchSearchKey >.
Definition at line 290 of file BTreePrefetchSearchExecStream.cpp.
References DUP_SEEK_BEGIN, DUP_SEEK_END, BTreePrefetchSearchExecStream::endOnNextKey, EXECBUF_EOS, BTreePrefetchSearchExecStream::getPrefetchSearchKey(), BTreeSearchExecStream::leastUpper, BTreeSearchExecStream::lowerBoundDirective, NULL_PAGE_ID, BTreePrefetchSearchExecStream::pfLowerBoundData, BTreePrefetchSearchExecStream::pfLowerBoundDirective, SingleInputExecStream::pInAccessor, BTreePrefetchSearchExecStream::pNonLeafReader, BTreePrefetchSearchExecStream::returnedRoot, BTreePrefetchSearchExecStream::rootOnly, SEARCH_CLOSED_LOWER, SEARCH_OPEN_LOWER, SEARCH_UNBOUNDED_LOWER, BTreePrefetchSearchExecStream::setSearchKeyData(), and BTreePrefetchSearchExecStream::testNonLeafInterval().
00293 { 00294 found = true; 00295 00296 // Handle the special case where the tree consists of a single root page 00297 // by simply pre-fetching that root page for each search range. Note 00298 // that the page will actually only be pre-fetched once. 00299 if (rootOnly) { 00300 while (true) { 00301 if (returnedRoot) { 00302 if (pInAccessor->getState() == EXECBUF_EOS) { 00303 return NULL_PAGE_ID; 00304 } else if (!pInAccessor->demandData()) { 00305 found = false; 00306 return NULL_PAGE_ID; 00307 } 00308 returnedRoot = false; 00309 getPrefetchSearchKey(); 00310 } 00311 returnedRoot = true; 00312 setSearchKeyData(true, searchKey); 00313 pInAccessor->consumeTuple(); 00314 return pNonLeafReader->getRootPageId(); 00315 } 00316 } 00317 00318 bool first; 00319 00320 while (true) { 00321 // If we're already positioned within the non-leaf page, then continue 00322 // searching the page, unless the previous key was larger than the 00323 // upper bound, in which case, the previous page is the last matching 00324 // leaf page, and therefore, we should end the current search. 00325 if (pNonLeafReader->isPositioned()) { 00326 first = false; 00327 if (endOnNextKey) { 00328 pInAccessor->consumeTuple(); 00329 pNonLeafReader->endSearch(); 00330 continue; 00331 } else { 00332 pNonLeafReader->searchNext(); 00333 } 00334 00335 // Otherwise, initiate a search on the non-leaf page based on the lower 00336 // bound directive. If necessary, first read the search directives 00337 // from the input stream, provided there's input available. 00338 } else { 00339 if (!pInAccessor->isTupleConsumptionPending()) { 00340 // If the current input stream buffer is exhausted, passing 00341 // back a NULL_PAGE_ID will signal innerSearchLoop() to 00342 // map a new range of pre-fetches. 00343 if (pInAccessor->getState() == EXECBUF_EOS) { 00344 return NULL_PAGE_ID; 00345 } else if (!pInAccessor->demandData()) { 00346 found = false; 00347 return NULL_PAGE_ID; 00348 } 00349 getPrefetchSearchKey(); 00350 } 00351 first = true; 00352 switch (pfLowerBoundDirective) { 00353 case SEARCH_UNBOUNDED_LOWER: 00354 if (pfLowerBoundData.size() <= 1) { 00355 pNonLeafReader->searchFirst(); 00356 break; 00357 } 00358 // Fall through to handle the case where we have > 1 key and a 00359 // non-equality search on the last key. In this case, we need to 00360 // position to the equality portion of the key 00361 case SEARCH_CLOSED_LOWER: 00362 pNonLeafReader->searchForKey( 00363 pfLowerBoundData, DUP_SEEK_BEGIN, leastUpper); 00364 break; 00365 case SEARCH_OPEN_LOWER: 00366 pNonLeafReader->searchForKey( 00367 pfLowerBoundData, DUP_SEEK_END, leastUpper); 00368 break; 00369 default: 00370 permFail( 00371 "unexpected lower bound directive: " 00372 << (char) lowerBoundDirective); 00373 } 00374 } 00375 00376 // See if the key found corresponds to the last possible matching 00377 // key before passing back the pre-fetch info. Note that we should 00378 // always find a key because at a minimum, we'll find the infinity 00379 // key. 00380 assert(!pNonLeafReader->isSingular()); 00381 endOnNextKey = testNonLeafInterval(); 00382 setSearchKeyData(first, searchKey); 00383 return pNonLeafReader->getChildForCurrent(); 00384 } 00385 }
void BTreePrefetchSearchExecStream::closeImpl | ( | ) | [virtual, inherited] |
Implements ClosableObject.
ExecStream implementations may override this to release any resources acquired while open.
Reimplemented from BTreeSearchExecStream.
Definition at line 451 of file BTreePrefetchSearchExecStream.cpp.
References BTreeSearchExecStream::closeImpl(), NULL_PAGE_ID, SegmentAccessor::pSegment, BTreeExecStream::scratchAccessor, and BTreePrefetchSearchExecStream::scratchPages.
00452 { 00453 BTreeSearchExecStream::closeImpl(); 00454 scratchPages.clear(); 00455 if (scratchAccessor.pSegment) { 00456 scratchAccessor.pSegment->deallocatePageRange( 00457 NULL_PAGE_ID, NULL_PAGE_ID); 00458 } 00459 }
ExecStreamResult BTreeSearchExecStream::innerFetchLoop | ( | ExecStreamQuantum const & | quantum, | |
uint & | nTuples | |||
) | [protected, inherited] |
Definition at line 446 of file BTreeSearchExecStream.cpp.
References EXECRC_BUF_OVERFLOW, EXECRC_QUANTUM_EXPIRED, EXECRC_YIELD, BTreeSearchExecStream::nJoinAttributes, ExecStreamQuantum::nTuplesMax, SingleOutputExecStream::pOutAccessor, BTreeReadExecStream::pReader, BTreeReadExecStream::projAccessor, BTreeSearchExecStream::reachedTupleLimit(), BTreeSearchExecStream::testInterval(), BTreeReadExecStream::tupleData, and TupleProjectionAccessor::unmarshal().
Referenced by BTreeSearchExecStream::execute(), and BTreePrefetchSearchExecStream::execute().
00449 { 00450 for (;;) { 00451 if (nTuples >= quantum.nTuplesMax) { 00452 return EXECRC_QUANTUM_EXPIRED; 00453 } 00454 if (reachedTupleLimit(nTuples)) { 00455 return EXECRC_BUF_OVERFLOW; 00456 } 00457 if (pOutAccessor->produceTuple(tupleData)) { 00458 ++nTuples; 00459 } else { 00460 return EXECRC_BUF_OVERFLOW; 00461 } 00462 if (pReader->searchNext()) { 00463 if (testInterval()) { 00464 projAccessor.unmarshal( 00465 tupleData.begin() + nJoinAttributes); 00466 // continue with inner fetch loop 00467 continue; 00468 } 00469 } 00470 pReader->endSearch(); 00471 // break out of this loop to enable a new key search 00472 return EXECRC_YIELD; 00473 } 00474 }
void BTreeSearchExecStream::readDirectives | ( | ) | [protected, inherited] |
Definition at line 265 of file BTreeSearchExecStream.cpp.
References BTreeSearchExecStream::directiveAccessor, BTreeSearchExecStream::directiveData, BTreeSearchExecStream::LOWER_BOUND_DIRECTIVE, BTreeSearchExecStream::lowerBoundDirective, SEARCH_CLOSED_LOWER, SEARCH_CLOSED_UPPER, TupleProjectionAccessor::size(), TupleProjectionAccessor::unmarshal(), BTreeSearchExecStream::UPPER_BOUND_DIRECTIVE, and BTreeSearchExecStream::upperBoundDirective.
Referenced by BTreePrefetchSearchExecStream::getPrefetchSearchKey(), and BTreeSearchExecStream::innerSearchLoop().
00266 { 00267 if (!directiveAccessor.size()) { 00268 // default to point intervals 00269 lowerBoundDirective = SEARCH_CLOSED_LOWER; 00270 upperBoundDirective = SEARCH_CLOSED_UPPER; 00271 return; 00272 } 00273 00274 directiveAccessor.unmarshal(directiveData); 00275 00276 // directives can never be null 00277 assert(directiveData[LOWER_BOUND_DIRECTIVE].pData); 00278 assert(directiveData[UPPER_BOUND_DIRECTIVE].pData); 00279 00280 lowerBoundDirective = 00281 SearchEndpoint(*(directiveData[LOWER_BOUND_DIRECTIVE].pData)); 00282 upperBoundDirective = 00283 SearchEndpoint(*(directiveData[UPPER_BOUND_DIRECTIVE].pData)); 00284 }
bool BTreeSearchExecStream::testInterval | ( | ) | [protected, inherited] |
Definition at line 390 of file BTreeSearchExecStream.cpp.
References BTreeSearchExecStream::checkNextKey(), TupleDescriptor::compareTuples(), TupleDescriptor::compareTuplesKey(), BTreeSearchExecStream::inputKeyDesc, BTreeSearchExecStream::leastUpper, BTreeSearchExecStream::lowerBoundDirective, BTreeSearchExecStream::pSearchKey, BTreeSearchExecStream::readerKeyAccessor, BTreeSearchExecStream::readerKeyData, SEARCH_CLOSED_LOWER, SEARCH_CLOSED_UPPER, SEARCH_UNBOUNDED_UPPER, TupleProjectionAccessor::unmarshal(), BTreeSearchExecStream::upperBoundData, and BTreeSearchExecStream::upperBoundDirective.
Referenced by BTreeSearchExecStream::innerFetchLoop(), BTreePrefetchSearchExecStream::innerSearchLoop(), and BTreeSearchExecStream::searchForKey().
00391 { 00392 if (upperBoundDirective == SEARCH_UNBOUNDED_UPPER) { 00393 // if more than one search key in an unbounded search, the first part 00394 // of the key must be equality, so make sure that part of the key 00395 // matches 00396 if (pSearchKey->size() > 1) { 00397 readerKeyAccessor.unmarshal(readerKeyData); 00398 int c = 00399 inputKeyDesc.compareTuplesKey( 00400 readerKeyData, 00401 *pSearchKey, 00402 pSearchKey->size() - 1); 00403 if (c != 0) { 00404 return false; 00405 } 00406 } 00407 return true; 00408 } else { 00409 readerKeyAccessor.unmarshal(readerKeyData); 00410 int c = inputKeyDesc.compareTuples(upperBoundData, readerKeyData); 00411 if (upperBoundDirective == SEARCH_CLOSED_UPPER) { 00412 // if this is a greatest lower bound equality search on > 1 key, 00413 // it is possible that we are positioned one key to the left of 00414 // our desired key position; move forward one key to see if there 00415 // is a match 00416 if (!leastUpper && lowerBoundDirective == SEARCH_CLOSED_LOWER && 00417 pSearchKey->size() > 1 && c > 0) 00418 { 00419 return checkNextKey(); 00420 } 00421 if (c >= 0) { 00422 return true; 00423 } 00424 } else { 00425 if (c > 0) { 00426 return true; 00427 } 00428 } 00429 } 00430 return false; 00431 }
void BTreeSearchExecStream::readSearchKey | ( | ) | [protected, inherited] |
Reads the search key either from the input stream or dynamic parameters.
Definition at line 216 of file BTreeSearchExecStream.cpp.
References BTreeSearchExecStream::dynamicKeysRead, BTreeSearchExecStream::inputKeyAccessor, BTreeSearchExecStream::inputKeyData, ExecStream::pDynamicParamManager, SingleInputExecStream::pInAccessor, BTreeSearchExecStream::searchKeyParams, BTreeSearchExecStream::searchKeyProj, TupleProjectionAccessor::size(), TupleAccessor::unmarshal(), and TupleProjectionAccessor::unmarshal().
Referenced by BTreePrefetchSearchExecStream::getPrefetchSearchKey(), and BTreeSearchExecStream::innerSearchLoop().
00217 { 00218 // Even if we're not going to be reading the key values from the input 00219 // stream, we'll later need to read the directives, so we need to access 00220 // the input stream tuple 00221 TupleAccessor &inputAccessor = 00222 pInAccessor->accessConsumptionTuple(); 00223 00224 if (searchKeyParams.size() == 0) { 00225 if (inputKeyAccessor.size()) { 00226 // unmarshal just the key projection 00227 inputKeyAccessor.unmarshal(inputKeyData); 00228 } else { 00229 // umarshal the whole thing as the key 00230 inputAccessor.unmarshal(inputKeyData); 00231 } 00232 } else { 00233 // When passing in key values through dynamic parameters, only one 00234 // search range is allowed 00235 assert(!dynamicKeysRead); 00236 00237 // NOTE zfong 5/22/07 - We are accessing the dynamic parameter values 00238 // by reference rather than value. Therefore, the underlying values 00239 // are expected to be fixed for the duration of this search. Likewise, 00240 // in readUpperBoundKey(). 00241 uint nParams = searchKeyParams.size(); 00242 searchKeyProj.clear(); 00243 for (uint i = 0; i < nParams / 2; i++) { 00244 inputKeyData[searchKeyParams[i].keyOffset] = 00245 pDynamicParamManager->getParam( 00246 searchKeyParams[i].dynamicParamId).getDatum(); 00247 searchKeyProj.push_back(i); 00248 } 00249 // If there are an odd number of parameters, determine whether the 00250 // next parameter corresponds to the lower or upper bound 00251 if ((nParams%2) && searchKeyParams[nParams/2].keyOffset == nParams/2) { 00252 inputKeyData[nParams / 2] = 00253 pDynamicParamManager->getParam( 00254 searchKeyParams[nParams / 2].dynamicParamId).getDatum(); 00255 // The search key projection in the case of dynamic parameters 00256 // consists of only the portion of the search key that corresponds 00257 // to actual parameters supplied 00258 searchKeyProj.push_back(nParams / 2); 00259 } 00260 00261 dynamicKeysRead = true; 00262 } 00263 }
void BTreeSearchExecStream::readUpperBoundKey | ( | ) | [protected, inherited] |
Reads the upper bound key either from the input stream or dynamic parameters.
Definition at line 352 of file BTreeSearchExecStream.cpp.
References ExecStream::pDynamicParamManager, BTreeSearchExecStream::pSearchKey, BTreeSearchExecStream::searchKeyParams, TupleProjectionAccessor::unmarshal(), BTreeSearchExecStream::upperBoundAccessor, BTreeSearchExecStream::upperBoundData, BTreeSearchExecStream::upperBoundDesc, and BTreeSearchExecStream::upperBoundKeyProj.
Referenced by BTreePrefetchSearchExecStream::getPrefetchSearchKey(), and BTreeSearchExecStream::innerSearchLoop().
00353 { 00354 if (searchKeyParams.size() == 0) { 00355 if (upperBoundDesc.size()) { 00356 upperBoundAccessor.unmarshal(upperBoundData); 00357 } else { 00358 upperBoundData = *pSearchKey; 00359 } 00360 } else { 00361 // If there are an odd number of parameters, determine whether the 00362 // first parameter in the second group of parameters corresponds 00363 // to the lower or upper bound. If there are an even number of 00364 // parameters, always read that first parameter. 00365 uint nParams = searchKeyParams.size(); 00366 // The search key projection in the case of dynamic parameters 00367 // consists of only the portion of the search key that corresponds 00368 // to actual parameters supplied. Since the lower and upper bound 00369 // keys may have a different number of supplied parameters, we need 00370 // to recreate the projection. 00371 upperBoundKeyProj.clear(); 00372 if (!(nParams % 2) 00373 || searchKeyParams[nParams / 2].keyOffset == nParams / 2 + 1) 00374 { 00375 upperBoundData[0] = 00376 pDynamicParamManager->getParam( 00377 searchKeyParams[nParams / 2].dynamicParamId).getDatum(); 00378 upperBoundKeyProj.push_back(0); 00379 } 00380 uint keySize = upperBoundData.size(); 00381 for (uint i = nParams / 2 + 1; i < nParams; i++) { 00382 upperBoundData[searchKeyParams[i].keyOffset - keySize] = 00383 pDynamicParamManager->getParam( 00384 searchKeyParams[i].dynamicParamId).getDatum(); 00385 upperBoundKeyProj.push_back(i - keySize); 00386 } 00387 } 00388 }
bool BTreeSearchExecStream::checkNextKey | ( | ) | [protected, inherited] |
Determines if the next key value is within the upper bound search range.
Definition at line 433 of file BTreeSearchExecStream.cpp.
References TupleDescriptor::compareTuples(), BTreeSearchExecStream::inputKeyDesc, BTreeReadExecStream::pReader, BTreeSearchExecStream::readerKeyAccessor, BTreeSearchExecStream::readerKeyData, TupleProjectionAccessor::unmarshal(), and BTreeSearchExecStream::upperBoundData.
Referenced by BTreeSearchExecStream::testInterval().
00434 { 00435 // read the next key 00436 if (!pReader->searchNext()) { 00437 return false; 00438 } 00439 readerKeyAccessor.unmarshal(readerKeyData); 00440 int c = inputKeyDesc.compareTuples(upperBoundData, readerKeyData); 00441 // should only have to read one more key 00442 assert(c <= 0); 00443 return (c == 0); 00444 }
bool BTreeSearchExecStream::searchForKey | ( | ) | [protected, inherited] |
Searches the btree for a specific key.
Definition at line 286 of file BTreeSearchExecStream.cpp.
References TupleData::containsNull(), DUP_SEEK_BEGIN, DUP_SEEK_END, BTreeSearchExecStream::inputJoinAccessor, BTreeSearchExecStream::leastUpper, BTreeSearchExecStream::lowerBoundDirective, BTreeSearchExecStream::nJoinAttributes, BTreeSearchExecStream::outerJoin, BTreeReadExecStream::pReader, BTreeSearchExecStream::preFilterNulls, BTreeReadExecStream::projAccessor, BTreeSearchExecStream::pSearchKey, SEARCH_CLOSED_LOWER, SEARCH_OPEN_LOWER, SEARCH_UNBOUNDED_LOWER, BTreeSearchExecStream::searchKeyProj, TupleProjectionAccessor::size(), BTreeSearchExecStream::testInterval(), BTreeReadExecStream::tupleData, TupleProjectionAccessor::unmarshal(), BTreeSearchExecStream::upperBoundData, and BTreeSearchExecStream::upperBoundKeyProj.
Referenced by BTreeSearchExecStream::innerSearchLoop(), and BTreePrefetchSearchExecStream::innerSearchLoop().
00287 { 00288 switch (lowerBoundDirective) { 00289 case SEARCH_UNBOUNDED_LOWER: 00290 if (pSearchKey->size() <= 1) { 00291 pReader->searchFirst(); 00292 break; 00293 } 00294 // otherwise, this is the case where we have > 1 key and a 00295 // non-equality search on the last key; in this case, we need 00296 // to position to the equality portion of the key 00297 case SEARCH_CLOSED_LOWER: 00298 pReader->searchForKey(*pSearchKey, DUP_SEEK_BEGIN, leastUpper); 00299 break; 00300 case SEARCH_OPEN_LOWER: 00301 pReader->searchForKey(*pSearchKey, DUP_SEEK_END, leastUpper); 00302 break; 00303 default: 00304 permFail( 00305 "unexpected lower bound directive: " 00306 << (char) lowerBoundDirective); 00307 } 00308 00309 bool match = true; 00310 if (preFilterNulls && pSearchKey->containsNull(searchKeyProj)) { 00311 // null never matches when preFilterNulls is true; 00312 // TODO: so don't bother searching, but need a way 00313 // to fake pReader->isPositioned() 00314 match = false; 00315 } else { 00316 if (pReader->isSingular()) { 00317 // Searched past end of tree. 00318 match = false; 00319 } else { 00320 if (preFilterNulls && 00321 upperBoundData.containsNull(upperBoundKeyProj)) 00322 { 00323 match = false; 00324 } else { 00325 match = testInterval(); 00326 } 00327 } 00328 } 00329 00330 if (!match) { 00331 if (!outerJoin) { 00332 pReader->endSearch(); 00333 return false; 00334 } 00335 // no match, so make up null values for the missing attributes 00336 for (uint i = nJoinAttributes; i < tupleData.size(); ++i) { 00337 tupleData[i].pData = NULL; 00338 } 00339 } else { 00340 projAccessor.unmarshal( 00341 tupleData.begin() + nJoinAttributes); 00342 } 00343 00344 // propagate join attributes 00345 if (inputJoinAccessor.size()) { 00346 inputJoinAccessor.unmarshal(tupleData); 00347 } 00348 00349 return true; 00350 }
SharedBTreeWriter BTreeExecStream::newWriter | ( | bool | monotonic = false |
) | [protected, inherited] |
Definition at line 75 of file BTreeExecStream.cpp.
References BTreeExecStream::pBTreeAccessBase, BTreeExecStream::pBTreeReader, BTreeExecStream::scratchAccessor, and BTreeExecStream::treeDescriptor.
Referenced by FtrsTableWriter::createIndexWriter(), and BTreeInsertExecStream::open().
00076 { 00077 SharedBTreeWriter pWriter = SharedBTreeWriter( 00078 new BTreeWriter(treeDescriptor,scratchAccessor,monotonic)); 00079 pBTreeAccessBase = pBTreeReader = pWriter; 00080 return pWriter; 00081 }
SharedBTreeWriter BTreeExecStream::newWriter | ( | BTreeExecStreamParams const & | params | ) | [static, inherited] |
Definition at line 83 of file BTreeExecStream.cpp.
References BTreeExecStream::copyParamsToDescriptor(), ExecStreamParams::pCacheAccessor, ExecStreamParams::scratchAccessor, and BTreeExecStream::treeDescriptor.
00085 { 00086 BTreeDescriptor treeDescriptor; 00087 copyParamsToDescriptor(treeDescriptor,params,params.pCacheAccessor); 00088 return SharedBTreeWriter( 00089 new BTreeWriter( 00090 treeDescriptor,params.scratchAccessor)); 00091 }
void BTreeExecStream::endSearch | ( | ) | [protected, virtual, inherited] |
Forgets the current reader or writer's search, releasing any page locks.
Definition at line 107 of file BTreeExecStream.cpp.
References BTreeExecStream::pBTreeReader.
Referenced by BTreeExecStream::closeImpl(), and BTreeExecStream::open().
00108 { 00109 if (pBTreeReader && pBTreeReader->isSingular() == false) { 00110 pBTreeReader->endSearch(); 00111 } 00112 }
void BTreeExecStream::copyParamsToDescriptor | ( | BTreeDescriptor & | , | |
BTreeParams const & | , | |||
SharedCacheAccessor const & | ||||
) | [static, inherited] |
Definition at line 93 of file BTreeExecStream.cpp.
References BTreeParams::keyProj, BTreeDescriptor::keyProjection, BTreeParams::pageOwnerId, BTreeDescriptor::pageOwnerId, SegmentAccessor::pCacheAccessor, BTreeParams::pSegment, SegmentAccessor::pSegment, BTreeParams::rootPageId, BTreeDescriptor::rootPageId, BTreeDescriptor::segmentAccessor, BTreeParams::segmentId, BTreeDescriptor::segmentId, BTreeExecStream::treeDescriptor, BTreeParams::tupleDesc, and BTreeDescriptor::tupleDescriptor.
Referenced by BTreeExecStream::newWriter(), LbmSplicerExecStream::prepare(), and BTreeExecStream::prepare().
00097 { 00098 treeDescriptor.segmentAccessor.pSegment = params.pSegment; 00099 treeDescriptor.segmentAccessor.pCacheAccessor = pCacheAccessor; 00100 treeDescriptor.tupleDescriptor = params.tupleDesc; 00101 treeDescriptor.keyProjection = params.keyProj; 00102 treeDescriptor.rootPageId = params.rootPageId; 00103 treeDescriptor.segmentId = params.segmentId; 00104 treeDescriptor.pageOwnerId = params.pageOwnerId; 00105 }
void SingleOutputExecStream::setInputBufAccessors | ( | std::vector< SharedExecStreamBufAccessor > const & | inAccessors | ) | [virtual, inherited] |
Initializes the buffer accessors for inputs to this stream.
This method is only ever called once, before prepare.
inAccessors | buffer accessors ordered by input stream |
Implements ExecStream.
Reimplemented in ConduitExecStream, and ConfluenceExecStream.
Definition at line 35 of file SingleOutputExecStream.cpp.
void ConduitExecStream::setInputBufAccessors | ( | std::vector< SharedExecStreamBufAccessor > const & | inAccessors | ) | [virtual, inherited] |
Initializes the buffer accessors for inputs to this stream.
This method is only ever called once, before prepare.
inAccessors | buffer accessors ordered by input stream |
Reimplemented from SingleInputExecStream.
Definition at line 30 of file ConduitExecStream.cpp.
References SingleInputExecStream::setInputBufAccessors().
00032 { 00033 SingleInputExecStream::setInputBufAccessors(inAccessors); 00034 }
void SingleOutputExecStream::setOutputBufAccessors | ( | std::vector< SharedExecStreamBufAccessor > const & | outAccessors | ) | [virtual, inherited] |
Initializes the buffer accessors for outputs from this stream.
This method is only ever called once, before prepare.
outAccessors | buffer accessors ordered by output stream |
Implements ExecStream.
Reimplemented in ConduitExecStream.
Definition at line 41 of file SingleOutputExecStream.cpp.
References SingleOutputExecStream::pOutAccessor.
Referenced by ConduitExecStream::setOutputBufAccessors().
00043 { 00044 assert(outAccessors.size() == 1); 00045 pOutAccessor = outAccessors[0]; 00046 }
void ConduitExecStream::setOutputBufAccessors | ( | std::vector< SharedExecStreamBufAccessor > const & | outAccessors | ) | [virtual, inherited] |
Initializes the buffer accessors for outputs from this stream.
This method is only ever called once, before prepare.
outAccessors | buffer accessors ordered by output stream |
Reimplemented from SingleInputExecStream.
Definition at line 36 of file ConduitExecStream.cpp.
References SingleOutputExecStream::setOutputBufAccessors().
00038 { 00039 SingleOutputExecStream::setOutputBufAccessors(outAccessors); 00040 }
ExecStreamBufProvision SingleOutputExecStream::getOutputBufProvision | ( | ) | const [virtual, inherited] |
Queries the BufferProvision which this stream is capable of when producing tuples.
Reimplemented from ExecStream.
Reimplemented in BarrierExecStream, DoubleBufferExecStream, MergeExecStream, MockResourceExecStream, ScratchBufferExecStream, SegBufferExecStream, SegBufferReaderExecStream, ValuesExecStream, FtrsTableWriterExecStream, and LcsClusterAppendExecStream.
Definition at line 69 of file SingleOutputExecStream.cpp.
References BUFPROV_CONSUMER.
Referenced by SingleOutputExecStream::prepare().
00070 { 00071 return BUFPROV_CONSUMER; 00072 }
bool ExecStream::canEarlyClose | ( | ) | [virtual, inherited] |
Reimplemented in SegBufferWriterExecStream.
Definition at line 49 of file ExecStream.cpp.
ExecStreamGraph & ExecStream::getGraph | ( | ) | const [inline, inherited] |
Definition at line 293 of file ExecStream.h.
References ExecStream::pGraph.
Referenced by ExternalSortExecStreamImpl::execute(), JavaSinkExecStream::execute(), SegBufferWriterExecStream::execute(), SegBufferExecStream::execute(), BarrierExecStream::execute(), Java_net_sf_farrago_fennel_FennelStorage_tupleStreamFetch(), Java_net_sf_farrago_fennel_FennelStorage_tupleStreamTransformFetch(), JavaSinkExecStream::stuffByteBuffer(), and ExecStreamScheduler::traceStreamBuffers().
ExecStreamId ExecStream::getStreamId | ( | ) | const [inline, inherited] |
Definition at line 288 of file ExecStream.h.
References ExecStream::id.
Referenced by ExternalSortExecStreamImpl::execute(), SegBufferWriterExecStream::execute(), SegBufferExecStream::execute(), CorrelationJoinExecStream::execute(), BarrierExecStream::execute(), Java_net_sf_farrago_fennel_FennelStorage_tupleStreamTransformFetch(), JavaTransformExecStream::open(), SingleInputExecStream::open(), ConfluenceExecStream::open(), CartesianJoinExecStream::prepare(), ParallelExecStreamScheduler::readStream(), DfsTreeExecStreamScheduler::readStream(), LbmMinusExecStream::restartSubtrahends(), ExecStreamScheduler::tracePostExecution(), ExecStreamScheduler::tracePreExecution(), ExecStreamScheduler::traceStreamBuffers(), and ParallelExecStreamScheduler::tryExecuteTask().
00289 { 00290 return id; 00291 }
void ExecStream::setName | ( | std::string const & | ) | [virtual, inherited] |
Sets unique name of this stream.
Definition at line 157 of file ExecStream.cpp.
References ExecStream::name.
00158 { 00159 name = nameInit; 00160 }
std::string const & ExecStream::getName | ( | ) | const [virtual, inherited] |
Definition at line 162 of file ExecStream.cpp.
References ExecStream::name.
Referenced by DfsTreeExecStreamScheduler::findNextConsumer(), ParallelExecStreamScheduler::readStream(), DfsTreeExecStreamScheduler::readStream(), ExecStreamScheduler::tracePostExecution(), and ExecStreamScheduler::tracePreExecution().
00163 { 00164 return name; 00165 }
bool ExecStream::mayBlock | ( | ) | const [virtual, inherited] |
Queries whether this stream's implementation may block when execute() is called.
For accurate scheduling, non-blocking implementations are preferred; the scheduler must be aware of the potential for blocking so that it can allocate extra threads accordingly.
Definition at line 167 of file ExecStream.cpp.
void ExecStream::checkAbort | ( | ) | const [virtual, inherited] |
Checks whether there is an abort request for this stream's scheduler.
Normally, streams don't need to check this, since the scheduler services abort requests in between quanta. However, streams which enter long-running loops need to check for themselves. If an abort is scheduled, this method will throw an AbortExcn automatically.
Definition at line 72 of file ExecStream.cpp.
References ExecStreamScheduler::checkAbort(), ExecStreamGraph::getScheduler(), and ExecStream::pGraph.
Referenced by LhxJoinExecStream::execute(), LhxAggExecStream::execute(), ExternalSortRunAccessor::fetch(), and ExternalSortMerger::fetch().
00073 { 00074 if (!pGraph) { 00075 return; 00076 } 00077 ExecStreamScheduler *pScheduler = pGraph->getScheduler(); 00078 if (!pScheduler) { 00079 return; 00080 } 00081 pScheduler->checkAbort(); 00082 }
ExecStreamBufProvision ExecStream::getOutputBufConversion | ( | ) | const [virtual, inherited] |
Queries the BufferProvision to which this stream needs its output to be converted, if any.
Reimplemented in JavaTransformExecStream.
Definition at line 177 of file ExecStream.cpp.
References BUFPROV_NONE.
00178 { 00179 return BUFPROV_NONE; 00180 }
ExecStreamBufProvision ExecStream::getInputBufProvision | ( | ) | const [virtual, inherited] |
Queries the BufferProvision which this stream requires of its inputs when consuming their tuples.
Reimplemented in ConfluenceExecStream, DoubleBufferExecStream, ScratchBufferExecStream, SegBufferExecStream, SegBufferWriterExecStream, SingleInputExecStream, and JavaTransformExecStream.
Definition at line 182 of file ExecStream.cpp.
References BUFPROV_NONE.
00183 { 00184 return BUFPROV_NONE; 00185 }
ExecStreamBufProvision SingleInputExecStream::getInputBufProvision | ( | ) | const [virtual, inherited] |
Queries the BufferProvision which this stream requires of its inputs when consuming their tuples.
Reimplemented from ExecStream.
Reimplemented in DoubleBufferExecStream, ScratchBufferExecStream, SegBufferExecStream, and SegBufferWriterExecStream.
Definition at line 62 of file SingleInputExecStream.cpp.
References BUFPROV_PRODUCER.
Referenced by SingleInputExecStream::prepare().
00063 { 00064 return BUFPROV_PRODUCER; 00065 }
bool ClosableObject::isClosed | ( | ) | const [inline, inherited] |
Definition at line 58 of file ClosableObject.h.
00059 { 00060 return !needsClose; 00061 }
void ClosableObject::close | ( | ) | [inherited] |
Closes this object, releasing any unallocated resources.
Reimplemented in CollectExecStream, CorrelationJoinExecStream, LcsClusterAppendExecStream, and LcsClusterReplaceExecStream.
Definition at line 39 of file ClosableObject.cpp.
References ClosableObject::closeImpl(), and ClosableObject::needsClose.
Referenced by CacheImpl< PageT, VictimPolicyT >::allocatePages(), LcsRowScanBaseExecStream::closeImpl(), ExecStreamGraphImpl::closeImpl(), FlatFileBuffer::open(), ClosableObjectDestructor::operator()(), and Segment::~Segment().
00040 { 00041 if (!needsClose) { 00042 return; 00043 } 00044 needsClose = false; 00045 closeImpl(); 00046 }
void TraceSource::initTraceSource | ( | SharedTraceTarget | pTraceTarget, | |
std::string | name | |||
) | [virtual, inherited] |
For use when initialization has to be deferred until after construction.
pTraceTarget | the TraceTarget to which messages will be sent | |
name | the name of this source |
Definition at line 46 of file TraceSource.cpp.
References TraceSource::isTracing(), TraceSource::minimumLevel, TraceSource::name, TraceSource::pTraceTarget, and TRACE_OFF.
Referenced by TestBase::beforeTestCase(), TestBase::TestBase(), and TraceSource::TraceSource().
00049 { 00050 assert(!pTraceTarget.get()); 00051 00052 pTraceTarget = pTraceTargetInit; 00053 name = nameInit; 00054 if (isTracing()) { 00055 minimumLevel = pTraceTarget->getSourceTraceLevel(name); 00056 } else { 00057 minimumLevel = TRACE_OFF; 00058 } 00059 }
void TraceSource::trace | ( | TraceLevel | level, | |
std::string | message | |||
) | const [inherited] |
Records a trace message.
Normally only called via FENNEL_TRACE.
level | severity level of event being trace | |
message | the text of the message |
Definition at line 61 of file TraceSource.cpp.
References TraceSource::getTraceTarget(), TraceSource::isTracing(), TraceSource::name, and TraceTarget::notifyTrace().
Referenced by Calculator::exec(), and ExecStreamScheduler::traceStreamBufferContents().
00062 { 00063 if (isTracing()) { 00064 getTraceTarget().notifyTrace(name,level,message); 00065 } 00066 }
bool TraceSource::isTracing | ( | ) | const [inline, inherited] |
Definition at line 88 of file TraceSource.h.
Referenced by TraceSource::initTraceSource(), CalcExecStream::prepare(), and TraceSource::trace().
00089 { 00090 return pTraceTarget.get() ? true : false; 00091 }
bool TraceSource::isTracingLevel | ( | TraceLevel | level | ) | const [inline, inherited] |
Determines whether a particular level is being traced.
level | trace level to test |
Definition at line 100 of file TraceSource.h.
Referenced by ExecStreamScheduler::addGraph(), SimpleExecStreamGovernor::assignCachePages(), SimpleExecStreamGovernor::distributeCachePages(), Calculator::exec(), ExecStreamScheduler::ExecStreamScheduler(), LcsClusterNodeWriter::getLastClusterPageForWrite(), LcsClusterNodeWriter::moveFromTempToIndex(), JavaSinkExecStream::stuffByteBuffer(), and ExecStreamScheduler::traceStreamBuffers().
00101 { 00102 return level >= minimumLevel; 00103 }
TraceTarget& TraceSource::getTraceTarget | ( | ) | const [inline, inherited] |
Definition at line 108 of file TraceSource.h.
Referenced by TraceSource::trace().
00109 { 00110 assert(isTracing()); 00111 return *(pTraceTarget.get()); 00112 }
SharedTraceTarget TraceSource::getSharedTraceTarget | ( | ) | const [inline, inherited] |
Definition at line 117 of file TraceSource.h.
Referenced by Database::init(), LcsClusterAppendExecStream::initLoad(), and CalcExecStream::prepare().
00118 { 00119 return pTraceTarget; 00120 }
std::string TraceSource::getTraceSourceName | ( | ) | const [inline, inherited] |
Gets the name of this source.
Useful to construct nested names for subcomponents that are also TraceSources.
Definition at line 127 of file TraceSource.h.
Referenced by LcsClusterAppendExecStream::initLoad().
00128 { 00129 return name; 00130 }
void TraceSource::setTraceSourceName | ( | std::string const & | n | ) | [inline, inherited] |
Sets the name of this source.
Useful to construct dynamic names for fine-grained filtering.
Definition at line 136 of file TraceSource.h.
00137 { 00138 name = n; 00139 }
TraceLevel TraceSource::getMinimumTraceLevel | ( | ) | const [inline, inherited] |
void TraceSource::disableTracing | ( | ) | [inherited] |
Definition at line 68 of file TraceSource.cpp.
References TraceSource::minimumLevel, TraceSource::pTraceTarget, and TRACE_OFF.
Referenced by TestBase::afterTestCase().
00069 { 00070 pTraceTarget.reset(); 00071 minimumLevel = TRACE_OFF; 00072 }
void ErrorSource::initErrorSource | ( | SharedErrorTarget | pErrorTarget, | |
const std::string & | name | |||
) | [virtual, inherited] |
For use when initialization has to be deferred until after construction.
pErrorTarget | the ErrorTarget to which errors will be posted | |
name | the name of this source |
Definition at line 47 of file ErrorSource.cpp.
References ErrorSource::name, and ErrorSource::pErrorTarget.
Referenced by ErrorSource::ErrorSource().
00050 { 00051 pErrorTarget = pErrorTargetInit; 00052 name = nameInit; 00053 }
void ErrorSource::postError | ( | ErrorLevel | level, | |
const std::string & | message, | |||
void * | address, | |||
long | capacity, | |||
int | index | |||
) | [inherited] |
Posts an exception, such as a row exception.
Definition at line 55 of file ErrorSource.cpp.
References ErrorSource::getErrorTarget(), ErrorSource::hasTarget(), ErrorSource::name, and ErrorTarget::notifyError().
Referenced by FlatFileExecStreamImpl::logError(), ErrorSource::postError(), and LbmSplicerExecStream::postViolation().
00058 { 00059 if (hasTarget()) { 00060 getErrorTarget().notifyError( 00061 name, level, message, address, capacity, index); 00062 } 00063 }
void ErrorSource::postError | ( | ErrorLevel | level, | |
const std::string & | message, | |||
const TupleDescriptor & | errorDesc, | |||
const TupleData & | errorTuple, | |||
int | index | |||
) | [inherited] |
Posts an exception, such as a row exception.
Definition at line 65 of file ErrorSource.cpp.
References TupleAccessor::compute(), ErrorSource::errorAccessor, FixedBuffer, TupleAccessor::getByteCount(), TupleAccessor::getMaxByteCount(), ErrorSource::hasTarget(), TupleAccessor::marshal(), ErrorSource::pErrorBuf, and ErrorSource::postError().
00068 { 00069 if (!hasTarget()) { 00070 return; 00071 } 00072 00073 if (!pErrorBuf) { 00074 errorAccessor.compute(errorDesc); 00075 uint cbMax = errorAccessor.getMaxByteCount(); 00076 pErrorBuf.reset(new FixedBuffer[cbMax]); 00077 } 00078 00079 uint cbTuple = errorAccessor.getByteCount(errorTuple); 00080 errorAccessor.marshal(errorTuple, pErrorBuf.get()); 00081 postError(level, message, pErrorBuf.get(), cbTuple, index); 00082 }
bool ErrorSource::hasTarget | ( | ) | const [inline, inherited] |
Definition at line 112 of file ErrorSource.h.
Referenced by ErrorSource::postError().
00113 { 00114 return pErrorTarget.get() ? true : false; 00115 }
ErrorTarget& ErrorSource::getErrorTarget | ( | ) | const [inline, inherited] |
Definition at line 120 of file ErrorSource.h.
Referenced by ErrorSource::postError().
00121 { 00122 assert(hasTarget()); 00123 return *(pErrorTarget.get()); 00124 }
SharedErrorTarget ErrorSource::getSharedErrorTarget | ( | ) | const [inline, inherited] |
Definition at line 129 of file ErrorSource.h.
00130 { 00131 return pErrorTarget; 00132 }
std::string ErrorSource::getErrorSourceName | ( | ) | const [inline, inherited] |
Gets the name of this source.
Useful to construct nested names for subcomponents that are also ErrorSources.
Definition at line 139 of file ErrorSource.h.
00140 { 00141 return name; 00142 }
void ErrorSource::setErrorSourceName | ( | std::string const & | n | ) | [inline, inherited] |
Sets the name of this source.
Useful to construct dynamic names for fine-grained filtering.
Definition at line 148 of file ErrorSource.h.
00149 { 00150 name = n; 00151 }
void ErrorSource::disableTarget | ( | ) | [inherited] |
Definition at line 84 of file ErrorSource.cpp.
References ErrorSource::pErrorTarget.
00085 { 00086 pErrorTarget.reset(); 00087 }
ExecStreamResult ConduitExecStream::precheckConduitBuffers | ( | ) | [protected, inherited] |
Checks the state of the input and output buffers.
If input empty, requests production. If input EOS, propagates that to output buffer. If output full, returns EXECRC_OVERFLOW.
Definition at line 61 of file ConduitExecStream.cpp.
References EXECBUF_EMPTY, EXECBUF_EOS, EXECBUF_NONEMPTY, EXECBUF_OVERFLOW, EXECBUF_UNDERFLOW, EXECRC_BUF_OVERFLOW, EXECRC_BUF_UNDERFLOW, EXECRC_EOS, EXECRC_YIELD, SingleInputExecStream::pInAccessor, and SingleOutputExecStream::pOutAccessor.
Referenced by ExternalSortExecStreamImpl::execute(), FtrsTableWriterExecStream::execute(), BTreeSearchUniqueExecStream::execute(), BTreeSearchExecStream::execute(), BTreeInsertExecStream::execute(), UncollectExecStream::execute(), SortedAggExecStream::execute(), ReshapeExecStream::execute(), CopyExecStream::execute(), CollectExecStream::execute(), BernoulliSamplingExecStream::execute(), and CalcExecStream::execute().
00062 { 00063 switch (pInAccessor->getState()) { 00064 case EXECBUF_EMPTY: 00065 pInAccessor->requestProduction(); 00066 return EXECRC_BUF_UNDERFLOW; 00067 case EXECBUF_UNDERFLOW: 00068 return EXECRC_BUF_UNDERFLOW; 00069 case EXECBUF_EOS: 00070 pOutAccessor->markEOS(); 00071 return EXECRC_EOS; 00072 case EXECBUF_NONEMPTY: 00073 case EXECBUF_OVERFLOW: 00074 break; 00075 default: 00076 permAssert(false); 00077 } 00078 if (pOutAccessor->getState() == EXECBUF_OVERFLOW) { 00079 return EXECRC_BUF_OVERFLOW; 00080 } 00081 return EXECRC_YIELD; 00082 }
bool LbmSearchExecStream::ridInKey [private] |
True if the rid key is included in the btree search key.
This will be the case if the entire btree key has search values, and a startRid dynamic parameter is provided.
Definition at line 64 of file LbmSearchExecStream.h.
Referenced by prepare(), setAdditionalKeys(), and setLowerBoundKey().
DynamicParamId LbmSearchExecStream::rowLimitParamId [private] |
Parameter id representing the dynamic parameter used to limit the number of rows to produce on a single execute.
Definition at line 70 of file LbmSearchExecStream.h.
Referenced by prepare(), and reachedTupleLimit().
bool LbmSearchExecStream::ignoreRowLimit [private] |
True if row limit does not apply.
Definition at line 75 of file LbmSearchExecStream.h.
Referenced by prepare(), and reachedTupleLimit().
DynamicParamId LbmSearchExecStream::startRidParamId [private] |
Parameter id representing the dynamic parameter used to set the starting rid value for bitmap entries.
Definition at line 81 of file LbmSearchExecStream.h.
Referenced by prepare(), and setAdditionalKeys().
RecordNum LbmSearchExecStream::rowLimit [private] |
Number of rows that can be produced.
Definition at line 86 of file LbmSearchExecStream.h.
Referenced by prepare(), and reachedTupleLimit().
LcsRid LbmSearchExecStream::startRid [private] |
Desired starting rid value for bitmap entries.
Definition at line 91 of file LbmSearchExecStream.h.
Referenced by prepare(), and setAdditionalKeys().
TupleDatum LbmSearchExecStream::rowLimitDatum [private] |
Tuple datum used to store dynamic paramter for rowLimit.
Definition at line 96 of file LbmSearchExecStream.h.
Referenced by prepare(), and reachedTupleLimit().
TupleDatum LbmSearchExecStream::startRidDatum [private] |
Tuple datum used to store dynamic parameter for startRid.
Definition at line 101 of file LbmSearchExecStream.h.
Referenced by prepare(), and setAdditionalKeys().
Tuple data used as search key that includes rid.
Definition at line 106 of file LbmSearchExecStream.h.
Referenced by prepare(), setAdditionalKeys(), and setLowerBoundKey().
bool LbmSearchExecStream::ridKeySetup [private] |
True if the search key for this stream already has the rid key setup in the descriptor, in the case where the startrid dynamic parameter is used to skip ahead in the btree search.
Definition at line 113 of file LbmSearchExecStream.h.
Referenced by prepare(), and setAdditionalKeys().
SegPageEntryIter<BTreePrefetchSearchKey> BTreePrefetchSearchExecStream::leafPageQueue [protected, inherited] |
Iterator that provides the pre-fetched leaf pages.
Definition at line 104 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::innerSearchLoop(), and BTreePrefetchSearchExecStream::open().
SharedBTreeLeafReader BTreePrefetchSearchExecStream::pLeafReader [protected, inherited] |
Reader used to search/read leaf pages from the btree.
This shared pointer points to the same object as pReader.
Definition at line 110 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::innerSearchLoop(), and BTreePrefetchSearchExecStream::newReader().
SharedBTreeNonLeafReader BTreePrefetchSearchExecStream::pNonLeafReader [protected, inherited] |
Reader used to search/read non-leaf pages from the btree.
Definition at line 115 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::getNextPageForPrefetch(), BTreePrefetchSearchExecStream::open(), and BTreePrefetchSearchExecStream::testNonLeafInterval().
TupleAccessor BTreePrefetchSearchExecStream::savedLowerBoundAccessor [protected, inherited] |
Accessor used to reference a saved lower bound search key that will be used to search a leaf page.
Definition at line 121 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::getResourceRequirements(), prepare(), BTreePrefetchSearchExecStream::prepare(), setLowerBoundKey(), BTreePrefetchSearchExecStream::setLowerBoundKey(), and BTreePrefetchSearchExecStream::setSearchKeyData().
TupleAccessor BTreePrefetchSearchExecStream::savedUpperBoundAccessor [protected, inherited] |
Accessor used to reference a saved upper bound search key used in a leaf page search.
Definition at line 127 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::prepare(), BTreePrefetchSearchExecStream::setSearchKeyData(), and BTreePrefetchSearchExecStream::setUpSearchKey().
SearchEndpoint BTreePrefetchSearchExecStream::pfLowerBoundDirective [protected, inherited] |
Lower bound directive used when searching non-leaf nodes to pre-fetch leaf pages.
Definition at line 133 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::getNextPageForPrefetch(), BTreePrefetchSearchExecStream::getPrefetchSearchKey(), and BTreePrefetchSearchExecStream::setSearchKeyData().
SearchEndpoint BTreePrefetchSearchExecStream::pfUpperBoundDirective [protected, inherited] |
Upper bound directive used when searching non-leaf nodes to pre-fetch leaf pages.
Definition at line 139 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::getPrefetchSearchKey(), BTreePrefetchSearchExecStream::setSearchKeyData(), and BTreePrefetchSearchExecStream::testNonLeafInterval().
TupleData BTreePrefetchSearchExecStream::pfLowerBoundData [protected, inherited] |
Lower bound key used when searching non-leaf nodes to pre-fetch leaf pages.
Definition at line 145 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::getNextPageForPrefetch(), BTreePrefetchSearchExecStream::getPrefetchSearchKey(), prepare(), BTreePrefetchSearchExecStream::prepare(), BTreePrefetchSearchExecStream::setSearchKeyData(), and BTreePrefetchSearchExecStream::testNonLeafInterval().
TupleData BTreePrefetchSearchExecStream::pfUpperBoundData [protected, inherited] |
Upper bound key used when searching non-leaf nodes to pre-fetch leaf pages.
Definition at line 151 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::getPrefetchSearchKey(), BTreePrefetchSearchExecStream::prepare(), BTreePrefetchSearchExecStream::setSearchKeyData(), and BTreePrefetchSearchExecStream::testNonLeafInterval().
bool BTreePrefetchSearchExecStream::endOnNextKey [protected, inherited] |
If true, abort search of non-leaf page when positioning to the next key.
Definition at line 157 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::getNextPageForPrefetch().
BTreePageLock BTreePrefetchSearchExecStream::scratchLock [protected, inherited] |
Page lock used to allocate scratch pages used to store search key information associated with pre-fetched leaf pages.
Definition at line 163 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::allocateScratchPages(), and BTreePrefetchSearchExecStream::prepare().
uint BTreePrefetchSearchExecStream::scratchPageSize [protected, inherited] |
Space available on a single scratch page.
Definition at line 168 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::getResourceRequirements(), and BTreePrefetchSearchExecStream::prepare().
uint BTreePrefetchSearchExecStream::nMiscCachePages [protected, inherited] |
Number of cache pages needed, including pages needed for pre-fetches, but excluding scratch pages used to store search key information.
Definition at line 174 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::getResourceRequirements(), and BTreePrefetchSearchExecStream::setResourceAllocation().
uint BTreePrefetchSearchExecStream::nPrefetchScratchPages [protected, inherited] |
Number of scratch pages available to store search key information.
Definition at line 179 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::allocateScratchPages(), BTreePrefetchSearchExecStream::open(), and BTreePrefetchSearchExecStream::setResourceAllocation().
uint BTreePrefetchSearchExecStream::keyValuesSize [protected, inherited] |
Size of space occupied by lower and upper bound key values.
Definition at line 184 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::getResourceRequirements(), BTreePrefetchSearchExecStream::initPrefetchEntry(), and BTreePrefetchSearchExecStream::setSearchKeyData().
uint BTreePrefetchSearchExecStream::nEntriesPerScratchPage [protected, inherited] |
Number of search key entries per scratch page.
Definition at line 189 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::getResourceRequirements(), BTreePrefetchSearchExecStream::initPrefetchEntry(), and BTreePrefetchSearchExecStream::open().
bool BTreePrefetchSearchExecStream::bigMaxKey [protected, inherited] |
True if the maximum key size is such that potentially only a single key can be stored on a page.
Definition at line 195 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::getResourceRequirements(), BTreePrefetchSearchExecStream::initPrefetchEntry(), BTreePrefetchSearchExecStream::open(), and BTreePrefetchSearchExecStream::setSearchKeyData().
std::vector<PBuffer> BTreePrefetchSearchExecStream::scratchPages [protected, inherited] |
Vector of pointers to scratch pages allocated.
Definition at line 200 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::allocateScratchPages(), BTreePrefetchSearchExecStream::closeImpl(), and BTreePrefetchSearchExecStream::initPrefetchEntry().
uint BTreePrefetchSearchExecStream::currPage [protected, inherited] |
Index into scratch pages vector, indicating the current page whose space is being used to initialize pre-fetch entries.
Definition at line 206 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::allocateScratchPages(), and BTreePrefetchSearchExecStream::initPrefetchEntry().
uint BTreePrefetchSearchExecStream::currPageEntry [protected, inherited] |
Index into the current scratch page whose space is being used to initialize pre-fetch entries.
Definition at line 212 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::allocateScratchPages(), and BTreePrefetchSearchExecStream::initPrefetchEntry().
bool BTreePrefetchSearchExecStream::initialPrefetchDone [protected, inherited] |
True if first pre-fetch needs to be initiated.
Definition at line 217 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::innerSearchLoop(), and BTreePrefetchSearchExecStream::open().
bool BTreePrefetchSearchExecStream::processingDone [protected, inherited] |
True if all input search ranges have been processed.
Definition at line 222 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::execute(), BTreePrefetchSearchExecStream::innerSearchLoop(), and BTreePrefetchSearchExecStream::open().
bool BTreePrefetchSearchExecStream::prevLeafSearchRc [protected, inherited] |
Boolean return code from the previous leaf page search.
Definition at line 227 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::innerSearchLoop(), and BTreePrefetchSearchExecStream::open().
bool BTreePrefetchSearchExecStream::rootOnly [protected, inherited] |
True if the btree is a root-only tree.
Definition at line 232 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::getNextPageForPrefetch(), and BTreePrefetchSearchExecStream::open().
bool BTreePrefetchSearchExecStream::returnedRoot [protected, inherited] |
True if the root, leaf page has been returned as a pre-fetch page for the current search range.
Definition at line 238 of file BTreePrefetchSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::getNextPageForPrefetch(), and BTreePrefetchSearchExecStream::open().
TupleProjectionAccessor BTreeSearchExecStream::inputKeyAccessor [protected, inherited] |
Definition at line 117 of file BTreeSearchExecStream.h.
Referenced by BTreeSearchExecStream::prepare(), and BTreeSearchExecStream::readSearchKey().
TupleProjectionAccessor BTreeSearchExecStream::inputJoinAccessor [protected, inherited] |
Definition at line 118 of file BTreeSearchExecStream.h.
Referenced by BTreeSearchExecStream::prepare(), and BTreeSearchExecStream::searchForKey().
TupleProjectionAccessor BTreeSearchExecStream::readerKeyAccessor [protected, inherited] |
Definition at line 119 of file BTreeSearchExecStream.h.
Referenced by BTreeSearchExecStream::checkNextKey(), BTreeSearchExecStream::open(), and BTreeSearchExecStream::testInterval().
TupleProjectionAccessor BTreeSearchExecStream::directiveAccessor [protected, inherited] |
Definition at line 120 of file BTreeSearchExecStream.h.
Referenced by BTreeSearchExecStream::prepare(), and BTreeSearchExecStream::readDirectives().
TupleProjectionAccessor BTreeSearchExecStream::upperBoundAccessor [protected, inherited] |
Definition at line 121 of file BTreeSearchExecStream.h.
Referenced by BTreeSearchExecStream::prepare(), and BTreeSearchExecStream::readUpperBoundKey().
TupleDescriptor BTreeSearchExecStream::inputKeyDesc [protected, inherited] |
Definition at line 122 of file BTreeSearchExecStream.h.
Referenced by BTreeSearchExecStream::checkNextKey(), BTreeSearchExecStream::open(), prepare(), BTreeSearchExecStream::prepare(), BTreePrefetchSearchExecStream::prepare(), BTreeSearchExecStream::testInterval(), and BTreePrefetchSearchExecStream::testNonLeafInterval().
TupleDescriptor BTreeSearchExecStream::upperBoundDesc [protected, inherited] |
Definition at line 122 of file BTreeSearchExecStream.h.
Referenced by BTreeSearchExecStream::prepare(), BTreePrefetchSearchExecStream::prepare(), and BTreeSearchExecStream::readUpperBoundKey().
TupleData BTreeSearchExecStream::inputKeyData [protected, inherited] |
Definition at line 123 of file BTreeSearchExecStream.h.
Referenced by BTreeSearchExecStream::innerSearchLoop(), BTreeSearchExecStream::prepare(), BTreeSearchExecStream::readSearchKey(), setAdditionalKeys(), BTreePrefetchSearchExecStream::setAdditionalKeys(), setLowerBoundKey(), and BTreePrefetchSearchExecStream::setLowerBoundKey().
TupleData BTreeSearchExecStream::upperBoundData [protected, inherited] |
Definition at line 123 of file BTreeSearchExecStream.h.
Referenced by BTreeSearchExecStream::checkNextKey(), BTreePrefetchSearchExecStream::getPrefetchSearchKey(), BTreeSearchExecStream::prepare(), BTreeSearchExecStream::readUpperBoundKey(), BTreeSearchExecStream::searchForKey(), BTreePrefetchSearchExecStream::setUpSearchKey(), and BTreeSearchExecStream::testInterval().
TupleData BTreeSearchExecStream::readerKeyData [protected, inherited] |
Definition at line 123 of file BTreeSearchExecStream.h.
Referenced by BTreeSearchExecStream::checkNextKey(), BTreeSearchExecStream::prepare(), BTreeSearchExecStream::testInterval(), and BTreePrefetchSearchExecStream::testNonLeafInterval().
TupleData BTreeSearchExecStream::directiveData [protected, inherited] |
Definition at line 123 of file BTreeSearchExecStream.h.
Referenced by BTreeSearchExecStream::prepare(), and BTreeSearchExecStream::readDirectives().
TupleData * BTreeSearchExecStream::pSearchKey [protected, inherited] |
Definition at line 123 of file BTreeSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::getPrefetchSearchKey(), BTreeSearchExecStream::innerSearchLoop(), BTreeSearchExecStream::readUpperBoundKey(), BTreeSearchExecStream::searchForKey(), setAdditionalKeys(), BTreePrefetchSearchExecStream::setAdditionalKeys(), setLowerBoundKey(), BTreePrefetchSearchExecStream::setLowerBoundKey(), and BTreeSearchExecStream::testInterval().
bool BTreeSearchExecStream::outerJoin [protected, inherited] |
Definition at line 125 of file BTreeSearchExecStream.h.
Referenced by BTreeSearchExecStream::prepare(), and BTreeSearchExecStream::searchForKey().
bool BTreeSearchExecStream::preFilterNulls [protected, inherited] |
Definition at line 126 of file BTreeSearchExecStream.h.
Referenced by BTreeSearchExecStream::prepare(), and BTreeSearchExecStream::searchForKey().
uint BTreeSearchExecStream::nJoinAttributes [protected, inherited] |
Definition at line 127 of file BTreeSearchExecStream.h.
Referenced by BTreeSearchExecStream::innerFetchLoop(), BTreeSearchExecStream::prepare(), and BTreeSearchExecStream::searchForKey().
SearchEndpoint BTreeSearchExecStream::lowerBoundDirective [protected, inherited] |
Definition at line 128 of file BTreeSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::getNextPageForPrefetch(), BTreePrefetchSearchExecStream::getPrefetchSearchKey(), BTreeSearchExecStream::readDirectives(), BTreeSearchExecStream::searchForKey(), setAdditionalKeys(), BTreePrefetchSearchExecStream::setUpSearchKey(), and BTreeSearchExecStream::testInterval().
SearchEndpoint BTreeSearchExecStream::upperBoundDirective [protected, inherited] |
Definition at line 129 of file BTreeSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::getPrefetchSearchKey(), BTreeSearchExecStream::readDirectives(), setAdditionalKeys(), BTreePrefetchSearchExecStream::setUpSearchKey(), and BTreeSearchExecStream::testInterval().
bool BTreeSearchExecStream::leastUpper [protected, inherited] |
Definition at line 130 of file BTreeSearchExecStream.h.
Referenced by BTreePrefetchSearchExecStream::getNextPageForPrefetch(), prepare(), BTreeSearchExecStream::prepare(), BTreeSearchExecStream::searchForKey(), and BTreeSearchExecStream::testInterval().
std::vector<BTreeSearchKeyParameter> BTreeSearchExecStream::searchKeyParams [protected, inherited] |
Definition at line 131 of file BTreeSearchExecStream.h.
Referenced by BTreeSearchExecStream::prepare(), BTreeSearchExecStream::readSearchKey(), and BTreeSearchExecStream::readUpperBoundKey().
boost::scoped_array<FixedBuffer> BTreeSearchExecStream::searchKeyBuffer [protected, inherited] |
Definition at line 132 of file BTreeSearchExecStream.h.
bool BTreeSearchExecStream::dynamicKeysRead [protected, inherited] |
Definition at line 133 of file BTreeSearchExecStream.h.
Referenced by BTreeSearchExecStream::open(), and BTreeSearchExecStream::readSearchKey().
TupleProjection BTreeSearchExecStream::searchKeyProj [protected, inherited] |
Definition at line 134 of file BTreeSearchExecStream.h.
Referenced by BTreeSearchExecStream::prepare(), BTreeSearchExecStream::readSearchKey(), and BTreeSearchExecStream::searchForKey().
TupleProjection BTreeSearchExecStream::upperBoundKeyProj [protected, inherited] |
Definition at line 134 of file BTreeSearchExecStream.h.
Referenced by BTreeSearchExecStream::prepare(), BTreeSearchExecStream::readUpperBoundKey(), and BTreeSearchExecStream::searchForKey().
SharedBTreeReader BTreeReadExecStream::pReader [protected, inherited] |
Definition at line 59 of file BTreeReadExecStream.h.
Referenced by BTreeSearchExecStream::checkNextKey(), BTreeSearchUniqueExecStream::execute(), BTreeScanExecStream::execute(), BTreeSearchExecStream::innerFetchLoop(), BTreeSearchExecStream::innerSearchLoop(), BTreePrefetchSearchExecStream::innerSearchLoop(), BTreeSearchExecStream::open(), BTreeScanExecStream::open(), BTreeReadExecStream::open(), and BTreeSearchExecStream::searchForKey().
TupleProjectionAccessor BTreeReadExecStream::projAccessor [protected, inherited] |
Definition at line 60 of file BTreeReadExecStream.h.
Referenced by BTreeScanExecStream::execute(), BTreeSearchExecStream::innerFetchLoop(), BTreePrefetchSearchExecStream::innerSearchLoop(), BTreeReadExecStream::open(), and BTreeSearchExecStream::searchForKey().
TupleData BTreeReadExecStream::tupleData [protected, inherited] |
Definition at line 61 of file BTreeReadExecStream.h.
Referenced by BTreeSearchUniqueExecStream::execute(), BTreeScanExecStream::execute(), BTreeSearchExecStream::innerFetchLoop(), BTreePrefetchSearchExecStream::innerSearchLoop(), BTreeReadExecStream::prepare(), and BTreeSearchExecStream::searchForKey().
TupleProjection BTreeReadExecStream::outputProj [protected, inherited] |
Definition at line 62 of file BTreeReadExecStream.h.
Referenced by BTreeReadExecStream::open(), and BTreeReadExecStream::prepare().
BTreeDescriptor BTreeExecStream::treeDescriptor [protected, inherited] |
Definition at line 113 of file BTreeExecStream.h.
Referenced by BTreeInsertExecStream::buildTree(), BTreeExecStream::closeImpl(), BTreeExecStream::copyParamsToDescriptor(), LcsClusterReplaceExecStream::getTupleForLoad(), LcsClusterAppendExecStream::initLoad(), LcsClusterReplaceExecStream::initTupleLoadParams(), BTreePrefetchSearchExecStream::innerSearchLoop(), BTreePrefetchSearchExecStream::newReader(), BTreeExecStream::newReader(), BTreeExecStream::newWriter(), LcsClusterReplaceExecStream::open(), BTreeSearchExecStream::open(), BTreePrefetchSearchExecStream::open(), BTreeInsertExecStream::open(), BTreeExecStream::open(), LcsClusterReplaceExecStream::prepare(), LcsClusterAppendExecStream::prepare(), prepare(), LbmGeneratorExecStream::prepare(), BTreeSearchExecStream::prepare(), BTreeInsertExecStream::prepare(), BTreeExecStream::prepare(), and BTreeInsertExecStream::truncateTree().
SegmentAccessor BTreeExecStream::scratchAccessor [protected, inherited] |
Reimplemented in LcsClusterAppendExecStream.
Definition at line 114 of file BTreeExecStream.h.
Referenced by LbmGeneratorExecStream::closeImpl(), BTreePrefetchSearchExecStream::closeImpl(), BTreeExecStream::newWriter(), LbmGeneratorExecStream::prepare(), BTreePrefetchSearchExecStream::prepare(), and BTreeExecStream::prepare().
BTreeOwnerRootMap* BTreeExecStream::pRootMap [protected, inherited] |
Definition at line 115 of file BTreeExecStream.h.
Referenced by BTreeExecStream::closeImpl(), BTreeExecStream::open(), and BTreeExecStream::prepare().
SharedBTreeAccessBase BTreeExecStream::pBTreeAccessBase [protected, inherited] |
Definition at line 116 of file BTreeExecStream.h.
Referenced by BTreeInsertExecStream::closeImpl(), BTreeExecStream::closeImpl(), BTreePrefetchSearchExecStream::newReader(), BTreeExecStream::newReader(), BTreeExecStream::newWriter(), and BTreeExecStream::open().
SharedBTreeReader BTreeExecStream::pBTreeReader [protected, inherited] |
Definition at line 117 of file BTreeExecStream.h.
Referenced by BTreeExecStream::endSearch(), BTreePrefetchSearchExecStream::newReader(), BTreeExecStream::newReader(), and BTreeExecStream::newWriter().
DynamicParamId BTreeExecStream::rootPageIdParamId [protected, inherited] |
Definition at line 118 of file BTreeExecStream.h.
Referenced by BTreeSearchExecStream::open(), BTreeInsertExecStream::open(), BTreeInsertExecStream::prepare(), and BTreeExecStream::prepare().
SharedExecStreamBufAccessor SingleOutputExecStream::pOutAccessor [protected, inherited] |
Definition at line 56 of file SingleOutputExecStream.h.
Referenced by LcsClusterAppendExecStream::compress(), ExternalSortExecStreamImpl::execute(), LcsRowScanExecStream::execute(), LbmUnionExecStream::execute(), LbmNormalizerExecStream::execute(), LbmGeneratorExecStream::execute(), LbmChopperExecStream::execute(), LhxJoinExecStream::execute(), LhxAggExecStream::execute(), FtrsTableWriterExecStream::execute(), BTreeSortExecStream::execute(), BTreeSearchUniqueExecStream::execute(), BTreeScanExecStream::execute(), BTreePrefetchSearchExecStream::execute(), BTreeInsertExecStream::execute(), FlatFileExecStreamImpl::execute(), ValuesExecStream::execute(), UncollectExecStream::execute(), SortedAggExecStream::execute(), SegBufferReaderExecStream::execute(), ScratchBufferExecStream::execute(), ReshapeExecStream::execute(), MockResourceExecStream::execute(), MockProducerExecStream::execute(), MergeExecStream::execute(), DoubleBufferExecStream::execute(), CorrelationJoinExecStream::execute(), CopyExecStream::execute(), CollectExecStream::execute(), CartesianJoinExecStream::execute(), BernoulliSamplingExecStream::execute(), BarrierExecStream::execute(), CalcExecStream::execute(), LbmGeneratorExecStream::flushEntry(), MockProducerExecStream::getProducedRowCount(), ExternalSortExecStreamImpl::getResourceRequirements(), BTreeSearchExecStream::innerFetchLoop(), LbmUnionExecStream::open(), LbmChopperExecStream::open(), LbmBitOpExecStream::open(), SingleOutputExecStream::open(), SegBufferReaderExecStream::open(), SegBufferExecStream::open(), ScratchBufferExecStream::open(), DoubleBufferExecStream::open(), CollectExecStream::open(), SegBufferExecStream::openBufferForRead(), ConduitExecStream::precheckConduitBuffers(), LcsRowScanExecStream::prepare(), LcsRowScanBaseExecStream::prepare(), LcsClusterAppendExecStream::prepare(), LbmUnionExecStream::prepare(), LbmGeneratorExecStream::prepare(), LhxJoinExecStream::prepare(), LhxAggExecStream::prepare(), FtrsTableWriterExecStream::prepare(), FlatFileExecStreamImpl::prepare(), UncollectExecStream::prepare(), SortedAggExecStream::prepare(), SingleOutputExecStream::prepare(), ReshapeExecStream::prepare(), MockResourceExecStream::prepare(), MockProducerExecStream::prepare(), MergeExecStream::prepare(), CorrelationJoinExecStream::prepare(), ConduitExecStream::prepare(), CollectExecStream::prepare(), CartesianJoinExecStream::prepare(), BernoulliSamplingExecStream::prepare(), BarrierExecStream::prepare(), CalcExecStream::prepare(), SortedAggExecStream::produce(), LbmBitOpExecStream::producePendingOutput(), LbmUnionExecStream::produceTuple(), LbmNormalizerExecStream::produceTuple(), LbmMinusExecStream::produceTuple(), LbmChopperExecStream::produceTuple(), LbmBitOpExecStream::produceTuple(), LbmBitOpExecStream::readInput(), LbmMinusExecStream::readMinuendInput(), and SingleOutputExecStream::setOutputBufAccessors().
bool ExecStream::isOpen [protected, inherited] |
Whether this stream is currently open.
Note that this is not quite the opposite of the inherited ClosableObject.needsClose, since a stream needs to be closed before destruction if it has been prepared but never opened.
Definition at line 61 of file ExecStream.h.
Referenced by ExecStream::closeImpl(), ExecStream::ExecStream(), and ExecStream::open().
ExecStreamGraph* ExecStream::pGraph [protected, inherited] |
Dataflow graph containing this stream.
Note that we don't use a weak_ptr for this because it needs to be accessed frequently during execution, and the extra locking overhead would be frivolous.
Definition at line 68 of file ExecStream.h.
Referenced by ExecStream::checkAbort(), ExecStream::ExecStream(), CorrelationJoinExecStream::execute(), ExecStream::getGraph(), JavaTransformExecStream::open(), SingleInputExecStream::open(), MergeExecStream::open(), ExecStream::open(), CorrelationJoinExecStream::open(), ConfluenceExecStream::open(), ExecStream::prepare(), CartesianJoinExecStream::prepare(), and LbmMinusExecStream::restartSubtrahends().
ExecStreamId ExecStream::id [protected, inherited] |
Identifier for this stream; local to its containing graph.
Definition at line 73 of file ExecStream.h.
Referenced by ExecStream::getStreamId().
std::string ExecStream::name [protected, inherited] |
Name of stream, as known by optimizer.
Reimplemented from TraceSource.
Definition at line 78 of file ExecStream.h.
Referenced by ExecStream::ExecStream(), ExecStream::getName(), FlatFileExecStreamImpl::open(), and ExecStream::setName().
SharedDynamicParamManager ExecStream::pDynamicParamManager [protected, inherited] |
The dynamic parameter manager available to this stream.
(Obtained at prepare() time. Keep a shared pointer in case the stream is reassigned to another graph for execution; cf ExecStreamGraph::mergeFrom())
Definition at line 85 of file ExecStream.h.
Referenced by CorrelationJoinExecStream::close(), SegBufferReaderExecStream::closeImpl(), LbmUnionExecStream::execute(), LbmSplicerExecStream::execute(), LbmGeneratorExecStream::execute(), LbmChopperExecStream::execute(), CorrelationJoinExecStream::execute(), BarrierExecStream::execute(), LcsClusterReplaceExecStream::open(), LbmUnionExecStream::open(), LbmSplicerExecStream::open(), LbmGeneratorExecStream::open(), LbmBitOpExecStream::open(), BTreeSearchExecStream::open(), BTreeInsertExecStream::open(), SegBufferWriterExecStream::open(), SegBufferReaderExecStream::open(), NestedLoopJoinExecStream::open(), CorrelationJoinExecStream::open(), ExecStream::prepare(), CalcExecStream::prepare(), NestedLoopJoinExecStream::processLeftInput(), reachedTupleLimit(), ReshapeExecStream::readDynamicParams(), SegBufferWriterExecStream::readReaderRefCount(), BTreeSearchExecStream::readSearchKey(), BTreeSearchExecStream::readUpperBoundKey(), setAdditionalKeys(), and LbmBitOpExecStream::writeStartRidParamValue().
SharedLogicalTxn ExecStream::pTxn [protected, inherited] |
The transaction embracing the stream.
Obtained at open() time; but not released at close() time, to allow TableWriters to replay a txn. Keep a shared pointer in case the stream is reassigned to another graph for execution; cf ExecStreamGraph::mergeFrom())
Definition at line 94 of file ExecStream.h.
Referenced by FtrsTableWriterExecStream::commitSavepoint(), FtrsTableWriterExecStream::createSavepoint(), FtrsTableWriterExecStream::open(), ExecStream::open(), and FtrsTableWriterExecStream::rollbackSavepoint().
ExecStreamResourceQuantity ExecStream::resourceAllocation [protected, inherited] |
Resource quantities currently allocated to this stream.
Definition at line 100 of file ExecStream.h.
Referenced by ExecStream::setResourceAllocation().
SharedCacheAccessor ExecStream::pQuotaAccessor [protected, inherited] |
CacheAccessor used for quota tracking.
Definition at line 105 of file ExecStream.h.
Referenced by ExecStream::open(), ExecStream::prepare(), and ExecStream::setResourceAllocation().
SharedCacheAccessor ExecStream::pScratchQuotaAccessor [protected, inherited] |
CacheAccessor used for scratch page quota tracking.
Definition at line 110 of file ExecStream.h.
Referenced by ExecStream::open(), ExecStream::prepare(), and ExecStream::setResourceAllocation().
bool ClosableObject::needsClose [protected, inherited] |
Definition at line 44 of file ClosableObject.h.
Referenced by SegStreamAllocation::beginWrite(), ExecStreamGraphImpl::clear(), ClosableObject::ClosableObject(), ClosableObject::close(), FlatFileBuffer::open(), ExecStreamGraphImpl::open(), ExecStream::open(), and ClosableObject::~ClosableObject().
SharedExecStreamBufAccessor SingleInputExecStream::pInAccessor [protected, inherited] |
Definition at line 51 of file SingleInputExecStream.h.
Referenced by SortedAggExecStream::compareGroupByKeys(), ExternalSortExecStreamImpl::computeFirstResult(), ExternalSortExecStreamImpl::execute(), LbmSplicerExecStream::execute(), FtrsTableWriterExecStream::execute(), BTreeSortExecStream::execute(), BTreeSearchUniqueExecStream::execute(), BTreeSearchExecStream::execute(), BTreePrefetchSearchExecStream::execute(), BTreeInsertExecStream::execute(), JavaSinkExecStream::execute(), UncollectExecStream::execute(), SplitterExecStream::execute(), SortedAggExecStream::execute(), SegBufferWriterExecStream::execute(), SegBufferReaderExecStream::execute(), SegBufferExecStream::execute(), ScratchBufferExecStream::execute(), ReshapeExecStream::execute(), MockConsumerExecStream::execute(), DoubleBufferExecStream::execute(), CopyExecStream::execute(), CollectExecStream::execute(), BernoulliSamplingExecStream::execute(), CalcExecStream::execute(), BTreePrefetchSearchExecStream::getNextPageForPrefetch(), LcsClusterReplaceExecStream::getTupleForLoad(), LcsClusterAppendExecStream::getTupleForLoad(), LbmSplicerExecStream::getValidatedTuple(), LcsClusterReplaceExecStream::initTupleLoadParams(), BTreeSearchExecStream::innerSearchLoop(), BTreePrefetchSearchExecStream::innerSearchLoop(), LcsClusterReplaceExecStream::open(), LbmNormalizerExecStream::open(), SingleInputExecStream::open(), SegBufferWriterExecStream::open(), SegBufferExecStream::open(), ScratchBufferExecStream::open(), MockConsumerExecStream::open(), DoubleBufferExecStream::open(), CollectExecStream::open(), LcsClusterAppendExecStream::postProcessTuple(), ConduitExecStream::precheckConduitBuffers(), ExternalSortExecStreamImpl::prepare(), LcsClusterAppendExecStream::prepare(), LbmSplicerExecStream::prepare(), LbmNormalizerExecStream::prepare(), BTreeSearchExecStream::prepare(), BTreeInsertExecStream::prepare(), UncollectExecStream::prepare(), SortedAggExecStream::prepare(), SingleInputExecStream::prepare(), SegBufferReaderExecStream::prepare(), ReshapeExecStream::prepare(), DiffluenceExecStream::prepare(), ConduitExecStream::prepare(), CollectExecStream::prepare(), BernoulliSamplingExecStream::prepare(), CalcExecStream::prepare(), SortedAggExecStream::produce(), BTreeSearchExecStream::readSearchKey(), LhxAggExecStream::setAggComputers(), LhxAggExecStream::setHashInfo(), SingleInputExecStream::setInputBufAccessors(), and JavaSinkExecStream::stuffByteBuffer().