PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/tupdesc.h"
#include "backup/basebackup.h"
#include "backup/basebackup_sink.h"
#include "catalog/pg_type_d.h"
#include "executor/executor.h"
#include "libpq/libpq.h"
#include "libpq/pqformat.h"
#include "tcop/dest.h"
#include "utils/builtins.h"
#include "utils/timestamp.h"
Go to the source code of this file.
Data Structures | |
struct | bbsink_copystream |
Macros | |
#define | PROGRESS_REPORT_BYTE_INTERVAL 65536 |
#define | PROGRESS_REPORT_MILLISECOND_THRESHOLD 1000 |
Typedefs | |
typedef struct bbsink_copystream | bbsink_copystream |
Functions | |
static void | bbsink_copystream_begin_backup (bbsink *sink) |
static void | bbsink_copystream_begin_archive (bbsink *sink, const char *archive_name) |
static void | bbsink_copystream_archive_contents (bbsink *sink, size_t len) |
static void | bbsink_copystream_end_archive (bbsink *sink) |
static void | bbsink_copystream_begin_manifest (bbsink *sink) |
static void | bbsink_copystream_manifest_contents (bbsink *sink, size_t len) |
static void | bbsink_copystream_end_manifest (bbsink *sink) |
static void | bbsink_copystream_end_backup (bbsink *sink, XLogRecPtr endptr, TimeLineID endtli) |
static void | bbsink_copystream_cleanup (bbsink *sink) |
static void | SendCopyOutResponse (void) |
static void | SendCopyDone (void) |
static void | SendXlogRecPtrResult (XLogRecPtr ptr, TimeLineID tli) |
static void | SendTablespaceList (List *tablespaces) |
bbsink * | bbsink_copystream_new (bool send_to_client) |
Variables | |
static const bbsink_ops | bbsink_copystream_ops |
#define PROGRESS_REPORT_BYTE_INTERVAL 65536 |
Definition at line 72 of file basebackup_copy.c.
#define PROGRESS_REPORT_MILLISECOND_THRESHOLD 1000 |
Definition at line 73 of file basebackup_copy.c.
typedef struct bbsink_copystream bbsink_copystream |
|
static |
Definition at line 183 of file basebackup_copy.c.
References bbsink_copystream::base, bbsink::bbs_state, buf, bbsink_copystream::bytes_done_at_last_time_check, GetCurrentTimestamp(), bbsink_copystream::last_progress_report_time, len, bbsink_copystream::msgbuffer, now(), pq_beginmessage(), pq_endmessage(), pq_flush_if_writable, pq_putmessage, pq_sendbyte(), pq_sendint64(), PqMsg_CopyData, PROGRESS_REPORT_BYTE_INTERVAL, PROGRESS_REPORT_MILLISECOND_THRESHOLD, bbsink_copystream::send_to_client, and TimestampDifferenceMilliseconds().
|
static |
Definition at line 165 of file basebackup_copy.c.
References bbsink::bbs_state, buf, list_nth(), tablespaceinfo::path, pq_beginmessage(), pq_endmessage(), pq_sendbyte(), pq_sendstring(), and PqMsg_CopyData.
|
static |
Definition at line 126 of file basebackup_copy.c.
References bbsink_copystream::base, bbsink::bbs_buffer, bbsink::bbs_buffer_length, bbsink::bbs_state, buf, bbsink_copystream::msgbuffer, palloc(), pq_puttextmessage(), PqMsg_CommandComplete, SendCopyOutResponse(), SendTablespaceList(), and SendXlogRecPtrResult().
|
static |
Definition at line 260 of file basebackup_copy.c.
References buf, pq_beginmessage(), pq_endmessage(), pq_sendbyte(), and PqMsg_CopyData.
|
static |
Definition at line 308 of file basebackup_copy.c.
|
static |
Definition at line 241 of file basebackup_copy.c.
References bbsink_copystream::base, bbsink::bbs_state, buf, bbsink_copystream::bytes_done_at_last_time_check, GetCurrentTimestamp(), bbsink_copystream::last_progress_report_time, pq_beginmessage(), pq_endmessage(), pq_flush_if_writable, pq_sendbyte(), pq_sendint64(), and PqMsg_CopyData.
|
static |
Definition at line 297 of file basebackup_copy.c.
References SendCopyDone(), and SendXlogRecPtrResult().
|
static |
Definition at line 288 of file basebackup_copy.c.
|
static |
Definition at line 273 of file basebackup_copy.c.
References len, bbsink_copystream::msgbuffer, pq_putmessage, and bbsink_copystream::send_to_client.
bbsink* bbsink_copystream_new | ( | bool | send_to_client | ) |
Definition at line 108 of file basebackup_copy.c.
References bbsink_copystream::base, bbsink::bbs_ops, bbsink_copystream_ops, bbsink_copystream::bytes_done_at_last_time_check, GetCurrentTimestamp(), bbsink_copystream::last_progress_report_time, palloc0(), bbsink_copystream::send_to_client, and UINT64CONST.
Referenced by SendBaseBackup().
|
static |
Definition at line 331 of file basebackup_copy.c.
References pq_putemptymessage(), and PqMsg_CopyDone.
Referenced by bbsink_copystream_end_backup().
|
static |
Definition at line 317 of file basebackup_copy.c.
References buf, pq_beginmessage(), pq_endmessage(), pq_sendbyte(), pq_sendint16(), and PqMsg_CopyOutResponse.
Referenced by bbsink_copystream_begin_backup().
|
static |
Definition at line 378 of file basebackup_copy.c.
References begin_tup_output_tupdesc(), CreateDestReceiver(), CreateTemplateTupleDesc(), CStringGetTextDatum, generate_unaccent_rules::dest, DestRemoteSimple, do_tup_output(), end_tup_output(), Int64GetDatum(), lfirst, ObjectIdGetDatum(), tablespaceinfo::oid, tablespaceinfo::path, tablespaceinfo::size, TTSOpsVirtual, TupleDescInitBuiltinEntry(), and values.
Referenced by bbsink_copystream_begin_backup().
|
static |
Definition at line 341 of file basebackup_copy.c.
References begin_tup_output_tupdesc(), CreateDestReceiver(), CreateTemplateTupleDesc(), CStringGetTextDatum, generate_unaccent_rules::dest, DestRemoteSimple, do_tup_output(), end_tup_output(), Int64GetDatum(), LSN_FORMAT_ARGS, pq_puttextmessage(), PqMsg_CommandComplete, psprintf(), TTSOpsVirtual, TupleDescInitBuiltinEntry(), and values.
Referenced by bbsink_copystream_begin_backup(), and bbsink_copystream_end_backup().
|
static |
Definition at line 92 of file basebackup_copy.c.
Referenced by bbsink_copystream_new().