ettirapp commented on a change in pull request #12581: URL: https://github.com/apache/beam/pull/12581#discussion_r473195191
########## File path: sdks/java/io/azure/src/main/java/org/apache/beam/sdk/io/azure/options/BlobstoreOptions.java ########## @@ -0,0 +1,154 @@ +/* + * 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.beam.sdk.io.azure.options; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.storage.blob.models.CustomerProvidedKey; +import com.azure.storage.common.StorageSharedKeyCredential; +import org.apache.beam.sdk.annotations.Experimental; +import org.apache.beam.sdk.annotations.Experimental.Kind; +import org.apache.beam.sdk.io.azure.blobstore.DefaultBlobstoreClientBuilderFactory; +import org.apache.beam.sdk.options.Default; +import org.apache.beam.sdk.options.DefaultValueFactory; +import org.apache.beam.sdk.options.Description; +import org.apache.beam.sdk.options.PipelineOptions; +import org.checkerframework.checker.nullness.qual.Nullable; + +// TODO: Tag each option with @Default or @Nullable + +@Experimental(Kind.FILESYSTEM) +/** Options used to configure Microsoft Azure Blob Storage. */ +public interface BlobstoreOptions extends PipelineOptions { + + @Description( + "Factory class that should be created and used to create a builder of Azure Blobstore client." + + "Override the default value if you need a Azure client with custom properties.") + @Default.Class(DefaultBlobstoreClientBuilderFactory.class) + Class<? extends BlobstoreClientBuilderFactory> getBlobstoreClientFactoryClass(); + + void setBlobstoreClientFactoryClass( + Class<? extends BlobstoreClientBuilderFactory> blobstoreClientFactoryClass); + + @Description("Adds a pipeline policy to apply on each request sent to the blob service client.") + @Nullable + HttpPipelinePolicy getPipelinePolicy(); + + void setPipelinePolicy(HttpPipelinePolicy pipelinePolicy); + + /** The client configuration instance that should be used to configure Azure service clients. */ + @Description( + "The configuration instance used to retrieve environment configuration values " + + "when building an Azure Blobstore client. Set only those that need custom changes.") + @Default.InstanceFactory(BlobstoreOptions.ConfigurationFactory.class) + @Nullable + Configuration getEnvironmentConfiguration(); + + void setEnvironmentConfiguration(Configuration configuration); + + /** Default Azure client configuration. */ + class ConfigurationFactory implements DefaultValueFactory<Configuration> { + + @Override + public Configuration create(PipelineOptions options) { + return new Configuration(); + } + } + Review comment: Sure, I'll remove it ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
