refactor: expose external ECStore owner symbols (#3748)

This commit is contained in:
Zhengchao An
2026-06-22 21:42:54 +08:00
committed by GitHub
parent 418b5d04f9
commit db7ff8f513
7 changed files with 127 additions and 79 deletions
+5 -25
View File
@@ -12,7 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use crate::{ecstore_error, ecstore_global, ecstore_set_disk, ecstore_storage};
use crate::{
SELECT_DEFAULT_READ_BUFFER_SIZE, SelectGetObjectReader, SelectObjectInfo, SelectObjectOptions, SelectStorageError,
SelectStore, resolve_select_object_store_handle, select_is_err_bucket_not_found, select_is_err_object_not_found,
select_is_err_version_not_found,
};
use async_trait::async_trait;
use bytes::Bytes;
use chrono::Utc;
@@ -45,34 +49,10 @@ use tokio::io::{AsyncRead, ReadBuf};
use tokio_util::io::ReaderStream;
use transform_stream::AsyncTryStream;
type SelectStorageError = ecstore_error::StorageError;
type SelectStore = ecstore_storage::ECStore;
type SelectGetObjectReader = <SelectStore as rustfs_storage_api::ObjectIO>::GetObjectReader;
type SelectObjectInfo = <SelectStore as rustfs_storage_api::ObjectOperations>::ObjectInfo;
type SelectObjectOptions = <SelectStore as rustfs_storage_api::ObjectOperations>::ObjectOptions;
const SELECT_DEFAULT_READ_BUFFER_SIZE: usize = ecstore_set_disk::DEFAULT_READ_BUFFER_SIZE;
fn select_default_read_buffer_size_u64() -> u64 {
u64::try_from(SELECT_DEFAULT_READ_BUFFER_SIZE).unwrap_or(u64::MAX)
}
fn resolve_select_object_store_handle() -> Option<Arc<SelectStore>> {
ecstore_global::resolve_object_store_handle()
}
fn select_is_err_bucket_not_found(err: &SelectStorageError) -> bool {
ecstore_error::is_err_bucket_not_found(err)
}
fn select_is_err_object_not_found(err: &SelectStorageError) -> bool {
ecstore_error::is_err_object_not_found(err)
}
fn select_is_err_version_not_found(err: &SelectStorageError) -> bool {
ecstore_error::is_err_version_not_found(err)
}
/// Maximum allowed object size for JSON DOCUMENT mode.
///
/// JSON DOCUMENT format requires loading the entire file into memory for DOM