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

Function ExecBitmapHeapInitializeDSM

src/backend/executor/nodeBitmapHeapscan.c:969–997  ·  view source on GitHub ↗

---------------------------------------------------------------- * ExecBitmapHeapInitializeDSM * * Set up a parallel bitmap heap scan descriptor. * ---------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

967 * ----------------------------------------------------------------
968 */
969void
970ExecBitmapHeapInitializeDSM(BitmapHeapScanState *node,
971 ParallelContext *pcxt)
972{
973 ParallelBitmapHeapState *pstate;
974 EState *estate = node->ss.ps.state;
975 dsa_area *dsa = node->ss.ps.state->es_query_dsa;
976
977 /* If there's no DSA, there are no workers; initialize nothing. */
978 if (dsa == NULL)
979 return;
980
981 pstate = shm_toc_allocate(pcxt->toc, node->pscan_len);
982
983 pstate->tbmiterator = 0;
984 pstate->prefetch_iterator = 0;
985
986 /* Initialize the mutex */
987 SpinLockInit(&pstate->mutex);
988 pstate->prefetch_pages = 0;
989 pstate->prefetch_target = 0;
990 pstate->state = BM_INITIAL;
991
992 ConditionVariableInit(&pstate->cv);
993 SerializeSnapshot(estate->es_snapshot, pstate->phs_snapshot_data);
994
995 shm_toc_insert(pcxt->toc, node->ss.ps.plan->plan_node_id, pstate);
996 node->pstate = pstate;
997}
998
999/* ----------------------------------------------------------------
1000 * ExecBitmapHeapReInitializeDSM

Callers 2

Calls 4

shm_toc_allocateFunction · 0.85
ConditionVariableInitFunction · 0.85
SerializeSnapshotFunction · 0.85
shm_toc_insertFunction · 0.85

Tested by

no test coverage detected