cryptoe commented on code in PR #12874: URL: https://github.com/apache/druid/pull/12874#discussion_r943791649
########## core/src/main/java/org/apache/druid/storage/StorageConnector.java: ########## @@ -0,0 +1,103 @@ +/* + * 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.druid.storage; + +import org.apache.druid.guice.annotations.UnstableApi; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +/** + * Low level interface for interacting with different storage providers like S3, GCS, Azure and local file system. + * <p> + * For adding a new implementation of this interface in your extension extend {@link StorageConnectorProvider}. + * <p> + * For using the interface in your extension as a consumer, use JsonConfigProvider like: + * <ol> + * <li>{@code JsonConfigProvider.bind(binder, "druid,extension.custom.type", StorageConnectorProvider.class, Custom.class);}</li> + * <li>// bind the storage config provider {@code binder.bind(Key.get(StorageConnector.class, Custom.class)).toProvider(Key.get(StorageConnectorProvider.class, Custom.class)).in(LazySingleton.class);} </li> + * <li>// Use Named annotations to access the storageConnector instance in your custom extension.{@code @Custom StorageConnector storageConnector} </li> + * </ol> + * The final state of this inteface would have + * <ol> + * <li>Future Non blocking API's</li> + * <li>Offset based fetch</li> + * </ol> + */ + +@UnstableApi +public interface StorageConnector +{ + + /** + * Check if the path exists in the underlying storage layer. Most implementations prepend the input path + * with a basePath. Review Comment: As the above class level description is already too long, I think having the documentation per API makes the caller less likely to run into issues. -- 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]
