MCPcopy Create free account
hub / github.com/apache/cloudberry / insertResgroupCapabilityEntry

Function insertResgroupCapabilityEntry

src/backend/commands/resgroupcmds.c:1431–1451  ·  view source on GitHub ↗

* Insert one capability to the capability table. * * @param rel the relation * @param groupid oid of the resource group * @param type the resource limit type * @param value the limit value */

Source from the content-addressed store, hash-verified

1429 * @param value the limit value
1430 */
1431static void
1432insertResgroupCapabilityEntry(Relation rel,
1433 Oid groupid,
1434 uint16 type,
1435 const char *value)
1436{
1437 Datum new_record[Natts_pg_resgroupcapability];
1438 bool new_record_nulls[Natts_pg_resgroupcapability];
1439 HeapTuple tuple;
1440 TupleDesc tupleDesc = RelationGetDescr(rel);
1441
1442 MemSet(new_record, 0, sizeof(new_record));
1443 MemSet(new_record_nulls, false, sizeof(new_record_nulls));
1444
1445 new_record[Anum_pg_resgroupcapability_resgroupid - 1] = ObjectIdGetDatum(groupid);
1446 new_record[Anum_pg_resgroupcapability_reslimittype - 1] = UInt16GetDatum(type);
1447 new_record[Anum_pg_resgroupcapability_value - 1] = CStringGetTextDatum(value);
1448
1449 tuple = heap_form_tuple(tupleDesc, new_record, new_record_nulls);
1450 CatalogTupleInsert(rel, tuple);
1451}
1452
1453/*
1454 * Delete capability entries of one resource group.

Callers 2

Calls 4

ObjectIdGetDatumFunction · 0.85
UInt16GetDatumFunction · 0.85
heap_form_tupleFunction · 0.85
CatalogTupleInsertFunction · 0.85

Tested by

no test coverage detected