Skip to content

Commit

Permalink
fix doc build
Browse files Browse the repository at this point in the history
  • Loading branch information
shbhmrzd committed Apr 19, 2024
1 parent 1a709df commit e9e417b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/src/services/hdfs_native/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ impl Accessor for HdfsNativeBackend {

async fn list(&self, path: &str, _args: OpList) -> Result<(RpList, Self::Lister)> {
let p = build_rooted_abs_path(&self.root, path);
let list_status_iterator = self.client.list_status_iter(path, false);
let list_status_iterator = self.client.list_status_iter(&p, false);
let l = HdfsNativeLister::new(&self.root, list_status_iterator);
Ok((RpList::default(), Some(l)))
}
Expand Down
15 changes: 13 additions & 2 deletions core/src/services/hdfs_native/lister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// specific language governing permissions and limitations
// under the License.

use chrono::DateTime;
use hdfs_native::client::{FileStatus, ListStatusIterator};

use crate::raw::oio::Entry;
Expand All @@ -38,7 +39,7 @@ impl HdfsNativeLister {

impl oio::List for HdfsNativeLister {
async fn next(&mut self) -> Result<Option<Entry>> {
let de: FileStatus = match self.lsi.next() {
let de: FileStatus = match self.lsi.next().await {
Some(res) => match res {
Ok(fs) => fs,
Err(e) => return Err(parse_hdfs_error(e)),
Expand All @@ -49,9 +50,19 @@ impl oio::List for HdfsNativeLister {
let path = build_rel_path(&self.root, &de.path);

let entry = if !de.isdir {
let odt = DateTime::from_timestamp(de.modification_time as i64, 0);
let dt = match odt {
Some(dt) => dt,
None => {
return Err(Error::new(
ErrorKind::Unexpected,
&format!("Failure in extracting modified_time for {}", path),
))
}
};
let meta = Metadata::new(EntryMode::FILE)
.with_content_length(de.length as u64)
.with_last_modified(de.modification_time.into());
.with_last_modified(dt);
oio::Entry::new(&path, meta)
} else if de.isdir {
// Make sure we are returning the correct path.
Expand Down

0 comments on commit e9e417b

Please sign in to comment.