#include <NdbScanOperation.hpp>
Scan flags. OR-ed together and passed as second argument to readTuples. Note that SF_MultiRange has to be set if several ranges (bounds) are to be passed.
virtual int NdbScanOperation::readTuples | ( | LockMode | lock_mode = LM_Read , |
|
Uint32 | scan_flags = 0 , |
|||
Uint32 | parallel = 0 , |
|||
Uint32 | batch = 0 | |||
) | [virtual] |
readTuples
lock_mode | Lock mode | |
scan_flags | see ScanFlag | |
parallel | No of fragments to scan in parallel (0=max) |
Reimplemented in NdbIndexScanOperation.
int NdbScanOperation::nextResult | ( | bool | fetchAllowed = true , |
|
bool | forceSend = false | |||
) |
Get the next tuple in a scan transaction.
After each call to nextResult the buffers and NdbRecAttr objects defined in NdbOperation::getValue are updated with values from the scanned tuple.
fetchAllowed | If set to false, then fetching is disabled | |
forceSend | If true send will occur immediately (see Adaptive Send Algorithm) |
fetchAllowed = false is useful when you want to update or delete all the records fetched in one transaction(This will save a lot of round trip time and make updates or deletes of scanned records a lot faster). While nextResult(false) returns 0 take over the record to another transaction. When nextResult(false) returns 2 you must execute and commit the other transaction. This will cause the locks to be transferred to the other transaction, updates or deletes will be made and then the locks will be released. After that, call nextResult(true) which will fetch new records and cache them in the NdbApi.
Please contact for examples of efficient scan updates and deletes.
See ndb/examples/ndbapi_scan_example for usage.
void NdbScanOperation::close | ( | bool | forceSend = false , |
|
bool | releaseOp = false | |||
) |
Close scan
NdbOperation * NdbScanOperation::lockCurrentTuple | ( | ) | [inline] |
NdbOperation * NdbScanOperation::lockCurrentTuple | ( | NdbTransaction * | lockTrans | ) | [inline] |
Lock current tuple
lockTrans | Transaction that should perform the lock |
NdbOperation * NdbScanOperation::updateCurrentTuple | ( | ) | [inline] |
NdbOperation * NdbScanOperation::updateCurrentTuple | ( | NdbTransaction * | updateTrans | ) | [inline] |
Update current tuple
updateTrans | Transaction that should perform the update |
int NdbScanOperation::deleteCurrentTuple | ( | ) | [inline] |
Delete current tuple
int NdbScanOperation::deleteCurrentTuple | ( | NdbTransaction * | takeOverTransaction | ) | [inline] |
Delete current tuple
takeOverTransaction | Transaction that should perform the delete |
int NdbScanOperation::restart | ( | bool | forceSend = false |
) |
Restart scan with exactly the same getValues and search conditions