Move astreamer (except astreamer_inject) to fe_utils.
This allows the code to be used by other frontend applications. Amul Sul, reviewed by Sravan Kumar, Andres Freund (whose input I specifically solicited regarding the meson.build changes), and me. Discussion: http://postgr.es/m/CAAJ_b94StvLWrc_p4q-f7n3OPfr6GhL8_XuAg2aAaYZp1tF-nw@mail.gmail.com
This commit is contained in:
parent
53b2c921a0
commit
f80b09bac8
@ -3037,7 +3037,7 @@ frontend_common_code = declare_dependency(
|
|||||||
compile_args: ['-DFRONTEND'],
|
compile_args: ['-DFRONTEND'],
|
||||||
include_directories: [postgres_inc],
|
include_directories: [postgres_inc],
|
||||||
sources: generated_headers,
|
sources: generated_headers,
|
||||||
dependencies: [os_deps, zlib, zstd],
|
dependencies: [os_deps, zlib, zstd, lz4],
|
||||||
)
|
)
|
||||||
|
|
||||||
backend_common_code = declare_dependency(
|
backend_common_code = declare_dependency(
|
||||||
|
@ -37,12 +37,7 @@ OBJS = \
|
|||||||
|
|
||||||
BBOBJS = \
|
BBOBJS = \
|
||||||
pg_basebackup.o \
|
pg_basebackup.o \
|
||||||
astreamer_file.o \
|
astreamer_inject.o
|
||||||
astreamer_gzip.o \
|
|
||||||
astreamer_inject.o \
|
|
||||||
astreamer_lz4.o \
|
|
||||||
astreamer_tar.o \
|
|
||||||
astreamer_zstd.o
|
|
||||||
|
|
||||||
all: pg_basebackup pg_createsubscriber pg_receivewal pg_recvlogical
|
all: pg_basebackup pg_createsubscriber pg_receivewal pg_recvlogical
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#ifndef ASTREAMER_INJECT_H
|
#ifndef ASTREAMER_INJECT_H
|
||||||
#define ASTREAMER_INJECT_H
|
#define ASTREAMER_INJECT_H
|
||||||
|
|
||||||
#include "astreamer.h"
|
#include "fe_utils/astreamer.h"
|
||||||
#include "pqexpbuffer.h"
|
#include "pqexpbuffer.h"
|
||||||
|
|
||||||
extern astreamer *astreamer_recovery_injector_new(astreamer *next,
|
extern astreamer *astreamer_recovery_injector_new(astreamer *next,
|
||||||
|
@ -1,12 +1,7 @@
|
|||||||
# Copyright (c) 2022-2024, PostgreSQL Global Development Group
|
# Copyright (c) 2022-2024, PostgreSQL Global Development Group
|
||||||
|
|
||||||
common_sources = files(
|
common_sources = files(
|
||||||
'astreamer_file.c',
|
|
||||||
'astreamer_gzip.c',
|
|
||||||
'astreamer_inject.c',
|
'astreamer_inject.c',
|
||||||
'astreamer_lz4.c',
|
|
||||||
'astreamer_tar.c',
|
|
||||||
'astreamer_zstd.c',
|
|
||||||
'receivelog.c',
|
'receivelog.c',
|
||||||
'streamutil.c',
|
'streamutil.c',
|
||||||
'walmethods.c',
|
'walmethods.c',
|
||||||
|
@ -21,6 +21,11 @@ override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS)
|
|||||||
|
|
||||||
OBJS = \
|
OBJS = \
|
||||||
archive.o \
|
archive.o \
|
||||||
|
astreamer_file.o \
|
||||||
|
astreamer_gzip.o \
|
||||||
|
astreamer_lz4.o \
|
||||||
|
astreamer_tar.o \
|
||||||
|
astreamer_zstd.o \
|
||||||
cancel.o \
|
cancel.o \
|
||||||
conditional.o \
|
conditional.o \
|
||||||
connect_utils.o \
|
connect_utils.o \
|
||||||
|
@ -13,10 +13,10 @@
|
|||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "astreamer.h"
|
|
||||||
#include "common/file_perm.h"
|
#include "common/file_perm.h"
|
||||||
#include "common/logging.h"
|
#include "common/logging.h"
|
||||||
#include "common/string.h"
|
#include "common/string.h"
|
||||||
|
#include "fe_utils/astreamer.h"
|
||||||
|
|
||||||
typedef struct astreamer_plain_writer
|
typedef struct astreamer_plain_writer
|
||||||
{
|
{
|
@ -17,10 +17,10 @@
|
|||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "astreamer.h"
|
|
||||||
#include "common/file_perm.h"
|
#include "common/file_perm.h"
|
||||||
#include "common/logging.h"
|
#include "common/logging.h"
|
||||||
#include "common/string.h"
|
#include "common/string.h"
|
||||||
|
#include "fe_utils/astreamer.h"
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_LIBZ
|
||||||
typedef struct astreamer_gzip_writer
|
typedef struct astreamer_gzip_writer
|
@ -17,10 +17,10 @@
|
|||||||
#include <lz4frame.h>
|
#include <lz4frame.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "astreamer.h"
|
|
||||||
#include "common/file_perm.h"
|
#include "common/file_perm.h"
|
||||||
#include "common/logging.h"
|
#include "common/logging.h"
|
||||||
#include "common/string.h"
|
#include "common/string.h"
|
||||||
|
#include "fe_utils/astreamer.h"
|
||||||
|
|
||||||
#ifdef USE_LZ4
|
#ifdef USE_LZ4
|
||||||
typedef struct astreamer_lz4_frame
|
typedef struct astreamer_lz4_frame
|
@ -23,8 +23,8 @@
|
|||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include "astreamer.h"
|
|
||||||
#include "common/logging.h"
|
#include "common/logging.h"
|
||||||
|
#include "fe_utils/astreamer.h"
|
||||||
#include "pgtar.h"
|
#include "pgtar.h"
|
||||||
|
|
||||||
typedef struct astreamer_tar_parser
|
typedef struct astreamer_tar_parser
|
@ -17,8 +17,8 @@
|
|||||||
#include <zstd.h>
|
#include <zstd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "astreamer.h"
|
|
||||||
#include "common/logging.h"
|
#include "common/logging.h"
|
||||||
|
#include "fe_utils/astreamer.h"
|
||||||
|
|
||||||
#ifdef USE_ZSTD
|
#ifdef USE_ZSTD
|
||||||
|
|
@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
fe_utils_sources = files(
|
fe_utils_sources = files(
|
||||||
'archive.c',
|
'archive.c',
|
||||||
|
'astreamer_file.c',
|
||||||
|
'astreamer_gzip.c',
|
||||||
|
'astreamer_lz4.c',
|
||||||
|
'astreamer_tar.c',
|
||||||
|
'astreamer_zstd.c',
|
||||||
'cancel.c',
|
'cancel.c',
|
||||||
'conditional.c',
|
'conditional.c',
|
||||||
'connect_utils.c',
|
'connect_utils.c',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user