Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hoslo committed Apr 28, 2024
1 parent 71c8df1 commit 274fa3d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 2 additions & 5 deletions core/src/types/blocking_read/blocking_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use std::ops::RangeBounds;

use bytes::Buf;
use bytes::BufMut;
use log::debug;
use rayon::prelude::*;

use crate::raw::oio::BlockingRead;
Expand Down Expand Up @@ -85,7 +84,6 @@ impl BlockingReader {
let mut bufs = Vec::new();
let mut offset = start;
let concurrent = self.options.concurrent() as u64;


let (interval_size, mut intervals) = end
.map(|end| {
Expand Down Expand Up @@ -116,15 +114,14 @@ impl BlockingReader {
});

loop {

let results: Vec<Result<(usize, Buffer)>> = intervals
.into_par_iter()
.map(|(start, end)| -> Result<(usize, Buffer)> {
let limit = (end - start) as usize;

let bs = self.inner.read_at(start as u64, limit)?;
let bs = self.inner.read_at(start, limit)?;
let n = bs.remaining();

Ok((n, bs))
})
.collect();
Expand Down
6 changes: 5 additions & 1 deletion core/src/types/operator/blocking_operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,11 @@ impl BlockingOperator {
FunctionRead(OperatorFunction::new(
self.inner().clone(),
path,
(OpRead::default(), BytesRange::default(), OpReader::default()),
(
OpRead::default(),
BytesRange::default(),
OpReader::default(),
),
|inner, path, (args, range, options)| {
if !validate_path(&path, EntryMode::FILE) {
return Err(
Expand Down

0 comments on commit 274fa3d

Please sign in to comment.