Register citus custom scan nodes

pull/1825/head
Onder Kalaci 2017-11-22 18:07:31 +02:00
parent 83c1143505
commit 16421f089f
3 changed files with 19 additions and 3 deletions

View File

@ -124,8 +124,20 @@ static CustomExecMethods CoordinatorInsertSelectCustomExecMethods = {
/* /*
* RegisterCitusCustomScanMethods ets PostgreSQL know about * Let PostgreSQL know about Citus' custom scan nodes.
* Citus' custom scan nodes. */
void
RegisterCitusCustomScanMethods(void)
{
RegisterCustomScanMethods(&RealTimeCustomScanMethods);
RegisterCustomScanMethods(&TaskTrackerCustomScanMethods);
RegisterCustomScanMethods(&RouterCustomScanMethods);
RegisterCustomScanMethods(&CoordinatorInsertSelectCustomScanMethods);
RegisterCustomScanMethods(&DelayedErrorCustomScanMethods);
}
/*
* RealTimeCreateScan creates the scan state for real-time executor queries. * RealTimeCreateScan creates the scan state for real-time executor queries.
*/ */
static Node * static Node *
@ -269,6 +281,7 @@ CitusSelectBeginScan(CustomScanState *node, EState *estate, int eflags)
/* just an empty function */ /* just an empty function */
} }
/* /*
* CitusEndScan is used to clean up tuple store of the given custom scan state. * CitusEndScan is used to clean up tuple store of the given custom scan state.
*/ */

View File

@ -189,6 +189,9 @@ _PG_init(void)
/* make our additional node types known */ /* make our additional node types known */
RegisterNodes(); RegisterNodes();
/* make our custom scan nodes known */
RegisterCitusCustomScanMethods();
/* intercept planner */ /* intercept planner */
planner_hook = distributed_planner; planner_hook = distributed_planner;

View File

@ -34,7 +34,7 @@ extern CustomScanMethods CoordinatorInsertSelectCustomScanMethods;
extern CustomScanMethods DelayedErrorCustomScanMethods; extern CustomScanMethods DelayedErrorCustomScanMethods;
/* common functions for different executors */ extern void RegisterCitusCustomScanMethods(void);
extern void CitusExplainScan(CustomScanState *node, List *ancestors, struct extern void CitusExplainScan(CustomScanState *node, List *ancestors, struct
ExplainState *es); ExplainState *es);