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

Function ExecAppendInitializeDSM

src/backend/executor/nodeAppend.c:520–533  ·  view source on GitHub ↗

---------------------------------------------------------------- * ExecAppendInitializeDSM * * Set up shared state for Parallel Append. * ---------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

518 * ----------------------------------------------------------------
519 */
520void
521ExecAppendInitializeDSM(AppendState *node,
522 ParallelContext *pcxt)
523{
524 ParallelAppendState *pstate;
525
526 pstate = shm_toc_allocate(pcxt->toc, node->pstate_len);
527 memset(pstate, 0, node->pstate_len);
528 LWLockInitialize(&pstate->pa_lock, LWTRANCHE_PARALLEL_APPEND);
529 shm_toc_insert(pcxt->toc, node->ps.plan->plan_node_id, pstate);
530
531 node->as_pstate = pstate;
532 node->choose_next_subplan = choose_next_subplan_for_leader;
533}
534
535
536/* ----------------------------------------------------------------

Callers 2

Calls 3

shm_toc_allocateFunction · 0.85
LWLockInitializeFunction · 0.85
shm_toc_insertFunction · 0.85

Tested by

no test coverage detected