@@ -67,7 +67,8 @@ std::string ReadFile::pread(uint64_t offset, uint64_t length) const {
67
67
68
68
uint64_t ReadFile::preadv (
69
69
uint64_t offset,
70
- const std::vector<folly::Range<char *>>& buffers) const {
70
+ const std::vector<folly::Range<char *>>& buffers,
71
+ io::IoStatistics* stats) const {
71
72
auto fileSize = size ();
72
73
uint64_t numRead = 0 ;
73
74
if (offset >= fileSize) {
@@ -87,7 +88,8 @@ uint64_t ReadFile::preadv(
87
88
88
89
uint64_t ReadFile::preadv (
89
90
folly::Range<const common::Region*> regions,
90
- folly::Range<folly::IOBuf*> iobufs) const {
91
+ folly::Range<folly::IOBuf*> iobufs,
92
+ io::IoStatistics* stats) const {
91
93
VELOX_CHECK_EQ (regions.size (), iobufs.size ());
92
94
uint64_t length = 0 ;
93
95
for (size_t i = 0 ; i < regions.size (); ++i) {
@@ -195,7 +197,8 @@ LocalReadFile::pread(uint64_t offset, uint64_t length, void* buf) const {
195
197
196
198
uint64_t LocalReadFile::preadv (
197
199
uint64_t offset,
198
- const std::vector<folly::Range<char *>>& buffers) const {
200
+ const std::vector<folly::Range<char *>>& buffers,
201
+ io::IoStatistics* stats) const {
199
202
// Dropped bytes sized so that a typical dropped range of 50K is not
200
203
// too many iovecs.
201
204
static thread_local std::vector<char > droppedBytes (16 * 1024 );
@@ -251,16 +254,18 @@ uint64_t LocalReadFile::preadv(
251
254
252
255
folly::SemiFuture<uint64_t > LocalReadFile::preadvAsync (
253
256
uint64_t offset,
254
- const std::vector<folly::Range<char *>>& buffers) const {
257
+ const std::vector<folly::Range<char *>>& buffers,
258
+ io::IoStatistics* stats) const {
255
259
if (!executor_) {
256
- return ReadFile::preadvAsync (offset, buffers);
260
+ return ReadFile::preadvAsync (offset, buffers, stats );
257
261
}
258
262
auto [promise, future] = folly::makePromiseContract<uint64_t >();
259
263
executor_->add ([this ,
260
264
_promise = std::move (promise),
261
265
_offset = offset,
262
- _buffers = buffers]() mutable {
263
- auto delegateFuture = ReadFile::preadvAsync (_offset, _buffers);
266
+ _buffers = buffers,
267
+ _stats = stats]() mutable {
268
+ auto delegateFuture = ReadFile::preadvAsync (_offset, _buffers, _stats);
264
269
_promise.setTry (std::move (delegateFuture).getTry ());
265
270
});
266
271
return std::move (future);
0 commit comments