This is an automated email from the ASF dual-hosted git repository. morningman pushed a commit to branch branch-fs-spi in repository https://gitbox.apache.org/repos/asf/doris.git
commit 216454f1996cf3a2aac693e4172be2be69ba46a8 Author: morningman <[email protected]> AuthorDate: Wed Apr 1 15:22:31 2026 +0800 [refactor](fs-spi) P4.8-C: delete MultipartUploadCapable interface ### What problem does this PR solve? Issue Number: N/A Problem Summary: The MultipartUploadCapable interface (legacy fe-core) was the only multipart upload contract for S3FileSystem and AzureFileSystem. All callers have already migrated to the SPI ObjFileSystem (which has its own completeMultipartUpload() method and ObjStorage.initiateMultipartUpload/ uploadPart/abortMultipartUpload). The interface is now dead code: - HMSTransaction already uses SPI ObjFileSystem directly - No code casts to MultipartUploadCapable Delete the interface and remove its implements clause from S3FileSystem and AzureFileSystem. The legacy completeMultipartUpload(bucket, key, uploadId, parts) methods remain in those classes pending Phase G deletion. ### Release note None ### Check List (For Author) - Test: No need to test (dead interface removal, FE build verified) - Behavior changed: No - Does this need documentation: No Co-authored-by: Copilot <[email protected]> --- .../apache/doris/fs/remote/AzureFileSystem.java | 3 +- .../doris/fs/remote/MultipartUploadCapable.java | 53 ---------------------- .../org/apache/doris/fs/remote/S3FileSystem.java | 3 +- 3 files changed, 2 insertions(+), 57 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/fs/remote/AzureFileSystem.java b/fe/fe-core/src/main/java/org/apache/doris/fs/remote/AzureFileSystem.java index a6ccac5687e..d85d5b13ab5 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/fs/remote/AzureFileSystem.java +++ b/fe/fe-core/src/main/java/org/apache/doris/fs/remote/AzureFileSystem.java @@ -31,7 +31,7 @@ import java.util.List; import java.util.Map; import java.util.Set; -public class AzureFileSystem extends ObjFileSystem implements MultipartUploadCapable { +public class AzureFileSystem extends ObjFileSystem { private static final Logger LOG = LogManager.getLogger(AzureFileSystem.class); private final AzureProperties azureProperties; @@ -80,7 +80,6 @@ public class AzureFileSystem extends ObjFileSystem implements MultipartUploadCap } } - @Override public void completeMultipartUpload(String bucket, String key, String uploadId, Map<Integer, String> parts) { AzureObjStorage azureObjStorage = (AzureObjStorage) getObjStorage(); azureObjStorage.completeMultipartUpload(bucket, key, parts); diff --git a/fe/fe-core/src/main/java/org/apache/doris/fs/remote/MultipartUploadCapable.java b/fe/fe-core/src/main/java/org/apache/doris/fs/remote/MultipartUploadCapable.java deleted file mode 100644 index 5302b7730a9..00000000000 --- a/fe/fe-core/src/main/java/org/apache/doris/fs/remote/MultipartUploadCapable.java +++ /dev/null @@ -1,53 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -package org.apache.doris.fs.remote; - -import java.util.Map; - -/** - * Optional capability interface for file systems that support S3-style multipart upload completion. - * - * <p>In object storage systems (S3, Azure Blob Storage), large files can be uploaded in multiple - * parts. After all parts are uploaded, the parts must be explicitly merged via - * {@link #completeMultipartUpload}. - * - * <p>Not all {@link ObjFileSystem} implementations support this protocol; callers must check - * {@code instanceof MultipartUploadCapable} before use. - * - * <p>Example usage: - * <pre>{@code - * FileSystem fs = switchingFs.fileSystem(path); - * if (!(fs instanceof MultipartUploadCapable)) { - * throw new IllegalStateException("FileSystem does not support multipart upload: " + path); - * } - * ((MultipartUploadCapable) fs).completeMultipartUpload(bucket, key, uploadId, parts); - * }</pre> - */ -public interface MultipartUploadCapable { - - /** - * Completes a multipart upload by merging all uploaded parts into a single object. - * - * @param bucket the name of the target bucket - * @param key the full object key (path) within the bucket - * @param uploadId the unique identifier of the multipart upload session - * @param parts mapping of part numbers (1-based) to their ETag values, - * used to assemble parts in the correct order - */ - void completeMultipartUpload(String bucket, String key, String uploadId, Map<Integer, String> parts); -} diff --git a/fe/fe-core/src/main/java/org/apache/doris/fs/remote/S3FileSystem.java b/fe/fe-core/src/main/java/org/apache/doris/fs/remote/S3FileSystem.java index fb3257f98f0..1992c36df44 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/fs/remote/S3FileSystem.java +++ b/fe/fe-core/src/main/java/org/apache/doris/fs/remote/S3FileSystem.java @@ -40,7 +40,7 @@ import java.util.List; import java.util.Map; import java.util.Set; -public class S3FileSystem extends ObjFileSystem implements MultipartUploadCapable { +public class S3FileSystem extends ObjFileSystem { private static final Logger LOG = LogManager.getLogger(S3FileSystem.class); private final AbstractS3CompatibleProperties s3Properties; @@ -129,7 +129,6 @@ public class S3FileSystem extends ObjFileSystem implements MultipartUploadCapabl } } - @Override public void completeMultipartUpload(String bucket, String key, String uploadId, Map<Integer, String> parts) { S3ObjStorage objStorage = (S3ObjStorage) this.objStorage; List<CompletedPart> completedParts = new ArrayList<>(); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
