PostgreSQL Source Code
git master
|
#include "postgres_fe.h"
#include <sys/select.h>
#include "common/logging.h"
#include "fe_utils/cancel.h"
#include "fe_utils/parallel_slot.h"
#include "fe_utils/query_utils.h"
Go to the source code of this file.
Macros | |
#define | ERRCODE_UNDEFINED_TABLE "42P01" |
Functions | |
static int | select_loop (int maxFd, fd_set *workerset) |
static bool | processQueryResult (ParallelSlot *slot, PGresult *result) |
static bool | consumeQueryResult (ParallelSlot *slot) |
static int | find_matching_idle_slot (const ParallelSlotArray *sa, const char *dbname) |
static int | find_unconnected_slot (const ParallelSlotArray *sa) |
static int | find_any_idle_slot (const ParallelSlotArray *sa) |
static bool | wait_on_slots (ParallelSlotArray *sa) |
static void | connect_slot (ParallelSlotArray *sa, int slotno, const char *dbname) |
ParallelSlot * | ParallelSlotsGetIdle (ParallelSlotArray *sa, const char *dbname) |
ParallelSlotArray * | ParallelSlotsSetup (int numslots, ConnParams *cparams, const char *progname, bool echo, const char *initcmd) |
void | ParallelSlotsAdoptConn (ParallelSlotArray *sa, PGconn *conn) |
void | ParallelSlotsTerminate (ParallelSlotArray *sa) |
bool | ParallelSlotsWaitCompletion (ParallelSlotArray *sa) |
bool | TableCommandResultHandler (PGresult *res, PGconn *conn, void *context) |
#define ERRCODE_UNDEFINED_TABLE "42P01" |
Definition at line 28 of file parallel_slot.c.
|
static |
Definition at line 287 of file parallel_slot.c.
References connectDatabase(), ParallelSlot::connection, dbname, executeCommand(), exit(), fd(), pg_log_error, pg_log_error_hint, and PQsocket().
Referenced by ParallelSlotsGetIdle().
|
static |
Definition at line 58 of file parallel_slot.c.
References ParallelSlot::connection, PQgetResult(), processQueryResult(), ResetCancelConn(), and SetCancelConn().
Referenced by ParallelSlotsWaitCompletion().
|
static |
|
static |
Definition at line 135 of file parallel_slot.c.
References dbname, i, and PQdb().
Referenced by ParallelSlotsGetIdle().
|
static |
Definition at line 159 of file parallel_slot.c.
References i.
Referenced by ParallelSlotsAdoptConn(), and ParallelSlotsGetIdle().
void ParallelSlotsAdoptConn | ( | ParallelSlotArray * | sa, |
PGconn * | conn | ||
) |
Definition at line 460 of file parallel_slot.c.
References conn, disconnectDatabase(), and find_unconnected_slot().
Referenced by main(), reindex_one_database(), and vacuum_one_database().
ParallelSlot* ParallelSlotsGetIdle | ( | ParallelSlotArray * | sa, |
const char * | dbname | ||
) |
Definition at line 371 of file parallel_slot.c.
References Assert, connect_slot(), dbname, disconnectDatabase(), find_any_idle_slot(), find_matching_idle_slot(), find_unconnected_slot(), and wait_on_slots().
Referenced by main(), reindex_one_database(), and vacuum_one_database().
ParallelSlotArray* ParallelSlotsSetup | ( | int | numslots, |
ConnParams * | cparams, | ||
const char * | progname, | ||
bool | echo, | ||
const char * | initcmd | ||
) |
Definition at line 428 of file parallel_slot.c.
References Assert, palloc0(), and progname.
Referenced by main(), reindex_one_database(), and vacuum_one_database().
void ParallelSlotsTerminate | ( | ParallelSlotArray * | sa | ) |
Definition at line 479 of file parallel_slot.c.
References conn, disconnectDatabase(), and i.
Referenced by main(), reindex_one_database(), and vacuum_one_database().
bool ParallelSlotsWaitCompletion | ( | ParallelSlotArray * | sa | ) |
Definition at line 501 of file parallel_slot.c.
References consumeQueryResult(), i, and ParallelSlotClearHandler().
Referenced by main(), reindex_one_database(), and vacuum_one_database().
|
static |
Definition at line 39 of file parallel_slot.c.
References Assert, ParallelSlot::connection, ParallelSlot::handler, ParallelSlot::handler_context, and PQclear().
Referenced by consumeQueryResult(), and wait_on_slots().
|
static |
Definition at line 80 of file parallel_slot.c.
References CancelRequested, EINTR, i, and select.
Referenced by wait_on_slots().
Definition at line 540 of file parallel_slot.c.
References Assert, conn, ERRCODE_UNDEFINED_TABLE, PG_DIAG_SQLSTATE, pg_log_error, PGRES_COMMAND_OK, PQclear(), PQdb(), PQerrorMessage(), PQresultErrorField(), PQresultStatus(), and res.
Referenced by reindex_one_database(), and vacuum_one_database().
|
static |
Definition at line 196 of file parallel_slot.c.
References Assert, i, ParallelSlotClearHandler(), PQconsumeInput(), PQgetResult(), PQisBusy(), PQsocket(), processQueryResult(), ResetCancelConn(), select_loop(), and SetCancelConn().
Referenced by ParallelSlotsGetIdle().