PostgreSQL Source Code
git master
|
#include "postgres_fe.h"
#include <sys/stat.h>
#include <unistd.h>
#include "common/hashfn_unstable.h"
#include "common/logging.h"
#include "common/parse_manifest.h"
#include "load_manifest.h"
#include "lib/simplehash.h"
Go to the source code of this file.
Macros | |
#define | ESTIMATED_BYTES_PER_MANIFEST_LINE 100 |
#define | READ_CHUNK_SIZE (128 * 1024) |
#define | SH_PREFIX manifest_files |
#define | SH_ELEMENT_TYPE manifest_file |
#define | SH_KEY_TYPE const char * |
#define | SH_KEY pathname |
#define | SH_HASH_KEY(tb, key) hash_string(key) |
#define | SH_EQUAL(tb, a, b) (strcmp(a, b) == 0) |
#define | SH_SCOPE extern |
#define | SH_RAW_ALLOCATOR pg_malloc0 |
#define | SH_DEFINE |
Functions | |
static void | combinebackup_version_cb (JsonManifestParseContext *context, int manifest_version) |
static void | combinebackup_system_identifier_cb (JsonManifestParseContext *context, uint64 manifest_system_identifier) |
static void | combinebackup_per_file_cb (JsonManifestParseContext *context, const char *pathname, uint64 size, pg_checksum_type checksum_type, int checksum_length, uint8 *checksum_payload) |
static void | combinebackup_per_wal_range_cb (JsonManifestParseContext *context, TimeLineID tli, XLogRecPtr start_lsn, XLogRecPtr end_lsn) |
static void | report_manifest_error (JsonManifestParseContext *context, const char *fmt,...) pg_attribute_printf(2 |
static void | pg_attribute_noreturn () |
manifest_data ** | load_backup_manifests (int n_backups, char **backup_directories) |
manifest_data * | load_backup_manifest (char *backup_directory) |
#define ESTIMATED_BYTES_PER_MANIFEST_LINE 100 |
Definition at line 35 of file load_manifest.c.
#define READ_CHUNK_SIZE (128 * 1024) |
Definition at line 41 of file load_manifest.c.
#define SH_DEFINE |
Definition at line 55 of file load_manifest.c.
#define SH_ELEMENT_TYPE manifest_file |
Definition at line 48 of file load_manifest.c.
#define SH_HASH_KEY | ( | tb, | |
key | |||
) | hash_string(key) |
Definition at line 51 of file load_manifest.c.
#define SH_KEY pathname |
Definition at line 50 of file load_manifest.c.
#define SH_KEY_TYPE const char * |
Definition at line 49 of file load_manifest.c.
#define SH_PREFIX manifest_files |
Definition at line 47 of file load_manifest.c.
#define SH_RAW_ALLOCATOR pg_malloc0 |
Definition at line 54 of file load_manifest.c.
#define SH_SCOPE extern |
Definition at line 53 of file load_manifest.c.
|
static |
Definition at line 268 of file load_manifest.c.
References manifest_file::checksum_length, manifest_file::checksum_payload, manifest_file::checksum_type, context, manifest, pg_fatal, size, and manifest_file::size.
Referenced by load_backup_manifest().
|
static |
Definition at line 293 of file load_manifest.c.
References context, manifest, palloc(), and range().
Referenced by load_backup_manifest().
|
static |
Definition at line 255 of file load_manifest.c.
References context, and manifest.
Referenced by load_backup_manifest().
|
static |
Definition at line 243 of file load_manifest.c.
References pg_fatal.
Referenced by load_backup_manifest().
manifest_data* load_backup_manifest | ( | char * | backup_directory | ) |
Definition at line 105 of file load_manifest.c.
References close, combinebackup_per_file_cb(), combinebackup_per_wal_range_cb(), combinebackup_system_identifier_cb(), combinebackup_version_cb(), context, ESTIMATED_BYTES_PER_MANIFEST_LINE, fd(), manifest_data::files, fstat, json_parse_manifest(), json_parse_manifest_incremental_chunk(), json_parse_manifest_incremental_init(), json_parse_manifest_incremental_shutdown(), Max, MAXPGPATH, Min, pfree(), PG_BINARY, pg_fatal, pg_log_warning, pg_malloc(), pg_malloc0(), PG_UINT32_MAX, read, READ_CHUNK_SIZE, report_manifest_error(), snprintf, and stat::st_size.
Referenced by load_backup_manifests().
manifest_data** load_backup_manifests | ( | int | n_backups, |
char ** | backup_directories | ||
) |
Definition at line 83 of file load_manifest.c.
References i, load_backup_manifest(), and pg_malloc().
Referenced by main().
static void pg_attribute_noreturn | ( | ) |
|
static |
Definition at line 228 of file load_manifest.c.
References exit(), fmt, gettext, PG_LOG_ERROR, pg_log_generic_v(), PG_LOG_PRIMARY, va_end(), and va_start().
Referenced by load_backup_manifest().