CalvinKirs commented on code in PR #63400: URL: https://github.com/apache/doris/pull/63400#discussion_r3361936262
########## fe/fe-filesystem/fe-filesystem-spi/src/main/java/org/apache/doris/filesystem/spi/ObjectStorageUri.java: ########## @@ -0,0 +1,97 @@ +// 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.filesystem.spi; + +/** + * Parsed object-storage URI. Extracts bucket and key without any fe-core dependency. + */ +public final class ObjectStorageUri { + + private final String bucket; + private final String key; + + private ObjectStorageUri(String bucket, String key) { + this.bucket = bucket; + this.key = key; + } + + /** + * Parses URIs of the form: scheme://bucket/key. + * + * <p>When {@code pathStyleAccess} is {@code true} <strong>and</strong> the scheme is + * {@code http} or {@code https}, the URI is treated as path-style: + * {@code scheme://endpoint/bucket/key}. The first path segment after the host is the + * bucket, the remainder is the key. For all other schemes the first authority + * component is always treated as the bucket, regardless of {@code pathStyleAccess}. + */ + public static ObjectStorageUri parse(String path, boolean pathStyleAccess) { Review Comment: The interface is actually the common low-level abstraction implemented by all backends, including AzureObjStorage (Azure Blob), which is not an S3-style API — so a provider-neutral name is intentional. The "S3-style API" wording in the Javadoc I'll reword it to "common object-storage abstraction" to avoid implying it's S3-specific. Let me know if you'd still prefer a rename. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
