PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | ParallelState |
Macros | |
#define | PG_MAX_JOBS INT_MAX |
Typedefs | |
typedef void(* | ParallelCompletionPtr) (ArchiveHandle *AH, TocEntry *te, int status, void *callback_data) |
typedef struct ParallelSlot | ParallelSlot |
typedef struct ParallelState | ParallelState |
Enumerations | |
enum | WFW_WaitOption { WFW_NO_WAIT , WFW_GOT_STATUS , WFW_ONE_IDLE , WFW_ALL_IDLE } |
Functions | |
void | init_parallel_dump_utils (void) |
bool | IsEveryWorkerIdle (ParallelState *pstate) |
void | WaitForWorkers (ArchiveHandle *AH, ParallelState *pstate, WFW_WaitOption mode) |
ParallelState * | ParallelBackupStart (ArchiveHandle *AH) |
void | DispatchJobForTocEntry (ArchiveHandle *AH, ParallelState *pstate, TocEntry *te, T_Action act, ParallelCompletionPtr callback, void *callback_data) |
void | ParallelBackupEnd (ArchiveHandle *AH, ParallelState *pstate) |
void | set_archive_cancel_info (ArchiveHandle *AH, PGconn *conn) |
#define PG_MAX_JOBS INT_MAX |
Definition at line 48 of file parallel.h.
typedef void(* ParallelCompletionPtr) (ArchiveHandle *AH, TocEntry *te, int status, void *callback_data) |
Definition at line 24 of file parallel.h.
typedef struct ParallelSlot ParallelSlot |
Definition at line 24 of file parallel.h.
typedef struct ParallelState ParallelState |
enum WFW_WaitOption |
Enumerator | |
---|---|
WFW_NO_WAIT | |
WFW_GOT_STATUS | |
WFW_ONE_IDLE | |
WFW_ALL_IDLE |
Definition at line 30 of file parallel.h.
void DispatchJobForTocEntry | ( | ArchiveHandle * | AH, |
ParallelState * | pstate, | ||
TocEntry * | te, | ||
T_Action | act, | ||
ParallelCompletionPtr | callback, | ||
void * | callback_data | ||
) |
Definition at line 1207 of file parallel.c.
References buf, buildWorkerCommand(), ParallelSlot::callback, callback(), ParallelSlot::callback_data, GetIdleWorker(), NO_SLOT, ParallelState::parallelSlot, sendMessageToWorker(), ParallelState::te, WaitForWorkers(), WFW_ONE_IDLE, ParallelSlot::workerStatus, and WRKR_WORKING.
Referenced by restore_toc_entries_parallel(), and WriteDataChunks().
void init_parallel_dump_utils | ( | void | ) |
bool IsEveryWorkerIdle | ( | ParallelState * | pstate | ) |
Definition at line 1270 of file parallel.c.
References i, ParallelState::numWorkers, ParallelState::parallelSlot, ParallelSlot::workerStatus, and WRKR_IDLE.
Referenced by ParallelBackupEnd(), restore_toc_entries_parallel(), and WaitForWorkers().
void ParallelBackupEnd | ( | ArchiveHandle * | AH, |
ParallelState * | pstate | ||
) |
Definition at line 1061 of file parallel.c.
References Assert, closesocket, free, i, IsEveryWorkerIdle(), ParallelState::numWorkers, ParallelState::parallelSlot, ParallelSlot::pipeRead, ParallelSlot::pipeWrite, ShutdownInformation::pstate, set_cancel_pstate(), shutdown_info, ParallelState::te, and WaitForTerminatingWorkers().
Referenced by _CloseArchive(), and RestoreArchive().
ParallelState* ParallelBackupStart | ( | ArchiveHandle * | AH | ) |
Definition at line 899 of file parallel.c.
References DumpSignalInformation::am_worker, Assert, closesocket, _archiveHandle::connection, exit(), fflush(), getLocalPQExpBuffer, i, j, ParallelState::numWorkers, Archive::numWorkers, ParallelState::parallelSlot, pg_fatal, pg_malloc(), pg_malloc0(), pgpipe, ParallelSlot::pid, PIPE_READ, PIPE_WRITE, ParallelSlot::pipeRead, ParallelSlot::pipeRevRead, ParallelSlot::pipeRevWrite, ParallelSlot::pipeWrite, pqsignal(), ShutdownInformation::pstate, _archiveHandle::public, RunWorker(), set_archive_cancel_info(), set_cancel_pstate(), shutdown_info, SIG_IGN, signal_info, SIGPIPE, ParallelState::te, ParallelSlot::workerStatus, and WRKR_IDLE.
Referenced by _CloseArchive(), and RestoreArchive().
void set_archive_cancel_info | ( | ArchiveHandle * | AH, |
PGconn * | conn | ||
) |
Definition at line 732 of file parallel.c.
References conn, _archiveHandle::connCancel, DumpSignalInformation::myAH, PQfreeCancel(), PQgetCancel(), set_cancel_handler(), and signal_info.
Referenced by ConnectDatabase(), DisconnectDatabase(), and ParallelBackupStart().
void WaitForWorkers | ( | ArchiveHandle * | AH, |
ParallelState * | pstate, | ||
WFW_WaitOption | mode | ||
) |
Definition at line 1453 of file parallel.c.
References Assert, do_wait, GetIdleWorker(), IsEveryWorkerIdle(), ListenToWorkers(), mode, NO_SLOT, WFW_ALL_IDLE, WFW_GOT_STATUS, WFW_NO_WAIT, and WFW_ONE_IDLE.
Referenced by DispatchJobForTocEntry(), restore_toc_entries_parallel(), and WriteDataChunks().