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

Function gm_readnext_tuple

src/backend/executor/nodeGatherMerge.c:714–740  ·  view source on GitHub ↗

* Attempt to read a tuple from given worker. */

Source from the content-addressed store, hash-verified

712 * Attempt to read a tuple from given worker.
713 */
714static MinimalTuple
715gm_readnext_tuple(GatherMergeState *gm_state, int nreader, bool nowait,
716 bool *done)
717{
718 TupleQueueReader *reader;
719 MinimalTuple tup;
720
721 /* Check for async events, particularly messages from workers. */
722 CHECK_FOR_INTERRUPTS();
723
724 /*
725 * Attempt to read a tuple.
726 *
727 * Note that TupleQueueReaderNext will just return NULL for a worker which
728 * fails to initialize. We'll treat that worker as having produced no
729 * tuples; WaitForParallelWorkersToFinish will error out when we get
730 * there.
731 */
732 reader = gm_state->reader[nreader - 1];
733 tup = TupleQueueReaderNext(reader, nowait, done);
734
735 /*
736 * Since we'll be buffering these across multiple calls, we need to make a
737 * copy.
738 */
739 return tup ? heap_copy_minimal_tuple(tup) : NULL;
740}
741
742/*
743 * We have one slot for each item in the heap array. We use SlotNumber

Callers 2

load_tuple_arrayFunction · 0.85
gather_merge_readnextFunction · 0.85

Calls 2

TupleQueueReaderNextFunction · 0.85
heap_copy_minimal_tupleFunction · 0.85

Tested by

no test coverage detected