diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2024-03-10 23:12:19 -0400 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2024-04-04 06:46:40 -0400 |
commit | ea7b4e9a2a7c23c62278d9a3e0c77310778f62b2 (patch) | |
tree | 4a56a27867b27f8566cc11e96f59380822fa7860 /src/include/common | |
parent | 3311ea86edc7a689614bad754e17371865cdc11f (diff) | |
download | postgresql-ea7b4e9a2a7c23c62278d9a3e0c77310778f62b2.tar.gz postgresql-ea7b4e9a2a7c23c62278d9a3e0c77310778f62b2.zip |
Add support for incrementally parsing backup manifests
This adds the infrastructure for using the new non-recursive JSON parser
in processing manifests. It's important that callers make sure that the
last piece of json handed to the incremental manifest parser contains
the entire last few lines of the manifest, including the checksum.
Author: Andrew Dunstan
Reviewed-By: Jacob Champion
Discussion: https://postgr.es/m/7b0a51d6-0d9d-7366-3a1a-f74397a02f55@dunslane.net
Diffstat (limited to 'src/include/common')
-rw-r--r-- | src/include/common/parse_manifest.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/include/common/parse_manifest.h b/src/include/common/parse_manifest.h index 78b052c045b..3aa594fcac7 100644 --- a/src/include/common/parse_manifest.h +++ b/src/include/common/parse_manifest.h @@ -20,6 +20,7 @@ struct JsonManifestParseContext; typedef struct JsonManifestParseContext JsonManifestParseContext; +typedef struct JsonManifestParseIncrementalState JsonManifestParseIncrementalState; typedef void (*json_manifest_version_callback) (JsonManifestParseContext *, int manifest_version); @@ -48,5 +49,9 @@ struct JsonManifestParseContext extern void json_parse_manifest(JsonManifestParseContext *context, char *buffer, size_t size); +extern JsonManifestParseIncrementalState *json_parse_manifest_incremental_init(JsonManifestParseContext *context); +extern void json_parse_manifest_incremental_chunk( + JsonManifestParseIncrementalState *incstate, char *chunk, int size, + bool is_last); #endif |