Skip to content

Commit

Permalink
Expose a generic read method that can be extended to have more contro…
Browse files Browse the repository at this point in the history
…l over how the `readFn` is called, for example concurrency limits or combination of requests that are close in offsets
  • Loading branch information
ZJONSSON committed Feb 18, 2018
1 parent e3c70df commit f82f719
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,15 @@ class ParquetEnvelopeReader {
}

constructor(readFn, closeFn, fileSize) {
this.read = readFn;
this.readFn = readFn;
this.close = closeFn;
this.fileSize = fileSize;
}

async read(offset, length) {
return this.readFn(offset, length);
}

async readHeader() {
let buf = await this.read(0, PARQUET_MAGIC.length);

Expand Down

0 comments on commit f82f719

Please sign in to comment.