Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

ctdbPartAdminByKey

Performs an administrative partition operation on the partition specified by key value.

Declaration

CTDBRET ctdbPartAdminByKey(CTHANDLE handle,pVOID keyval,CTPART_MODE_E partmode,pCOUNT partstatus)

Description

ctdbPartAdminByKey() manages the partitions for a table.

  • Handle [in] - a table handle.
  • keyval [in] - pointer to a partition key value that has been transformed
  • partmode [in] - partition operation mode. partmode is one of:

     

    CTPART_PURGE

    delete a partition

     

    CTPART_ADD

    add a partition

     

    CTPART_ARCHIVE

    archive a partition

     

    CTPART_BASE

    modify the lower limit partition number value

     

    CTPART_ACTIVATE

    activate an archived partition

     

    CTPART_STATUS

    return the partition status in partstatus

  • partstatus [out] - status code of partition when partmode specifies CTPART_STATUS. partstatus returns one of the following values:

     

    pmSTATUSnone

    0

    partition member does not exist

     

    pmSTATUSexst

    1

    partition member is active

     

    pmSTATUSopnd

    2

    partition member is active and currently open

     

    pmSTATUSarhv

    3

    partition member is archived

     

    pmSTATUSpurg

    4

    partition member was purged

     

    pmSTATUSparc

    19

    partition member is pending archive

     

    pmSTATUSppnd

    20

    partition member is pending purge

Returns

ctdbPartAdminByKey() returns CTDBRET_OK on success. BMOD_ERR (446) is returned with a bad partmode value. A c-treeDB API C API error on failure.

See also

ctdbPartAdminByName(), ctdbPartAdminByNumber()

TOCIndex