diff --git a/CHANGES.md b/CHANGES.md index ea5207825bdd6..a103efad54a7b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -58,7 +58,6 @@ ## I/Os -* Support for read from Cosmos DB [#23604](https://github.com/apache/beam/issues/23604) * Support for X source added (Java/Python) ([#X](https://github.com/apache/beam/issues/X)). * Support for Bigtable Change Streams added in Java `BigtableIO.ReadChangeStream` ([#27183](https://github.com/apache/beam/issues/27183)) * Support for read from Cosmos DB Core SQL API [#23604](https://github.com/apache/beam/issues/23604) diff --git a/sdks/java/io/azure-cosmos/src/main/java/org/apache/beam/sdk/io/azure/cosmos/CosmosOptions.java b/sdks/java/io/azure-cosmos/src/main/java/org/apache/beam/sdk/io/azure/cosmos/CosmosOptions.java index e03728f44f83c..2e4c0ed3cd1e7 100644 --- a/sdks/java/io/azure-cosmos/src/main/java/org/apache/beam/sdk/io/azure/cosmos/CosmosOptions.java +++ b/sdks/java/io/azure-cosmos/src/main/java/org/apache/beam/sdk/io/azure/cosmos/CosmosOptions.java @@ -44,16 +44,14 @@ public interface CosmosOptions extends AzureOptions { void setCosmosClientBuilder(CosmosClientBuilder builder); /** The Azure Cosmos service endpoint used by the Cosmos client. */ - @Description( - "Sets the cosmos service endpoint, additionally parses it for information (SAS token)") + @Description("Sets the cosmos service endpoint") @Nullable String getCosmosServiceEndpoint(); void setCosmosServiceEndpoint(String endpoint); /** The Azure Cosmos key used to perform authentication for accessing resource */ - @Description( - "Sets the cosmos service endpoint, additionally parses it for information (SAS token)") + @Description("Sets the cosmos service endpoint") @Nullable String getCosmosKey(); diff --git a/sdks/java/io/azure/src/main/java/org/apache/beam/sdk/io/azure/options/AzureOptions.java b/sdks/java/io/azure/src/main/java/org/apache/beam/sdk/io/azure/options/AzureOptions.java index 33a8fd2923f4c..c4793300fe48b 100644 --- a/sdks/java/io/azure/src/main/java/org/apache/beam/sdk/io/azure/options/AzureOptions.java +++ b/sdks/java/io/azure/src/main/java/org/apache/beam/sdk/io/azure/options/AzureOptions.java @@ -1,3 +1,20 @@ +/* + * 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; @@ -9,38 +26,36 @@ public interface AzureOptions extends PipelineOptions { - /* Refer to {@link DefaultAWSCredentialsProviderChain} Javadoc for usage help. */ - - /** - * The credential instance that should be used to authenticate against Azure services. The option - * value must contain a "@type" field and an Azure credentials provider class as the field value. - * - *

For example, to specify the Azure client id, tenant id, and client secret, specify the - * following: - * {"@type" : "ClientSecretCredential", "azureClientId": "client_id_value", - * "azureTenantId": "tenant_id_value", "azureClientSecret": "client_secret_value"} - * - */ - @Description( - "The credential instance that should be used to authenticate " - + "against Azure services. The option value must contain \"@type\" field " - + "and an Azure credentials provider class name as the field value. " - + " For example, to specify the Azure client id, tenant id, and client secret, specify the following: " - + "{\"@type\" : \"ClientSecretCredential\", \"azureClientId\": \"client_id_value\", " - + "\"azureTenantId\": \"tenant_id_value\", \"azureClientSecret\": \"client_secret_value\"}") - @Default.InstanceFactory(AzureUserCredentialsFactory.class) - TokenCredential getAzureCredentialsProvider(); - - void setAzureCredentialsProvider(TokenCredential value); - - /** Attempts to load Azure credentials. */ - class AzureUserCredentialsFactory implements DefaultValueFactory { - - @Override - public TokenCredential create(PipelineOptions options) { - return new DefaultAzureCredentialBuilder().build(); - } + /* Refer to {@link DefaultAWSCredentialsProviderChain} Javadoc for usage help. */ + + /** + * The credential instance that should be used to authenticate against Azure services. The option + * value must contain a "@type" field and an Azure credentials provider class as the field value. + * + *

For example, to specify the Azure client id, tenant id, and client secret, specify the + * following: + * {"@type" : "ClientSecretCredential", "azureClientId": "client_id_value", + * "azureTenantId": "tenant_id_value", "azureClientSecret": "client_secret_value"} + * + */ + @Description( + "The credential instance that should be used to authenticate " + + "against Azure services. The option value must contain \"@type\" field " + + "and an Azure credentials provider class name as the field value. " + + " For example, to specify the Azure client id, tenant id, and client secret, specify the following: " + + "{\"@type\" : \"ClientSecretCredential\", \"azureClientId\": \"client_id_value\", " + + "\"azureTenantId\": \"tenant_id_value\", \"azureClientSecret\": \"client_secret_value\"}") + @Default.InstanceFactory(AzureUserCredentialsFactory.class) + TokenCredential getAzureCredentialsProvider(); + + void setAzureCredentialsProvider(TokenCredential value); + + /** Attempts to load Azure credentials. */ + class AzureUserCredentialsFactory implements DefaultValueFactory { + + @Override + public TokenCredential create(PipelineOptions options) { + return new DefaultAzureCredentialBuilder().build(); } - - + } } diff --git a/sdks/java/io/azure/src/main/java/org/apache/beam/sdk/io/azure/options/BlobstoreOptions.java b/sdks/java/io/azure/src/main/java/org/apache/beam/sdk/io/azure/options/BlobstoreOptions.java index 241bce764759a..7471452dfce01 100644 --- a/sdks/java/io/azure/src/main/java/org/apache/beam/sdk/io/azure/options/BlobstoreOptions.java +++ b/sdks/java/io/azure/src/main/java/org/apache/beam/sdk/io/azure/options/BlobstoreOptions.java @@ -17,17 +17,13 @@ */ 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.identity.DefaultAzureCredentialBuilder; import com.azure.storage.blob.models.CustomerProvidedKey; 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