Commit badf3549 authored by unknown's avatar unknown
Browse files

ndb - Update documentation wrt scans


ndb/include/ndbapi/Ndb.hpp:
  Update documentation wrt scans
ndb/include/ndbapi/NdbIndexScanOperation.hpp:
  Update documentation wrt scans
ndb/include/ndbapi/NdbOperation.hpp:
  Update documentation wrt scans
ndb/include/ndbapi/NdbRecAttr.hpp:
  Update documentation wrt scans
ndb/include/ndbapi/NdbScanOperation.hpp:
  Update documentation wrt scans
ndb/include/ndbapi/NdbTransaction.hpp:
  Update documentation wrt scans
ndb/src/ndbapi/NdbOperationSearch.cpp:
  Update documentation wrt scans
parent 29b3edb9
Loading
Loading
Loading
Loading
+428 −399

File changed.

Preview size limit exceeded, changes collapsed.

+13 −17
Original line number Diff line number Diff line
@@ -34,16 +34,15 @@ class NdbIndexScanOperation : public NdbScanOperation {

public:
  /**
   * readTuples returns a NdbResultSet where tuples are stored.
   * Tuples are not stored in NdbResultSet until execute(NoCommit) 
   * has been executed and nextResult has been called.
   * readTuples using ordered index
   * 
   * @param parallel  Scan parallelism
   * @param lock_mode Lock mode
   * @param batch     No of rows to fetch from each fragment at a time
   * @param LockMode  Scan lock handling   
   * @param parallel  No of fragments to scan in parallel
   * @param order_by  Order result set in index order
   * @param order_desc Order descending, ignored unless order_by
   * @returns NdbResultSet.
   * @param read_range_no Enable reading of range no using @ref get_range_no
   * @returns 0 for success and -1 for failure
   * @see NdbScanOperation::readTuples
   */ 
  int readTuples(LockMode = LM_Read,
@@ -53,16 +52,6 @@ public:
                 bool order_desc = false,
		 bool read_range_no = false);
  
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
  inline int readTuples(int parallell){
    return readTuples(LM_Read, 0, parallell, false);
  }
  
  inline int readTuplesExclusive(int parallell = 0){
    return readTuples(LM_Exclusive, 0, parallell, false);
  }
#endif
  
  /**
   * Type of ordered index key bound.  The values (0-4) will not change
   * and can be used explicitly (e.g. they could be computed).
@@ -134,7 +123,14 @@ public:
   */
  int get_range_no();
  
  /**
   * Is current scan sorted
   */
  bool getSorted() const { return m_ordered; }

  /**
   * Is current scan sorted descending
   */
  bool getDescending() const { return m_descending; }
private:
  NdbIndexScanOperation(Ndb* aNdb);
+9 −16
Original line number Diff line number Diff line
@@ -265,21 +265,6 @@ public:
  int  equal(Uint32 anAttrId, Int64 aValue);	
  int  equal(Uint32 anAttrId, Uint64 aValue);
	
  /**
   * Generate a tuple id and set it as search argument.
   *
   * The Tuple id has NDB$TID as attribute name and 0 as attribute id.
   *
   * The generated tuple id is returned by the method.
   * If zero is returned there is an error.
   *
   * This is mostly used for tables without any primary key 
   * attributes.
   * 
   * @return    Generated tuple id if successful, otherwise 0.
   */
  Uint64       setTupleId();			

  /** @} *********************************************************************/
  /** 
   * @name Specify Attribute Actions for Operations
@@ -708,6 +693,7 @@ public:

  /** @} *********************************************************************/

#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
  /**
   * Type of operation
   */
@@ -723,11 +709,16 @@ public:
    NotDefined2,                  ///< Internal for debugging
    NotDefined                    ///< Internal for debugging
  };
#endif

  /**
   * Return lock mode for operation
   */
  LockMode getLockMode() const { return theLockMode; }
  void setAbortOption(Int8 ao) { m_abortOption = ao; }

