Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(core)!: Remove not used cap write_multi_align_size #5322

Merged
merged 4 commits into from
Nov 14, 2024
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
8 changes: 0 additions & 8 deletions bindings/c/include/opendal.h
Original file line number Diff line number Diff line change
Expand Up @@ -515,14 +515,6 @@ typedef struct opendal_capability {
* If it is not set, this will be zero
*/
uintptr_t write_multi_min_size;
/**
* write_multi_align_size is the align size that services required in write_multi.
*
* For example, Google GCS requires align size to 256KiB in write_multi.
*
* If it is not set, this will be zero
*/
uintptr_t write_multi_align_size;
/**
* write_total_max_size is the max size that services support in write_total.
*
Expand Down
7 changes: 0 additions & 7 deletions bindings/c/src/operator_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,6 @@ pub struct opendal_capability {
///
/// If it is not set, this will be zero
pub write_multi_min_size: usize,
/// write_multi_align_size is the align size that services required in write_multi.
///
/// For example, Google GCS requires align size to 256KiB in write_multi.
///
/// If it is not set, this will be zero
pub write_multi_align_size: usize,
/// write_total_max_size is the max size that services support in write_total.
///
/// For example, Cloudflare D1 supports 1MB as max in write_total.
Expand Down Expand Up @@ -253,7 +247,6 @@ impl From<core::Capability> for opendal_capability {
write_with_cache_control: value.write_with_cache_control,
write_multi_max_size: value.write_multi_max_size.unwrap_or(0),
write_multi_min_size: value.write_multi_min_size.unwrap_or(0),
write_multi_align_size: value.write_multi_align_size.unwrap_or(0),
write_total_max_size: value.write_total_max_size.unwrap_or(0),
create_dir: value.create_dir,
delete: value.delete,
Expand Down
5 changes: 0 additions & 5 deletions bindings/go/operator_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,6 @@ func (c *Capability) WriteMultiMaxSize() uint {
func (c *Capability) WriteMultiMinSize() uint {
return c.inner.writeMultiMinSize
}

func (c *Capability) WriteMultiAlignSize() uint {
return c.inner.writeMultiAlignSize
}

func (c *Capability) WriteTotalMaxSize() uint {
return c.inner.writeTotalMaxSize
}
Expand Down
2 changes: 0 additions & 2 deletions bindings/go/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ var (
&ffi.TypeUint8, // write_with_cache_control
&ffi.TypePointer, // write_multi_max_size
&ffi.TypePointer, // write_multi_min_size
&ffi.TypePointer, // write_multi_align_size
&ffi.TypePointer, // write_total_max_size
&ffi.TypeUint8, // create_dir
&ffi.TypeUint8, // delete
Expand Down Expand Up @@ -189,7 +188,6 @@ type opendalCapability struct {
writeWithCacheControl uint8
writeMultiMaxSize uint
writeMultiMinSize uint
writeMultiAlignSize uint
writeTotalMaxSize uint
createDir uint8
delete uint8
Expand Down
3 changes: 1 addition & 2 deletions bindings/java/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ fn make_operator_info<'a>(env: &mut JNIEnv<'a>, info: OperatorInfo) -> Result<JO
fn make_capability<'a>(env: &mut JNIEnv<'a>, cap: Capability) -> Result<JObject<'a>> {
let capability = env.new_object(
"org/apache/opendal/Capability",
"(ZZZZZZZZZZZZZZZJJJZZZZZZZZZZZZZZJZ)V",
"(ZZZZZZZZZZZZZZZJJZZZZZZZZZZZZZZJZ)V",
&[
JValue::Bool(cap.stat as jboolean),
JValue::Bool(cap.stat_with_if_match as jboolean),
Expand All @@ -113,7 +113,6 @@ fn make_capability<'a>(env: &mut JNIEnv<'a>, cap: Capability) -> Result<JObject<
JValue::Bool(cap.write_with_cache_control as jboolean),
JValue::Long(convert::usize_to_jlong(cap.write_multi_max_size)),
JValue::Long(convert::usize_to_jlong(cap.write_multi_min_size)),
JValue::Long(convert::usize_to_jlong(cap.write_multi_align_size)),
JValue::Bool(cap.create_dir as jboolean),
JValue::Bool(cap.delete as jboolean),
JValue::Bool(cap.copy as jboolean),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,6 @@ public class Capability {
*/
public final long writeMultiMinSize;

/**
* write_multi_align_size is the align size that services required in write_multi.
* For example, Google GCS requires align size to 256KiB in write_multi.
*/
public final long writeMultiAlignSize;

/**
* If operator supports create dir.
*/
Expand Down Expand Up @@ -214,7 +208,6 @@ public Capability(
boolean writeWithCacheControl,
long writeMultiMaxSize,
long writeMultiMinSize,
long writeMultiAlignSize,
boolean createDir,
boolean delete,
boolean copy,
Expand Down Expand Up @@ -248,7 +241,6 @@ public Capability(
this.writeWithCacheControl = writeWithCacheControl;
this.writeMultiMaxSize = writeMultiMaxSize;
this.writeMultiMinSize = writeMultiMinSize;
this.writeMultiAlignSize = writeMultiAlignSize;
this.createDir = createDir;
this.delete = delete;
this.copy = copy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public void testBlockingOperatorInfo() {
assertThat(info.fullCapability.write).isTrue();
assertThat(info.fullCapability.delete).isTrue();
assertThat(info.fullCapability.writeCanAppend).isTrue();
assertThat(info.fullCapability.writeMultiAlignSize).isEqualTo(-1);
assertThat(info.fullCapability.writeMultiMaxSize).isEqualTo(-1);
assertThat(info.fullCapability.writeMultiMinSize).isEqualTo(-1);
assertThat(info.fullCapability.batchMaxOperations).isEqualTo(-1);
Expand All @@ -71,7 +70,6 @@ public void testOperatorInfo() {
assertThat(info.fullCapability.write).isTrue();
assertThat(info.fullCapability.delete).isTrue();
assertThat(info.fullCapability.writeCanAppend).isFalse();
assertThat(info.fullCapability.writeMultiAlignSize).isEqualTo(-1);
assertThat(info.fullCapability.writeMultiMaxSize).isEqualTo(-1);
assertThat(info.fullCapability.writeMultiMinSize).isEqualTo(-1);
assertThat(info.fullCapability.batchMaxOperations).isEqualTo(-1);
Expand Down
6 changes: 0 additions & 6 deletions bindings/nodejs/generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,6 @@ export class Capability {
* For example, AWS S3 requires at least 5MiB in write_multi expect the last one.
*/
get writeMultiMinSize(): bigint | null
/**
* write_multi_align_size is the align size that services required in write_multi.
*
* For example, Google GCS requires align size to 256KiB in write_multi.
*/
get writeMultiAlignSize(): bigint | null
/**
* write_total_max_size is the max size that services support in write_total.
*
Expand Down
9 changes: 0 additions & 9 deletions bindings/nodejs/src/capability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,6 @@ impl Capability {
pub fn write_multi_min_size(&self) -> Option<usize> {
self.0.write_multi_min_size
}

/// write_multi_align_size is the align size that services required in write_multi.
///
/// For example, Google GCS requires align size to 256KiB in write_multi.
#[napi(getter)]
pub fn write_multi_align_size(&self) -> Option<usize> {
self.0.write_multi_align_size
}

/// write_total_max_size is the max size that services support in write_total.
///
/// For example, Cloudflare D1 supports 1MB as max in write_total.
Expand Down
1 change: 0 additions & 1 deletion bindings/python/python/opendal/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ class Capability:
write_with_cache_control: bool
write_multi_max_size: Optional[int]
write_multi_min_size: Optional[int]
write_multi_align_size: Optional[int]
write_total_max_size: Optional[int]

create_dir: bool
Expand Down
5 changes: 0 additions & 5 deletions bindings/python/src/capability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ pub struct Capability {
///
/// For example, AWS S3 requires at least 5MiB in write_multi expect the last one.
pub write_multi_min_size: Option<usize>,
/// write_multi_align_size is the align size that services required in write_multi.
///
/// For example, Google GCS requires align size to 256KiB in write_multi.
pub write_multi_align_size: Option<usize>,
/// write_total_max_size is the max size that services support in write_total.
///
/// For example, Cloudflare D1 supports 1MB as max in write_total.
Expand Down Expand Up @@ -135,7 +131,6 @@ impl Capability {
write_with_cache_control: capability.write_with_cache_control,
write_multi_max_size: capability.write_multi_max_size,
write_multi_min_size: capability.write_multi_min_size,
write_multi_align_size: capability.write_multi_align_size,
write_total_max_size: capability.write_total_max_size,
create_dir: capability.create_dir,
delete: capability.delete,
Expand Down
2 changes: 0 additions & 2 deletions bindings/ruby/src/capability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ define_accessors!(Capability, {
write_with_user_metadata: bool,
write_multi_max_size: Option<usize>,
write_multi_min_size: Option<usize>,
write_multi_align_size: Option<usize>,
write_total_max_size: Option<usize>,
create_dir: bool,
delete: bool,
Expand Down Expand Up @@ -130,7 +129,6 @@ pub fn include(gem_module: &RModule) -> Result<(), Error> {
write_with_user_metadata,
write_multi_max_size,
write_multi_min_size,
write_multi_align_size,
write_total_max_size,
create_dir,
delete,
Expand Down
3 changes: 0 additions & 3 deletions core/src/types/capability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,6 @@ pub struct Capability {
/// Minimum size required for multipart uploads (except for the last part).
/// For example, AWS S3 requires at least 5MiB per part.
pub write_multi_min_size: Option<usize>,
/// Required size alignment for multipart uploads.
/// For example, Google GCS requires 256KiB alignment.
pub write_multi_align_size: Option<usize>,
/// Maximum total size supported for write operations.
/// For example, Cloudflare D1 has a 1MB total size limit.
pub write_total_max_size: Option<usize>,
Expand Down
Loading