PostgreSQL Source Code
git master
|
#include "postgres_fe.h"
#include <fcntl.h>
#include <time.h>
#include <unistd.h>
#include "common/checksum_helper.h"
#include "common/file_perm.h"
#include "common/logging.h"
#include "lib/stringinfo.h"
#include "load_manifest.h"
#include "mb/pg_wchar.h"
#include "write_manifest.h"
Go to the source code of this file.
Data Structures | |
struct | manifest_writer |
Functions | |
static void | escape_json (StringInfo buf, const char *str) |
static void | flush_manifest (manifest_writer *mwriter) |
static size_t | hex_encode (const uint8 *src, size_t len, char *dst) |
manifest_writer * | create_manifest_writer (char *directory, uint64 system_identifier) |
void | add_file_to_manifest (manifest_writer *mwriter, const char *manifest_path, uint64 size, time_t mtime, pg_checksum_type checksum_type, int checksum_length, uint8 *checksum_payload) |
void | finalize_manifest (manifest_writer *mwriter, manifest_wal_range *first_wal_range) |
void add_file_to_manifest | ( | manifest_writer * | mwriter, |
const char * | manifest_path, | ||
uint64 | size, | ||
time_t | mtime, | ||
pg_checksum_type | checksum_type, | ||
int | checksum_length, | ||
uint8 * | checksum_payload | ||
) |
Definition at line 76 of file write_manifest.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), manifest_writer::buf, StringInfoData::data, enlargeStringInfo(), escape_json(), manifest_writer::first_file, flush_manifest(), hex_encode(), StringInfoData::len, pg_checksum_type_name(), pg_encoding_verifymbstr(), PG_UTF8, and size.
Referenced by process_directory_recursively(), and write_backup_label().
manifest_writer* create_manifest_writer | ( | char * | directory, |
uint64 | system_identifier | ||
) |
Definition at line 48 of file write_manifest.c.
References appendStringInfo(), manifest_writer::buf, CHECKSUM_TYPE_SHA256, directory, manifest_writer::fd, manifest_writer::first_file, initStringInfo(), manifest_writer::manifest_ctx, MAXPGPATH, manifest_writer::pathname, pg_checksum_init(), pg_malloc(), snprintf, manifest_writer::still_checksumming, and UINT64_FORMAT.
Referenced by main().
|
static |
Definition at line 196 of file write_manifest.c.
References appendStringInfo(), appendStringInfoCharMacro, appendStringInfoString(), buf, and str.
Referenced by add_file_to_manifest().
void finalize_manifest | ( | manifest_writer * | mwriter, |
manifest_wal_range * | first_wal_range | ||
) |
Definition at line 143 of file write_manifest.c.
References appendStringInfo(), appendStringInfoString(), Assert, manifest_writer::buf, close, StringInfoData::data, manifest_wal_range::end_lsn, enlargeStringInfo(), manifest_writer::fd, flush_manifest(), hex_encode(), StringInfoData::len, len, LSN_FORMAT_ARGS, manifest_writer::manifest_ctx, manifest_wal_range::next, manifest_writer::pathname, pg_checksum_final(), pg_fatal, PG_SHA256_DIGEST_LENGTH, PG_SHA256_DIGEST_STRING_LENGTH, manifest_wal_range::start_lsn, manifest_writer::still_checksumming, and manifest_wal_range::tli.
Referenced by main().
|
static |
Definition at line 245 of file write_manifest.c.
References manifest_writer::buf, StringInfoData::data, manifest_writer::fd, StringInfoData::len, manifest_writer::manifest_ctx, manifest_writer::pathname, PG_BINARY, pg_checksum_update(), pg_fatal, pg_file_create_mode, resetStringInfo(), manifest_writer::still_checksumming, and write.
Referenced by add_file_to_manifest(), and finalize_manifest().
|
static |
Definition at line 281 of file write_manifest.c.
References len.
Referenced by add_file_to_manifest(), and finalize_manifest().