File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ struct BufferInfo {
128
128
offset < offset_ + async_req_len_);
129
129
}
130
130
131
- size_t CurrentSize () { return buffer_.CurrentSize (); }
131
+ size_t CurrentSize () const { return buffer_.CurrentSize (); }
132
132
};
133
133
134
134
enum class FilePrefetchBufferUsage {
@@ -396,6 +396,19 @@ class FilePrefetchBuffer {
396
396
// Callback function passed to underlying FS in case of asynchronous reads.
397
397
void PrefetchAsyncCallback (FSReadRequest& req, void * cb_arg);
398
398
399
+ size_t GetTotalBufferSize () const {
400
+ size_t total = 0 ;
401
+ for (const BufferInfo* buf_info : bufs_) {
402
+ if (buf_info != nullptr ) {
403
+ total += buf_info->CurrentSize ();
404
+ }
405
+ }
406
+ if (overlap_buf_ != nullptr ) {
407
+ total += overlap_buf_->CurrentSize ();
408
+ }
409
+ return total;
410
+ }
411
+
399
412
void TEST_GetBufferOffsetandSize (
400
413
std::vector<std::tuple<uint64_t , size_t , bool >>& buffer_info) {
401
414
for (size_t i = 0 ; i < bufs_.size (); i++) {
You can’t perform that action at this time.
0 commit comments