#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
  void setAbortOption(Int8 ao) { m_abortOption = ao; }
  
  /**
   * Set/get distribution/partition key
   */
@@ -758,8 +749,10 @@ protected:
  void	next(NdbOperation*);		// Set next pointer		      
  NdbOperation*	    next();	        // Get next pointer		       
public:
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
  const NdbOperation* next() const;
  const NdbRecAttr* getFirstRecAttr() const;
#endif
protected:

  enum OperationStatus
+2 −0
Original line number Diff line number Diff line
@@ -245,7 +245,9 @@ public:
  ~NdbRecAttr();    

public:
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
  const NdbRecAttr* next() const;
#endif
private:
  NdbRecAttr();

+15 −39
Original line number Diff line number Diff line
@@ -37,16 +37,14 @@ class NdbScanOperation : public NdbOperation {

public:
  /**
   * readTuples returns a NdbResultSet where tuples are stored.
   * Tuples are not stored in NdbResultSet until execute(NoCommit) 
   * has been executed and nextResult has been called.
   * readTuples
   * 
   * @param parallel  Scan parallelism
   * @param lock_mode Lock mode
   * @param batch No of rows to fetch from each fragment at a time
   * @param LockMode  Scan lock handling   
   * @param parallel No of fragments to scan in parallell
   * @note specifying 0 for batch and parallall means max performance
   */ 
  int readTuples(LockMode = LM_Read, 
  int readTuples(LockMode lock_mode = LM_Read, 
		 Uint32 batch = 0, Uint32 parallel = 0);
  
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
@@ -67,7 +65,7 @@ public:
  /**
   * Get the next tuple in a scan transaction. 
   * 
   * After each call to NdbResult::nextResult
   * After each call to nextResult
   * the buffers and NdbRecAttr objects defined in 
   * NdbOperation::getValue are updated with values 
   * from the scanned tuple. 
@@ -114,53 +112,31 @@ public:
  int nextResult(bool fetchAllowed = true, bool forceSend = false);

  /**
   * Close result set (scan)
   * Close scan
   */
  void close(bool forceSend = false);

  /**
   * Restart
   */
  int restart(bool forceSend = false);
  
  /**
   * Transfer scan operation to an updating transaction. Use this function 
   * when a scan has found a record that you want to update. 
   * 1. Start a new transaction.
   * 2. Call the function takeOverForUpdate using your new transaction 
   *    as parameter, all the properties of the found record will be copied 
   *    to the new transaction.
   * 3. When you execute the new transaction, the lock held by the scan will 
   *    be transferred to the new transaction(it's taken over).
   *
   * @note You must have started the scan with openScanExclusive
   *       to be able to update the found tuple.
   * Update current tuple
   *
   * @param updateTrans the update transaction connection.
   * @return an NdbOperation or NULL.
   */
  NdbOperation* updateCurrentTuple();
  NdbOperation*	updateCurrentTuple(NdbTransaction* updateTrans);

  /**
   * Transfer scan operation to a deleting transaction. Use this function 
   * when a scan has found a record that you want to delete. 
   * 1. Start a new transaction.
   * 2. Call the function takeOverForDelete using your new transaction 
   *    as parameter, all the properties of the found record will be copied 
   *    to the new transaction.
   * 3. When you execute the new transaction, the lock held by the scan will 
   *    be transferred to the new transaction(its taken over).
   *
   * @note You must have started the scan with openScanExclusive
   *       to be able to delete the found tuple.
   *
   * @param deleteTrans the delete transaction connection.
   * @return an NdbOperation or NULL.
   * Delete current tuple
   * @return 0 on success or -1 on failure
   */
  int deleteCurrentTuple();
  int deleteCurrentTuple(NdbTransaction* takeOverTransaction);
  
  /**
   * Restart scan with exactly the same
   *   getValues and search conditions
   */
  int restart(bool forceSend = false);
  
protected:
  NdbScanOperation(Ndb* aNdb);
  virtual ~NdbScanOperation();
Loading