PostgreSQL Source Code git master
Loading...
Searching...
No Matches
execAsync.c File Reference
Include dependency graph for execAsync.c:

Go to the source code of this file.

Functions

void ExecAsyncRequest (AsyncRequest *areq)
 
void ExecAsyncConfigureWait (AsyncRequest *areq)
 
void ExecAsyncNotify (AsyncRequest *areq)
 
void ExecAsyncResponse (AsyncRequest *areq)
 
void ExecAsyncRequestDone (AsyncRequest *areq, TupleTableSlot *result)
 
void ExecAsyncRequestPending (AsyncRequest *areq)
 

Function Documentation

◆ ExecAsyncConfigureWait()

void ExecAsyncConfigureWait ( AsyncRequest areq)

Definition at line 63 of file execAsync.c.

64{
65 /* must provide our own instrumentation support */
66 if (areq->requestee->instrument)
67 InstrStartNode(areq->requestee->instrument);
68
69 switch (nodeTag(areq->requestee))
70 {
73 break;
74 default:
75 /* If the node doesn't support async, caller messed up. */
76 elog(ERROR, "unrecognized node type: %d",
77 (int) nodeTag(areq->requestee));
78 }
79
80 /* must provide our own instrumentation support */
81 if (areq->requestee->instrument)
82 InstrStopNode(areq->requestee->instrument, 0.0);
83}
#define ERROR
Definition elog.h:39
#define elog(elevel,...)
Definition elog.h:226
void InstrStartNode(Instrumentation *instr)
Definition instrument.c:68
void InstrStopNode(Instrumentation *instr, double nTuples)
Definition instrument.c:88
void ExecAsyncForeignScanConfigureWait(AsyncRequest *areq)
#define nodeTag(nodeptr)
Definition nodes.h:139
static int fb(int x)

References elog, ERROR, ExecAsyncForeignScanConfigureWait(), fb(), InstrStartNode(), InstrStopNode(), and nodeTag.

Referenced by ExecAppendAsyncEventWait().

◆ ExecAsyncNotify()

void ExecAsyncNotify ( AsyncRequest areq)

Definition at line 89 of file execAsync.c.

90{
91 /* must provide our own instrumentation support */
92 if (areq->requestee->instrument)
93 InstrStartNode(areq->requestee->instrument);
94
95 switch (nodeTag(areq->requestee))
96 {
99 break;
100 default:
101 /* If the node doesn't support async, caller messed up. */
102 elog(ERROR, "unrecognized node type: %d",
103 (int) nodeTag(areq->requestee));
104 }
105
107
108 /* must provide our own instrumentation support */
109 if (areq->requestee->instrument)
110 InstrStopNode(areq->requestee->instrument,
111 TupIsNull(areq->result) ? 0.0 : 1.0);
112}
void ExecAsyncResponse(AsyncRequest *areq)
Definition execAsync.c:118
void ExecAsyncForeignScanNotify(AsyncRequest *areq)
#define TupIsNull(slot)
Definition tuptable.h:325

References elog, ERROR, ExecAsyncForeignScanNotify(), ExecAsyncResponse(), fb(), InstrStartNode(), InstrStopNode(), nodeTag, and TupIsNull.

Referenced by ExecAppendAsyncEventWait().

◆ ExecAsyncRequest()

void ExecAsyncRequest ( AsyncRequest areq)

Definition at line 27 of file execAsync.c.

28{
29 if (areq->requestee->chgParam != NULL) /* something changed? */
30 ExecReScan(areq->requestee); /* let ReScan handle this */
31
32 /* must provide our own instrumentation support */
33 if (areq->requestee->instrument)
34 InstrStartNode(areq->requestee->instrument);
35
36 switch (nodeTag(areq->requestee))
37 {
40 break;
41 default:
42 /* If the node doesn't support async, caller messed up. */
43 elog(ERROR, "unrecognized node type: %d",
44 (int) nodeTag(areq->requestee));
45 }
46
48
49 /* must provide our own instrumentation support */
50 if (areq->requestee->instrument)
51 InstrStopNode(areq->requestee->instrument,
52 TupIsNull(areq->result) ? 0.0 : 1.0);
53}
void ExecReScan(PlanState *node)
Definition execAmi.c:78
void ExecAsyncForeignScanRequest(AsyncRequest *areq)

References elog, ERROR, ExecAsyncForeignScanRequest(), ExecAsyncResponse(), ExecReScan(), fb(), InstrStartNode(), InstrStopNode(), nodeTag, and TupIsNull.

Referenced by ExecAppendAsyncBegin(), and ExecAppendAsyncRequest().

◆ ExecAsyncRequestDone()

void ExecAsyncRequestDone ( AsyncRequest areq,
TupleTableSlot result 
)

Definition at line 138 of file execAsync.c.

139{
140 areq->request_complete = true;
141 areq->result = result;
142}

References fb().

Referenced by process_pending_request(), and produce_tuple_asynchronously().

◆ ExecAsyncRequestPending()

void ExecAsyncRequestPending ( AsyncRequest areq)

Definition at line 150 of file execAsync.c.

151{
152 areq->callback_pending = true;
153 areq->request_complete = false;
154 areq->result = NULL;
155}

References fb().

Referenced by produce_tuple_asynchronously().

◆ ExecAsyncResponse()

void ExecAsyncResponse ( AsyncRequest areq)

Definition at line 118 of file execAsync.c.

119{
120 switch (nodeTag(areq->requestor))
121 {
122 case T_AppendState:
124 break;
125 default:
126 /* If the node doesn't support async, caller messed up. */
127 elog(ERROR, "unrecognized node type: %d",
128 (int) nodeTag(areq->requestor));
129 }
130}
void ExecAsyncAppendResponse(AsyncRequest *areq)

References elog, ERROR, ExecAsyncAppendResponse(), fb(), and nodeTag.

Referenced by complete_pending_request(), ExecAsyncNotify(), ExecAsyncRequest(), and process_pending_request().