Skip to content

Commit ec70018

Browse files
committed
Expose a generic read method that can be extended to have more control over how the readFn is called, for example concurrency limits or combination of requests that are close in offsets
1 parent 1fa58b5 commit ec70018

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/reader.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,15 @@ class ParquetEnvelopeReader {
201201
}
202202

203203
constructor(readFn, closeFn, fileSize) {
204-
this.read = readFn;
204+
this.readFn = readFn;
205205
this.close = closeFn;
206206
this.fileSize = fileSize;
207207
}
208208

209+
async read(offset, length) {
210+
return this.readFn(offset, length);
211+
}
212+
209213
async readHeader() {
210214
let buf = await this.read(0, PARQUET_MAGIC.length);
211215

0 commit comments

Comments
 (0)