Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/oay/src/services/webdav/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ use axum::http::Request;
use axum::routing::any_service;
use axum::Router;
use dav_server::DavHandler;
use dav_server_opendalfs::OpendalFs;
use opendal::Operator;

use crate::Config;
use dav_server_opendalfs::OpendalFs;

pub struct WebdavService {
cfg: Arc<Config>,
Expand Down
3 changes: 2 additions & 1 deletion bindings/c/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
// specific language governing permissions and limitations
// under the License.

use ::opendal as core;
use std::ffi::CString;
use std::os::raw::c_char;

use ::opendal as core;

/// \brief opendal_list_entry is the entry under a path, which is listed from the opendal_lister
///
/// For examples, please see the comment section of opendal_operator_list()
Expand Down
3 changes: 2 additions & 1 deletion bindings/c/src/operator_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
// specific language governing permissions and limitations
// under the License.

use std::ffi::{c_char, CString};
use std::ffi::c_char;
use std::ffi::CString;

use ::opendal as core;

Expand Down
6 changes: 4 additions & 2 deletions bindings/c/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
// specific language governing permissions and limitations
// under the License.

use super::*;
use ::opendal as core;
use std::io::Read;

use ::opendal as core;

use super::*;

/// \brief The result type returned by opendal's reader operation.
///
/// \note The opendal_reader actually owns a pointer to
Expand Down
2 changes: 1 addition & 1 deletion bindings/java/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ services-webdav = ["opendal/services-webdav"]
services-webhdfs = ["opendal/services-webhdfs"]

# Optional services provided by opendal.
services-alluxio = ["opendal/services-alluxio"]
services-azfile = ["opendal/services-azfile"]
services-cacache = ["opendal/services-cacache"]
services-dashmap = ["opendal/services-dashmap"]
Expand Down Expand Up @@ -136,7 +137,6 @@ services-swift = ["opendal/services-swift"]
services-tikv = ["opendal/services-tikv"]
services-vercel-artifacts = ["opendal/services-vercel-artifacts"]
services-wasabi = ["opendal/services-wasabi"]
services-alluxio = ["opendal/services-alluxio"]

[dependencies]
anyhow = "1.0.71"
Expand Down
4 changes: 2 additions & 2 deletions bindings/java/src/blocking_operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ use jni::objects::JByteArray;
use jni::objects::JClass;
use jni::objects::JObject;
use jni::objects::JString;
use jni::sys::jbyteArray;
use jni::sys::jlong;
use jni::sys::jobject;
use jni::sys::jobjectArray;
use jni::sys::jsize;
use jni::sys::{jbyteArray, jlong};
use jni::JNIEnv;

use opendal::BlockingOperator;

use crate::convert::jstring_to_string;
Expand Down
7 changes: 5 additions & 2 deletions bindings/java/src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
// specific language governing permissions and limitations
// under the License.

use jni::objects::{JMap, JObject, JString};
use std::collections::HashMap;

use jni::objects::JMap;
use jni::objects::JObject;
use jni::objects::JString;
use jni::sys::jlong;
use jni::JNIEnv;
use std::collections::HashMap;

pub(crate) fn usize_to_jlong(n: Option<usize>) -> jlong {
// usize is always >= 0, so we can use -1 to identify the empty value.
Expand Down
5 changes: 3 additions & 2 deletions bindings/java/src/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
use std::time::Duration;

use jni::objects::JClass;
use jni::sys::{jboolean, jfloat, jlong};
use jni::sys::jboolean;
use jni::sys::jfloat;
use jni::sys::jlong;
use jni::JNIEnv;

use opendal::layers::RetryLayer;
use opendal::Operator;

Expand Down
4 changes: 2 additions & 2 deletions bindings/java/src/operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ use jni::objects::JObject;
use jni::objects::JString;
use jni::objects::JValue;
use jni::objects::JValueOwned;
use jni::sys::jlong;
use jni::sys::jobject;
use jni::sys::jsize;
use jni::sys::{jlong, jobject};
use jni::JNIEnv;

use opendal::layers::BlockingLayer;
use opendal::raw::PresignedRequest;
use opendal::Operator;
Expand Down
7 changes: 4 additions & 3 deletions bindings/java/src/utility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
// specific language governing permissions and limitations
// under the License.

use jni::objects::{JClass, JObject};
use jni::sys::{jobjectArray, jsize};
use jni::objects::JClass;
use jni::objects::JObject;
use jni::sys::jobjectArray;
use jni::sys::jsize;
use jni::JNIEnv;

use opendal::Scheme;

use crate::convert::string_to_jstring;
Expand Down
2 changes: 1 addition & 1 deletion bindings/nodejs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ services-webdav = ["opendal/services-webdav"]
services-webhdfs = ["opendal/services-webhdfs"]

# Optional services provided by opendal.
services-alluxio = ["opendal/services-alluxio"]
services-azfile = ["opendal/services-azfile"]
services-cacache = ["opendal/services-cacache"]
services-dashmap = ["opendal/services-dashmap"]
Expand Down Expand Up @@ -132,7 +133,6 @@ services-swift = ["opendal/services-swift"]
services-tikv = ["opendal/services-tikv"]
services-vercel-artifacts = ["opendal/services-vercel-artifacts"]
services-wasabi = ["opendal/services-wasabi"]
services-alluxio = ["opendal/services-alluxio"]

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion bindings/nodejs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ export class Layer { }
* retry.jitter = true;
*
* op.layer(retry.build());
*```
* ```
*/
export class RetryLayer {
constructor()
Expand Down
2 changes: 1 addition & 1 deletion bindings/nodejs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ impl NodeLayer for opendal::layers::RetryLayer {
/// retry.jitter = true;
///
/// op.layer(retry.build());
///```
/// ```
#[derive(Default)]
#[napi]
pub struct RetryLayer {
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ services-webdav = ["opendal/services-webdav"]
services-webhdfs = ["opendal/services-webhdfs"]

# Optional services provided by opendal.
services-alluxio = ["opendal/services-alluxio"]
services-azfile = ["opendal/services-azfile"]
services-cacache = ["opendal/services-cacache"]
services-dashmap = ["opendal/services-dashmap"]
Expand Down Expand Up @@ -132,7 +133,6 @@ services-swift = ["opendal/services-swift"]
services-tikv = ["opendal/services-tikv"]
services-vercel-artifacts = ["opendal/services-vercel-artifacts"]
services-wasabi = ["opendal/services-wasabi"]
services-alluxio = ["opendal/services-alluxio"]

[lib]
crate-type = ["cdylib"]
Expand Down
6 changes: 4 additions & 2 deletions bindings/python/src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@
// specific language governing permissions and limitations
// under the License.

use std::io::Read;
use std::io::Seek;
use std::io::SeekFrom;
use std::io::{Read, Write};
use std::io::Write;
use std::ops::DerefMut;
use std::sync::Arc;

use futures::AsyncReadExt;
use futures::AsyncSeekExt;
use futures::{AsyncReadExt, AsyncWriteExt};
use futures::AsyncWriteExt;
use pyo3::exceptions::PyIOError;
use pyo3::exceptions::PyValueError;
use pyo3::prelude::*;
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/src/lister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.

use futures::TryStreamExt;
use std::sync::Arc;

use futures::TryStreamExt;
use pyo3::exceptions::PyStopAsyncIteration;
use pyo3::prelude::*;
use pyo3_asyncio::tokio::future_into_py;
Expand Down
3 changes: 2 additions & 1 deletion bindings/python/src/operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ use std::time::Duration;

use pyo3::exceptions::PyValueError;
use pyo3::prelude::*;
use pyo3::types::{PyBytes, PyDict};
use pyo3::types::PyBytes;
use pyo3::types::PyDict;
use pyo3_asyncio::tokio::future_into_py;

use crate::*;
Expand Down
2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ layers-await-tree = ["dep:await-tree"]
# Enable layers async-backtrace support.
layers-async-backtrace = ["dep:async-backtrace"]

services-alluxio = []
services-atomicserver = ["dep:atomic_lib"]
services-azblob = [
"dep:sha2",
Expand Down Expand Up @@ -148,7 +149,6 @@ services-gdrive = []
services-ghac = []
services-gridfs = ["dep:mongodb"]
services-hdfs = ["dep:hdrs"]
services-alluxio = []
services-http = []
services-ipfs = ["dep:prost"]
services-ipmfs = []
Expand Down
3 changes: 2 additions & 1 deletion core/edge/file_write_on_full_disk/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
// specific language governing permissions and limitations
// under the License.

use std::env;

use opendal::services::Fs;
use opendal::Operator;
use opendal::Result;
use rand::prelude::*;
use std::env;

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
3 changes: 2 additions & 1 deletion core/fuzz/fuzz_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@

#![no_main]

use std::fmt::{Debug, Formatter};
use std::fmt::Debug;
use std::fmt::Formatter;
use std::io::SeekFrom;

use libfuzzer_sys::arbitrary::Arbitrary;
Expand Down
3 changes: 2 additions & 1 deletion core/src/layers/immutable_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@

use std::collections::HashSet;
use std::fmt::Debug;
use std::task::{Context, Poll};
use std::task::Context;
use std::task::Poll;
use std::vec::IntoIter;

use async_trait::async_trait;
Expand Down
3 changes: 2 additions & 1 deletion core/src/layers/prometheus_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ use std::io;
use std::sync::Arc;
use std::task::Context;
use std::task::Poll;
use std::time::{Duration, Instant};
use std::time::Duration;
use std::time::Instant;

use async_trait::async_trait;
use bytes::Bytes;
Expand Down
6 changes: 5 additions & 1 deletion core/src/raw/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ use crate::*;
/// self.inner.list(path, args).await
/// }
///
/// fn blocking_list(&self, path: &str, args: OpList) -> Result<(RpList, Self::BlockingLister)> {
/// fn blocking_list(
/// &self,
/// path: &str,
/// args: OpList,
/// ) -> Result<(RpList, Self::BlockingLister)> {
/// self.inner.blocking_list(path, args)
/// }
/// }
Expand Down
4 changes: 3 additions & 1 deletion core/src/raw/oio/buf/adaptive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
// specific language governing permissions and limitations
// under the License.

use bytes::{Bytes, BytesMut};
use std::cmp;

use bytes::Bytes;
use bytes::BytesMut;
use tokio::io::ReadBuf;

/// The default minimum adaptive buffer size is 8 KiB.
Expand Down
9 changes: 2 additions & 7 deletions core/src/raw/oio/list/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@

use std::fmt::Display;
use std::fmt::Formatter;
use std::task::{Context, Poll};

use async_trait::async_trait;
use std::task::Context;
use std::task::Poll;

use crate::raw::oio::Entry;
use crate::*;
Expand Down Expand Up @@ -59,7 +58,6 @@ impl From<ListOperation> for &'static str {
}

/// Page trait is used by [`raw::Accessor`] to implement `list` operation.
#[async_trait]
pub trait List: Send + Sync + 'static {
/// Fetch a new page of [`Entry`]
///
Expand All @@ -71,21 +69,18 @@ pub trait List: Send + Sync + 'static {
/// The boxed version of [`List`]
pub type Lister = Box<dyn List>;

#[async_trait]
impl<P: List + ?Sized> List for Box<P> {
fn poll_next(&mut self, cx: &mut Context<'_>) -> Poll<Result<Option<Entry>>> {
(**self).poll_next(cx)
}
}

#[async_trait]
impl List for () {
fn poll_next(&mut self, _: &mut Context<'_>) -> Poll<Result<Option<Entry>>> {
Poll::Ready(Ok(None))
}
}

#[async_trait]
impl<P: List> List for Option<P> {
fn poll_next(&mut self, cx: &mut Context<'_>) -> Poll<Result<Option<Entry>>> {
match self {
Expand Down
7 changes: 4 additions & 3 deletions core/src/raw/oio/list/flat_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
// specific language governing permissions and limitations
// under the License.

use std::task::{ready, Context, Poll};
use std::task::ready;
use std::task::Context;
use std::task::Poll;

use async_trait::async_trait;
use futures::future::BoxFuture;
use futures::FutureExt;

Expand Down Expand Up @@ -102,7 +103,6 @@ where
}
}

#[async_trait]
impl<A, L> oio::List for FlatLister<A, L>
where
A: Accessor<Lister = L>,
Expand Down Expand Up @@ -208,6 +208,7 @@ where

#[cfg(test)]
mod tests {
use async_trait::async_trait;
use std::collections::HashMap;
use std::vec;
use std::vec::IntoIter;
Expand Down
Loading