node-s3tables 0.0.12 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +22 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -848,7 +848,11 @@ async function updateManifestList(params) {
|
|
|
848
848
|
const passthrough = new node_stream.PassThrough();
|
|
849
849
|
const decoder = new avsc__namespace.streams.BlockDecoder({
|
|
850
850
|
codecs: { deflate: zlib__namespace.inflateRaw },
|
|
851
|
-
parseHook
|
|
851
|
+
parseHook(schema) {
|
|
852
|
+
return avsc__namespace.Type.forSchema(schema, {
|
|
853
|
+
registry: { ...AvroRegistry },
|
|
854
|
+
});
|
|
855
|
+
},
|
|
852
856
|
});
|
|
853
857
|
const encoder = new avsc__namespace.streams.BlockEncoder(ManifestListType, {
|
|
854
858
|
codec: 'deflate',
|
|
@@ -864,14 +868,28 @@ async function updateManifestList(params) {
|
|
|
864
868
|
params: { Bucket: bucket, Key: outKey, Body: passthrough },
|
|
865
869
|
});
|
|
866
870
|
const stream_promise = new Promise((resolve, reject) => {
|
|
867
|
-
|
|
871
|
+
source.on('error', (err) => {
|
|
872
|
+
reject(err);
|
|
873
|
+
});
|
|
874
|
+
passthrough.on('error', (err) => {
|
|
875
|
+
reject(err);
|
|
876
|
+
});
|
|
877
|
+
encoder.on('error', (err) => {
|
|
878
|
+
reject(err);
|
|
879
|
+
});
|
|
880
|
+
decoder.on('error', (err) => {
|
|
881
|
+
reject(err);
|
|
882
|
+
});
|
|
868
883
|
decoder.on('data', (record) => {
|
|
869
|
-
encoder.write(record)
|
|
884
|
+
if (!encoder.write(record)) {
|
|
885
|
+
decoder.pause();
|
|
886
|
+
encoder.once('drain', () => decoder.resume());
|
|
887
|
+
}
|
|
870
888
|
});
|
|
871
889
|
decoder.on('end', () => {
|
|
872
890
|
encoder.end();
|
|
873
891
|
});
|
|
874
|
-
|
|
892
|
+
encoder.on('finish', () => {
|
|
875
893
|
resolve();
|
|
876
894
|
});
|
|
877
895
|
source.pipe(decoder);
|