PostgreSQL Source Code  git master
rewind_source.h File Reference
#include "access/xlogdefs.h"
#include "file_ops.h"
#include "filemap.h"
#include "libpq-fe.h"
Include dependency graph for rewind_source.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  rewind_source
 

Typedefs

typedef struct rewind_source rewind_source
 

Functions

rewind_sourceinit_libpq_source (PGconn *conn)
 
rewind_sourceinit_local_source (const char *datadir)
 

Typedef Documentation

◆ rewind_source

typedef struct rewind_source rewind_source

Function Documentation

◆ init_libpq_source()

rewind_source* init_libpq_source ( PGconn conn)

Definition at line 81 of file libpq_source.c.

82 {
83  libpq_source *src;
84 
86 
87  src = pg_malloc0(sizeof(libpq_source));
88 
95 
96  src->conn = conn;
97 
98  initStringInfo(&src->paths);
99  initStringInfo(&src->offsets);
100  initStringInfo(&src->lengths);
101 
102  return &src->common;
103 }
void * pg_malloc0(size_t size)
Definition: fe_memutils.c:53
static void init_libpq_conn(PGconn *conn)
Definition: libpq_source.c:109
static char * libpq_fetch_file(rewind_source *source, const char *path, size_t *filesize)
Definition: libpq_source.c:593
static XLogRecPtr libpq_get_current_wal_insert_lsn(rewind_source *source)
Definition: libpq_source.c:206
static void libpq_traverse_files(rewind_source *source, process_file_callback_t callback)
Definition: libpq_source.c:230
static void libpq_destroy(rewind_source *source)
Definition: libpq_source.c:633
static void libpq_queue_fetch_range(rewind_source *source, const char *path, off_t off, size_t len)
Definition: libpq_source.c:314
static void libpq_finish_fetch(rewind_source *source)
Definition: libpq_source.c:379
PGconn * conn
Definition: streamutil.c:54
void initStringInfo(StringInfo str)
Definition: stringinfo.c:59
StringInfoData paths
Definition: libpq_source.c:51
StringInfoData lengths
Definition: libpq_source.c:53
PGconn * conn
Definition: libpq_source.c:41
StringInfoData offsets
Definition: libpq_source.c:52
rewind_source common
Definition: libpq_source.c:39
void(* traverse_files)(struct rewind_source *, process_file_callback_t callback)
Definition: rewind_source.h:29
void(* finish_fetch)(struct rewind_source *)
Definition: rewind_source.h:53
XLogRecPtr(* get_current_wal_insert_lsn)(struct rewind_source *)
Definition: rewind_source.h:58
void(* queue_fetch_range)(struct rewind_source *, const char *path, off_t offset, size_t len)
Definition: rewind_source.h:47
char *(* fetch_file)(struct rewind_source *, const char *path, size_t *filesize)
Definition: rewind_source.h:37
void(* destroy)(struct rewind_source *)
Definition: rewind_source.h:63

References libpq_source::common, conn, libpq_source::conn, rewind_source::destroy, rewind_source::fetch_file, rewind_source::finish_fetch, rewind_source::get_current_wal_insert_lsn, init_libpq_conn(), initStringInfo(), libpq_source::lengths, libpq_destroy(), libpq_fetch_file(), libpq_finish_fetch(), libpq_get_current_wal_insert_lsn(), libpq_queue_fetch_range(), libpq_traverse_files(), libpq_source::offsets, libpq_source::paths, pg_malloc0(), rewind_source::queue_fetch_range, and rewind_source::traverse_files.

Referenced by main().

◆ init_local_source()

rewind_source* init_local_source ( const char *  datadir)

Definition at line 38 of file local_source.c.

39 {
40  local_source *src;
41 
42  src = pg_malloc0(sizeof(local_source));
43 
50 
51  src->datadir = datadir;
52 
53  return &src->common;
54 }
static void local_destroy(rewind_source *source)
Definition: local_source.c:128
static void local_fetch_file_range(rewind_source *source, const char *path, off_t off, size_t len)
Definition: local_source.c:72
static void local_traverse_files(rewind_source *source, process_file_callback_t callback)
Definition: local_source.c:57
static char * local_fetch_file(rewind_source *source, const char *path, size_t *filesize)
Definition: local_source.c:63
static void local_finish_fetch(rewind_source *source)
Definition: local_source.c:120
char * datadir
rewind_source common
Definition: local_source.c:23
const char * datadir
Definition: local_source.c:25

References local_source::common, local_source::datadir, datadir, rewind_source::destroy, rewind_source::fetch_file, rewind_source::finish_fetch, rewind_source::get_current_wal_insert_lsn, local_destroy(), local_fetch_file(), local_fetch_file_range(), local_finish_fetch(), local_traverse_files(), pg_malloc0(), rewind_source::queue_fetch_range, and rewind_source::traverse_files.

Referenced by main().