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

Function find_unconnected_slot

src/fe_utils/parallel_slot.c:160–175  ·  view source on GitHub ↗

* Return the offset of the first slot without a database connection, or -1 if * all slots are connected. */

Source from the content-addressed store, hash-verified

158 * all slots are connected.
159 */
160static int
161find_unconnected_slot(const ParallelSlotArray *sa)
162{
163 int i;
164
165 for (i = 0; i < sa->numslots; i++)
166 {
167 if (sa->slots[i].inUse)
168 continue;
169
170 if (sa->slots[i].connection == NULL)
171 return i;
172 }
173
174 return -1;
175}
176
177/*
178 * Return the offset of the first idle slot, or -1 if all slots are busy.

Callers 2

ParallelSlotsGetIdleFunction · 0.85
ParallelSlotsAdoptConnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected