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

Function ExecParallelHashPopChunkQueue

src/backend/executor/nodeHash.c:4001–4020  ·  view source on GitHub ↗

* Take the next available chunk from the queue of chunks being worked on in * parallel. Return NULL if there are none left. Otherwise return a pointer * to the chunk, and set *shared to the DSA pointer to the chunk. */

Source from the content-addressed store, hash-verified

3999 * to the chunk, and set *shared to the DSA pointer to the chunk.
4000 */
4001static HashMemoryChunk
4002ExecParallelHashPopChunkQueue(HashJoinTable hashtable, dsa_pointer *shared)
4003{
4004 ParallelHashJoinState *pstate = hashtable->parallel_state;
4005 HashMemoryChunk chunk;
4006
4007 LWLockAcquire(&pstate->lock, LW_EXCLUSIVE);
4008 if (DsaPointerIsValid(pstate->chunk_work_queue))
4009 {
4010 *shared = pstate->chunk_work_queue;
4011 chunk = (HashMemoryChunk)
4012 dsa_get_address(hashtable->area, *shared);
4013 pstate->chunk_work_queue = chunk->next.shared;
4014 }
4015 else
4016 chunk = NULL;
4017 LWLockRelease(&pstate->lock);
4018
4019 return chunk;
4020}
4021
4022/*
4023 * Increase the space preallocated in this backend for a given inner batch by

Calls 3

LWLockAcquireFunction · 0.85
dsa_get_addressFunction · 0.85
LWLockReleaseFunction · 0.85

Tested by

no test coverage detected