ctdbGetTableStatus
Declaration
ULONG ctdbGetTableStatus(CTHANDLE Handle);
Description
Retrieves the table status. The table status indicates which rebuild action will be taken by an alter table operation.
Return Values
Returns CTDB_REBUILD_NONE if the table is not changed or a bit mask of the values below describing the table status.
The possible rebuild status returns are:
Rebuild Status Value |
Rebuild Status Symbolic Code |
Explanation |
---|---|---|
0 |
CTDB_REBUILD_NONE |
Nothing to be done, no changes to table |
1 |
CTDB_REBUILD_DODA |
Update the table DODA |
2 |
CTDB_REBUILD_RESOURCE |
Update table FC!DFLD resource |
4 |
CTDB_REBUILD_INDEX |
Add new indices to table |
8 |
CTDB_REBUILD_ALL |
Rebuild all indices |
16 |
CTDB_REBUILD_FULL |
Full table rebuild. A temporary table is created and all data is moved to new table and the indexes are built on the fly. |
Example
ULONG status = ctdbGetTableStatus(hTable);
if (status & CTDB_REBUILD_ALL || status & CTDB_REBUILD_FULL)
ctdbAlterTable(hTable, CTDB_ALTER_FULL)
else if (status)
ctdbAlterTable(hTable, CTDB_ALTER_NORMAL);
See Also
ctdbGetIndexStatus(), ctdbGetSegmentStatus(), ctdbAlterTable()