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 
96 
97  src->conn = conn;
98 
99  initStringInfo(&src->paths);
100  initStringInfo(&src->offsets);
101  initStringInfo(&src->lengths);
102 
103  return &src->common;
104 }
void * pg_malloc0(size_t size)
Definition: fe_memutils.c:53
static void init_libpq_conn(PGconn *conn)
Definition: libpq_source.c:110
static char * libpq_fetch_file(rewind_source *source, const char *path, size_t *filesize)
Definition: libpq_source.c:634
static XLogRecPtr libpq_get_current_wal_insert_lsn(rewind_source *source)
Definition: libpq_source.c:208
static void libpq_traverse_files(rewind_source *source, process_file_callback_t callback)
Definition: libpq_source.c:232
static void libpq_destroy(rewind_source *source)
Definition: libpq_source.c:674
static void libpq_queue_fetch_range(rewind_source *source, const char *path, off_t off, size_t len)
Definition: libpq_source.c:355
static void libpq_queue_fetch_file(rewind_source *source, const char *path, size_t len)
Definition: libpq_source.c:325
static void libpq_finish_fetch(rewind_source *source)
Definition: libpq_source.c:420
PGconn * conn
Definition: streamutil.c:53
void initStringInfo(StringInfo str)
Definition: stringinfo.c:56
StringInfoData paths
Definition: libpq_source.c:50
StringInfoData lengths
Definition: libpq_source.c:52
PGconn * conn
Definition: libpq_source.c:40
StringInfoData offsets
Definition: libpq_source.c:51
rewind_source common
Definition: libpq_source.c:38
void(* queue_fetch_file)(struct rewind_source *, const char *path, size_t len)
Definition: rewind_source.h:60
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:66
XLogRecPtr(* get_current_wal_insert_lsn)(struct rewind_source *)
Definition: rewind_source.h:71
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:76

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_file(), libpq_queue_fetch_range(), libpq_traverse_files(), libpq_source::offsets, libpq_source::paths, pg_malloc0(), rewind_source::queue_fetch_file, 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 
51 
52  src->datadir = datadir;
53 
54  return &src->common;
55 }
static void local_queue_fetch_file(rewind_source *source, const char *path, size_t len)
Definition: local_source.c:75
static void local_destroy(rewind_source *source)
Definition: local_source.c:182
static void local_traverse_files(rewind_source *source, process_file_callback_t callback)
Definition: local_source.c:58
static char * local_fetch_file(rewind_source *source, const char *path, size_t *filesize)
Definition: local_source.c:64
static void local_finish_fetch(rewind_source *source)
Definition: local_source.c:174
static void local_queue_fetch_range(rewind_source *source, const char *path, off_t off, size_t len)
Definition: local_source.c:126
char * datadir
rewind_source common
Definition: local_source.c:21
const char * datadir
Definition: local_source.c:23

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_finish_fetch(), local_queue_fetch_file(), local_queue_fetch_range(), local_traverse_files(), pg_malloc0(), rewind_source::queue_fetch_file, rewind_source::queue_fetch_range, and rewind_source::traverse_files.

Referenced by main().