1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-03-03 14:52:21 +02:00

Refactor remote storage protocol to use Packs instead of JSON.

Packs are more efficient and strongly typed so they make more sense for the protocol.
This commit is contained in:
David Steele 2022-04-18 14:08:53 -04:00
parent cfd6c7ceb4
commit b7fccaf994
4 changed files with 7 additions and 6 deletions

View File

@ -14,7 +14,6 @@ Remote Storage Protocol Handler
#include "common/log.h"
#include "common/regExp.h"
#include "common/type/pack.h"
#include "common/type/json.h"
#include "config/config.h"
#include "protocol/helper.h"
#include "storage/remote/protocol.h"
@ -356,7 +355,7 @@ storageRemoteOpenReadProtocol(PackRead *const param, ProtocolServer *const serve
const String *file = pckReadStrP(param);
bool ignoreMissing = pckReadBoolP(param);
const uint64_t offset = pckReadU64P(param);
const Variant *limit = jsonToVar(pckReadStrP(param));
const Variant *const limit = pckReadNullP(param) ? NULL : VARUINT64(pckReadU64P(param));
const Pack *const filter = pckReadPackP(param);
// Create the read object

View File

@ -11,7 +11,6 @@ Remote Storage Read
#include "common/io/read.h"
#include "common/log.h"
#include "common/type/convert.h"
#include "common/type/json.h"
#include "common/type/object.h"
#include "storage/remote/protocol.h"
#include "storage/remote/read.h"
@ -75,7 +74,12 @@ storageReadRemoteOpen(THIS_VOID)
pckWriteStrP(param, this->interface.name);
pckWriteBoolP(param, this->interface.ignoreMissing);
pckWriteU64P(param, this->interface.offset);
pckWriteStrP(param, jsonFromVar(this->interface.limit));
if (this->interface.limit == NULL)
pckWriteNullP(param);
else
pckWriteU64P(param, varUInt64(this->interface.limit));
pckWritePackP(param, ioFilterGroupParamAll(ioReadFilterGroup(storageReadIo(this->read))));
protocolClientCommandPut(this->client, command, false);

View File

@ -6,7 +6,6 @@ Remote Storage
#include "common/debug.h"
#include "common/log.h"
#include "common/memContext.h"
#include "common/type/json.h"
#include "common/type/object.h"
#include "common/type/pack.h"
#include "storage/remote/protocol.h"

View File

@ -8,7 +8,6 @@ Remote Storage File write
#include "common/io/io.h"
#include "common/io/write.h"
#include "common/log.h"
#include "common/type/json.h"
#include "common/type/object.h"
#include "storage/remote/protocol.h"
#include "storage/remote/write.h"