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

Function InventorySliceTree

src/backend/executor/execUtils.c:1911–1935  ·  view source on GitHub ↗

* Helper for AssignGangs takes a simple inventory of the gangs required * by a slice tree. Recursive. Closely coupled with AssignGangs. Not * generally useful. */

Source from the content-addressed store, hash-verified

1909 * generally useful.
1910 */
1911static void
1912InventorySliceTree(CdbDispatcherState *ds, SliceTable *sliceTable, int sliceIndex)
1913{
1914 ExecSlice *slice = &sliceTable->slices[sliceIndex];
1915 ListCell *cell;
1916
1917 if (slice->gangType == GANGTYPE_UNALLOCATED)
1918 {
1919 slice->primaryGang = NULL;
1920 slice->primaryProcesses = getCdbProcessesForQD(true);
1921 }
1922 else if (!slice->primaryGang)
1923 {
1924 Assert(slice->segments != NIL);
1925 slice->primaryGang = AllocateGang(ds, slice->gangType, slice->segments);
1926 setupCdbProcessList(slice);
1927 }
1928
1929 foreach(cell, slice->children)
1930 {
1931 int childIndex = lfirst_int(cell);
1932
1933 InventorySliceTree(ds, sliceTable, childIndex);
1934 }
1935}
1936
1937/*
1938 * Choose the execution identity (who does this executor serve?).

Callers 1

AssignGangsFunction · 0.85

Calls 4

getCdbProcessesForQDFunction · 0.85
AllocateGangFunction · 0.85
setupCdbProcessListFunction · 0.85
foreachFunction · 0.50

Tested by

no test coverage detected