Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

ctdbSetBatchRangeOn

Sets a range to be used in batch operations.

Declaration

CTDBRET ctdbSetBatchRangeOn(CTHANDLE Handle, NINT SegCount, pVOID lRange, pVOID uRange, pNINT operators)

Description

  • Handle [IN] - Record handle
  • SegCount [IN] - segcount indicates the number of index segments values that should be used for setting the range, and the number of operators, because there must be one operator for each key segment in lRange and/or uRange.
  • lRange [IN] - lRange is a buffer with the lower range segment values. Use the function ctdbBuildTargetKey to build the lRange buffer.
  • uRange [IN] - uRange is a buffer with the upper range segment values. Use the function ctdbBuildTargetKey to build the uRange buffer.
  • operators [IN] - operators is an array of operators. There must be one operator for each key segment in lRange and/or uRange.

    The operators CTIX_EQ, CTIX_NE, CTIX_GT, CTIX_GE, CTIX_LE, CTIX_LT are open -ended and use only the lRange buffer for range values and the equivalent key segment in uRange is ignored and may be set to nul (ASCII \0 values). The operators CTIX_BET, CTIX_BET_IE, CTIX_BET_EI, CTIX_BET_EE and CTIX_NOTBET use both lRange and uRange buffers to establish the lower and upper bound values.

This is the batch version of ctdbRecordRangeOn(). When performing a record batch, use ctdbSetBatchRangeOn() as it does not connect to the server but instead sets the information locally in the client so it can piggyback onto the ctdbSetBatch() call avoiding an extra network hit. When performing individual record lookups, use ctdbRecordRangeOn().

Returns

Return CTDBRET_OK on success.

New error code CTDBRET_ALREADYSET = 4170 indicates that a range or a filter for batch operation is already set.

See Also

ctdbSetBatchRangeOff (ctdbSetBatchRangeOff, ctdbSetBatchRangeOff)()

ctdbSetBatchFilter (ctdbSetBatchFilter, ctdbSetBatchFilter)()

TOCIndex