From 540a16de033a41c6b43a44adbc2555598d3edfa7 Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Wed, 24 Apr 2024 08:09:43 -0700 Subject: [PATCH 01/33] Initial changes --- .../NonStreamingOrderByDocumentProducer.java | 43 +++ ...gOrderByDocumentQueryExecutionContext.java | 302 ++++++++++++++++++ ...ParallelDocumentQueryExecutionContext.java | 3 +- ...ipelinedDocumentQueryExecutionContext.java | 15 +- .../query/PipelinedQueryExecutionContext.java | 2 +- .../PipelinedQueryExecutionContextBase.java | 3 +- .../implementation/query/QueryInfo.java | 6 + 7 files changed, 366 insertions(+), 8 deletions(-) create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentProducer.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentProducer.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentProducer.java new file mode 100644 index 000000000000..35a3d4665309 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentProducer.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.implementation.query; + +import com.azure.cosmos.implementation.Document; +import com.azure.cosmos.implementation.DocumentClientRetryPolicy; +import com.azure.cosmos.implementation.RxDocumentServiceRequest; +import com.azure.cosmos.implementation.feedranges.FeedRangeEpkImpl; +import com.azure.cosmos.implementation.query.orderbyquery.OrderbyRowComparer; +import com.azure.cosmos.models.CosmosQueryRequestOptions; +import com.azure.cosmos.models.FeedResponse; +import reactor.core.publisher.Mono; + +import java.util.UUID; +import java.util.function.Function; +import java.util.function.Supplier; + +public class NonStreamingOrderByDocumentProducer extends DocumentProducer{ + private final OrderbyRowComparer consumeComparer; + + NonStreamingOrderByDocumentProducer( + OrderbyRowComparer consumeComparer, + IDocumentQueryClient client, + String collectionResourceId, + CosmosQueryRequestOptions cosmosQueryRequestOptions, + TriFunction createRequestFunc, + Function>> executeRequestFunc, + FeedRangeEpkImpl feedRange, + String collectionLink, + Supplier createRetryPolicyFunc, + Class resourceType, + UUID correlatedActivityId, + int initialPageSize, + String initialContinuationToken, + int top, + Supplier operationContextTextProvider) { + super(client, collectionResourceId, cosmosQueryRequestOptions, createRequestFunc, executeRequestFunc, + collectionLink, createRetryPolicyFunc, resourceType, correlatedActivityId, initialPageSize, + initialContinuationToken, top, feedRange, operationContextTextProvider); + this.consumeComparer = consumeComparer; + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java new file mode 100644 index 000000000000..616db9ebc904 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.implementation.query; + +import com.azure.cosmos.BridgeInternal; +import com.azure.cosmos.CosmosException; +import com.azure.cosmos.implementation.ClientSideRequestStatistics; +import com.azure.cosmos.implementation.DiagnosticsClientContext; +import com.azure.cosmos.implementation.Document; +import com.azure.cosmos.implementation.DocumentClientRetryPolicy; +import com.azure.cosmos.implementation.DocumentCollection; +import com.azure.cosmos.implementation.HttpConstants; +import com.azure.cosmos.implementation.ImplementationBridgeHelpers; +import com.azure.cosmos.implementation.QueryMetrics; +import com.azure.cosmos.implementation.RequestChargeTracker; +import com.azure.cosmos.implementation.ResourceType; +import com.azure.cosmos.implementation.RxDocumentServiceRequest; +import com.azure.cosmos.implementation.Utils; +import com.azure.cosmos.implementation.feedranges.FeedRangeEpkImpl; +import com.azure.cosmos.implementation.query.orderbyquery.OrderByRowResult; +import com.azure.cosmos.implementation.query.orderbyquery.OrderbyRowComparer; +import com.azure.cosmos.models.CosmosQueryRequestOptions; +import com.azure.cosmos.models.FeedResponse; +import com.azure.cosmos.models.ModelBridgeInternal; +import com.azure.cosmos.models.SqlQuerySpec; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +public class NonStreamingOrderByDocumentQueryExecutionContext + extends ParallelDocumentQueryExecutionContextBase { + + private final static + ImplementationBridgeHelpers.CosmosDiagnosticsHelper.CosmosDiagnosticsAccessor diagnosticsAccessor = + ImplementationBridgeHelpers.CosmosDiagnosticsHelper.getCosmosDiagnosticsAccessor(); + + private static final ImplementationBridgeHelpers.FeedResponseHelper.FeedResponseAccessor feedResponseAccessor = + ImplementationBridgeHelpers.FeedResponseHelper.getFeedResponseAccessor(); + + private final static String FormatPlaceHolder = "{documentdb-formattableorderbyquery-filter}"; + private final static String True = "true"; + + private final OrderbyRowComparer consumeComparer; + private final RequestChargeTracker tracker; + private final ConcurrentMap queryMetricMap; + private final Collection clientSideRequestStatistics; + + private int maxPageSizePerPartition; + + public NonStreamingOrderByDocumentQueryExecutionContext( + DiagnosticsClientContext diagnosticsClientContext, + IDocumentQueryClient client, + ResourceType resourceTypeEnum, + SqlQuerySpec query, + CosmosQueryRequestOptions cosmosQueryRequestOptions, + String resourceLink, + String rewrittenQuery, + OrderbyRowComparer consumeComparer, + UUID correlatedActivityId, + boolean hasSelectValue, + final AtomicBoolean isQueryCancelledOnTimeout, + int maxPageSizePerPartition) { + super(diagnosticsClientContext, client, resourceTypeEnum, Document.class, query, cosmosQueryRequestOptions, + resourceLink, rewrittenQuery, correlatedActivityId, hasSelectValue, isQueryCancelledOnTimeout); + this.consumeComparer = consumeComparer; + this.tracker = new RequestChargeTracker(); + this.queryMetricMap = new ConcurrentHashMap<>(); + this.clientSideRequestStatistics = ConcurrentHashMap.newKeySet(); + this.maxPageSizePerPartition = maxPageSizePerPartition; + } + + public static Flux> createAsync( + DiagnosticsClientContext diagnosticsClientContext, + IDocumentQueryClient client, + PipelinedDocumentQueryParams initParams, + DocumentCollection collection, + int maxPageSizePerPartition) { + + QueryInfo queryInfo = initParams.getQueryInfo(); + + NonStreamingOrderByDocumentQueryExecutionContext context = new NonStreamingOrderByDocumentQueryExecutionContext( + diagnosticsClientContext, + client, + initParams.getResourceTypeEnum(), + initParams.getQuery(), + initParams.getCosmosQueryRequestOptions(), + initParams.getResourceLink(), + initParams.getQueryInfo().getRewrittenQuery(), + new OrderbyRowComparer<>(queryInfo.getOrderBy()), + initParams.getCorrelatedActivityId(), + queryInfo.hasSelectValue(), + initParams.isQueryCancelledOnTimeout(), + maxPageSizePerPartition); + + context.setTop(initParams.getTop()); + + try { + context.initialize( + initParams.getFeedRanges(), + initParams.getQueryInfo().getOrderBy(), + initParams.getQueryInfo().getOrderByExpressions(), + initParams.getInitialPageSize(), + collection); + + return Flux.just(context); + } catch (CosmosException dce) { + return Flux.error(dce); + } + } + + private void initialize( + List feedRanges, List sortOrders, + Collection orderByExpressions, + int initialPageSize, + DocumentCollection collection) throws CosmosException { + // Since the continuation token will always be null, + // we don't need to handle any initialization based on continuationToken. + // We can directly initialize without any consideration for continuationToken. + super.initialize(collection, + feedRanges.stream().collect(Collectors.toMap( + feedRangeEpk -> feedRangeEpk, + feedRangeEpk -> null)), + initialPageSize, + new SqlQuerySpec(querySpec.getQueryText().replace(FormatPlaceHolder, True), + querySpec.getParameters())); + } + + @Override + protected NonStreamingOrderByDocumentProducer createDocumentProducer( + String collectionRid, + String continuationToken, + int initialPageSize, + CosmosQueryRequestOptions cosmosQueryRequestOptions, + SqlQuerySpec querySpecForInit, + Map commonRequestHeaders, + TriFunction createRequestFunc, + Function>> executeFunc, + Supplier createRetryPolicyFunc, + FeedRangeEpkImpl feedRange) { + return new NonStreamingOrderByDocumentProducer( + consumeComparer, + client, + collectionRid, + cosmosQueryRequestOptions, + createRequestFunc, + executeFunc, + feedRange, + collectionRid, + createRetryPolicyFunc, + Document.class, + correlatedActivityId, + maxPageSizePerPartition, + continuationToken, + top, + this.getOperationContextTextProvider()); + } + + @Override + public Flux> drainAsync(int maxPageSize) { + int adjustedMaxPageSize = Math.min(maxPageSize, maxPageSizePerPartition); + maxPageSizePerPartition -= adjustedMaxPageSize; + return Flux.defer(() -> { + List>> orderedFluxes = new ArrayList<>(); + for (DocumentProducer producer : documentProducers) { + Flux> orderedFlux = producer.produceAsync() + .transform(new PageToItemTransformer(tracker, queryMetricMap, + consumeComparer.getSortOrders(), adjustedMaxPageSize)); + orderedFluxes.add(orderedFlux); + } + return Flux.mergeOrdered(consumeComparer, orderedFluxes.toArray(new Flux[0])) + .transformDeferred(new ItemToPageTransformer(tracker, maxPageSize, queryMetricMap, + this.clientSideRequestStatistics)); + }); + } + + @Override + public Flux> executeAsync() { + return drainAsync(ModelBridgeInternal.getMaxItemCountFromQueryRequestOptions(cosmosQueryRequestOptions)); + } + + private static class PageToItemTransformer implements + Function.DocumentProducerFeedResponse>, Flux>> { + private final RequestChargeTracker tracker; + private final Map queryMetricsMap; + private final List sortOrders; + private final int maxPageSize; + + public PageToItemTransformer( + RequestChargeTracker tracker, Map queryMetricsMap, + List sortOrders, int maxPageSize) { + this.tracker = tracker; + this.queryMetricsMap = queryMetricsMap; + this.sortOrders = sortOrders; + this.maxPageSize = maxPageSize; + } + + @Override + public Flux> apply(Flux.DocumentProducerFeedResponse> source) { + return source.flatMap(documentProducerFeedResponse -> { + QueryMetrics.mergeQueryMetricsMap(queryMetricsMap, + BridgeInternal.queryMetricsFromFeedResponse(documentProducerFeedResponse.pageResult)); + List results = documentProducerFeedResponse.pageResult.getResults(); + tracker.addCharge(documentProducerFeedResponse.pageResult.getRequestCharge()); + int pageSize = Math.min(maxPageSize, results.size()); + return Flux.fromIterable(results.subList(0, pageSize)) + .map(r -> new OrderByRowResult( + ModelBridgeInternal.toJsonFromJsonSerializable(r), + documentProducerFeedResponse.sourceFeedRange, + null)); // Continuation token is always null + }, 1); + } + } + + private static class ItemToPageTransformer implements + Function>, Flux>> { + private final static int DEFAULT_PAGE_SIZE = 100; + private final RequestChargeTracker tracker; + private final int maxPageSize; + private final ConcurrentMap queryMetricMap; + private final Collection clientSideRequestStatistics; + + public ItemToPageTransformer(RequestChargeTracker tracker, + int maxPageSize, + ConcurrentMap queryMetricsMap, + Collection clientSideRequestStatistics) { + this.tracker = tracker; + this.maxPageSize = maxPageSize > 0 ? maxPageSize : DEFAULT_PAGE_SIZE; + this.queryMetricMap = queryMetricsMap; + this.clientSideRequestStatistics = clientSideRequestStatistics; + } + + private static Map headerResponse(double requestCharge) { + return Utils.immutableMapOf(HttpConstants.HttpHeaders.REQUEST_CHARGE, String.valueOf(requestCharge)); + } + + @Override + public Flux> apply(Flux> source) { + return source + .window(maxPageSize).map(Flux::collectList) + .flatMap(resultListObs -> resultListObs, 1) + .map(orderByRowResults -> { + // construct a page from result with request charge + FeedResponse> feedResponse = feedResponseAccessor.createFeedResponse( + orderByRowResults, + headerResponse(tracker.getAndResetCharge()), + null); + if (!queryMetricMap.isEmpty()) { + for (Map.Entry entry : queryMetricMap.entrySet()) { + BridgeInternal.putQueryMetricsIntoMap(feedResponse, + entry.getKey(), + entry.getValue()); + } + } + return feedResponse; + }) + .concatWith(Flux.defer(() -> { + return Flux.just(feedResponseAccessor.createFeedResponse(Utils.immutableListOf(), + null, null)); + })) + .map(feedOfOrderByRowResults -> { + List unwrappedResults = new ArrayList<>(); + for (OrderByRowResult orderByRowResult : feedOfOrderByRowResults.getResults()) { + unwrappedResults.add(orderByRowResult.getPayload()); + } + FeedResponse feedResponse = BridgeInternal.createFeedResponseWithQueryMetrics(unwrappedResults, + feedOfOrderByRowResults.getResponseHeaders(), + BridgeInternal.queryMetricsFromFeedResponse(feedOfOrderByRowResults), + ModelBridgeInternal.getQueryPlanDiagnosticsContext(feedOfOrderByRowResults), + false, + false, feedOfOrderByRowResults.getCosmosDiagnostics()); + diagnosticsAccessor.addClientSideDiagnosticsToFeed( + feedResponse.getCosmosDiagnostics(), clientSideRequestStatistics); + return feedResponse; + }).switchIfEmpty(Flux.defer(() -> { + // create an empty page if there is no result + FeedResponse frp = BridgeInternal.createFeedResponseWithQueryMetrics(Utils.immutableListOf(), + headerResponse( + tracker.getAndResetCharge()), + queryMetricMap, + null, + false, + false, + null); + diagnosticsAccessor.addClientSideDiagnosticsToFeed( + frp.getCosmosDiagnostics(), clientSideRequestStatistics); + return Flux.just(frp); + })); + } + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/ParallelDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/ParallelDocumentQueryExecutionContext.java index 020b8633d2be..6ed30d3a7fbe 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/ParallelDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/ParallelDocumentQueryExecutionContext.java @@ -106,7 +106,8 @@ public static Flux> createAsync( || queryInfo.hasAggregates() || queryInfo.hasGroupBy() || queryInfo.hasDCount() - || queryInfo.hasDistinct()), + || queryInfo.hasDistinct() + || queryInfo.hasNonStreamingOrderBy()), initParams.isQueryCancelledOnTimeout()); context.setTop(initParams.getTop()); diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java index ca27fd264ac7..11a06c78e986 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java @@ -52,12 +52,17 @@ private static BiFunction, Flux { CosmosQueryRequestOptions orderByCosmosQueryRequestOptions = qryOptAccessor.clone(requestOptions); - ModelBridgeInternal.setQueryRequestOptionsContinuationToken(orderByCosmosQueryRequestOptions, continuationToken); - qryOptAccessor.getImpl(orderByCosmosQueryRequestOptions).setItemFactoryMethod(null); - documentQueryParams.setCosmosQueryRequestOptions(orderByCosmosQueryRequestOptions); - - return OrderByDocumentQueryExecutionContext.createAsync(diagnosticsClientContext, client, documentQueryParams, collection); + if (queryInfo.hasNonStreamingOrderBy()) { + qryOptAccessor.getImpl(orderByCosmosQueryRequestOptions).setItemFactoryMethod(null); + documentQueryParams.setCosmosQueryRequestOptions(orderByCosmosQueryRequestOptions); + return NonStreamingOrderByDocumentQueryExecutionContext.createAsync(diagnosticsClientContext, client, documentQueryParams, collection, 1000); + } else { + ModelBridgeInternal.setQueryRequestOptionsContinuationToken(orderByCosmosQueryRequestOptions, continuationToken); + qryOptAccessor.getImpl(orderByCosmosQueryRequestOptions).setItemFactoryMethod(null); + documentQueryParams.setCosmosQueryRequestOptions(orderByCosmosQueryRequestOptions); + return OrderByDocumentQueryExecutionContext.createAsync(diagnosticsClientContext, client, documentQueryParams, collection); + } }; } else { diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContext.java index 651b0e6cda1f..6f12e6c74f4f 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContext.java @@ -132,7 +132,7 @@ public Flux> executeAsync() { } private static QueryInfo validateQueryInfo(QueryInfo queryInfo) { - if (queryInfo.hasOrderBy() || queryInfo.hasAggregates() || queryInfo.hasGroupBy()) { + if (queryInfo.hasOrderBy() || queryInfo.hasAggregates() || queryInfo.hasGroupBy() || queryInfo.hasNonStreamingOrderBy()) { // Any query with order by, aggregates or group by needs to go through the Document query pipeline throw new IllegalStateException("This query must not use the simple query pipeline."); } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContextBase.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContextBase.java index bb8b68d854fb..c3c5482da65b 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContextBase.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContextBase.java @@ -59,7 +59,8 @@ public static Flux> createAsync( || queryInfo.hasAggregates() || queryInfo.hasGroupBy() || queryInfo.hasDCount() - || queryInfo.hasDistinct()) { + || queryInfo.hasDistinct() + || queryInfo.hasNonStreamingOrderBy()) { return PipelinedDocumentQueryExecutionContext.createAsyncCore( diagnosticsClientContext, diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryInfo.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryInfo.java index 65efb92c3325..48870a5ae52d 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryInfo.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryInfo.java @@ -36,6 +36,7 @@ public final class QueryInfo extends JsonSerializable { private DistinctQueryType distinctQueryType; private QueryPlanDiagnosticsContext queryPlanDiagnosticsContext; private DCountInfo dCountInfo; + private boolean nonStreamingOrderBy; public QueryInfo() { } @@ -160,6 +161,11 @@ public boolean hasGroupBy() { return groupByExpressions != null && !groupByExpressions.isEmpty(); } + public boolean hasNonStreamingOrderBy() { + this.nonStreamingOrderBy = Boolean.TRUE.equals(super.getBoolean("hasNonStreamingOrderBy")); + return this.nonStreamingOrderBy; + } + public Map getGroupByAliasToAggregateType(){ Map groupByAliasToAggregateMap; groupByAliasToAggregateMap = super.getMap("groupByAliasToAggregateType"); From 6f49c75162b5aab4b0cd5d39a8f05859f908d33d Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Thu, 25 Apr 2024 12:27:57 -0700 Subject: [PATCH 02/33] Initial changes --- .../CosmosQueryRequestOptionsImpl.java | 22 ++++ .../NonStreamingOrderByDocumentProducer.java | 2 +- ...gOrderByDocumentQueryExecutionContext.java | 66 +++-------- .../query/NonStreamingOrderByUtils.java | 108 ++++++++++++++++++ .../models/CosmosQueryRequestOptions.java | 20 ++++ .../cosmos/models/ModelBridgeInternal.java | 11 ++ 6 files changed, 179 insertions(+), 50 deletions(-) create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java index 4dc62089acc5..c5bc339e4d5d 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java @@ -25,6 +25,7 @@ public final class CosmosQueryRequestOptionsImpl extends CosmosQueryRequestOptio private boolean queryPlanRetrievalDisallowed; private boolean emptyPageDiagnosticsEnabled; private String queryName; + private Integer maxSizePerPartition; private List cancelledRequestDiagnosticsTracker = new ArrayList<>(); /** @@ -62,6 +63,7 @@ public CosmosQueryRequestOptionsImpl(CosmosQueryRequestOptionsImpl options) { this.queryName = options.queryName; this.feedRange = options.feedRange; this.cancelledRequestDiagnosticsTracker = options.cancelledRequestDiagnosticsTracker; + this.maxSizePerPartition = options.maxSizePerPartition; } /** @@ -196,6 +198,26 @@ public CosmosQueryRequestOptionsImpl setMaxItemCount(Integer maxItemCount) { return this; } + /** + * Gets the maximum size to fetch from a partition during non-streaming order by queries + * + * @return the max size per partition + */ + public Integer getMaxSizePerPartition() { + return maxSizePerPartition; + } + + /** + * Sets the maximum size to fetch from a partition during non-streaming order by queries + * + * @param maxSizePerPartition the max size per partition + * @return the CosmosQueryRequestOptions. + */ + public CosmosQueryRequestOptionsImpl setMaxSizePerPartition(Integer maxSizePerPartition) { + this.maxSizePerPartition = maxSizePerPartition; + return this; + } + /** * Gets the request continuation token. * diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentProducer.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentProducer.java index 35a3d4665309..c64ef5d1fbda 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentProducer.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentProducer.java @@ -16,7 +16,7 @@ import java.util.function.Function; import java.util.function.Supplier; -public class NonStreamingOrderByDocumentProducer extends DocumentProducer{ +public class NonStreamingOrderByDocumentProducer extends DocumentProducer { private final OrderbyRowComparer consumeComparer; NonStreamingOrderByDocumentProducer( diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java index 616db9ebc904..da2ed5791cc6 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java @@ -56,6 +56,7 @@ public class NonStreamingOrderByDocumentQueryExecutionContext private final RequestChargeTracker tracker; private final ConcurrentMap queryMetricMap; private final Collection clientSideRequestStatistics; + private Flux> orderByObservable; private int maxPageSizePerPartition; @@ -112,7 +113,8 @@ public static Flux> createAsync( initParams.getQueryInfo().getOrderBy(), initParams.getQueryInfo().getOrderByExpressions(), initParams.getInitialPageSize(), - collection); + collection, + ModelBridgeInternal.getMaxSizePerPartitionFromQueryRequestOptions(initParams.getCosmosQueryRequestOptions())); return Flux.just(context); } catch (CosmosException dce) { @@ -124,7 +126,8 @@ private void initialize( List feedRanges, List sortOrders, Collection orderByExpressions, int initialPageSize, - DocumentCollection collection) throws CosmosException { + DocumentCollection collection, + int maxSizePerPartition) throws CosmosException { // Since the continuation token will always be null, // we don't need to handle any initialization based on continuationToken. // We can directly initialize without any consideration for continuationToken. @@ -135,6 +138,14 @@ private void initialize( initialPageSize, new SqlQuerySpec(querySpec.getQueryText().replace(FormatPlaceHolder, True), querySpec.getParameters())); + + orderByObservable = NonStreamingOrderByUtils.nonStreamingOrderedMerge( + consumeComparer, + tracker, + documentProducers, + queryMetricMap, + maxSizePerPartition, + clientSideRequestStatistics); } @Override @@ -169,20 +180,10 @@ protected NonStreamingOrderByDocumentProducer createDocumentProducer( @Override public Flux> drainAsync(int maxPageSize) { - int adjustedMaxPageSize = Math.min(maxPageSize, maxPageSizePerPartition); - maxPageSizePerPartition -= adjustedMaxPageSize; - return Flux.defer(() -> { - List>> orderedFluxes = new ArrayList<>(); - for (DocumentProducer producer : documentProducers) { - Flux> orderedFlux = producer.produceAsync() - .transform(new PageToItemTransformer(tracker, queryMetricMap, - consumeComparer.getSortOrders(), adjustedMaxPageSize)); - orderedFluxes.add(orderedFlux); - } - return Flux.mergeOrdered(consumeComparer, orderedFluxes.toArray(new Flux[0])) - .transformDeferred(new ItemToPageTransformer(tracker, maxPageSize, queryMetricMap, - this.clientSideRequestStatistics)); - }); + return this.orderByObservable.transformDeferred(new ItemToPageTransformer(tracker, + maxPageSize, + this.queryMetricMap, + this.clientSideRequestStatistics)); } @Override @@ -190,39 +191,6 @@ public Flux> executeAsync() { return drainAsync(ModelBridgeInternal.getMaxItemCountFromQueryRequestOptions(cosmosQueryRequestOptions)); } - private static class PageToItemTransformer implements - Function.DocumentProducerFeedResponse>, Flux>> { - private final RequestChargeTracker tracker; - private final Map queryMetricsMap; - private final List sortOrders; - private final int maxPageSize; - - public PageToItemTransformer( - RequestChargeTracker tracker, Map queryMetricsMap, - List sortOrders, int maxPageSize) { - this.tracker = tracker; - this.queryMetricsMap = queryMetricsMap; - this.sortOrders = sortOrders; - this.maxPageSize = maxPageSize; - } - - @Override - public Flux> apply(Flux.DocumentProducerFeedResponse> source) { - return source.flatMap(documentProducerFeedResponse -> { - QueryMetrics.mergeQueryMetricsMap(queryMetricsMap, - BridgeInternal.queryMetricsFromFeedResponse(documentProducerFeedResponse.pageResult)); - List results = documentProducerFeedResponse.pageResult.getResults(); - tracker.addCharge(documentProducerFeedResponse.pageResult.getRequestCharge()); - int pageSize = Math.min(maxPageSize, results.size()); - return Flux.fromIterable(results.subList(0, pageSize)) - .map(r -> new OrderByRowResult( - ModelBridgeInternal.toJsonFromJsonSerializable(r), - documentProducerFeedResponse.sourceFeedRange, - null)); // Continuation token is always null - }, 1); - } - } - private static class ItemToPageTransformer implements Function>, Flux>> { private final static int DEFAULT_PAGE_SIZE = 100; diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java new file mode 100644 index 000000000000..c73a63bd0ea0 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java @@ -0,0 +1,108 @@ +package com.azure.cosmos.implementation.query; + +import com.azure.cosmos.BridgeInternal; +import com.azure.cosmos.implementation.ClientSideRequestStatistics; +import com.azure.cosmos.implementation.Document; +import com.azure.cosmos.implementation.ImplementationBridgeHelpers; +import com.azure.cosmos.implementation.QueryMetrics; +import com.azure.cosmos.implementation.RequestChargeTracker; +import com.azure.cosmos.implementation.Resource; +import com.azure.cosmos.implementation.query.orderbyquery.OrderByRowResult; +import com.azure.cosmos.implementation.query.orderbyquery.OrderbyRowComparer; +import com.azure.cosmos.models.ModelBridgeInternal; +import reactor.core.publisher.Flux; + +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.PriorityQueue; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.function.Function; + +public class NonStreamingOrderByUtils { + private final static + ImplementationBridgeHelpers.CosmosDiagnosticsHelper.CosmosDiagnosticsAccessor diagnosticsAccessor = + ImplementationBridgeHelpers.CosmosDiagnosticsHelper.getCosmosDiagnosticsAccessor(); + + public static Flux> nonStreamingOrderedMerge(OrderbyRowComparer consumeComparer, + RequestChargeTracker tracker, + List> documentProducers, + Map queryMetricsMap, + int maxSizePerPartition, + Collection clientSideRequestStatistics) { + @SuppressWarnings("unchecked") + Flux>[] fluxes = documentProducers + .subList(0, documentProducers.size()) + .stream() + .map(producer -> + toNonStreamingOrderByQueryResultObservable(producer, tracker, queryMetricsMap, + maxSizePerPartition, consumeComparer, clientSideRequestStatistics)) + .toArray(Flux[]::new); + return Flux.mergeOrdered(consumeComparer, fluxes); + } + + private static Flux> toNonStreamingOrderByQueryResultObservable(DocumentProducer producer, + RequestChargeTracker tracker, + Map queryMetricsMap, + int maxSizePerPartition, + OrderbyRowComparer consumeComparer, + Collection clientSideRequestStatisticsList) { + return producer + .produceAsync() + .transformDeferred(new NonStreamingOrderByUtils.PageToItemTransformer(tracker, queryMetricsMap, + maxSizePerPartition, consumeComparer, clientSideRequestStatisticsList)); + } + + private static class PageToItemTransformer implements + Function.DocumentProducerFeedResponse>, Flux>> { + private final RequestChargeTracker tracker; + private final Map queryMetricsMap; + private final Integer maxSizePerPartition; + private final OrderbyRowComparer consumeComparer; + private final Collection clientSideRequestStatistics; + + private PageToItemTransformer(RequestChargeTracker tracker, Map queryMetricsMap, + Integer maxSizePerPartition, OrderbyRowComparer consumeComparer, + Collection clientSideRequestStatistics) { + this.tracker = tracker; + this.queryMetricsMap = queryMetricsMap; + this.maxSizePerPartition = maxSizePerPartition; + this.consumeComparer = consumeComparer; + this.clientSideRequestStatistics = clientSideRequestStatistics; + } + + @Override + public Flux> apply(Flux.DocumentProducerFeedResponse> source) { + PriorityQueue> priorityQueue = new PriorityQueue<>(consumeComparer); + AtomicBoolean emitFlag = new AtomicBoolean(true); + + return source.flatMap(documentProducerFeedResponse -> { + // Checks if the max size has been reached, if so, stop processing new pages + if (emitFlag.get()) { + clientSideRequestStatistics.addAll( + diagnosticsAccessor.getClientSideRequestStatisticsForQueryPipelineAggregations(documentProducerFeedResponse + .pageResult.getCosmosDiagnostics())); + + QueryMetrics.mergeQueryMetricsMap(queryMetricsMap, + BridgeInternal.queryMetricsFromFeedResponse(documentProducerFeedResponse.pageResult)); + List results = documentProducerFeedResponse.pageResult.getResults(); + results.forEach(r -> { + OrderByRowResult orderByRowResult = new OrderByRowResult( + ModelBridgeInternal.toJsonFromJsonSerializable(r), + documentProducerFeedResponse.sourceFeedRange, + null); + if (priorityQueue.size() < maxSizePerPartition) { + priorityQueue.add(orderByRowResult); + } else { + emitFlag.set(false); + } + }); + tracker.addCharge(documentProducerFeedResponse.pageResult.getRequestCharge()); + } + // Returning an empty Flux since we are only processing and managing state here + return Flux.empty(); + }, 1) + .thenMany(Flux.defer(() -> Flux.fromIterable(priorityQueue))); + } + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java index b86911884aad..352f86a98190 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java @@ -255,6 +255,26 @@ CosmosQueryRequestOptions setMaxItemCount(Integer maxItemCount) { return this; } + /** + * Gets the maximum size to fetch from a partition during non-streaming order by queries + * + * @return the max size per partition + */ + public Integer getMaxSizePerPartition() { + return this.actualRequestOptions.getMaxSizePerPartition(); + } + + /** + * Sets the maximum size to fetch from a partition during non-streaming order by queries + * + * @param maxSizePerPartition the max size per partition + * @return the CosmosQueryRequestOptions. + */ + public CosmosQueryRequestOptions setMaxSizePerPartition(Integer maxSizePerPartition) { + this.actualRequestOptions.setMaxSizePerPartition(maxSizePerPartition); + return this; + } + /** * Gets the request continuation token. * diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java index 8a589d7cd421..08a9a4dfcae4 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java @@ -555,6 +555,12 @@ public static void setQueryRequestOptionsMaxItemCount(CosmosQueryRequestOptions cosmosQueryRequestOptions.setMaxItemCount(maxItemCount); } + @Warning(value = INTERNAL_USE_ONLY_WARNING) + public static void setMaxSizePerPartitionFromQueryRequestOptions(CosmosQueryRequestOptions options, Integer maxSizePerPartition) { + options.setMaxSizePerPartition(maxSizePerPartition); + } + + @Warning(value = INTERNAL_USE_ONLY_WARNING) public static CosmosChangeFeedRequestOptions getEffectiveChangeFeedRequestOptions( CosmosChangeFeedRequestOptions cosmosChangeFeedRequestOptions, @@ -703,6 +709,11 @@ public static Integer getMaxItemCountFromQueryRequestOptions(CosmosQueryRequestO return options.getMaxItemCount(); } + @Warning(value = INTERNAL_USE_ONLY_WARNING) + public static Integer getMaxSizePerPartitionFromQueryRequestOptions(CosmosQueryRequestOptions options) { + return options.getMaxSizePerPartition(); + } + @Warning(value = INTERNAL_USE_ONLY_WARNING) public static String getRequestContinuationFromQueryRequestOptions(CosmosQueryRequestOptions options) { return options.getRequestContinuation(); From 528a0ebd7ddd39a6883931adc10d27a56f14daa3 Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Thu, 2 May 2024 08:18:18 -0700 Subject: [PATCH 03/33] [Cosmos][VectorIndex]Adding changes for vectorIndex and vectorEmbeddingPolicy (#40004) * Adding changes for vectorIndex and vectorEmbeddingPolicy * Adding some necessary comments * Adding test case * updating enum values * Updating test case * Updating test case * Updating test case * updating changelog * Updating test case * Resolving comments * Resolving comments * Fixing test case * Resolving comments * Resolving Comments * Fixing build issues * Resolving comments * Resolving Comments --- .../com/azure/cosmos/rx/VectorIndexTest.java | 345 ++++++++++++++++++ sdk/cosmos/azure-cosmos/CHANGELOG.md | 3 +- .../cosmos/implementation/Constants.java | 9 + .../implementation/DocumentCollection.java | 33 +- .../azure/cosmos/models/CompositePath.java | 2 +- .../models/CosmosContainerProperties.java | 22 ++ .../cosmos/models/CosmosVectorDataType.java | 58 +++ .../models/CosmosVectorDistanceFunction.java | 53 +++ .../cosmos/models/CosmosVectorEmbedding.java | 128 +++++++ .../models/CosmosVectorEmbeddingPolicy.java | 55 +++ .../cosmos/models/CosmosVectorIndexSpec.java | 77 ++++ .../cosmos/models/CosmosVectorIndexType.java | 36 ++ .../azure/cosmos/models/IndexingPolicy.java | 59 ++- .../cosmos/models/ModelBridgeInternal.java | 4 + 14 files changed, 874 insertions(+), 10 deletions(-) create mode 100644 sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDataType.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDistanceFunction.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbedding.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbeddingPolicy.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexSpec.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexType.java diff --git a/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java new file mode 100644 index 000000000000..74f13be9d4f4 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.rx; + +import com.azure.cosmos.ConsistencyLevel; +import com.azure.cosmos.CosmosAsyncClient; +import com.azure.cosmos.CosmosAsyncContainer; +import com.azure.cosmos.CosmosAsyncDatabase; +import com.azure.cosmos.CosmosClientBuilder; +import com.azure.cosmos.CosmosDatabaseForTest; +import com.azure.cosmos.CosmosException; +import com.azure.cosmos.DirectConnectionConfig; +import com.azure.cosmos.implementation.TestConfigurations; +import com.azure.cosmos.implementation.Utils; +import com.azure.cosmos.implementation.guava25.collect.ImmutableList; +import com.azure.cosmos.models.CosmosContainerProperties; +import com.azure.cosmos.models.CosmosVectorDataType; +import com.azure.cosmos.models.CosmosVectorDistanceFunction; +import com.azure.cosmos.models.CosmosVectorEmbedding; +import com.azure.cosmos.models.CosmosVectorEmbeddingPolicy; +import com.azure.cosmos.models.ExcludedPath; +import com.azure.cosmos.models.IncludedPath; +import com.azure.cosmos.models.IndexingMode; +import com.azure.cosmos.models.IndexingPolicy; +import com.azure.cosmos.models.PartitionKeyDefinition; +import com.azure.cosmos.models.CosmosVectorIndexSpec; +import com.azure.cosmos.models.CosmosVectorIndexType; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Ignore; +import org.testng.annotations.Test; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.UUID; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; + +@Ignore("TODO: Ignore these test cases until the public emulator with vector indexes is released.") +public class VectorIndexTest extends TestSuiteBase { + protected static final int TIMEOUT = 30000; + protected static final int SETUP_TIMEOUT = 20000; + protected static final int SHUTDOWN_TIMEOUT = 20000; + + protected static Logger logger = LoggerFactory.getLogger(VectorIndexTest.class.getSimpleName()); + private final ObjectMapper simpleObjectMapper = Utils.getSimpleObjectMapper(); + private final String databaseId = CosmosDatabaseForTest.generateId(); + private CosmosAsyncClient client; + private CosmosAsyncDatabase database; + + @BeforeClass(groups = {"emulator"}, timeOut = SETUP_TIMEOUT) + public void before_VectorIndexTest() { + // set up the client + client = new CosmosClientBuilder() + .endpoint(TestConfigurations.HOST) + .key(TestConfigurations.MASTER_KEY) + .directMode(DirectConnectionConfig.getDefaultConfig()) + .consistencyLevel(ConsistencyLevel.SESSION) + .contentResponseOnWriteEnabled(true) + .buildAsyncClient(); + + database = createDatabase(client, databaseId); + } + + @AfterClass(groups = {"emulator"}, timeOut = SHUTDOWN_TIMEOUT, alwaysRun = true) + public void afterClass() { + safeDeleteDatabase(database); + safeClose(client); + } + + @Test(groups = {"emulator"}, timeOut = TIMEOUT*10000) + public void shouldCreateVectorEmbeddingPolicy() { + PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); + ArrayList paths = new ArrayList(); + paths.add("/mypk"); + partitionKeyDef.setPaths(paths); + + CosmosContainerProperties collectionDefinition = new CosmosContainerProperties(UUID.randomUUID().toString(), partitionKeyDef); + + IndexingPolicy indexingPolicy = new IndexingPolicy(); + indexingPolicy.setIndexingMode(IndexingMode.CONSISTENT); + ExcludedPath excludedPath = new ExcludedPath("/*"); + indexingPolicy.setExcludedPaths(Collections.singletonList(excludedPath)); + + IncludedPath includedPath1 = new IncludedPath("/name/?"); + IncludedPath includedPath2 = new IncludedPath("/description/?"); + indexingPolicy.setIncludedPaths(ImmutableList.of(includedPath1, includedPath2)); + + indexingPolicy.setVectorIndexes(populateVectorIndexes()); + + CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy = new CosmosVectorEmbeddingPolicy(); + cosmosVectorEmbeddingPolicy.setCosmosVectorEmbeddings(populateEmbeddings()); + + collectionDefinition.setIndexingPolicy(indexingPolicy); + collectionDefinition.setVectorEmbeddingPolicy(cosmosVectorEmbeddingPolicy); + + database.createContainer(collectionDefinition).block(); + CosmosAsyncContainer createdCollection = database.getContainer(collectionDefinition.getId()); + CosmosContainerProperties collectionProperties = createdCollection.read().block().getProperties(); + validateCollectionProperties(collectionDefinition, collectionProperties); + } + + @Test(groups = {"emulator"}, timeOut = TIMEOUT) + public void shouldFailOnEmptyVectorEmbeddingPolicy() { + PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); + ArrayList paths = new ArrayList(); + paths.add("/mypk"); + partitionKeyDef.setPaths(paths); + + CosmosContainerProperties collectionDefinition = new CosmosContainerProperties(UUID.randomUUID().toString(), partitionKeyDef); + + IndexingPolicy indexingPolicy = new IndexingPolicy(); + indexingPolicy.setIndexingMode(IndexingMode.CONSISTENT); + ExcludedPath excludedPath = new ExcludedPath("/*"); + indexingPolicy.setExcludedPaths(Collections.singletonList(excludedPath)); + + IncludedPath includedPath1 = new IncludedPath("/name/?"); + IncludedPath includedPath2 = new IncludedPath("/description/?"); + indexingPolicy.setIncludedPaths(ImmutableList.of(includedPath1, includedPath2)); + + CosmosVectorIndexSpec cosmosVectorIndexSpec = new CosmosVectorIndexSpec(); + cosmosVectorIndexSpec.setPath("/vector1"); + cosmosVectorIndexSpec.setType(CosmosVectorIndexType.FLAT.toString()); + indexingPolicy.setVectorIndexes(ImmutableList.of(cosmosVectorIndexSpec)); + + collectionDefinition.setIndexingPolicy(indexingPolicy); + + try { + database.createContainer(collectionDefinition).block(); + fail("Container creation will fail as no vector embedding policy is being passed"); + } catch (CosmosException ex) { + assertThat(ex.getStatusCode()).isEqualTo(400); + assertThat(ex.getMessage()).contains("vector1 not matching in Embedding's path"); + } + } + + @Test(groups = {"emulator"}, timeOut = TIMEOUT) + public void shouldFailOnWrongVectorIndex() { + PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); + ArrayList paths = new ArrayList(); + paths.add("/mypk"); + partitionKeyDef.setPaths(paths); + + CosmosContainerProperties collectionDefinition = new CosmosContainerProperties(UUID.randomUUID().toString(), partitionKeyDef); + + IndexingPolicy indexingPolicy = new IndexingPolicy(); + indexingPolicy.setIndexingMode(IndexingMode.CONSISTENT); + ExcludedPath excludedPath = new ExcludedPath("/*"); + indexingPolicy.setExcludedPaths(Collections.singletonList(excludedPath)); + + IncludedPath includedPath1 = new IncludedPath("/name/?"); + IncludedPath includedPath2 = new IncludedPath("/description/?"); + indexingPolicy.setIncludedPaths(ImmutableList.of(includedPath1, includedPath2)); + + CosmosVectorIndexSpec cosmosVectorIndexSpec = new CosmosVectorIndexSpec(); + cosmosVectorIndexSpec.setPath("/vector1"); + cosmosVectorIndexSpec.setType("NonFlat"); + indexingPolicy.setVectorIndexes(ImmutableList.of(cosmosVectorIndexSpec)); + collectionDefinition.setIndexingPolicy(indexingPolicy); + + CosmosVectorEmbedding embedding = new CosmosVectorEmbedding(); + embedding.setPath("/vector1"); + embedding.setDataType(CosmosVectorDataType.FLOAT32); + embedding.setDimensions(3L); + embedding.setDistanceFunction(CosmosVectorDistanceFunction.COSINE); + CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy = new CosmosVectorEmbeddingPolicy(); + cosmosVectorEmbeddingPolicy.setCosmosVectorEmbeddings(ImmutableList.of(embedding)); + collectionDefinition.setVectorEmbeddingPolicy(cosmosVectorEmbeddingPolicy); + + try { + database.createContainer(collectionDefinition).block(); + fail("Container creation will fail as wrong vector index type is being passed"); + } catch (CosmosException ex) { + assertThat(ex.getStatusCode()).isEqualTo(400); + assertThat(ex.getMessage()).contains("NonFlat is invalid, Valid types are 'flat' or 'quantizedFlat'"); + } + } + + @Test(groups = {"emulator"}, timeOut = TIMEOUT) + public void shouldCreateVectorIndexSimilarPathDifferentVectorType() { + PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); + ArrayList paths = new ArrayList(); + paths.add("/mypk"); + partitionKeyDef.setPaths(paths); + + CosmosContainerProperties collectionDefinition = new CosmosContainerProperties(UUID.randomUUID().toString(), partitionKeyDef); + + IndexingPolicy indexingPolicy = new IndexingPolicy(); + indexingPolicy.setIndexingMode(IndexingMode.CONSISTENT); + ExcludedPath excludedPath = new ExcludedPath("/*"); + indexingPolicy.setExcludedPaths(Collections.singletonList(excludedPath)); + + IncludedPath includedPath1 = new IncludedPath("/name/?"); + IncludedPath includedPath2 = new IncludedPath("/description/?"); + indexingPolicy.setIncludedPaths(ImmutableList.of(includedPath1, includedPath2)); + + List vectorIndexes = populateVectorIndexes(); + vectorIndexes.get(2).setPath("/vector2"); + indexingPolicy.setVectorIndexes(vectorIndexes); + + List embeddings = populateEmbeddings(); + embeddings.get(2).setPath("/vector2"); + CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy = new CosmosVectorEmbeddingPolicy(); + cosmosVectorEmbeddingPolicy.setCosmosVectorEmbeddings(embeddings); + + collectionDefinition.setIndexingPolicy(indexingPolicy); + collectionDefinition.setVectorEmbeddingPolicy(cosmosVectorEmbeddingPolicy); + + database.createContainer(collectionDefinition).block(); + CosmosAsyncContainer createdCollection = database.getContainer(collectionDefinition.getId()); + CosmosContainerProperties collectionProperties = createdCollection.read().block().getProperties(); + validateCollectionProperties(collectionDefinition, collectionProperties); + } + + @Test(groups = {"unit"}, timeOut = TIMEOUT) + public void shouldFailOnWrongVectorEmbeddingPolicy() { + CosmosVectorEmbedding embedding = new CosmosVectorEmbedding(); + try { + + embedding.setDataType(null); + fail("Embedding creation failed because cosmosVectorDataType argument is empty"); + } catch (NullPointerException ex) { + assertThat(ex.getMessage()).isEqualTo("cosmosVectorDataType cannot be empty"); + } + + try { + embedding.setDistanceFunction(null); + fail("Embedding creation failed because cosmosVectorDistanceFunction argument is empty"); + } catch (NullPointerException ex) { + assertThat(ex.getMessage()).isEqualTo("cosmosVectorDistanceFunction cannot be empty"); + } + + try { + embedding.setDimensions(null); + fail("Embedding creation failed because dimensions argument is empty"); + } catch (NullPointerException ex) { + assertThat(ex.getMessage()).isEqualTo("dimensions cannot be empty"); + } + + try { + embedding.setDimensions(-1L); + fail("Vector Embedding policy creation will fail for negative dimensions being passed"); + } catch (IllegalArgumentException ex) { + assertThat(ex.getMessage()).isEqualTo("Dimensions for the embedding has to be a long value greater than 1 for the vector embedding policy"); + } + } + + @Test(groups = {"unit"}, timeOut = TIMEOUT) + public void shouldValidateVectorEmbeddingPolicySerializationAndDeserialization() throws JsonProcessingException { + IndexingPolicy indexingPolicy = new IndexingPolicy(); + indexingPolicy.setVectorIndexes(populateVectorIndexes()); + + CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy = new CosmosVectorEmbeddingPolicy(); + cosmosVectorEmbeddingPolicy.setCosmosVectorEmbeddings(populateEmbeddings()); + String vectorEmbeddingPolicyJson = getVectorEmbeddingPolicyAsString(); + String expectedVectorEmbeddingPolicyJson = simpleObjectMapper.writeValueAsString(cosmosVectorEmbeddingPolicy); + assertThat(vectorEmbeddingPolicyJson).isEqualTo(expectedVectorEmbeddingPolicyJson); + + CosmosVectorEmbeddingPolicy expectedCosmosVectorEmbeddingPolicy = simpleObjectMapper.readValue(expectedVectorEmbeddingPolicyJson, CosmosVectorEmbeddingPolicy.class); + validateVectorEmbeddingPolicy(cosmosVectorEmbeddingPolicy, expectedCosmosVectorEmbeddingPolicy); + } + + private void validateCollectionProperties(CosmosContainerProperties collectionDefinition, CosmosContainerProperties collectionProperties) { + assertThat(collectionProperties.getVectorEmbeddingPolicy()).isNotNull(); + assertThat(collectionProperties.getVectorEmbeddingPolicy().getVectorEmbeddings()).isNotNull(); + validateVectorEmbeddingPolicy(collectionProperties.getVectorEmbeddingPolicy(), + collectionDefinition.getVectorEmbeddingPolicy()); + + assertThat(collectionProperties.getIndexingPolicy().getVectorIndexes()).isNotNull(); + validateVectorIndexes(collectionDefinition.getIndexingPolicy().getVectorIndexes(), collectionProperties.getIndexingPolicy().getVectorIndexes()); + } + + private void validateVectorEmbeddingPolicy(CosmosVectorEmbeddingPolicy actual, CosmosVectorEmbeddingPolicy expected) { + List actualEmbeddings = actual.getVectorEmbeddings(); + List expectedEmbeddings = expected.getVectorEmbeddings(); + assertThat(expectedEmbeddings).hasSameSizeAs(actualEmbeddings); + for (int i = 0; i < expectedEmbeddings.size(); i++) { + assertThat(expectedEmbeddings.get(i).getPath()).isEqualTo(actualEmbeddings.get(i).getPath()); + assertThat(expectedEmbeddings.get(i).getDataType()).isEqualTo(actualEmbeddings.get(i).getDataType()); + assertThat(expectedEmbeddings.get(i).getDimensions()).isEqualTo(actualEmbeddings.get(i).getDimensions()); + assertThat(expectedEmbeddings.get(i).getDistanceFunction()).isEqualTo(actualEmbeddings.get(i).getDistanceFunction()); + } + } + + private void validateVectorIndexes(List actual, List expected) { + assertThat(expected).hasSameSizeAs(actual); + for (int i = 0; i < expected.size(); i++) { + assertThat(expected.get(i).getPath()).isEqualTo(actual.get(i).getPath()); + assertThat(expected.get(i).getType()).isEqualTo(actual.get(i).getType()); + } + } + + private List populateVectorIndexes() { + CosmosVectorIndexSpec cosmosVectorIndexSpec1 = new CosmosVectorIndexSpec(); + cosmosVectorIndexSpec1.setPath("/vector1"); + cosmosVectorIndexSpec1.setType(CosmosVectorIndexType.FLAT.toString()); + + CosmosVectorIndexSpec cosmosVectorIndexSpec2 = new CosmosVectorIndexSpec(); + cosmosVectorIndexSpec2.setPath("/vector2"); + cosmosVectorIndexSpec2.setType(CosmosVectorIndexType.QUANTIZED_FLAT.toString()); + + CosmosVectorIndexSpec cosmosVectorIndexSpec3 = new CosmosVectorIndexSpec(); + cosmosVectorIndexSpec3.setPath("/vector3"); + cosmosVectorIndexSpec3.setType(CosmosVectorIndexType.DISK_ANN.toString()); + + return Arrays.asList(cosmosVectorIndexSpec1, cosmosVectorIndexSpec2, cosmosVectorIndexSpec3); + } + + private List populateEmbeddings() { + CosmosVectorEmbedding embedding1 = new CosmosVectorEmbedding(); + embedding1.setPath("/vector1"); + embedding1.setDataType(CosmosVectorDataType.INT8); + embedding1.setDimensions(3L); + embedding1.setDistanceFunction(CosmosVectorDistanceFunction.COSINE); + + CosmosVectorEmbedding embedding2 = new CosmosVectorEmbedding(); + embedding2.setPath("/vector2"); + embedding2.setDataType(CosmosVectorDataType.FLOAT32); + embedding2.setDimensions(3L); + embedding2.setDistanceFunction(CosmosVectorDistanceFunction.DOT_PRODUCT); + + CosmosVectorEmbedding embedding3 = new CosmosVectorEmbedding(); + embedding3.setPath("/vector3"); + embedding3.setDataType(CosmosVectorDataType.UINT8); + embedding3.setDimensions(3L); + embedding3.setDistanceFunction(CosmosVectorDistanceFunction.EUCLIDEAN); + return Arrays.asList(embedding1, embedding2, embedding3); + } + + private String getVectorEmbeddingPolicyAsString() { + return "{\"vectorEmbeddings\":[" + + "{\"path\":\"/vector1\",\"dataType\":\"int8\",\"dimensions\":3,\"distanceFunction\":\"cosine\"}," + + "{\"path\":\"/vector2\",\"dataType\":\"float32\",\"dimensions\":3,\"distanceFunction\":\"dotproduct\"}," + + "{\"path\":\"/vector3\",\"dataType\":\"uint8\",\"dimensions\":3,\"distanceFunction\":\"euclidean\"}" + + "]}"; + } +} diff --git a/sdk/cosmos/azure-cosmos/CHANGELOG.md b/sdk/cosmos/azure-cosmos/CHANGELOG.md index 4ea8a84052bd..28c11dc76f12 100644 --- a/sdk/cosmos/azure-cosmos/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos/CHANGELOG.md @@ -13,8 +13,9 @@ ### 4.59.0 (2024-04-27) #### Features Added +* Added `cosmosVectorEmbeddingPolicy` in `cosmosContainerProperties` and `vectorIndexes` in `indexPolicy` to support vector search in CosmosDB - See[39379](https://github.com/Azure/azure-sdk-for-java/pull/39379) * Added public APIs `getCustomItemSerializer` and `setCustomItemSerializer` to allow customers to specify custom payload transformations or serialization settings. - See [PR 38997](https://github.com/Azure/azure-sdk-for-java/pull/38997) and [PR 39933](https://github.com/Azure/azure-sdk-for-java/pull/39933) - + #### Other Changes * Load Blackbird or Afterburner into the ObjectMapper depending upon Java version and presence of modules in classpath. Make Afterburner and Blackbird optional maven dependencies. See - [PR 39689](https://github.com/Azure/azure-sdk-for-java/pull/39689) diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Constants.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Constants.java index 8409d5b7ec23..f789963783ed 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Constants.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Constants.java @@ -120,6 +120,15 @@ public static final class Properties { public static final String SPATIAL_INDEXES = "spatialIndexes"; public static final String TYPES = "types"; + // Vector Embedding Policy + public static final String VECTOR_EMBEDDING_POLICY = "vectorEmbeddingPolicy"; + public static final String VECTOR_INDEXES = "vectorIndexes"; + public static final String VECTOR_EMBEDDINGS = "vectorEmbeddings"; + public static final String VECTOR_INDEX_TYPE = "type"; + public static final String VECTOR_DATA_TYPE = "dataType"; + public static final String VECTOR_DIMENSIONS = "dimensions"; + public static final String DISTANCE_FUNCTION = "distanceFunction"; + // Unique index. public static final String UNIQUE_KEY_POLICY = "uniqueKeyPolicy"; public static final String UNIQUE_KEYS = "uniqueKeys"; diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentCollection.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentCollection.java index 678bdb90378c..1930f2275a61 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentCollection.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentCollection.java @@ -6,10 +6,11 @@ import com.azure.cosmos.CosmosItemSerializer; import com.azure.cosmos.implementation.apachecommons.lang.StringUtils; import com.azure.cosmos.implementation.caches.SerializableWrapper; -import com.azure.cosmos.models.ClientEncryptionPolicy; import com.azure.cosmos.models.ChangeFeedPolicy; +import com.azure.cosmos.models.ClientEncryptionPolicy; import com.azure.cosmos.models.ComputedProperty; import com.azure.cosmos.models.ConflictResolutionPolicy; +import com.azure.cosmos.models.CosmosVectorEmbeddingPolicy; import com.azure.cosmos.models.IndexingPolicy; import com.azure.cosmos.models.ModelBridgeInternal; import com.azure.cosmos.models.PartitionKeyDefinition; @@ -24,6 +25,8 @@ import java.util.Collection; import java.util.Collections; +import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; + /** * Represents a document collection in the Azure Cosmos DB database service. A collection is a named logical container * for documents. @@ -40,6 +43,7 @@ public final class DocumentCollection extends Resource { private UniqueKeyPolicy uniqueKeyPolicy; private PartitionKeyDefinition partitionKeyDefinition; private ClientEncryptionPolicy clientEncryptionPolicyInternal; + private CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy; /** * Constructor. @@ -410,6 +414,33 @@ public void setClientEncryptionPolicy(ClientEncryptionPolicy value) { this.set(Constants.Properties.CLIENT_ENCRYPTION_POLICY, value, CosmosItemSerializer.DEFAULT_SERIALIZER); } + /** + * Gets the Vector Embedding Policy containing paths for embeddings along with path-specific settings for the item + * used in performing vector search on the items in a collection in the Azure CosmosDB database service. + * + * @return the Vector Embedding Policy. + */ + public CosmosVectorEmbeddingPolicy getVectorEmbeddingPolicy() { + if (this.cosmosVectorEmbeddingPolicy == null) { + if (super.has(Constants.Properties.VECTOR_EMBEDDING_POLICY)) { + this.cosmosVectorEmbeddingPolicy = super.getObject(Constants.Properties.VECTOR_EMBEDDING_POLICY, + CosmosVectorEmbeddingPolicy.class); + } + } + return this.cosmosVectorEmbeddingPolicy; + } + + /** + * Sets the Vector Embedding Policy containing paths for embeddings along with path-specific settings for the item + * used in performing vector search on the items in a collection in the Azure CosmosDB database service. + * + * @param value the Vector Embedding Policy. + */ + public void setVectorEmbeddingPolicy(CosmosVectorEmbeddingPolicy value) { + checkNotNull(value, "cosmosVectorEmbeddingPolicy cannot be null"); + this.set(Constants.Properties.VECTOR_EMBEDDING_POLICY, value, CosmosItemSerializer.DEFAULT_SERIALIZER); + } + public void populatePropertyBag() { super.populatePropertyBag(); if (this.indexingPolicy == null) { diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CompositePath.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CompositePath.java index a278e0aa8f50..8cfd99b46e37 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CompositePath.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CompositePath.java @@ -93,7 +93,7 @@ public CompositePathSortOrder getOrder() { } /** - * Gets the sort order for the composite path. + * Sets the sort order for the composite path. *

* For example if you want to run the query "SELECT * FROM c ORDER BY c.age asc, c.height desc", * then you need to make the order for "/age" "ascending" and the order for "/height" "descending". diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java index 4fae5a797a70..0d357da0cc37 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java @@ -347,6 +347,28 @@ public CosmosContainerProperties setClientEncryptionPolicy(ClientEncryptionPolic return this; } + /** + * Gets the Vector Embedding Policy containing paths for embeddings along with path-specific settings for the item + * used in performing vector search on the items in a collection in the Azure CosmosDB database service. + * + * @return the Vector Embedding Policy. + */ + public CosmosVectorEmbeddingPolicy getVectorEmbeddingPolicy() { + return this.documentCollection.getVectorEmbeddingPolicy(); + } + + /** + * Sets the Vector Embedding Policy containing paths for embeddings along with path-specific settings for the item + * used in performing vector search on the items in a collection in the Azure CosmosDB database service. + * + * @param value the Vector Embedding Policy. + * @return the CosmosContainerProperties. + */ + public CosmosContainerProperties setVectorEmbeddingPolicy(CosmosVectorEmbeddingPolicy value) { + this.documentCollection.setVectorEmbeddingPolicy(value); + return this; + } + Resource getResource() { return this.documentCollection; } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDataType.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDataType.java new file mode 100644 index 000000000000..1a0d42af17a4 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDataType.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.models; + +import com.fasterxml.jackson.annotation.JsonValue; + +import java.util.Arrays; + +/** + * Data types for the embeddings in Cosmos DB database service. + */ +public enum CosmosVectorDataType { + /** + * Represents a int8 data type. + */ + INT8("int8"), + + /** + * Represents a uint8 data type. + */ + UINT8("uint8"), + + /** + * Represents a float16 data type. + */ + FLOAT16("float16"), + + /** + * Represents a float32 data type. + */ + FLOAT32("float32"); + + private final String overWireValue; + + CosmosVectorDataType(String overWireValue) { + this.overWireValue = overWireValue; + } + + @JsonValue + @Override + public String toString() { + return this.overWireValue; + } + + /** + * Method to retrieve the enum constant by its overWireValue. + * @param value the overWire value of the enum constant + * @return the matching CosmosVectorDataType + * @throws IllegalArgumentException if no matching enum constant is found + */ + public static CosmosVectorDataType fromString(String value) { + return Arrays.stream(CosmosVectorDataType.values()) + .filter(vectorDataType -> vectorDataType.toString().equalsIgnoreCase(value)) + .findFirst() + .orElseThrow(() -> new IllegalArgumentException("Invalid vector data type for the vector embedding policy.")); + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDistanceFunction.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDistanceFunction.java new file mode 100644 index 000000000000..60efd432ad7f --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDistanceFunction.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.models; + +import com.fasterxml.jackson.annotation.JsonValue; + +import java.util.Arrays; + +/** + * Distance Function for the embeddings in the Cosmos DB database service. + */ +public enum CosmosVectorDistanceFunction { + /** + * Represents the euclidean distance function. + */ + EUCLIDEAN("euclidean"), + + /** + * Represents the cosine distance function. + */ + COSINE("cosine"), + + /** + * Represents the dot product distance function. + */ + DOT_PRODUCT("dotproduct"); + + private final String overWireValue; + + CosmosVectorDistanceFunction(String overWireValue) { + this.overWireValue = overWireValue; + } + + @JsonValue + @Override + public String toString() { + return this.overWireValue; + } + + /** + * Method to retrieve the enum constant by its overWireValue. + * @param value the overWire value of the enum constant + * @return the matching CosmosVectorDataType + * @throws IllegalArgumentException if no matching enum constant is found + */ + public static CosmosVectorDistanceFunction fromString(String value) { + return Arrays.stream(CosmosVectorDistanceFunction.values()) + .filter(vectorDistanceFunction -> vectorDistanceFunction.toString().equalsIgnoreCase(value)) + .findFirst() + .orElseThrow(() -> new IllegalArgumentException("Invalid distance function for the vector embedding policy.")); + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbedding.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbedding.java new file mode 100644 index 000000000000..94a519ef9d38 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbedding.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.models; + +import com.azure.cosmos.implementation.Constants; +import com.azure.cosmos.implementation.JsonSerializable; +import com.azure.cosmos.implementation.apachecommons.lang.StringUtils; +import com.fasterxml.jackson.annotation.JsonProperty; +import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; + +/** + * Embedding settings within {@link CosmosVectorEmbeddingPolicy} + */ +public final class CosmosVectorEmbedding { + @JsonProperty(Constants.Properties.PATH) + private String path; + @JsonProperty(Constants.Properties.VECTOR_DATA_TYPE) + private String dataType; + @JsonProperty(Constants.Properties.VECTOR_DIMENSIONS) + private Long dimensions; + @JsonProperty(Constants.Properties.DISTANCE_FUNCTION) + private String distanceFunction; + private JsonSerializable jsonSerializable; + + /** + * Constructor + */ + public CosmosVectorEmbedding() { + this.jsonSerializable = new JsonSerializable(); + } + + /** + * Gets the path for the cosmosVectorEmbedding. + * + * @return path + */ + public String getPath() { + return path; + } + + /** + * Sets the path for the cosmosVectorEmbedding. + * + * @param path the path for the cosmosVectorEmbedding + * @return CosmosVectorEmbedding + */ + public CosmosVectorEmbedding setPath(String path) { + if (StringUtils.isEmpty(path)) { + throw new NullPointerException("embedding path is empty"); + } + + if (path.charAt(0) != '/' || path.lastIndexOf('/') != 0) { + throw new IllegalArgumentException(""); + } + + this.path = path; + return this; + } + + /** + * Gets the data type for the cosmosVectorEmbedding. + * + * @return dataType + */ + public CosmosVectorDataType getDataType() { + return CosmosVectorDataType.fromString(dataType); + } + + /** + * Sets the data type for the cosmosVectorEmbedding. + * + * @param dataType the data type for the cosmosVectorEmbedding + * @return CosmosVectorEmbedding + */ + public CosmosVectorEmbedding setDataType(CosmosVectorDataType dataType) { + checkNotNull(dataType, "cosmosVectorDataType cannot be null"); + this.dataType = dataType.toString(); + return this; + } + + /** + * Gets the dimensions for the cosmosVectorEmbedding. + * + * @return dimensions + */ + public Long getDimensions() { + return dimensions; + } + + /** + * Sets the dimensions for the cosmosVectorEmbedding. + * + * @param dimensions the dimensions for the cosmosVectorEmbedding + * @return CosmosVectorEmbedding + */ + public CosmosVectorEmbedding setDimensions(Long dimensions) { + checkNotNull(dimensions, "dimensions cannot be null"); + if (dimensions < 1) { + throw new IllegalArgumentException("Dimensions for the embedding has to be a long value greater than 0 " + + "for the vector embedding policy"); + } + + this.dimensions = dimensions; + return this; + } + + /** + * Gets the distanceFunction for the cosmosVectorEmbedding. + * + * @return distanceFunction + */ + public CosmosVectorDistanceFunction getDistanceFunction() { + return CosmosVectorDistanceFunction.fromString(distanceFunction); + } + + /** + * Sets the distanceFunction for the cosmosVectorEmbedding. + * + * @param distanceFunction the distanceFunction for the cosmosVectorEmbedding + * @return CosmosVectorEmbedding + */ + public CosmosVectorEmbedding setDistanceFunction(CosmosVectorDistanceFunction distanceFunction) { + checkNotNull(distanceFunction, "cosmosVectorDistanceFunction cannot be empty"); + this.distanceFunction = distanceFunction.toString(); + return this; + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbeddingPolicy.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbeddingPolicy.java new file mode 100644 index 000000000000..c54c843ebd96 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbeddingPolicy.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.models; + +import com.azure.cosmos.implementation.Constants; +import com.azure.cosmos.implementation.JsonSerializable; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +/** + * Vector Embedding Policy + */ +public final class CosmosVectorEmbeddingPolicy { + + private JsonSerializable jsonSerializable; + /** + * Paths for embeddings along with path-specific settings for the item. + */ + @JsonProperty(Constants.Properties.VECTOR_EMBEDDINGS) + private List cosmosVectorEmbeddings; + + /** + * Constructor + */ + public CosmosVectorEmbeddingPolicy() { + this.jsonSerializable = new JsonSerializable(); + } + + /** + * Gets the paths for embeddings along with path-specific settings for the item. + * + * @return the paths for embeddings along with path-specific settings for the item. + */ + public List getVectorEmbeddings() { + return this.cosmosVectorEmbeddings; + } + + /** + * Sets the paths for embeddings along with path-specific settings for the item. + * + * @param cosmosVectorEmbeddings paths for embeddings along with path-specific settings for the item. + */ + public void setCosmosVectorEmbeddings(List cosmosVectorEmbeddings) { + cosmosVectorEmbeddings.forEach(embedding -> { + if (embedding == null) { + throw new NullPointerException("Embedding cannot be null."); + } + }); + this.cosmosVectorEmbeddings = cosmosVectorEmbeddings; +// this.jsonSerializable.set(Constants.Properties.VECTOR_EMBEDDINGS, cosmosVectorEmbeddings); + } + +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexSpec.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexSpec.java new file mode 100644 index 000000000000..13b1559810ca --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexSpec.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.models; + +import com.azure.cosmos.CosmosItemSerializer; +import com.azure.cosmos.implementation.Constants; +import com.azure.cosmos.implementation.JsonSerializable; + +import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; + +/** + * Vector Indexes spec for Azure CosmosDB service. + */ +public final class CosmosVectorIndexSpec { + + private JsonSerializable jsonSerializable; + private String type; + + /** + * Constructor + */ + public CosmosVectorIndexSpec() { this.jsonSerializable = new JsonSerializable(); } + + /** + * Gets path. + * + * @return the path. + */ + public String getPath() { + return this.jsonSerializable.getString(Constants.Properties.PATH); + } + + /** + * Sets path. + * + * @param path the path. + * @return the SpatialSpec. + */ + public CosmosVectorIndexSpec setPath(String path) { + this.jsonSerializable.set(Constants.Properties.PATH, path, CosmosItemSerializer.DEFAULT_SERIALIZER); + return this; + } + + /** + * Gets the vector index type for the vector index + * + * @return the vector index type + */ + public String getType() { + if (this.type == null) { + this.type = this.jsonSerializable.getString(Constants.Properties.VECTOR_INDEX_TYPE); + } + return this.type; + } + + /** + * Sets the vector index type for the vector index + * + * @param type the vector index type + * @return the VectorIndexSpec + */ + public CosmosVectorIndexSpec setType(String type) { + checkNotNull(type, "cosmosVectorIndexType cannot be null"); + this.type = type; + this.jsonSerializable.set(Constants.Properties.VECTOR_INDEX_TYPE, this.type, CosmosItemSerializer.DEFAULT_SERIALIZER); + return this; + } + + void populatePropertyBag() { + this.jsonSerializable.populatePropertyBag(); + } + + JsonSerializable getJsonSerializable() { + return this.jsonSerializable; + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexType.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexType.java new file mode 100644 index 000000000000..679ea1f991c0 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexType.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.models; + +/** + * Defines the index type of vector index specification in the Azure Cosmos DB service. + */ +public enum CosmosVectorIndexType { + /** + * Represents a flat vector index type. + */ + FLAT("flat"), + + /** + * Represents a quantized flat vector index type. + */ + QUANTIZED_FLAT("quantizedFlat"), + + /** + * Represents a disk ANN vector index type. + */ + DISK_ANN("diskANN"); + + + private final String overWireValue; + + CosmosVectorIndexType(String overWireValue) { + this.overWireValue = overWireValue; + } + + @Override + public String toString() { + return this.overWireValue; + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java index 4ee5153877f8..678cea56fcc4 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java @@ -20,13 +20,12 @@ */ public final class IndexingPolicy { private static final String DEFAULT_PATH = "/*"; - + private final JsonSerializable jsonSerializable; private List includedPaths; private List excludedPaths; private List> compositeIndexes; private List spatialIndexes; - - private JsonSerializable jsonSerializable; + private List vectorIndexes; /** * Constructor. @@ -54,7 +53,7 @@ public IndexingPolicy() { * * * @param defaultIndexOverrides comma separated set of indexes that serve as default index specifications for the - * root path. + * root path. * @throws IllegalArgumentException throws when defaultIndexOverrides is null */ IndexingPolicy(Index[] defaultIndexOverrides) { @@ -235,7 +234,7 @@ public IndexingPolicy setCompositeIndexes(List> compositeInd } /** - * Sets the spatial indexes for additional indexes. + * Gets the spatial indexes for additional indexes. * * @return the spatial indexes. */ @@ -266,11 +265,55 @@ public IndexingPolicy setSpatialIndexes(List spatialIndexes) { return this; } + /** + * Gets the vector indexes. + * + * @return the vector indexes + */ + public List getVectorIndexes() { + if (this.vectorIndexes == null) { + this.vectorIndexes = this.jsonSerializable.getList(Constants.Properties.VECTOR_INDEXES, CosmosVectorIndexSpec.class); + + if (this.vectorIndexes == null) { + this.vectorIndexes = new ArrayList(); + } + } + + return this.vectorIndexes; + } + + /** + * Sets the vector indexes. + * + * Example of the vectorIndexes: + * "vectorIndexes": [ + * { + * "path": "/vector1", + * "type": "diskANN" + * }, + * { + * "path": "/vector1", + * "type": "flat" + * }, + * { + * "path": "/vector2", + * "type": "quantizedFlat" + * }] + * + * @param vectorIndexes the vector indexes + * @return the Indexing Policy. + */ + public IndexingPolicy setVectorIndexes(List vectorIndexes) { + this.vectorIndexes = vectorIndexes; + this.jsonSerializable.set(Constants.Properties.VECTOR_INDEXES,this.vectorIndexes, CosmosItemSerializer.DEFAULT_SERIALIZER); + return this; + } + void populatePropertyBag() { this.jsonSerializable.populatePropertyBag(); // If indexing mode is not 'none' and not paths are set, set them to the defaults if (this.getIndexingMode() != IndexingMode.NONE && this.getIncludedPaths().size() == 0 - && this.getExcludedPaths().size() == 0) { + && this.getExcludedPaths().size() == 0) { IncludedPath includedPath = new IncludedPath(IndexingPolicy.DEFAULT_PATH); this.getIncludedPaths().add(includedPath); } @@ -296,5 +339,7 @@ void populatePropertyBag() { } } - JsonSerializable getJsonSerializable() { return this.jsonSerializable; } + JsonSerializable getJsonSerializable() { + return this.jsonSerializable; + } } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java index a8f344ce4e2d..4931c9b3b1b0 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java @@ -435,6 +435,8 @@ public static void populatePropertyBag(T t) { ((PartitionKeyDefinition) t).populatePropertyBag(); } else if (t instanceof SpatialSpec) { ((SpatialSpec) t).populatePropertyBag(); + } else if (t instanceof CosmosVectorIndexSpec) { + ((CosmosVectorIndexSpec) t).populatePropertyBag(); } else if (t instanceof SqlParameter) { ((SqlParameter) t).populatePropertyBag(); } else if (t instanceof SqlQuerySpec) { @@ -468,6 +470,8 @@ public static JsonSerializable getJsonSerializable(T t) { return ((PartitionKeyDefinition) t).getJsonSerializable(); } else if (t instanceof SpatialSpec) { return ((SpatialSpec) t).getJsonSerializable(); + } else if (t instanceof CosmosVectorIndexSpec) { + return ((CosmosVectorIndexSpec) t).getJsonSerializable(); } else if (t instanceof SqlParameter) { return ((SqlParameter) t).getJsonSerializable(); } else if (t instanceof SqlQuerySpec) { From a979c1139b06a95456bf527cd8bb10599bfcf058 Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Fri, 3 May 2024 12:20:34 -0700 Subject: [PATCH 04/33] Initial changes --- .../DocumentQueryExecutionContextFactory.java | 27 ++++++++++ ...onStreamingOrderByBadRequestException.java | 20 ++++++++ ...gOrderByDocumentQueryExecutionContext.java | 1 + .../query/NonStreamingOrderByUtils.java | 51 ++++++++++--------- ...ipelinedDocumentQueryExecutionContext.java | 4 +- .../implementation/query/QueryFeature.java | 3 +- .../query/QueryPlanRetriever.java | 3 +- 7 files changed, 80 insertions(+), 29 deletions(-) create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByBadRequestException.java diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java index a13cfc65348d..07fb5d14b925 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java @@ -7,6 +7,7 @@ import com.azure.cosmos.implementation.Constants; import com.azure.cosmos.implementation.DiagnosticsClientContext; import com.azure.cosmos.implementation.DocumentCollection; +import com.azure.cosmos.implementation.HttpConstants; import com.azure.cosmos.implementation.ImplementationBridgeHelpers; import com.azure.cosmos.implementation.OperationType; import com.azure.cosmos.implementation.PartitionKeyRange; @@ -358,6 +359,32 @@ public static Flux> createSpecia boolean getLazyFeedResponse = queryInfo.hasTop(); + // We need to compute the optimal initial age size for non-streaming order-by queries + if (queryInfo.hasNonStreamingOrderBy()) { + // Validate the TOP or LIMIT for non-streaming order-by queries + if (!queryInfo.hasTop() || !queryInfo.hasLimit() || queryInfo.getTop() < 0 || queryInfo.getLimit() < 0) { + throw new NonStreamingOrderByBadRequestException(HttpConstants.StatusCodes.BADREQUEST, + "Executing a vector search query without TOP or LIMIT can consume a large number of RUs" + + "very fast and have long runtimes. Please ensure you are using one of the above two filters" + + "with you vector search query."); + } + + // Validate the size of TOP or LIMIT against MaxSizePerPartition + int maxLimit = Math.max(queryInfo.hasTop() ? queryInfo.getTop() : 0, + queryInfo.hasLimit() ? queryInfo.getLimit() : 0); + if (maxLimit > cosmosQueryRequestOptions.getMaxSizePerPartition()) { + throw new NonStreamingOrderByBadRequestException(HttpConstants.StatusCodes.BADREQUEST, + "Executing a vector search query with TOP or LIMIT larger than the MaxSizePerPartition " + + "is not allowed"); + } + + // Set initialPageSize based on the smallest of TOP or LIMIT + if (queryInfo.hasTop() || queryInfo.hasLimit() ) { + initialPageSize = Math.min(queryInfo.hasTop() ? queryInfo.getTop() : Integer.MAX_VALUE, + queryInfo.hasLimit() ? queryInfo.getLimit() : Integer.MAX_VALUE); + } + } + // We need to compute the optimal initial page size for order-by queries if (queryInfo.hasOrderBy()) { int top; diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByBadRequestException.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByBadRequestException.java new file mode 100644 index 000000000000..4b3b41fbc675 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByBadRequestException.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.cosmos.implementation.query; + +import com.azure.cosmos.CosmosException; + +public class NonStreamingOrderByBadRequestException extends CosmosException { + + private static final long serialVersionUID = 1L; + + /** + * Creates a new instance of the NonStreamingOrderByBadRequestException class. + * + * @param statusCode the http status code of the response. + * @param errorMessage the error message. + */ + public NonStreamingOrderByBadRequestException(int statusCode, String errorMessage) { + super(statusCode, errorMessage); + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java index da2ed5791cc6..e0a318bdf9eb 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java @@ -143,6 +143,7 @@ private void initialize( consumeComparer, tracker, documentProducers, + initialPageSize, queryMetricMap, maxSizePerPartition, clientSideRequestStatistics); diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java index c73a63bd0ea0..8a039ba1342e 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java @@ -27,6 +27,7 @@ public class NonStreamingOrderByUtils { public static Flux> nonStreamingOrderedMerge(OrderbyRowComparer consumeComparer, RequestChargeTracker tracker, List> documentProducers, + int initialPageSize, Map queryMetricsMap, int maxSizePerPartition, Collection clientSideRequestStatistics) { @@ -35,7 +36,7 @@ public static Flux> nonStreaming .subList(0, documentProducers.size()) .stream() .map(producer -> - toNonStreamingOrderByQueryResultObservable(producer, tracker, queryMetricsMap, + toNonStreamingOrderByQueryResultObservable(producer, tracker, queryMetricsMap, initialPageSize, maxSizePerPartition, consumeComparer, clientSideRequestStatistics)) .toArray(Flux[]::new); return Flux.mergeOrdered(consumeComparer, fluxes); @@ -44,12 +45,13 @@ public static Flux> nonStreaming private static Flux> toNonStreamingOrderByQueryResultObservable(DocumentProducer producer, RequestChargeTracker tracker, Map queryMetricsMap, + int initialPageSize, int maxSizePerPartition, OrderbyRowComparer consumeComparer, Collection clientSideRequestStatisticsList) { return producer .produceAsync() - .transformDeferred(new NonStreamingOrderByUtils.PageToItemTransformer(tracker, queryMetricsMap, + .transformDeferred(new NonStreamingOrderByUtils.PageToItemTransformer(tracker, queryMetricsMap, initialPageSize, maxSizePerPartition, consumeComparer, clientSideRequestStatisticsList)); } @@ -57,15 +59,17 @@ private static class PageToItemTransformer implements Function.DocumentProducerFeedResponse>, Flux>> { private final RequestChargeTracker tracker; private final Map queryMetricsMap; + private final Integer initialPageSize; private final Integer maxSizePerPartition; private final OrderbyRowComparer consumeComparer; private final Collection clientSideRequestStatistics; private PageToItemTransformer(RequestChargeTracker tracker, Map queryMetricsMap, - Integer maxSizePerPartition, OrderbyRowComparer consumeComparer, + Integer initialPageSize, Integer maxSizePerPartition, OrderbyRowComparer consumeComparer, Collection clientSideRequestStatistics) { this.tracker = tracker; this.queryMetricsMap = queryMetricsMap; + this.initialPageSize = initialPageSize; this.maxSizePerPartition = maxSizePerPartition; this.consumeComparer = consumeComparer; this.clientSideRequestStatistics = clientSideRequestStatistics; @@ -74,31 +78,28 @@ private PageToItemTransformer(RequestChargeTracker tracker, Map> apply(Flux.DocumentProducerFeedResponse> source) { PriorityQueue> priorityQueue = new PriorityQueue<>(consumeComparer); - AtomicBoolean emitFlag = new AtomicBoolean(true); return source.flatMap(documentProducerFeedResponse -> { - // Checks if the max size has been reached, if so, stop processing new pages - if (emitFlag.get()) { - clientSideRequestStatistics.addAll( - diagnosticsAccessor.getClientSideRequestStatisticsForQueryPipelineAggregations(documentProducerFeedResponse - .pageResult.getCosmosDiagnostics())); + clientSideRequestStatistics.addAll( + diagnosticsAccessor.getClientSideRequestStatisticsForQueryPipelineAggregations(documentProducerFeedResponse + .pageResult.getCosmosDiagnostics())); - QueryMetrics.mergeQueryMetricsMap(queryMetricsMap, - BridgeInternal.queryMetricsFromFeedResponse(documentProducerFeedResponse.pageResult)); - List results = documentProducerFeedResponse.pageResult.getResults(); - results.forEach(r -> { - OrderByRowResult orderByRowResult = new OrderByRowResult( - ModelBridgeInternal.toJsonFromJsonSerializable(r), - documentProducerFeedResponse.sourceFeedRange, - null); - if (priorityQueue.size() < maxSizePerPartition) { - priorityQueue.add(orderByRowResult); - } else { - emitFlag.set(false); - } - }); - tracker.addCharge(documentProducerFeedResponse.pageResult.getRequestCharge()); - } + QueryMetrics.mergeQueryMetricsMap(queryMetricsMap, + BridgeInternal.queryMetricsFromFeedResponse(documentProducerFeedResponse.pageResult)); + List results = documentProducerFeedResponse.pageResult.getResults(); + results.forEach(r -> { + OrderByRowResult orderByRowResult = new OrderByRowResult( + r.toJson(), + documentProducerFeedResponse.sourceFeedRange, + null); + if (priorityQueue.size() < initialPageSize) { + priorityQueue.add(orderByRowResult); + } else { + priorityQueue.add(orderByRowResult); + priorityQueue.poll(); + } + }); + tracker.addCharge(documentProducerFeedResponse.pageResult.getRequestCharge()); // Returning an empty Flux since we are only processing and managing state here return Flux.empty(); }, 1) diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java index 5ce5e4b662e2..6ce1ec612338 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java @@ -54,12 +54,12 @@ private static BiFunction, Flux getQueryPlanThroughGatewayAsync(DiagnosticsClientContext diagnosticsClientContext, IDocumentQueryClient queryClient, From e2756a56b4183721e732377764e73cb8b466d56e Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Fri, 3 May 2024 12:43:50 -0700 Subject: [PATCH 05/33] Initial changes --- sdk/cosmos/azure-cosmos/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/cosmos/azure-cosmos/CHANGELOG.md b/sdk/cosmos/azure-cosmos/CHANGELOG.md index 4ea8a84052bd..d90bed0f0bde 100644 --- a/sdk/cosmos/azure-cosmos/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos/CHANGELOG.md @@ -4,6 +4,8 @@ #### Features Added +* Added a new non-streaming OrderBy query pipeline and a query feature`NonStreamingOrderBy` to support Vector Search queries. - See [PR 39897](https://github.com/Azure/azure-sdk-for-java/pull/39897/) + #### Breaking Changes #### Bugs Fixed From 8be227717419c5fa6c57de3932167aa38c2f4830 Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Fri, 3 May 2024 15:10:51 -0700 Subject: [PATCH 06/33] Initial changes --- .../CosmosQueryRequestOptionsImpl.java | 22 ------------------- .../DocumentQueryExecutionContextFactory.java | 9 -------- ...gOrderByDocumentQueryExecutionContext.java | 7 ++---- .../query/NonStreamingOrderByUtils.java | 10 +++------ .../models/CosmosQueryRequestOptions.java | 20 ----------------- .../cosmos/models/ModelBridgeInternal.java | 11 ---------- 6 files changed, 5 insertions(+), 74 deletions(-) diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java index c5bc339e4d5d..4dc62089acc5 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java @@ -25,7 +25,6 @@ public final class CosmosQueryRequestOptionsImpl extends CosmosQueryRequestOptio private boolean queryPlanRetrievalDisallowed; private boolean emptyPageDiagnosticsEnabled; private String queryName; - private Integer maxSizePerPartition; private List cancelledRequestDiagnosticsTracker = new ArrayList<>(); /** @@ -63,7 +62,6 @@ public CosmosQueryRequestOptionsImpl(CosmosQueryRequestOptionsImpl options) { this.queryName = options.queryName; this.feedRange = options.feedRange; this.cancelledRequestDiagnosticsTracker = options.cancelledRequestDiagnosticsTracker; - this.maxSizePerPartition = options.maxSizePerPartition; } /** @@ -198,26 +196,6 @@ public CosmosQueryRequestOptionsImpl setMaxItemCount(Integer maxItemCount) { return this; } - /** - * Gets the maximum size to fetch from a partition during non-streaming order by queries - * - * @return the max size per partition - */ - public Integer getMaxSizePerPartition() { - return maxSizePerPartition; - } - - /** - * Sets the maximum size to fetch from a partition during non-streaming order by queries - * - * @param maxSizePerPartition the max size per partition - * @return the CosmosQueryRequestOptions. - */ - public CosmosQueryRequestOptionsImpl setMaxSizePerPartition(Integer maxSizePerPartition) { - this.maxSizePerPartition = maxSizePerPartition; - return this; - } - /** * Gets the request continuation token. * diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java index 07fb5d14b925..cabcf1f200dc 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java @@ -369,15 +369,6 @@ public static Flux> createSpecia "with you vector search query."); } - // Validate the size of TOP or LIMIT against MaxSizePerPartition - int maxLimit = Math.max(queryInfo.hasTop() ? queryInfo.getTop() : 0, - queryInfo.hasLimit() ? queryInfo.getLimit() : 0); - if (maxLimit > cosmosQueryRequestOptions.getMaxSizePerPartition()) { - throw new NonStreamingOrderByBadRequestException(HttpConstants.StatusCodes.BADREQUEST, - "Executing a vector search query with TOP or LIMIT larger than the MaxSizePerPartition " + - "is not allowed"); - } - // Set initialPageSize based on the smallest of TOP or LIMIT if (queryInfo.hasTop() || queryInfo.hasLimit() ) { initialPageSize = Math.min(queryInfo.hasTop() ? queryInfo.getTop() : Integer.MAX_VALUE, diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java index e0a318bdf9eb..86a480b27165 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java @@ -113,8 +113,7 @@ public static Flux> createAsync( initParams.getQueryInfo().getOrderBy(), initParams.getQueryInfo().getOrderByExpressions(), initParams.getInitialPageSize(), - collection, - ModelBridgeInternal.getMaxSizePerPartitionFromQueryRequestOptions(initParams.getCosmosQueryRequestOptions())); + collection); return Flux.just(context); } catch (CosmosException dce) { @@ -126,8 +125,7 @@ private void initialize( List feedRanges, List sortOrders, Collection orderByExpressions, int initialPageSize, - DocumentCollection collection, - int maxSizePerPartition) throws CosmosException { + DocumentCollection collection) throws CosmosException { // Since the continuation token will always be null, // we don't need to handle any initialization based on continuationToken. // We can directly initialize without any consideration for continuationToken. @@ -145,7 +143,6 @@ private void initialize( documentProducers, initialPageSize, queryMetricMap, - maxSizePerPartition, clientSideRequestStatistics); } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java index 8a039ba1342e..19daeae3956d 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java @@ -29,7 +29,6 @@ public static Flux> nonStreaming List> documentProducers, int initialPageSize, Map queryMetricsMap, - int maxSizePerPartition, Collection clientSideRequestStatistics) { @SuppressWarnings("unchecked") Flux>[] fluxes = documentProducers @@ -37,7 +36,7 @@ public static Flux> nonStreaming .stream() .map(producer -> toNonStreamingOrderByQueryResultObservable(producer, tracker, queryMetricsMap, initialPageSize, - maxSizePerPartition, consumeComparer, clientSideRequestStatistics)) + consumeComparer, clientSideRequestStatistics)) .toArray(Flux[]::new); return Flux.mergeOrdered(consumeComparer, fluxes); } @@ -46,13 +45,12 @@ private static Flux> toNonStreamingOrderByQueryResult RequestChargeTracker tracker, Map queryMetricsMap, int initialPageSize, - int maxSizePerPartition, OrderbyRowComparer consumeComparer, Collection clientSideRequestStatisticsList) { return producer .produceAsync() .transformDeferred(new NonStreamingOrderByUtils.PageToItemTransformer(tracker, queryMetricsMap, initialPageSize, - maxSizePerPartition, consumeComparer, clientSideRequestStatisticsList)); + consumeComparer, clientSideRequestStatisticsList)); } private static class PageToItemTransformer implements @@ -60,17 +58,15 @@ private static class PageToItemTransformer implements private final RequestChargeTracker tracker; private final Map queryMetricsMap; private final Integer initialPageSize; - private final Integer maxSizePerPartition; private final OrderbyRowComparer consumeComparer; private final Collection clientSideRequestStatistics; private PageToItemTransformer(RequestChargeTracker tracker, Map queryMetricsMap, - Integer initialPageSize, Integer maxSizePerPartition, OrderbyRowComparer consumeComparer, + Integer initialPageSize, OrderbyRowComparer consumeComparer, Collection clientSideRequestStatistics) { this.tracker = tracker; this.queryMetricsMap = queryMetricsMap; this.initialPageSize = initialPageSize; - this.maxSizePerPartition = maxSizePerPartition; this.consumeComparer = consumeComparer; this.clientSideRequestStatistics = clientSideRequestStatistics; } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java index 9682664ec807..c9bf3909fd5d 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java @@ -256,26 +256,6 @@ CosmosQueryRequestOptions setMaxItemCount(Integer maxItemCount) { return this; } - /** - * Gets the maximum size to fetch from a partition during non-streaming order by queries - * - * @return the max size per partition - */ - public Integer getMaxSizePerPartition() { - return this.actualRequestOptions.getMaxSizePerPartition(); - } - - /** - * Sets the maximum size to fetch from a partition during non-streaming order by queries - * - * @param maxSizePerPartition the max size per partition - * @return the CosmosQueryRequestOptions. - */ - public CosmosQueryRequestOptions setMaxSizePerPartition(Integer maxSizePerPartition) { - this.actualRequestOptions.setMaxSizePerPartition(maxSizePerPartition); - return this; - } - /** * Gets the request continuation token. * diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java index 83c542967a7c..a8f344ce4e2d 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java @@ -392,12 +392,6 @@ public static void setQueryRequestOptionsMaxItemCount(CosmosQueryRequestOptions cosmosQueryRequestOptions.setMaxItemCount(maxItemCount); } - @Warning(value = INTERNAL_USE_ONLY_WARNING) - public static void setMaxSizePerPartitionFromQueryRequestOptions(CosmosQueryRequestOptions options, Integer maxSizePerPartition) { - options.setMaxSizePerPartition(maxSizePerPartition); - } - - @Warning(value = INTERNAL_USE_ONLY_WARNING) public static CosmosChangeFeedRequestOptions getEffectiveChangeFeedRequestOptions( CosmosChangeFeedRequestOptions cosmosChangeFeedRequestOptions, @@ -546,11 +540,6 @@ public static Integer getMaxItemCountFromQueryRequestOptions(CosmosQueryRequestO return options.getMaxItemCount(); } - @Warning(value = INTERNAL_USE_ONLY_WARNING) - public static Integer getMaxSizePerPartitionFromQueryRequestOptions(CosmosQueryRequestOptions options) { - return options.getMaxSizePerPartition(); - } - @Warning(value = INTERNAL_USE_ONLY_WARNING) public static String getRequestContinuationFromQueryRequestOptions(CosmosQueryRequestOptions options) { return options.getRequestContinuation(); From e491b9d88acb7d37a2ce48384d83679de282e965 Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Tue, 7 May 2024 15:31:32 -0700 Subject: [PATCH 07/33] Resolving comments --- sdk/cosmos/azure-cosmos/CHANGELOG.md | 2 +- .../azure/cosmos/implementation/Configs.java | 15 ++++++++++ .../CosmosQueryRequestOptionsImpl.java | 22 +++++++++++++++ .../DocumentQueryExecutionContextFactory.java | 28 +++++++++++++++---- ...gOrderByDocumentQueryExecutionContext.java | 10 ++----- .../query/NonStreamingOrderByUtils.java | 22 +++++++++------ ...ipelinedDocumentQueryExecutionContext.java | 5 +++- .../models/CosmosQueryRequestOptions.java | 20 +++++++++++++ .../cosmos/models/ModelBridgeInternal.java | 5 ++++ 9 files changed, 106 insertions(+), 23 deletions(-) diff --git a/sdk/cosmos/azure-cosmos/CHANGELOG.md b/sdk/cosmos/azure-cosmos/CHANGELOG.md index d90bed0f0bde..3f8b8a55964a 100644 --- a/sdk/cosmos/azure-cosmos/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos/CHANGELOG.md @@ -4,7 +4,7 @@ #### Features Added -* Added a new non-streaming OrderBy query pipeline and a query feature`NonStreamingOrderBy` to support Vector Search queries. - See [PR 39897](https://github.com/Azure/azure-sdk-for-java/pull/39897/) +* Added support for non-streaming OrderBy query and a query feature `NonStreamingOrderBy` to support Vector Search queries. - See [PR 39897](https://github.com/Azure/azure-sdk-for-java/pull/39897/) #### Breaking Changes diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java index da368de5360d..c643379b2fe6 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java @@ -166,6 +166,13 @@ public class Configs { public static final String MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED = "COSMOS.MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED"; private static final int DEFAULT_MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED = 1; + private static final String MAX_ITEM_SIZE_FOR_VECTOR_SEARCH = "COSMOS.MAX_ITEM_SIZE_FOR_VECTOR_SEARCH"; + private static final int DEFAULT_MAX_ITEM_SIZE_FOR_VECTOR_SEARCH = 50000; + + private static final String MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED = "COSMOS.MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED"; + + private static final boolean DEFAULT_MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED = true; + public static final int MIN_MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED = 1; public static final String TCP_CONNECTION_ACQUISITION_TIMEOUT_IN_MS = "COSMOS.TCP_CONNECTION_ACQUISITION_TIMEOUT_IN_MS"; @@ -484,6 +491,14 @@ public static int getMaxRetriesInLocalRegionWhenRemoteRegionPreferred() { MIN_MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED); } + public static int getMaxItemSizeForVectorSearch() { + return getJVMConfigAsInt(MAX_ITEM_SIZE_FOR_VECTOR_SEARCH, DEFAULT_MAX_ITEM_SIZE_FOR_VECTOR_SEARCH); + } + + public static boolean getMaxItemSizeForVectorSearchEnabled() { + return getJVMConfigAsBoolean(MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED, DEFAULT_MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED); + } + public static Duration getMinRetryTimeInLocalRegionWhenRemoteRegionPreferred() { return Duration.ofMillis(Math.max( diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java index 4dc62089acc5..c70ded3a906f 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java @@ -25,6 +25,7 @@ public final class CosmosQueryRequestOptionsImpl extends CosmosQueryRequestOptio private boolean queryPlanRetrievalDisallowed; private boolean emptyPageDiagnosticsEnabled; private String queryName; + private Integer maxItemSizeForVectorSearch; private List cancelledRequestDiagnosticsTracker = new ArrayList<>(); /** @@ -62,6 +63,7 @@ public CosmosQueryRequestOptionsImpl(CosmosQueryRequestOptionsImpl options) { this.queryName = options.queryName; this.feedRange = options.feedRange; this.cancelledRequestDiagnosticsTracker = options.cancelledRequestDiagnosticsTracker; + this.maxItemSizeForVectorSearch = options.maxItemSizeForVectorSearch; } /** @@ -196,6 +198,26 @@ public CosmosQueryRequestOptionsImpl setMaxItemCount(Integer maxItemCount) { return this; } + /** + * Gets the maximum item size to fetch during non-streaming order by queries. + * + * @return the max number of items for vector search. + */ + public Integer getMaxItemSizeForVectorSearch() { + return maxItemSizeForVectorSearch; + } + + /** + * Sets the maximum item size to fetch during non-streaming order by queries. + * + * @param maxItemSizeForVectorSearch the max number of items for vector search. + * return the CosmosQueryRequestOptions. + */ + public CosmosQueryRequestOptionsImpl setMaxItemSizeForVectorSearch(Integer maxItemSizeForVectorSearch) { + this.maxItemSizeForVectorSearch = maxItemSizeForVectorSearch; + return this; + } + /** * Gets the request continuation token. * diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java index cabcf1f200dc..7a530816856b 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java @@ -4,6 +4,7 @@ import com.azure.cosmos.BridgeInternal; import com.azure.cosmos.implementation.BadRequestException; +import com.azure.cosmos.implementation.Configs; import com.azure.cosmos.implementation.Constants; import com.azure.cosmos.implementation.DiagnosticsClientContext; import com.azure.cosmos.implementation.DocumentCollection; @@ -240,7 +241,8 @@ private static boolean canCacheQuery(QueryInfo queryInfo) { && !queryInfo.hasTop() && !queryInfo.hasOffset() && !queryInfo.hasDCount() - && !queryInfo.hasOrderBy(); + && !queryInfo.hasOrderBy() + && !queryInfo.hasNonStreamingOrderBy(); } private static boolean isScopedToSinglePartition(CosmosQueryRequestOptions cosmosQueryRequestOptions) { @@ -360,19 +362,33 @@ public static Flux> createSpecia boolean getLazyFeedResponse = queryInfo.hasTop(); // We need to compute the optimal initial age size for non-streaming order-by queries - if (queryInfo.hasNonStreamingOrderBy()) { + if (queryInfo.hasNonStreamingOrderBy() && Configs.getMaxItemSizeForVectorSearchEnabled()) { // Validate the TOP or LIMIT for non-streaming order-by queries - if (!queryInfo.hasTop() || !queryInfo.hasLimit() || queryInfo.getTop() < 0 || queryInfo.getLimit() < 0) { + if (!queryInfo.hasTop() && !queryInfo.hasLimit() && queryInfo.getTop() < 0 && queryInfo.getLimit() < 0) { throw new NonStreamingOrderByBadRequestException(HttpConstants.StatusCodes.BADREQUEST, "Executing a vector search query without TOP or LIMIT can consume a large number of RUs" + "very fast and have long runtimes. Please ensure you are using one of the above two filters" + "with you vector search query."); } - + // Validate the size of TOP or LIMIT against MaxItemSizeForVectorSearch + int maxLimit = Math.max(queryInfo.hasTop() ? queryInfo.getTop() : 0, + queryInfo.hasLimit() ? queryInfo.getLimit() : 0); + int maxItemSizeForVectorSearch = Math.max(Configs.getMaxItemSizeForVectorSearch(), + ModelBridgeInternal.getMaxItemSizeForVectorSearchFromQueryRequestOptions(cosmosQueryRequestOptions)); + if (maxLimit > maxItemSizeForVectorSearch) { + throw new NonStreamingOrderByBadRequestException(HttpConstants.StatusCodes.BADREQUEST, + "Executing a vector search query with TOP or LIMIT larger than the maxItemSizeForVectorSearch " + + "is not allowed"); + } // Set initialPageSize based on the smallest of TOP or LIMIT - if (queryInfo.hasTop() || queryInfo.hasLimit() ) { - initialPageSize = Math.min(queryInfo.hasTop() ? queryInfo.getTop() : Integer.MAX_VALUE, + if (queryInfo.hasTop() || queryInfo.hasLimit()) { + int pageSizeWithTopOrLimit = Math.min(queryInfo.hasTop() ? queryInfo.getTop() : Integer.MAX_VALUE, queryInfo.hasLimit() ? queryInfo.getLimit() : Integer.MAX_VALUE); + if (initialPageSize > 0) { + initialPageSize = Math.min(pageSizeWithTopOrLimit, initialPageSize); + } else { + initialPageSize = pageSizeWithTopOrLimit; + } } } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java index 86a480b27165..89a8a3065443 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java @@ -71,23 +71,20 @@ public NonStreamingOrderByDocumentQueryExecutionContext( OrderbyRowComparer consumeComparer, UUID correlatedActivityId, boolean hasSelectValue, - final AtomicBoolean isQueryCancelledOnTimeout, - int maxPageSizePerPartition) { + final AtomicBoolean isQueryCancelledOnTimeout) { super(diagnosticsClientContext, client, resourceTypeEnum, Document.class, query, cosmosQueryRequestOptions, resourceLink, rewrittenQuery, correlatedActivityId, hasSelectValue, isQueryCancelledOnTimeout); this.consumeComparer = consumeComparer; this.tracker = new RequestChargeTracker(); this.queryMetricMap = new ConcurrentHashMap<>(); this.clientSideRequestStatistics = ConcurrentHashMap.newKeySet(); - this.maxPageSizePerPartition = maxPageSizePerPartition; } public static Flux> createAsync( DiagnosticsClientContext diagnosticsClientContext, IDocumentQueryClient client, PipelinedDocumentQueryParams initParams, - DocumentCollection collection, - int maxPageSizePerPartition) { + DocumentCollection collection) { QueryInfo queryInfo = initParams.getQueryInfo(); @@ -102,8 +99,7 @@ public static Flux> createAsync( new OrderbyRowComparer<>(queryInfo.getOrderBy()), initParams.getCorrelatedActivityId(), queryInfo.hasSelectValue(), - initParams.isQueryCancelledOnTimeout(), - maxPageSizePerPartition); + initParams.isQueryCancelledOnTimeout()); context.setTop(initParams.getTop()); diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java index 19daeae3956d..1b4191e26413 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java @@ -1,7 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.azure.cosmos.implementation.query; import com.azure.cosmos.BridgeInternal; import com.azure.cosmos.implementation.ClientSideRequestStatistics; +import com.azure.cosmos.implementation.Configs; import com.azure.cosmos.implementation.Document; import com.azure.cosmos.implementation.ImplementationBridgeHelpers; import com.azure.cosmos.implementation.QueryMetrics; @@ -9,14 +12,12 @@ import com.azure.cosmos.implementation.Resource; import com.azure.cosmos.implementation.query.orderbyquery.OrderByRowResult; import com.azure.cosmos.implementation.query.orderbyquery.OrderbyRowComparer; -import com.azure.cosmos.models.ModelBridgeInternal; import reactor.core.publisher.Flux; import java.util.Collection; import java.util.List; import java.util.Map; -import java.util.PriorityQueue; -import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.PriorityBlockingQueue; import java.util.function.Function; public class NonStreamingOrderByUtils { @@ -38,7 +39,7 @@ public static Flux> nonStreaming toNonStreamingOrderByQueryResultObservable(producer, tracker, queryMetricsMap, initialPageSize, consumeComparer, clientSideRequestStatistics)) .toArray(Flux[]::new); - return Flux.mergeOrdered(consumeComparer, fluxes); + return Flux.mergeComparingDelayError(1,consumeComparer, fluxes); } private static Flux> toNonStreamingOrderByQueryResultObservable(DocumentProducer producer, @@ -73,7 +74,7 @@ private PageToItemTransformer(RequestChargeTracker tracker, Map> apply(Flux.DocumentProducerFeedResponse> source) { - PriorityQueue> priorityQueue = new PriorityQueue<>(consumeComparer); + PriorityBlockingQueue> priorityQueue = new PriorityBlockingQueue<>(initialPageSize, consumeComparer); return source.flatMap(documentProducerFeedResponse -> { clientSideRequestStatistics.addAll( @@ -88,12 +89,17 @@ public Flux> apply(Flux.Do r.toJson(), documentProducerFeedResponse.sourceFeedRange, null); - if (priorityQueue.size() < initialPageSize) { - priorityQueue.add(orderByRowResult); + if (Configs.getMaxItemSizeForVectorSearchEnabled()) { + if (priorityQueue.size() < initialPageSize) { + priorityQueue.add(orderByRowResult); + } else { + priorityQueue.add(orderByRowResult); + priorityQueue.poll(); + } } else { priorityQueue.add(orderByRowResult); - priorityQueue.poll(); } + }); tracker.addCharge(documentProducerFeedResponse.pageResult.getRequestCharge()); // Returning an empty Flux since we are only processing and managing state here diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java index 6ce1ec612338..a6ea9fc2d5f6 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java @@ -15,6 +15,8 @@ import java.util.function.BiFunction; +import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; + /** * While this class is public, but it is not part of our published public APIs. * This is meant to be internally used only by our sdk. @@ -54,9 +56,10 @@ private static BiFunction, Flux Date: Tue, 7 May 2024 16:01:21 -0700 Subject: [PATCH 08/33] Fixing build issues --- .../cosmos/models/CosmosQueryRequestOptions.java | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java index 9a65d6a70fa2..309fb87a8b22 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java @@ -265,17 +265,6 @@ public Integer getMaxItemSizeForVectorSearch() { return this.actualRequestOptions.getMaxItemSizeForVectorSearch(); } - /** - * Sets the maximum item size to fetch during non-streaming order by queries. - * - * @param maxItemSizeForVectorSearch the max number of items for vector search. - * return the CosmosQueryRequestOptions. - */ - public CosmosQueryRequestOptions setMaxItemSizeForVectorSearch(Integer maxItemSizeForVectorSearch) { - this.actualRequestOptions.setMaxItemSizeForVectorSearch(maxItemSizeForVectorSearch); - return this; - } - /** * Gets the request continuation token. * From 148cba58e621f90e796f17fd7b9a07dbe8f2da00 Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Wed, 8 May 2024 14:45:19 -0700 Subject: [PATCH 09/33] [Cosmos][VectorSearch] Non Streaming Order By Query (#40085) * Increment versions for core releases (#40003) Increment package versions for core releases * Ensure ServiceBus session idle timeout fall back to retry-options::try-timeout (#39994) * Added Alpha3 Java Media Streaming Events (#40002) * Added Alpha3 Java Media Streaming Events * updating readme to add the media streaming events to remove model --------- Co-authored-by: Vinothini Dharmaraj * Update version of github-event-processor to 1.0.0-dev.20240502.2 (#40012) Co-authored-by: James Suplizio * Prepare May 2024 Identity Release (#40006) * Prepare Identity Broker May 2024 Release (#40014) * Increment package versions for identity releases (#40015) * [JobRouter] SDK Review updates (#40011) * SDK Review updates * Update auto-generated models * Add customization * Fix customization * Update package * Update tests * Linting * FixFaultInjectionRuleFailedToApplyPerPartitionInGatewayMode (#40005) * fix fault injection rule failed to apply per partition in gateway mode --------- Co-authored-by: annie-mac * azure-cosmos-test_1.0.0.beta.7Release (#40021) * release azure-cosmos-test 1.0.0.beta.7 --------- Co-authored-by: annie-mac --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac --- .github/workflows/event-processor.yml | 4 +- .../workflows/scheduled-event-processor.yml | 2 +- common/perf-test-core/pom.xml | 8 +- common/smoke-tests/pom.xml | 12 +- eng/versioning/version_client.txt | 35 ++-- .../azure-resourcemanager-advisor/pom.xml | 8 +- .../azure-resourcemanager-agrifood/pom.xml | 8 +- .../README.md | 2 +- .../azure-verticals-agrifood-farming/pom.xml | 12 +- .../pom.xml | 4 +- .../azure-ai-anomalydetector/README.md | 2 +- .../azure-ai-anomalydetector/pom.xml | 8 +- sdk/aot/azure-aot-graalvm-samples/pom.xml | 2 +- .../azure-resourcemanager-apicenter/pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../azure-data-appconfiguration-perf/pom.xml | 6 +- .../azure-data-appconfiguration/pom.xml | 14 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- sdk/astro/azure-resourcemanager-astro/pom.xml | 8 +- .../azure-resourcemanager-attestation/pom.xml | 8 +- .../azure-security-attestation/pom.xml | 14 +- .../azure-resourcemanager-automanage/pom.xml | 4 +- .../azure-resourcemanager-automation/pom.xml | 4 +- sdk/avs/azure-resourcemanager-avs/pom.xml | 8 +- .../pom.xml | 4 +- .../pom.xml | 8 +- .../azure-resourcemanager-azurestack/pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- sdk/batch/azure-resourcemanager-batch/pom.xml | 8 +- sdk/batch/microsoft-azure-batch/pom.xml | 2 +- .../azure-resourcemanager-batchai/pom.xml | 4 +- .../azure-resourcemanager-billing/pom.xml | 8 +- .../pom.xml | 8 +- .../azure-resourcemanager-botservice/pom.xml | 4 +- .../pom.xml | 8 +- sdk/chaos/azure-resourcemanager-chaos/pom.xml | 8 +- .../pom.xml | 8 +- .../azure-resourcemanager-commerce/pom.xml | 8 +- .../pom.xml | 14 +- .../CallAutomationEventParser.java | 9 ++ .../models/MediaStreamingFailed.java | 108 +++++++++++++ .../models/MediaStreamingStarted.java | 108 +++++++++++++ .../models/MediaStreamingStatus.java | 40 +++++ .../models/MediaStreamingStatusDetails.java | 78 +++++++++ .../models/MediaStreamingStopped.java | 108 +++++++++++++ .../models/MediaStreamingUpdate.java | 91 +++++++++++ .../models/events/MediaStreamingFailed.java | 52 ++++++ .../models/events/MediaStreamingStarted.java | 53 +++++++ .../models/events/MediaStreamingStatus.java | 39 +++++ .../events/MediaStreamingStatusDetails.java | 77 +++++++++ .../models/events/MediaStreamingStopped.java | 52 ++++++ .../models/events/MediaStreamingUpdate.java | 90 +++++++++++ ...ationEventParserAndProcessorUnitTests.java | 102 ++++++++++++ .../swagger/README.md | 5 +- .../azure-communication-callingserver/pom.xml | 12 +- .../azure-communication-chat/pom.xml | 12 +- .../azure-communication-common-perf/pom.xml | 6 +- .../azure-communication-common/pom.xml | 4 +- .../azure-communication-email/pom.xml | 14 +- .../azure-communication-identity/pom.xml | 14 +- .../azure-communication-jobrouter/assets.json | 2 +- .../main/java/JobRouterSdkCustomization.java | 8 + .../azure-communication-jobrouter/pom.xml | 12 +- .../converters/RouterRuleAdapter.java | 8 +- .../jobrouter/models/BestWorkerMode.java | 10 +- .../models/CancelExceptionAction.java | 10 +- .../ConditionalQueueSelectorAttachment.java | 9 +- .../ConditionalWorkerSelectorAttachment.java | 9 +- .../jobrouter/models/DirectMapRouterRule.java | 10 +- .../jobrouter/models/DistributionMode.java | 6 +- .../jobrouter/models/ExceptionAction.java | 8 +- .../jobrouter/models/ExceptionTrigger.java | 8 +- .../models/ExpressionRouterRule.java | 9 +- .../jobrouter/models/FunctionRouterRule.java | 9 +- .../jobrouter/models/LongestIdleMode.java | 10 +- .../ManualReclassifyExceptionAction.java | 10 +- .../PassThroughQueueSelectorAttachment.java | 9 +- .../PassThroughWorkerSelectorAttachment.java | 9 +- .../models/QueueLengthExceptionTrigger.java | 9 +- .../models/QueueSelectorAttachment.java | 8 +- .../models/ReclassifyExceptionAction.java | 10 +- .../jobrouter/models/RoundRobinMode.java | 10 +- .../jobrouter/models/RouterRule.java | 8 +- .../RuleEngineQueueSelectorAttachment.java | 9 +- .../RuleEngineWorkerSelectorAttachment.java | 9 +- .../jobrouter/models/ScoringRuleOptions.java | 8 +- .../models/StaticQueueSelectorAttachment.java | 9 +- .../jobrouter/models/StaticRouterRule.java | 10 +- .../StaticWorkerSelectorAttachment.java | 9 +- .../models/WaitTimeExceptionTrigger.java | 9 +- .../jobrouter/models/WebhookRouterRule.java | 46 +++--- ...htedAllocationQueueSelectorAttachment.java | 9 +- ...tedAllocationWorkerSelectorAttachment.java | 9 +- .../models/WorkerSelectorAttachment.java | 8 +- .../azure-communication-messages/pom.xml | 14 +- .../azure-communication-phonenumbers/pom.xml | 12 +- .../azure-communication-rooms/pom.xml | 14 +- .../azure-communication-sms/pom.xml | 12 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../README.md | 2 +- .../azure-security-confidentialledger/pom.xml | 10 +- .../azure-resourcemanager-confluent/pom.xml | 8 +- .../pom.xml | 8 +- .../azure-resourcemanager-consumption/pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 14 +- .../pom.xml | 8 +- .../azure-ai-contentsafety/pom.xml | 8 +- sdk/core/azure-core-amqp-experimental/pom.xml | 2 +- sdk/core/azure-core-amqp/CHANGELOG.md | 10 ++ sdk/core/azure-core-amqp/pom.xml | 6 +- sdk/core/azure-core-experimental/CHANGELOG.md | 10 ++ sdk/core/azure-core-experimental/pom.xml | 4 +- .../CHANGELOG.md | 10 ++ .../azure-core-http-jdk-httpclient/pom.xml | 10 +- sdk/core/azure-core-http-netty/CHANGELOG.md | 10 ++ sdk/core/azure-core-http-netty/pom.xml | 10 +- sdk/core/azure-core-http-okhttp/CHANGELOG.md | 10 ++ sdk/core/azure-core-http-okhttp/pom.xml | 10 +- sdk/core/azure-core-http-vertx/CHANGELOG.md | 10 ++ sdk/core/azure-core-http-vertx/pom.xml | 10 +- sdk/core/azure-core-management/CHANGELOG.md | 10 ++ sdk/core/azure-core-management/pom.xml | 6 +- .../CHANGELOG.md | 10 ++ .../azure-core-metrics-opentelemetry/pom.xml | 8 +- sdk/core/azure-core-perf/pom.xml | 6 +- .../CHANGELOG.md | 10 ++ .../azure-core-serializer-avro-apache/pom.xml | 6 +- .../pom.xml | 4 +- .../CHANGELOG.md | 10 ++ .../azure-core-serializer-json-gson/pom.xml | 4 +- .../CHANGELOG.md | 10 ++ .../pom.xml | 4 +- sdk/core/azure-core-test/CHANGELOG.md | 10 ++ sdk/core/azure-core-test/pom.xml | 4 +- .../pom.xml | 6 +- .../CHANGELOG.md | 10 ++ .../azure-core-tracing-opentelemetry/pom.xml | 10 +- sdk/core/azure-core-version-tests/pom.xml | 6 +- sdk/core/azure-core/CHANGELOG.md | 10 ++ sdk/core/azure-core/pom.xml | 2 +- sdk/cosmos/azure-cosmos-benchmark/pom.xml | 2 +- sdk/cosmos/azure-cosmos-encryption/pom.xml | 2 +- .../doc/configuration-reference.md | 116 +++++++------- sdk/cosmos/azure-cosmos-kafka-connect/pom.xml | 2 +- .../source/CosmosSourceConfig.java | 5 +- sdk/cosmos/azure-cosmos-spark_3_2-12/pom.xml | 4 +- sdk/cosmos/azure-cosmos-test/CHANGELOG.md | 9 +- sdk/cosmos/azure-cosmos-test/README.md | 2 +- sdk/cosmos/azure-cosmos-test/pom.xml | 2 +- sdk/cosmos/azure-cosmos-tests/pom.xml | 2 +- ...njectionServerErrorRuleOnGatewayTests.java | 150 ++++++++++-------- sdk/cosmos/azure-cosmos/pom.xml | 4 +- .../implementation/GlobalEndpointManager.java | 2 +- .../implementation/RxGatewayStoreModel.java | 2 +- .../GatewayServerErrorInjector.java | 92 ++++++++++- .../pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 4 +- .../azure-resourcemanager-dashboard/pom.xml | 8 +- .../azure-resourcemanager-databox/pom.xml | 8 +- .../azure-resourcemanager-databoxedge/pom.xml | 8 +- .../azure-resourcemanager-databricks/pom.xml | 8 +- .../azure-resourcemanager-datadog/pom.xml | 8 +- .../azure-resourcemanager-datafactory/pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../azure-developer-devcenter/pom.xml | 8 +- .../azure-resourcemanager-devcenter/pom.xml | 8 +- .../azure-resourcemanager-devhub/pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../azure-iot-deviceupdate/pom.xml | 8 +- .../pom.xml | 8 +- .../azure-resourcemanager-devspaces/pom.xml | 8 +- .../azure-resourcemanager-devtestlabs/pom.xml | 8 +- .../azure-digitaltwins-core/pom.xml | 16 +- .../pom.xml | 8 +- .../azure-resourcemanager-dnsresolver/pom.xml | 8 +- .../azure-ai-documentintelligence/README.md | 2 +- .../azure-ai-documentintelligence/pom.xml | 14 +- .../azure-resourcemanager-dynatrace/pom.xml | 8 +- sdk/e2e/pom.xml | 6 +- .../azure-analytics-defender-easm/pom.xml | 8 +- .../azure-resourcemanager-edgeorder/pom.xml | 4 +- .../azure-resourcemanager-edgezones/pom.xml | 8 +- .../azure-resourcemanager-education/pom.xml | 8 +- .../azure-resourcemanager-elastic/pom.xml | 8 +- .../azure-resourcemanager-elasticsan/pom.xml | 8 +- .../pom.xml | 4 +- .../pom.xml | 8 +- .../azure-messaging-eventgrid/pom.xml | 10 +- .../azure-resourcemanager-eventgrid/pom.xml | 8 +- .../pom.xml | 4 +- .../pom.xml | 2 +- .../azure-messaging-eventhubs-stress/pom.xml | 4 +- .../pom.xml | 2 +- .../azure-messaging-eventhubs/README.md | 2 +- .../azure-messaging-eventhubs/pom.xml | 12 +- .../pom.xml | 4 +- .../azure-resourcemanager-fluidrelay/pom.xml | 8 +- .../azure-ai-formrecognizer-perf/pom.xml | 6 +- .../azure-ai-formrecognizer/README.md | 2 +- .../azure-ai-formrecognizer/pom.xml | 14 +- .../azure-resourcemanager-frontdoor/pom.xml | 8 +- .../pom.xml | 8 +- .../azure-resourcemanager-hanaonazure/pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../azure-resourcemanager-hdinsight/pom.xml | 8 +- .../azure-resourcemanager-healthbot/pom.xml | 4 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 10 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../azure-identity-broker/CHANGELOG.md | 8 + sdk/identity/azure-identity-broker/README.md | 2 +- .../azure-identity-extensions/pom.xml | 2 +- sdk/identity/azure-identity-perf/pom.xml | 4 +- sdk/identity/azure-identity/CHANGELOG.md | 8 + sdk/identity/azure-identity/README.md | 2 +- sdk/identity/azure-identity/pom.xml | 6 +- .../pom.xml | 8 +- .../azure-resourcemanager-iotcentral/pom.xml | 8 +- .../pom.xml | 8 +- .../azure-resourcemanager-iothub/pom.xml | 8 +- .../pom.xml | 14 +- .../pom.xml | 14 +- .../azure-security-keyvault-jca/pom.xml | 2 +- .../azure-security-keyvault-keys/pom.xml | 14 +- .../azure-security-keyvault-perf/pom.xml | 10 +- .../azure-security-keyvault-secrets/pom.xml | 14 +- .../azure-security-test-keyvault-jca/pom.xml | 2 +- .../pom.xml | 8 +- sdk/kusto/azure-resourcemanager-kusto/pom.xml | 8 +- .../azure-resourcemanager-labservices/pom.xml | 4 +- .../pom.xml | 8 +- .../azure-developer-loadtesting/pom.xml | 8 +- .../azure-resourcemanager-loadtesting/pom.xml | 8 +- .../pom.xml | 8 +- .../microsoft-azure-loganalytics/pom.xml | 2 +- sdk/logic/azure-resourcemanager-logic/pom.xml | 8 +- sdk/logz/azure-resourcemanager-logz/pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 4 +- .../azure-resourcemanager-maintenance/pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- sdk/maps/azure-maps-elevation/pom.xml | 14 +- sdk/maps/azure-maps-geolocation/pom.xml | 14 +- sdk/maps/azure-maps-render/pom.xml | 14 +- sdk/maps/azure-maps-route/pom.xml | 14 +- sdk/maps/azure-maps-search/pom.xml | 14 +- sdk/maps/azure-maps-timezone/pom.xml | 14 +- sdk/maps/azure-maps-traffic/pom.xml | 14 +- sdk/maps/azure-maps-weather/pom.xml | 14 +- sdk/maps/azure-resourcemanager-maps/pom.xml | 8 +- .../azure-resourcemanager-mariadb/pom.xml | 8 +- .../pom.xml | 4 +- .../pom.xml | 8 +- .../azure-ai-metricsadvisor-perf/pom.xml | 4 +- .../azure-ai-metricsadvisor/README.md | 2 +- .../azure-ai-metricsadvisor/pom.xml | 14 +- .../pom.xml | 8 +- .../azure-mixedreality-authentication/pom.xml | 14 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../azure-iot-modelsrepository/pom.xml | 14 +- .../azure-monitor-ingestion-perf/pom.xml | 6 +- sdk/monitor/azure-monitor-ingestion/README.md | 2 +- sdk/monitor/azure-monitor-ingestion/pom.xml | 8 +- .../pom.xml | 10 +- sdk/monitor/azure-monitor-query-perf/pom.xml | 6 +- sdk/monitor/azure-monitor-query/README.md | 2 +- sdk/monitor/azure-monitor-query/pom.xml | 10 +- sdk/mysql/azure-resourcemanager-mysql/pom.xml | 8 +- .../pom.xml | 8 +- .../azure-resourcemanager-netapp/pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- sdk/nginx/azure-resourcemanager-nginx/pom.xml | 8 +- .../pom.xml | 8 +- sdk/oep/azure-resourcemanager-oep/pom.xml | 4 +- sdk/openai/azure-ai-openai-assistants/pom.xml | 14 +- sdk/openai/azure-ai-openai/README.md | 2 +- sdk/openai/azure-ai-openai/pom.xml | 14 +- .../pom.xml | 8 +- .../azure-resourcemanager-orbital/pom.xml | 8 +- .../pom.xml | 8 +- .../azure-resourcemanager-peering/pom.xml | 8 +- .../azure-ai-personalizer/pom.xml | 14 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../azure-resourcemanager-postgresql/pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../azure-resourcemanager-providerhub/pom.xml | 8 +- .../README.md | 2 +- .../pom.xml | 8 +- .../azure-analytics-purview-catalog/README.md | 2 +- .../azure-analytics-purview-catalog/pom.xml | 8 +- .../azure-analytics-purview-datamap/pom.xml | 8 +- .../README.md | 2 +- .../azure-analytics-purview-scanning/pom.xml | 8 +- .../azure-analytics-purview-sharing/pom.xml | 8 +- .../README.md | 2 +- .../azure-analytics-purview-workflow/pom.xml | 8 +- .../azure-resourcemanager-purview/pom.xml | 8 +- sdk/quantum/azure-quantum-jobs/pom.xml | 8 +- .../azure-resourcemanager-quantum/pom.xml | 8 +- .../azure-resourcemanager-qumulo/pom.xml | 8 +- sdk/quota/azure-resourcemanager-quota/pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- sdk/relay/azure-resourcemanager-relay/pom.xml | 4 +- .../pom.xml | 14 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../azure-resourcemanager-appplatform/pom.xml | 2 +- .../azure-resourcemanager-appservice/pom.xml | 2 +- .../pom.xml | 2 +- .../azure-resourcemanager-cdn/pom.xml | 2 +- .../azure-resourcemanager-compute/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../azure-resourcemanager-cosmos/pom.xml | 2 +- .../azure-resourcemanager-dns/pom.xml | 2 +- .../azure-resourcemanager-eventhubs/pom.xml | 2 +- .../azure-resourcemanager-keyvault/pom.xml | 2 +- .../azure-resourcemanager-monitor/pom.xml | 2 +- .../azure-resourcemanager-msi/pom.xml | 2 +- .../azure-resourcemanager-network/pom.xml | 2 +- .../azure-resourcemanager-perf/pom.xml | 4 +- .../azure-resourcemanager-privatedns/pom.xml | 2 +- .../azure-resourcemanager-redis/pom.xml | 2 +- .../azure-resourcemanager-resources/pom.xml | 6 +- .../azure-resourcemanager-samples/pom.xml | 6 +- .../azure-resourcemanager-search/pom.xml | 2 +- .../azure-resourcemanager-servicebus/pom.xml | 2 +- .../azure-resourcemanager-sql/pom.xml | 2 +- .../azure-resourcemanager-storage/pom.xml | 2 +- .../azure-resourcemanager-test/pom.xml | 10 +- .../pom.xml | 2 +- .../azure-resourcemanager/pom.xml | 12 +- sdk/resourcemanagerhybrid/README.md | 2 +- .../azure-resourcemanager-appservice/pom.xml | 2 +- .../pom.xml | 2 +- .../azure-resourcemanager-compute/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../azure-resourcemanager-dns/pom.xml | 2 +- .../azure-resourcemanager-eventhubs/pom.xml | 2 +- .../azure-resourcemanager-keyvault/pom.xml | 2 +- .../azure-resourcemanager-monitor/pom.xml | 2 +- .../azure-resourcemanager-network/pom.xml | 2 +- .../azure-resourcemanager-resources/pom.xml | 6 +- .../azure-resourcemanager-storage/pom.xml | 2 +- .../azure-resourcemanager-test/pom.xml | 12 +- .../azure-resourcemanager/pom.xml | 8 +- .../pom.xml | 8 +- .../README.md | 2 +- .../pom.xml | 6 +- .../README.md | 2 +- .../pom.xml | 6 +- .../azure-data-schemaregistry/README.md | 2 +- .../azure-data-schemaregistry/pom.xml | 8 +- sdk/scvmm/azure-resourcemanager-scvmm/pom.xml | 4 +- sdk/search/azure-search-documents/pom.xml | 10 +- sdk/search/azure-search-perf/pom.xml | 4 +- .../azure-resourcemanager-security/pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 4 +- .../azure-resourcemanager-selfhelp/pom.xml | 8 +- .../azure-messaging-servicebus-stress/pom.xml | 4 +- .../pom.xml | 4 +- .../azure-messaging-servicebus/CHANGELOG.md | 1 + .../azure-messaging-servicebus/README.md | 2 +- .../azure-messaging-servicebus/pom.xml | 20 +-- .../servicebus/SessionsMessagePump.java | 2 +- .../servicebus/IntegrationTestBase.java | 6 + .../pom.xml | 8 +- .../pom.xml | 6 +- .../pom.xml | 8 +- .../azure-resourcemanager-signalr/pom.xml | 8 +- .../azure-resourcemanager-sphere/pom.xml | 8 +- .../pom.xml | 2 +- .../spring-cloud-azure-actuator/pom.xml | 2 +- .../pom.xml | 4 +- .../spring-cloud-azure-autoconfigure/pom.xml | 4 +- sdk/spring/spring-cloud-azure-core/pom.xml | 8 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 4 +- .../spring-cloud-azure-trace-sleuth/pom.xml | 2 +- .../pom.xml | 2 +- .../spring-messaging-azure-servicebus/pom.xml | 4 +- .../pom.xml | 4 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../azure-resourcemanager-standbypool/pom.xml | 8 +- sdk/storage/azure-storage-blob-batch/pom.xml | 14 +- .../azure-storage-blob-changefeed/pom.xml | 14 +- .../azure-storage-blob-cryptography/pom.xml | 14 +- sdk/storage/azure-storage-blob-nio/pom.xml | 12 +- sdk/storage/azure-storage-blob-stress/pom.xml | 6 +- sdk/storage/azure-storage-blob/pom.xml | 14 +- sdk/storage/azure-storage-common/pom.xml | 14 +- .../pom.xml | 6 +- .../azure-storage-file-datalake/pom.xml | 14 +- .../azure-storage-file-share-stress/pom.xml | 6 +- sdk/storage/azure-storage-file-share/pom.xml | 14 +- .../azure-storage-internal-avro/pom.xml | 4 +- sdk/storage/azure-storage-perf/pom.xml | 6 +- sdk/storage/azure-storage-queue/pom.xml | 14 +- sdk/storage/azure-storage-stress/pom.xml | 6 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../azure-resourcemanager-storagepool/pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../azure-resourcemanager-support/pom.xml | 8 +- .../pom.xml | 14 +- .../azure-analytics-synapse-artifacts/pom.xml | 14 +- .../pom.xml | 14 +- .../pom.xml | 14 +- .../azure-analytics-synapse-spark/pom.xml | 14 +- .../azure-resourcemanager-synapse/pom.xml | 8 +- sdk/tables/azure-data-tables-perf/pom.xml | 6 +- sdk/tables/azure-data-tables/pom.xml | 8 +- sdk/template/azure-sdk-template-three/pom.xml | 2 +- sdk/template/azure-sdk-template-two/pom.xml | 2 +- sdk/template/azure-sdk-template/pom.xml | 2 +- sdk/template/azure-template-perf/pom.xml | 2 +- sdk/template/azure-template-stress/pom.xml | 10 +- .../azure-ai-textanalytics-perf/pom.xml | 6 +- .../azure-ai-textanalytics/README.md | 2 +- .../azure-ai-textanalytics/pom.xml | 14 +- .../pom.xml | 8 +- sdk/tools/azure-sdk-build-tool/pom.xml | 4 +- .../azure-ai-documenttranslator/pom.xml | 12 +- .../azure-ai-translation-text/pom.xml | 12 +- .../azure-media-videoanalyzer-edge/pom.xml | 4 +- .../pom.xml | 4 +- .../azure-ai-vision-imageanalysis/pom.xml | 8 +- .../pom.xml | 8 +- .../pom.xml | 8 +- .../azure-messaging-webpubsub-client/pom.xml | 6 +- .../azure-messaging-webpubsub/pom.xml | 8 +- .../azure-resourcemanager-webpubsub/pom.xml | 8 +- .../azure-resourcemanager-workloads/pom.xml | 8 +- .../pom.xml | 4 +- 478 files changed, 3092 insertions(+), 1676 deletions(-) create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingFailed.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingStarted.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingStatus.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingStatusDetails.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingStopped.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingUpdate.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/MediaStreamingFailed.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/MediaStreamingStarted.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/MediaStreamingStatus.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/MediaStreamingStatusDetails.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/MediaStreamingStopped.java create mode 100644 sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/MediaStreamingUpdate.java diff --git a/.github/workflows/event-processor.yml b/.github/workflows/event-processor.yml index 615c51b0f82e..8f448d1d7793 100644 --- a/.github/workflows/event-processor.yml +++ b/.github/workflows/event-processor.yml @@ -58,7 +58,7 @@ jobs: run: > dotnet tool install Azure.Sdk.Tools.GitHubEventProcessor - --version 1.0.0-dev.20240311.2 + --version 1.0.0-dev.20240502.2 --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json --global shell: bash @@ -114,7 +114,7 @@ jobs: run: > dotnet tool install Azure.Sdk.Tools.GitHubEventProcessor - --version 1.0.0-dev.20240311.2 + --version 1.0.0-dev.20240502.2 --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json --global shell: bash diff --git a/.github/workflows/scheduled-event-processor.yml b/.github/workflows/scheduled-event-processor.yml index 120531ac3d5b..09d530acfe98 100644 --- a/.github/workflows/scheduled-event-processor.yml +++ b/.github/workflows/scheduled-event-processor.yml @@ -39,7 +39,7 @@ jobs: run: > dotnet tool install Azure.Sdk.Tools.GitHubEventProcessor - --version 1.0.0-dev.20240311.2 + --version 1.0.0-dev.20240502.2 --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json --global shell: bash diff --git a/common/perf-test-core/pom.xml b/common/perf-test-core/pom.xml index 8b7c9183d965..4ea0c0b19b47 100644 --- a/common/perf-test-core/pom.xml +++ b/common/perf-test-core/pom.xml @@ -82,22 +82,22 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 io.vertx diff --git a/common/smoke-tests/pom.xml b/common/smoke-tests/pom.xml index 350efff330ce..d8303d2dd9b2 100644 --- a/common/smoke-tests/pom.xml +++ b/common/smoke-tests/pom.xml @@ -88,31 +88,31 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-tracing-opentelemetry - 1.0.0-beta.45 + 1.0.0-beta.46 com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 com.azure azure-core-amqp - 2.9.3 + 2.9.4 @@ -124,7 +124,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 7cef931ae6c8..bc256bc3f118 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -81,23 +81,23 @@ com.azure:azure-communication-rooms;1.1.1;1.2.0-beta.1 com.azure:azure-communication-sms;1.1.23;1.2.0-beta.1 com.azure:azure-containers-containerregistry;1.2.7;1.3.0-beta.1 com.azure:azure-containers-containerregistry-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-core;1.48.0;1.49.0 -com.azure:azure-core-amqp;2.9.3;2.9.4 +com.azure:azure-core;1.49.0;1.50.0-beta.1 +com.azure:azure-core-amqp;2.9.4;2.10.0-beta.1 com.azure:azure-core-amqp-experimental;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-core-experimental;1.0.0-beta.49;1.0.0-beta.50 -com.azure:azure-core-http-jdk-httpclient;1.0.0-beta.12;1.0.0-beta.13 -com.azure:azure-core-http-netty;1.14.2;1.15.0 -com.azure:azure-core-http-okhttp;1.11.20;1.11.21 -com.azure:azure-core-http-vertx;1.0.0-beta.17;1.0.0-beta.18 -com.azure:azure-core-management;1.13.0;1.14.0 -com.azure:azure-core-metrics-opentelemetry;1.0.0-beta.18;1.0.0-beta.19 +com.azure:azure-core-experimental;1.0.0-beta.50;1.0.0-beta.51 +com.azure:azure-core-http-jdk-httpclient;1.0.0-beta.13;1.0.0-beta.14 +com.azure:azure-core-http-netty;1.15.0;1.16.0-beta.1 +com.azure:azure-core-http-okhttp;1.11.21;1.12.0-beta.1 +com.azure:azure-core-http-vertx;1.0.0-beta.18;1.0.0-beta.19 +com.azure:azure-core-management;1.14.0;1.15.0-beta.1 +com.azure:azure-core-metrics-opentelemetry;1.0.0-beta.19;1.0.0-beta.20 com.azure:azure-core-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-core-serializer-avro-apache;1.0.0-beta.45;1.0.0-beta.46 +com.azure:azure-core-serializer-avro-apache;1.0.0-beta.46;1.0.0-beta.47 com.azure:azure-core-serializer-avro-jackson;1.0.0-beta.1;1.0.0-beta.2 -com.azure:azure-core-serializer-json-gson;1.2.11;1.2.12 -com.azure:azure-core-serializer-json-jackson;1.4.11;1.4.12 -com.azure:azure-core-test;1.24.2;1.25.0 -com.azure:azure-core-tracing-opentelemetry;1.0.0-beta.45;1.0.0-beta.46 +com.azure:azure-core-serializer-json-gson;1.2.12;1.3.0-beta.1 +com.azure:azure-core-serializer-json-jackson;1.4.12;1.5.0-beta.1 +com.azure:azure-core-test;1.25.0;1.26.0-beta.1 +com.azure:azure-core-tracing-opentelemetry;1.0.0-beta.46;1.0.0-beta.47 com.azure:azure-core-tracing-opentelemetry-samples;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-core-version-tests;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-cosmos;4.59.0;4.60.0-beta.1 @@ -127,9 +127,9 @@ com.azure:azure-e2e;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-health-insights-clinicalmatching;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-health-insights-cancerprofiling;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-health-insights-radiologyinsights;1.0.0-beta.1;1.0.0-beta.2 -com.azure:azure-identity;1.12.0;1.13.0-beta.1 +com.azure:azure-identity;1.12.1;1.13.0-beta.1 com.azure:azure-identity-extensions;1.1.15;1.2.0-beta.2 -com.azure:azure-identity-broker;1.1.0;1.2.0-beta.1 +com.azure:azure-identity-broker;1.1.1;1.2.0-beta.1 com.azure:azure-identity-broker-samples;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-identity-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-iot-deviceupdate;1.0.17;1.1.0-beta.1 @@ -469,9 +469,6 @@ com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 # In the pom, the version update tag after the version should name the unreleased package and the dependency version: # -unreleased_com.azure:azure-core-amqp;2.9.4 -unreleased_com.azure:azure-core-test;1.25.0 - # Released Beta dependencies: Copy the entry from above, prepend "beta_", remove the current # version and set the version to the released beta. Released beta dependencies are only valid # for dependency versions. These entries are specifically for when we've released a beta for diff --git a/sdk/advisor/azure-resourcemanager-advisor/pom.xml b/sdk/advisor/azure-resourcemanager-advisor/pom.xml index d785f2cadcf2..3f49cd7912ac 100644 --- a/sdk/advisor/azure-resourcemanager-advisor/pom.xml +++ b/sdk/advisor/azure-resourcemanager-advisor/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/agrifood/azure-resourcemanager-agrifood/pom.xml b/sdk/agrifood/azure-resourcemanager-agrifood/pom.xml index 4da2313f7132..58ad6195afda 100644 --- a/sdk/agrifood/azure-resourcemanager-agrifood/pom.xml +++ b/sdk/agrifood/azure-resourcemanager-agrifood/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/README.md b/sdk/agrifood/azure-verticals-agrifood-farming/README.md index f4bb0853dab3..d8d1efe2230c 100644 --- a/sdk/agrifood/azure-verticals-agrifood-farming/README.md +++ b/sdk/agrifood/azure-verticals-agrifood-farming/README.md @@ -47,7 +47,7 @@ To use the [DefaultAzureCredential][DefaultAzureCredential] provider shown below com.azure azure-identity - 1.11.4 + 1.12.0 ``` diff --git a/sdk/agrifood/azure-verticals-agrifood-farming/pom.xml b/sdk/agrifood/azure-verticals-agrifood-farming/pom.xml index 1c15857fb2c4..2380e6c807a5 100644 --- a/sdk/agrifood/azure-verticals-agrifood-farming/pom.xml +++ b/sdk/agrifood/azure-verticals-agrifood-farming/pom.xml @@ -43,17 +43,17 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-experimental - 1.0.0-beta.49 + 1.0.0-beta.50 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 @@ -78,13 +78,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -102,7 +102,7 @@ com.azure azure-core-serializer-json-jackson - 1.4.11 + 1.4.12 test diff --git a/sdk/alertsmanagement/azure-resourcemanager-alertsmanagement/pom.xml b/sdk/alertsmanagement/azure-resourcemanager-alertsmanagement/pom.xml index 7cf16d9c4bf8..03eba29e7389 100644 --- a/sdk/alertsmanagement/azure-resourcemanager-alertsmanagement/pom.xml +++ b/sdk/alertsmanagement/azure-resourcemanager-alertsmanagement/pom.xml @@ -44,12 +44,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/README.md b/sdk/anomalydetector/azure-ai-anomalydetector/README.md index a3cfe120f28d..ce8a01363436 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/README.md +++ b/sdk/anomalydetector/azure-ai-anomalydetector/README.md @@ -54,7 +54,7 @@ To use the [DefaultAzureCredential][DefaultAzureCredential] provider shown below com.azure azure-identity - 1.11.4 + 1.12.0 ``` diff --git a/sdk/anomalydetector/azure-ai-anomalydetector/pom.xml b/sdk/anomalydetector/azure-ai-anomalydetector/pom.xml index d29c9b4e9f8d..f502c66f4eac 100644 --- a/sdk/anomalydetector/azure-ai-anomalydetector/pom.xml +++ b/sdk/anomalydetector/azure-ai-anomalydetector/pom.xml @@ -45,12 +45,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 @@ -75,13 +75,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/aot/azure-aot-graalvm-samples/pom.xml b/sdk/aot/azure-aot-graalvm-samples/pom.xml index e3d21b48bff2..a2fb966605e4 100644 --- a/sdk/aot/azure-aot-graalvm-samples/pom.xml +++ b/sdk/aot/azure-aot-graalvm-samples/pom.xml @@ -66,7 +66,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 com.azure diff --git a/sdk/apicenter/azure-resourcemanager-apicenter/pom.xml b/sdk/apicenter/azure-resourcemanager-apicenter/pom.xml index 8e76961c4592..26b29c6f3e3e 100644 --- a/sdk/apicenter/azure-resourcemanager-apicenter/pom.xml +++ b/sdk/apicenter/azure-resourcemanager-apicenter/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/apimanagement/azure-resourcemanager-apimanagement/pom.xml b/sdk/apimanagement/azure-resourcemanager-apimanagement/pom.xml index 532fc2afb94b..ef492c6d15c3 100644 --- a/sdk/apimanagement/azure-resourcemanager-apimanagement/pom.xml +++ b/sdk/apimanagement/azure-resourcemanager-apimanagement/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/appcomplianceautomation/azure-resourcemanager-appcomplianceautomation/pom.xml b/sdk/appcomplianceautomation/azure-resourcemanager-appcomplianceautomation/pom.xml index f3034c9f650f..5c162a6ee8f6 100644 --- a/sdk/appcomplianceautomation/azure-resourcemanager-appcomplianceautomation/pom.xml +++ b/sdk/appcomplianceautomation/azure-resourcemanager-appcomplianceautomation/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/appconfiguration/azure-data-appconfiguration-perf/pom.xml b/sdk/appconfiguration/azure-data-appconfiguration-perf/pom.xml index e88095e82032..ffee58abad69 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration-perf/pom.xml +++ b/sdk/appconfiguration/azure-data-appconfiguration-perf/pom.xml @@ -38,12 +38,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 @@ -97,7 +97,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 diff --git a/sdk/appconfiguration/azure-data-appconfiguration/pom.xml b/sdk/appconfiguration/azure-data-appconfiguration/pom.xml index f0444709d65a..99f0286fb4a0 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/pom.xml +++ b/sdk/appconfiguration/azure-data-appconfiguration/pom.xml @@ -51,7 +51,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure @@ -61,25 +61,25 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -115,7 +115,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -130,7 +130,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/pom.xml b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/pom.xml index 2149739bd7a1..5d3a96e9709b 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/pom.xml +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/pom.xml b/sdk/appcontainers/azure-resourcemanager-appcontainers/pom.xml index f1f9bd039df0..06f2996e3bf5 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/pom.xml +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/pom.xml b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/pom.xml index b75803d31f0d..3e979aa60ffc 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/pom.xml +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/astro/azure-resourcemanager-astro/pom.xml b/sdk/astro/azure-resourcemanager-astro/pom.xml index 023395aef513..530459379db5 100644 --- a/sdk/astro/azure-resourcemanager-astro/pom.xml +++ b/sdk/astro/azure-resourcemanager-astro/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/attestation/azure-resourcemanager-attestation/pom.xml b/sdk/attestation/azure-resourcemanager-attestation/pom.xml index a8058c54526c..6e80cee07a28 100644 --- a/sdk/attestation/azure-resourcemanager-attestation/pom.xml +++ b/sdk/attestation/azure-resourcemanager-attestation/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/attestation/azure-security-attestation/pom.xml b/sdk/attestation/azure-security-attestation/pom.xml index d22798b09205..df72c6692616 100644 --- a/sdk/attestation/azure-security-attestation/pom.xml +++ b/sdk/attestation/azure-security-attestation/pom.xml @@ -45,7 +45,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.nimbusds @@ -65,13 +65,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-core-tracing-opentelemetry - 1.0.0-beta.45 + 1.0.0-beta.46 test @@ -113,19 +113,19 @@ com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -176,7 +176,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/automanage/azure-resourcemanager-automanage/pom.xml b/sdk/automanage/azure-resourcemanager-automanage/pom.xml index 86b26375f5d1..c657f12b9fc4 100644 --- a/sdk/automanage/azure-resourcemanager-automanage/pom.xml +++ b/sdk/automanage/azure-resourcemanager-automanage/pom.xml @@ -44,12 +44,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 diff --git a/sdk/automation/azure-resourcemanager-automation/pom.xml b/sdk/automation/azure-resourcemanager-automation/pom.xml index 8cb4888b2e0c..a02970947ab8 100644 --- a/sdk/automation/azure-resourcemanager-automation/pom.xml +++ b/sdk/automation/azure-resourcemanager-automation/pom.xml @@ -44,12 +44,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 diff --git a/sdk/avs/azure-resourcemanager-avs/pom.xml b/sdk/avs/azure-resourcemanager-avs/pom.xml index cebadcc90173..e5e8bfc77712 100644 --- a/sdk/avs/azure-resourcemanager-avs/pom.xml +++ b/sdk/avs/azure-resourcemanager-avs/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/azureadexternalidentities/azure-resourcemanager-azureadexternalidentities/pom.xml b/sdk/azureadexternalidentities/azure-resourcemanager-azureadexternalidentities/pom.xml index 6a65d7fa0bbb..a9558cb5a4d3 100644 --- a/sdk/azureadexternalidentities/azure-resourcemanager-azureadexternalidentities/pom.xml +++ b/sdk/azureadexternalidentities/azure-resourcemanager-azureadexternalidentities/pom.xml @@ -44,12 +44,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 diff --git a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/pom.xml b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/pom.xml index 58ebaaa4ae70..54953c5f3885 100644 --- a/sdk/azurearcdata/azure-resourcemanager-azurearcdata/pom.xml +++ b/sdk/azurearcdata/azure-resourcemanager-azurearcdata/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/azurestack/azure-resourcemanager-azurestack/pom.xml b/sdk/azurestack/azure-resourcemanager-azurestack/pom.xml index 45b4663f8ab5..95aaa1cf35ec 100644 --- a/sdk/azurestack/azure-resourcemanager-azurestack/pom.xml +++ b/sdk/azurestack/azure-resourcemanager-azurestack/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml index 0e44cc40a922..5d1c3579d938 100644 --- a/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml +++ b/sdk/azurestackhci/azure-resourcemanager-azurestackhci/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/pom.xml b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/pom.xml index f86a52c52dad..a2a91feb2726 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/pom.xml +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/batch/azure-resourcemanager-batch/pom.xml b/sdk/batch/azure-resourcemanager-batch/pom.xml index 487a7e92a780..a9b8d0b6aae5 100644 --- a/sdk/batch/azure-resourcemanager-batch/pom.xml +++ b/sdk/batch/azure-resourcemanager-batch/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/batch/microsoft-azure-batch/pom.xml b/sdk/batch/microsoft-azure-batch/pom.xml index baaac2e5e4b3..31052dbcd565 100644 --- a/sdk/batch/microsoft-azure-batch/pom.xml +++ b/sdk/batch/microsoft-azure-batch/pom.xml @@ -85,7 +85,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 test diff --git a/sdk/batchai/azure-resourcemanager-batchai/pom.xml b/sdk/batchai/azure-resourcemanager-batchai/pom.xml index c538571a5133..2035872f4e34 100644 --- a/sdk/batchai/azure-resourcemanager-batchai/pom.xml +++ b/sdk/batchai/azure-resourcemanager-batchai/pom.xml @@ -44,12 +44,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 diff --git a/sdk/billing/azure-resourcemanager-billing/pom.xml b/sdk/billing/azure-resourcemanager-billing/pom.xml index 007972bef8cb..67408a92ec32 100644 --- a/sdk/billing/azure-resourcemanager-billing/pom.xml +++ b/sdk/billing/azure-resourcemanager-billing/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/pom.xml b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/pom.xml index 7706a866723a..771f4180eec1 100644 --- a/sdk/billingbenefits/azure-resourcemanager-billingbenefits/pom.xml +++ b/sdk/billingbenefits/azure-resourcemanager-billingbenefits/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/botservice/azure-resourcemanager-botservice/pom.xml b/sdk/botservice/azure-resourcemanager-botservice/pom.xml index 5f8ff020a749..40a6cbf19b52 100644 --- a/sdk/botservice/azure-resourcemanager-botservice/pom.xml +++ b/sdk/botservice/azure-resourcemanager-botservice/pom.xml @@ -44,12 +44,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 diff --git a/sdk/changeanalysis/azure-resourcemanager-changeanalysis/pom.xml b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/pom.xml index 80c5e532eaa5..3f6b292e38c4 100644 --- a/sdk/changeanalysis/azure-resourcemanager-changeanalysis/pom.xml +++ b/sdk/changeanalysis/azure-resourcemanager-changeanalysis/pom.xml @@ -45,12 +45,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure.resourcemanager @@ -61,13 +61,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/chaos/azure-resourcemanager-chaos/pom.xml b/sdk/chaos/azure-resourcemanager-chaos/pom.xml index b12880124c84..a924e5895b85 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/pom.xml +++ b/sdk/chaos/azure-resourcemanager-chaos/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/pom.xml b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/pom.xml index 76ac0f6e23a4..40b46a3faee9 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/pom.xml +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/commerce/azure-resourcemanager-commerce/pom.xml b/sdk/commerce/azure-resourcemanager-commerce/pom.xml index f968aa560610..3ada1b25ccb8 100644 --- a/sdk/commerce/azure-resourcemanager-commerce/pom.xml +++ b/sdk/commerce/azure-resourcemanager-commerce/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/communication/azure-communication-callautomation/pom.xml b/sdk/communication/azure-communication-callautomation/pom.xml index f6b4e4f27fba..32b5e27eb7b8 100644 --- a/sdk/communication/azure-communication-callautomation/pom.xml +++ b/sdk/communication/azure-communication-callautomation/pom.xml @@ -55,7 +55,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure @@ -77,7 +77,7 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test @@ -119,19 +119,19 @@ com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -150,7 +150,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 @@ -201,7 +201,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationEventParser.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationEventParser.java index a9a96b00a4c0..f130e5a14f6d 100644 --- a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationEventParser.java +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/CallAutomationEventParser.java @@ -45,6 +45,9 @@ import com.azure.communication.callautomation.models.events.SendDtmfTonesCompleted; import com.azure.communication.callautomation.models.events.SendDtmfTonesFailed; import com.azure.communication.callautomation.models.events.TranscriptionUpdated; +import com.azure.communication.callautomation.models.events.MediaStreamingStarted; +import com.azure.communication.callautomation.models.events.MediaStreamingStopped; +import com.azure.communication.callautomation.models.events.MediaStreamingFailed; import com.azure.core.models.CloudEvent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.core.JsonProcessingException; @@ -190,6 +193,12 @@ private static CallAutomationEventBase parseSingleCloudEvent(String data, String ret = mapper.convertValue(eventData, CreateCallFailed.class); } else if (Objects.equals(eventType, "Microsoft.Communication.HoldFailed")) { ret = mapper.convertValue(eventData, HoldFailed.class); + } else if (Objects.equals(eventType, "Microsoft.Communication.MediaStreamingStarted")) { + ret = mapper.convertValue(eventData, MediaStreamingStarted.class); + } else if (Objects.equals(eventType, "Microsoft.Communication.MediaStreamingStopped")) { + ret = mapper.convertValue(eventData, MediaStreamingStopped.class); + } else if (Objects.equals(eventType, "Microsoft.Communication.MediaStreamingFailed")) { + ret = mapper.convertValue(eventData, MediaStreamingFailed.class); } return ret; } catch (RuntimeException e) { diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingFailed.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingFailed.java new file mode 100644 index 000000000000..4f7e6eb921a6 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingFailed.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.communication.callautomation.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The MediaStreamingFailed model. */ +@Immutable +public final class MediaStreamingFailed { + /* + * Used by customers when calling mid-call actions to correlate the request + * to the response event. + */ + @JsonProperty(value = "operationContext", access = JsonProperty.Access.WRITE_ONLY) + private String operationContext; + + /* + * Contains the resulting SIP code, sub-code and message. + */ + @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) + private ResultInformation resultInformation; + + /* + * Defines the result for audio streaming update with the current status + * and the details about the status + */ + @JsonProperty(value = "mediaStreamingUpdate", access = JsonProperty.Access.WRITE_ONLY) + private MediaStreamingUpdate mediaStreamingUpdate; + + /* + * Call connection ID. + */ + @JsonProperty(value = "callConnectionId", access = JsonProperty.Access.WRITE_ONLY) + private String callConnectionId; + + /* + * Server call ID. + */ + @JsonProperty(value = "serverCallId", access = JsonProperty.Access.WRITE_ONLY) + private String serverCallId; + + /* + * Correlation ID for event to call correlation. Also called ChainId for + * skype chain ID. + */ + @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) + private String correlationId; + + /** + * Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to + * the response event. + * + * @return the operationContext value. + */ + public String getOperationContext() { + return this.operationContext; + } + + /** + * Get the resultInformation property: Contains the resulting SIP code, sub-code and message. + * + * @return the resultInformation value. + */ + public ResultInformation getResultInformation() { + return this.resultInformation; + } + + /** + * Get the mediaStreamingUpdate property: Defines the result for audio streaming update with the current status and + * the details about the status. + * + * @return the mediaStreamingUpdate value. + */ + public MediaStreamingUpdate getMediaStreamingUpdate() { + return this.mediaStreamingUpdate; + } + + /** + * Get the callConnectionId property: Call connection ID. + * + * @return the callConnectionId value. + */ + public String getCallConnectionId() { + return this.callConnectionId; + } + + /** + * Get the serverCallId property: Server call ID. + * + * @return the serverCallId value. + */ + public String getServerCallId() { + return this.serverCallId; + } + + /** + * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain + * ID. + * + * @return the correlationId value. + */ + public String getCorrelationId() { + return this.correlationId; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingStarted.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingStarted.java new file mode 100644 index 000000000000..de6ff9beb057 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingStarted.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.communication.callautomation.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The MediaStreamingStarted model. */ +@Immutable +public final class MediaStreamingStarted { + /* + * Used by customers when calling mid-call actions to correlate the request + * to the response event. + */ + @JsonProperty(value = "operationContext", access = JsonProperty.Access.WRITE_ONLY) + private String operationContext; + + /* + * Contains the resulting SIP code, sub-code and message. + */ + @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) + private ResultInformation resultInformation; + + /* + * Defines the result for audio streaming update with the current status + * and the details about the status + */ + @JsonProperty(value = "mediaStreamingUpdate", access = JsonProperty.Access.WRITE_ONLY) + private MediaStreamingUpdate mediaStreamingUpdate; + + /* + * Call connection ID. + */ + @JsonProperty(value = "callConnectionId", access = JsonProperty.Access.WRITE_ONLY) + private String callConnectionId; + + /* + * Server call ID. + */ + @JsonProperty(value = "serverCallId", access = JsonProperty.Access.WRITE_ONLY) + private String serverCallId; + + /* + * Correlation ID for event to call correlation. Also called ChainId for + * skype chain ID. + */ + @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) + private String correlationId; + + /** + * Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to + * the response event. + * + * @return the operationContext value. + */ + public String getOperationContext() { + return this.operationContext; + } + + /** + * Get the resultInformation property: Contains the resulting SIP code, sub-code and message. + * + * @return the resultInformation value. + */ + public ResultInformation getResultInformation() { + return this.resultInformation; + } + + /** + * Get the mediaStreamingUpdate property: Defines the result for audio streaming update with the current status and + * the details about the status. + * + * @return the mediaStreamingUpdate value. + */ + public MediaStreamingUpdate getMediaStreamingUpdate() { + return this.mediaStreamingUpdate; + } + + /** + * Get the callConnectionId property: Call connection ID. + * + * @return the callConnectionId value. + */ + public String getCallConnectionId() { + return this.callConnectionId; + } + + /** + * Get the serverCallId property: Server call ID. + * + * @return the serverCallId value. + */ + public String getServerCallId() { + return this.serverCallId; + } + + /** + * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain + * ID. + * + * @return the correlationId value. + */ + public String getCorrelationId() { + return this.correlationId; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingStatus.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingStatus.java new file mode 100644 index 000000000000..84ae9e81ff18 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingStatus.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.communication.callautomation.implementation.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MediaStreamingStatus. */ +public final class MediaStreamingStatus extends ExpandableStringEnum { + /** Static value mediaStreamingStarted for MediaStreamingStatus. */ + public static final MediaStreamingStatus MEDIA_STREAMING_STARTED = fromString("mediaStreamingStarted"); + + /** Static value mediaStreamingFailed for MediaStreamingStatus. */ + public static final MediaStreamingStatus MEDIA_STREAMING_FAILED = fromString("mediaStreamingFailed"); + + /** Static value mediaStreamingStopped for MediaStreamingStatus. */ + public static final MediaStreamingStatus MEDIA_STREAMING_STOPPED = fromString("mediaStreamingStopped"); + + /** Static value unspecifiedError for MediaStreamingStatus. */ + public static final MediaStreamingStatus UNSPECIFIED_ERROR = fromString("unspecifiedError"); + + /** + * Creates or finds a MediaStreamingStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding MediaStreamingStatus. + */ + @JsonCreator + public static MediaStreamingStatus fromString(String name) { + return fromString(name, MediaStreamingStatus.class); + } + + /** @return known MediaStreamingStatus values. */ + public static Collection values() { + return values(MediaStreamingStatus.class); + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingStatusDetails.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingStatusDetails.java new file mode 100644 index 000000000000..93430c0d45f5 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingStatusDetails.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.communication.callautomation.implementation.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MediaStreamingStatusDetails. */ +public final class MediaStreamingStatusDetails extends ExpandableStringEnum { + /** Static value subscriptionStarted for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails SUBSCRIPTION_STARTED = fromString("subscriptionStarted"); + + /** Static value streamConnectionReestablished for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails STREAM_CONNECTION_REESTABLISHED = + fromString("streamConnectionReestablished"); + + /** Static value streamConnectionUnsuccessful for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails STREAM_CONNECTION_UNSUCCESSFUL = + fromString("streamConnectionUnsuccessful"); + + /** Static value streamUrlMissing for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails STREAM_URL_MISSING = fromString("streamUrlMissing"); + + /** Static value serviceShutdown for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails SERVICE_SHUTDOWN = fromString("serviceShutdown"); + + /** Static value streamConnectionInterrupted for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails STREAM_CONNECTION_INTERRUPTED = + fromString("streamConnectionInterrupted"); + + /** Static value speechServicesConnectionError for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails SPEECH_SERVICES_CONNECTION_ERROR = + fromString("speechServicesConnectionError"); + + /** Static value subscriptionStopped for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails SUBSCRIPTION_STOPPED = fromString("subscriptionStopped"); + + /** Static value unspecifiedError for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails UNSPECIFIED_ERROR = fromString("unspecifiedError"); + + /** Static value authenticationFailure for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails AUTHENTICATION_FAILURE = fromString("authenticationFailure"); + + /** Static value badRequest for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails BAD_REQUEST = fromString("badRequest"); + + /** Static value tooManyRequests for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails TOO_MANY_REQUESTS = fromString("tooManyRequests"); + + /** Static value forbidden for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails FORBIDDEN = fromString("forbidden"); + + /** Static value serviceTimeout for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails SERVICE_TIMEOUT = fromString("serviceTimeout"); + + /** Static value initialWebSocketConnectionFailed for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails INITIAL_WEB_SOCKET_CONNECTION_FAILED = + fromString("initialWebSocketConnectionFailed"); + + /** + * Creates or finds a MediaStreamingStatusDetails from its string representation. + * + * @param name a name to look for. + * @return the corresponding MediaStreamingStatusDetails. + */ + @JsonCreator + public static MediaStreamingStatusDetails fromString(String name) { + return fromString(name, MediaStreamingStatusDetails.class); + } + + /** @return known MediaStreamingStatusDetails values. */ + public static Collection values() { + return values(MediaStreamingStatusDetails.class); + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingStopped.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingStopped.java new file mode 100644 index 000000000000..95390daa30f2 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingStopped.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.communication.callautomation.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The MediaStreamingStopped model. */ +@Immutable +public final class MediaStreamingStopped { + /* + * Used by customers when calling mid-call actions to correlate the request + * to the response event. + */ + @JsonProperty(value = "operationContext", access = JsonProperty.Access.WRITE_ONLY) + private String operationContext; + + /* + * Contains the resulting SIP code, sub-code and message. + */ + @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) + private ResultInformation resultInformation; + + /* + * Defines the result for audio streaming update with the current status + * and the details about the status + */ + @JsonProperty(value = "mediaStreamingUpdate", access = JsonProperty.Access.WRITE_ONLY) + private MediaStreamingUpdate mediaStreamingUpdate; + + /* + * Call connection ID. + */ + @JsonProperty(value = "callConnectionId", access = JsonProperty.Access.WRITE_ONLY) + private String callConnectionId; + + /* + * Server call ID. + */ + @JsonProperty(value = "serverCallId", access = JsonProperty.Access.WRITE_ONLY) + private String serverCallId; + + /* + * Correlation ID for event to call correlation. Also called ChainId for + * skype chain ID. + */ + @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) + private String correlationId; + + /** + * Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to + * the response event. + * + * @return the operationContext value. + */ + public String getOperationContext() { + return this.operationContext; + } + + /** + * Get the resultInformation property: Contains the resulting SIP code, sub-code and message. + * + * @return the resultInformation value. + */ + public ResultInformation getResultInformation() { + return this.resultInformation; + } + + /** + * Get the mediaStreamingUpdate property: Defines the result for audio streaming update with the current status and + * the details about the status. + * + * @return the mediaStreamingUpdate value. + */ + public MediaStreamingUpdate getMediaStreamingUpdate() { + return this.mediaStreamingUpdate; + } + + /** + * Get the callConnectionId property: Call connection ID. + * + * @return the callConnectionId value. + */ + public String getCallConnectionId() { + return this.callConnectionId; + } + + /** + * Get the serverCallId property: Server call ID. + * + * @return the serverCallId value. + */ + public String getServerCallId() { + return this.serverCallId; + } + + /** + * Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain + * ID. + * + * @return the correlationId value. + */ + public String getCorrelationId() { + return this.correlationId; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingUpdate.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingUpdate.java new file mode 100644 index 000000000000..e3b2347475b0 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/implementation/models/MediaStreamingUpdate.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.communication.callautomation.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The MediaStreamingUpdate model. */ +@Fluent +public final class MediaStreamingUpdate { + /* + * The contentType property. + */ + @JsonProperty(value = "contentType") + private String contentType; + + /* + * The mediaStreamingStatus property. + */ + @JsonProperty(value = "mediaStreamingStatus") + private MediaStreamingStatus mediaStreamingStatus; + + /* + * The mediaStreamingStatusDetails property. + */ + @JsonProperty(value = "mediaStreamingStatusDetails") + private MediaStreamingStatusDetails mediaStreamingStatusDetails; + + /** + * Get the contentType property: The contentType property. + * + * @return the contentType value. + */ + public String getContentType() { + return this.contentType; + } + + /** + * Set the contentType property: The contentType property. + * + * @param contentType the contentType value to set. + * @return the MediaStreamingUpdate object itself. + */ + public MediaStreamingUpdate setContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get the mediaStreamingStatus property: The mediaStreamingStatus property. + * + * @return the mediaStreamingStatus value. + */ + public MediaStreamingStatus getMediaStreamingStatus() { + return this.mediaStreamingStatus; + } + + /** + * Set the mediaStreamingStatus property: The mediaStreamingStatus property. + * + * @param mediaStreamingStatus the mediaStreamingStatus value to set. + * @return the MediaStreamingUpdate object itself. + */ + public MediaStreamingUpdate setMediaStreamingStatus(MediaStreamingStatus mediaStreamingStatus) { + this.mediaStreamingStatus = mediaStreamingStatus; + return this; + } + + /** + * Get the mediaStreamingStatusDetails property: The mediaStreamingStatusDetails property. + * + * @return the mediaStreamingStatusDetails value. + */ + public MediaStreamingStatusDetails getMediaStreamingStatusDetails() { + return this.mediaStreamingStatusDetails; + } + + /** + * Set the mediaStreamingStatusDetails property: The mediaStreamingStatusDetails property. + * + * @param mediaStreamingStatusDetails the mediaStreamingStatusDetails value to set. + * @return the MediaStreamingUpdate object itself. + */ + public MediaStreamingUpdate setMediaStreamingStatusDetails( + MediaStreamingStatusDetails mediaStreamingStatusDetails) { + this.mediaStreamingStatusDetails = mediaStreamingStatusDetails; + return this; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/MediaStreamingFailed.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/MediaStreamingFailed.java new file mode 100644 index 000000000000..19d03128d6a6 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/MediaStreamingFailed.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation.models.events; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The MediaStreamingFailed model. */ +@Fluent +public final class MediaStreamingFailed extends CallAutomationEventBase { + + /* + * Contains the resulting SIP code, sub-code and message. + */ + @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) + private ResultInformation resultInformation; + + /* + * Defines the result for audio streaming update with the current status + * and the details about the status + */ + @JsonProperty(value = "mediaStreamingUpdate", access = JsonProperty.Access.WRITE_ONLY) + private MediaStreamingUpdate mediaStreamingUpdateResult; + + /** + * Creates an instance of MediaStreamingFailed class. + */ + public MediaStreamingFailed() { + resultInformation = null; + mediaStreamingUpdateResult = null; + } + + /** + * Get the resultInformation property: Contains the resulting SIP code, sub-code and message. + * + * @return the resultInformation value. + */ + public ResultInformation getResultInformation() { + return this.resultInformation; + } + + /** + * Get the mediaStreamingUpdateResult property: Defines the result for audio streaming update with the current status and + * the details about the status. + * + * @return the mediaStreamingUpdate value. + */ + public MediaStreamingUpdate getMediaStreamingUpdateResult() { + return this.mediaStreamingUpdateResult; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/MediaStreamingStarted.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/MediaStreamingStarted.java new file mode 100644 index 000000000000..42514e38512b --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/MediaStreamingStarted.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation.models.events; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The MediaStreamingStarted model. + */ +@Fluent +public final class MediaStreamingStarted extends CallAutomationEventBase { + /* + * Contains the resulting SIP code/sub-code and message from NGC services. + */ + @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) + private final ResultInformation resultInformation; + + /* + * Defines the result for MediaStreamingUpdate with the current status and the details about the status + */ + @JsonProperty(value = "mediaStreamingUpdate", access = JsonProperty.Access.WRITE_ONLY) + private final MediaStreamingUpdate mediaStreamingUpdateResult; + + /** + * Creates an instance of MediaStreamingStarted class. + */ + public MediaStreamingStarted() { + resultInformation = null; + mediaStreamingUpdateResult = null; + } + + /** + * Get the resultInformation property: Contains the resulting SIP code/sub-code and message from NGC services. + * + * @return the resultInformation value. + */ + public ResultInformation getResultInformation() { + return this.resultInformation; + } + + /** + * Get the mediaStreamingUpdateResult property: Defines the result for audio streaming update with the current status + * and the details about the status. + * + * @return the mediaStreamingUpdateResult value. + */ + public MediaStreamingUpdate getMediaStreamingUpdateResult() { + return this.mediaStreamingUpdateResult; + } + +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/MediaStreamingStatus.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/MediaStreamingStatus.java new file mode 100644 index 000000000000..500a49de3251 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/MediaStreamingStatus.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation.models.events; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MediaStreamingStatus. */ +public final class MediaStreamingStatus extends ExpandableStringEnum { + /** Static value mediaStreamingStarted for MediaStreamingStatus. */ + public static final MediaStreamingStatus MEDIA_STREAMING_STARTED = fromString("mediaStreamingStarted"); + + /** Static value mediaStreamingFailed for MediaStreamingStatus. */ + public static final MediaStreamingStatus MEDIA_STREAMING_FAILED = fromString("mediaStreamingFailed"); + + /** Static value mediaStreamingStopped for MediaStreamingStatus. */ + public static final MediaStreamingStatus MEDIA_STREAMING_STOPPED = fromString("mediaStreamingStopped"); + + /** Static value unspecifiedError for MediaStreamingStatus. */ + public static final MediaStreamingStatus UNSPECIFIED_ERROR = fromString("unspecifiedError"); + + /** + * Creates or finds a MediaStreamingStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding MediaStreamingStatus. + */ + @JsonCreator + public static MediaStreamingStatus fromString(String name) { + return fromString(name, MediaStreamingStatus.class); + } + + /** @return known MediaStreamingStatus values. */ + public static Collection values() { + return values(MediaStreamingStatus.class); + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/MediaStreamingStatusDetails.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/MediaStreamingStatusDetails.java new file mode 100644 index 000000000000..97eb4cf6c605 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/MediaStreamingStatusDetails.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation.models.events; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MediaStreamingStatusDetails. */ +public final class MediaStreamingStatusDetails extends ExpandableStringEnum { + /** Static value subscriptionStarted for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails SUBSCRIPTION_STARTED = fromString("subscriptionStarted"); + + /** Static value streamConnectionReestablished for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails STREAM_CONNECTION_REESTABLISHED = + fromString("streamConnectionReestablished"); + + /** Static value streamConnectionUnsuccessful for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails STREAM_CONNECTION_UNSUCCESSFUL = + fromString("streamConnectionUnsuccessful"); + + /** Static value streamUrlMissing for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails STREAM_URL_MISSING = fromString("streamUrlMissing"); + + /** Static value serviceShutdown for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails SERVICE_SHUTDOWN = fromString("serviceShutdown"); + + /** Static value streamConnectionInterrupted for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails STREAM_CONNECTION_INTERRUPTED = + fromString("streamConnectionInterrupted"); + + /** Static value speechServicesConnectionError for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails SPEECH_SERVICES_CONNECTION_ERROR = + fromString("speechServicesConnectionError"); + + /** Static value subscriptionStopped for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails SUBSCRIPTION_STOPPED = fromString("subscriptionStopped"); + + /** Static value unspecifiedError for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails UNSPECIFIED_ERROR = fromString("unspecifiedError"); + + /** Static value authenticationFailure for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails AUTHENTICATION_FAILURE = fromString("authenticationFailure"); + + /** Static value badRequest for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails BAD_REQUEST = fromString("badRequest"); + + /** Static value tooManyRequests for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails TOO_MANY_REQUESTS = fromString("tooManyRequests"); + + /** Static value forbidden for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails FORBIDDEN = fromString("forbidden"); + + /** Static value serviceTimeout for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails SERVICE_TIMEOUT = fromString("serviceTimeout"); + + /** Static value initialWebSocketConnectionFailed for MediaStreamingStatusDetails. */ + public static final MediaStreamingStatusDetails INITIAL_WEB_SOCKET_CONNECTION_FAILED = + fromString("initialWebSocketConnectionFailed"); + + /** + * Creates or finds a MediaStreamingStatusDetails from its string representation. + * + * @param name a name to look for. + * @return the corresponding MediaStreamingStatusDetails. + */ + @JsonCreator + public static MediaStreamingStatusDetails fromString(String name) { + return fromString(name, MediaStreamingStatusDetails.class); + } + + /** @return known MediaStreamingStatusDetails values. */ + public static Collection values() { + return values(MediaStreamingStatusDetails.class); + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/MediaStreamingStopped.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/MediaStreamingStopped.java new file mode 100644 index 000000000000..4a8e53891eb9 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/MediaStreamingStopped.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation.models.events; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The MediaStreamingStopped model. */ +@Fluent +public final class MediaStreamingStopped extends CallAutomationEventBase { + + /* + * Contains the resulting SIP code, sub-code and message. + */ + @JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY) + private ResultInformation resultInformation; + + /* + * Defines the result for audio streaming update with the current status + * and the details about the status + */ + @JsonProperty(value = "mediaStreamingUpdate", access = JsonProperty.Access.WRITE_ONLY) + private MediaStreamingUpdate mediaStreamingUpdateResult; + + /** + * Creates an instance of MediaStreamingStopped class. + */ + public MediaStreamingStopped() { + resultInformation = null; + mediaStreamingUpdateResult = null; + } + + /** + * Get the resultInformation property: Contains the resulting SIP code, sub-code and message. + * + * @return the resultInformation value. + */ + public ResultInformation getResultInformation() { + return this.resultInformation; + } + + /** + * Get the getMediaStreamingUpdateResult property: Defines the result for audio streaming update with the current status and + * the details about the status. + * + * @return the mediaStreamingUpdate value. + */ + public MediaStreamingUpdate getMediaStreamingUpdateResult() { + return this.mediaStreamingUpdateResult; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/MediaStreamingUpdate.java b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/MediaStreamingUpdate.java new file mode 100644 index 000000000000..b9e094f913f4 --- /dev/null +++ b/sdk/communication/azure-communication-callautomation/src/main/java/com/azure/communication/callautomation/models/events/MediaStreamingUpdate.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.communication.callautomation.models.events; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The MediaStreamingUpdate model. */ +@Fluent +public final class MediaStreamingUpdate { + /* + * The contentType property. + */ + @JsonProperty(value = "contentType") + private String contentType; + + /* + * The mediaStreamingStatus property. + */ + @JsonProperty(value = "mediaStreamingStatus") + private MediaStreamingStatus mediaStreamingStatus; + + /* + * The mediaStreamingStatusDetails property. + */ + @JsonProperty(value = "mediaStreamingStatusDetails") + private MediaStreamingStatusDetails mediaStreamingStatusDetails; + + /** + * Get the contentType property: The contentType property. + * + * @return the contentType value. + */ + public String getContentType() { + return this.contentType; + } + + /** + * Set the contentType property: The contentType property. + * + * @param contentType the contentType value to set. + * @return the MediaStreamingUpdate object itself. + */ + public MediaStreamingUpdate setContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get the mediaStreamingStatus property: The mediaStreamingStatus property. + * + * @return the mediaStreamingStatus value. + */ + public MediaStreamingStatus getMediaStreamingStatus() { + return this.mediaStreamingStatus; + } + + /** + * Set the mediaStreamingStatus property: The mediaStreamingStatus property. + * + * @param mediaStreamingStatus the mediaStreamingStatus value to set. + * @return the MediaStreamingUpdate object itself. + */ + public MediaStreamingUpdate setMediaStreamingStatus(MediaStreamingStatus mediaStreamingStatus) { + this.mediaStreamingStatus = mediaStreamingStatus; + return this; + } + + /** + * Get the mediaStreamingStatusDetails property: The mediaStreamingStatusDetails property. + * + * @return the mediaStreamingStatusDetails value. + */ + public MediaStreamingStatusDetails getMediaStreamingStatusDetails() { + return this.mediaStreamingStatusDetails; + } + + /** + * Set the mediaStreamingStatusDetails property: The mediaStreamingStatusDetails property. + * + * @param mediaStreamingStatusDetails the mediaStreamingStatusDetails value to set. + * @return the MediaStreamingUpdate object itself. + */ + public MediaStreamingUpdate setMediaStreamingStatusDetails( + MediaStreamingStatusDetails mediaStreamingStatusDetails) { + this.mediaStreamingStatusDetails = mediaStreamingStatusDetails; + return this; + } +} diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationEventParserAndProcessorUnitTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationEventParserAndProcessorUnitTests.java index 3c23a7e0c411..c7c98545a802 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationEventParserAndProcessorUnitTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationEventParserAndProcessorUnitTests.java @@ -49,6 +49,11 @@ import com.azure.communication.callautomation.models.events.TranscriptionStatusDetails; import com.azure.communication.callautomation.models.events.TranscriptionStopped; import com.azure.communication.callautomation.models.events.TranscriptionUpdated; +import com.azure.communication.callautomation.models.events.MediaStreamingStarted; +import com.azure.communication.callautomation.models.events.MediaStreamingStopped; +import com.azure.communication.callautomation.models.events.MediaStreamingFailed; +import com.azure.communication.callautomation.models.events.MediaStreamingStatus; +import com.azure.communication.callautomation.models.events.MediaStreamingStatusDetails; import org.junit.jupiter.api.Test; import java.util.List; @@ -1426,4 +1431,101 @@ public void parseHoldFailedEvent() { assertEquals(400, holdFailed.getResultInformation().getCode()); assertEquals(ReasonCode.Play.DOWNLOAD_FAILED, holdFailed.getReasonCode()); } + + @Test + public void parseMediaStreamingStartedEvent() { + String receivedEvent = "[{\n" + + "\"id\":\"d13c62c5-721e-44b9-a680-9866c33db7e7\",\n" + + "\"source\":\"calling/callConnections/4c1f5600-a9c6-4343-8979-b638a98de98f\",\n" + + "\"type\":\"Microsoft.Communication.MediaStreamingStarted\",\n" + + "\"data\":{\"eventSource\":\"calling/callConnections/4c1f5600-a9c6-4343-8979-b638a98de98f\",\n" + + "\"operationContext\":\"startMediaStreamingContext\",\n" + + "\"resultInformation\":{\"code\":200,\"subCode\":0,\"message\":\"Action completed successfully.\"},\n" + + "\"mediaStreamingUpdate\":{\"contentType\":\"Audio\",\n" + + "\"mediaStreamingStatus\":\"mediaStreamingStarted\",\n" + + "\"mediaStreamingStatusDetails\":\"subscriptionStarted\"},\n" + + "\"version\":\"2024-06-15-preview\",\n" + + "\"callConnectionId\":\"4c1f5600-a9c6-4343-8979-b638a98de98f\",\n" + + "\"serverCallId\":\"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LW1hc28tMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9LTTQteUZBUmhVYXN3T1RqbklPSXZnP2k9MTAtMTI4LTk1LTUyJmU9NjM4NTAwMTgzOTYwNzY2MzQ0\",\n" + + "\"correlationId\":\"30f0ad34-d615-4bf3-8476-5630ae7fc3db\",\n" + + "\"publicEventType\":\"Microsoft.Communication.MediaStreamingStarted\"},\n" + + "\"time\":\"2024-05-02T11:20:42.9110236+00:00\",\n" + + "\"specversion\":\"1.0\",\n" + + "\"datacontenttype\":\"application/json\",\n" + + "\"subject\":\"calling/callConnections/4c1f5600-a9c6-4343-8979-b638a98de98f\"}]"; + + MediaStreamingStarted event = (MediaStreamingStarted) CallAutomationEventParser.parseEvents(receivedEvent).get(0); + assertNotNull(event); + assertEquals("aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LW1hc28tMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9LTTQteUZBUmhVYXN3T1RqbklPSXZnP2k9MTAtMTI4LTk1LTUyJmU9NjM4NTAwMTgzOTYwNzY2MzQ0", event.getServerCallId()); + assertEquals("4c1f5600-a9c6-4343-8979-b638a98de98f", event.getCallConnectionId()); + assertEquals("30f0ad34-d615-4bf3-8476-5630ae7fc3db", event.getCorrelationId()); + assertEquals("Action completed successfully.", event.getResultInformation().getMessage()); + + assertNotNull(event.getMediaStreamingUpdateResult()); + assertEquals(MediaStreamingStatus.MEDIA_STREAMING_STARTED, event.getMediaStreamingUpdateResult().getMediaStreamingStatus()); + assertEquals(MediaStreamingStatusDetails.SUBSCRIPTION_STARTED, event.getMediaStreamingUpdateResult().getMediaStreamingStatusDetails()); + } + + @Test + public void parseMediaStreamingStoppedEvent() { + String receivedEvent = "[{\n" + + "\"id\":\"41039554-9475-491a-875b-08d23c5d0e75\",\n" + + "\"source\":\"calling/callConnections/4c1f5600-a9c6-4343-8979-b638a98de98f\",\n" + + "\"type\":\"Microsoft.Communication.MediaStreamingStopped\",\n" + + "\"data\":{\"eventSource\":\"calling/callConnections/4c1f5600-a9c6-4343-8979-b638a98de98f\",\n" + + "\"operationContext\":\"startMediaStreamingContext\",\n" + + "\"resultInformation\":{\"code\":200,\"subCode\":0,\"message\":\"Action completed successfully.\"},\n" + + "\"mediaStreamingUpdate\":{\"contentType\":\"Audio\",\"mediaStreamingStatus\":\"mediaStreamingStopped\",\n" + + "\"mediaStreamingStatusDetails\":\"subscriptionStopped\"},\n" + + "\"version\":\"2024-06-15-preview\",\"callConnectionId\":\"4c1f5600-a9c6-4343-8979-b638a98de98f\",\n" + + "\"serverCallId\":\"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LW1hc28tMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9LTTQteUZBUmhVYXN3T1RqbklPSXZnP2k9MTAtMTI4LTk1LTUyJmU9NjM4NTAwMTgzOTYwNzY2MzQ0\",\n" + + "\"correlationId\":\"30f0ad34-d615-4bf3-8476-5630ae7fc3db\",\n" + + "\"publicEventType\":\"Microsoft.Communication.MediaStreamingStopped\"},\n" + + "\"time\":\"2024-05-02T11:21:10.0261068+00:00\",\"specversion\":\"1.0\",\n" + + "\"datacontenttype\":\"application/json\",\n" + + "\"subject\":\"calling/callConnections/4c1f5600-a9c6-4343-8979-b638a98de98f\"}]"; + + MediaStreamingStopped event = (MediaStreamingStopped) CallAutomationEventParser.parseEvents(receivedEvent).get(0); + assertNotNull(event); + assertEquals("aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LW1hc28tMDEtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi9LTTQteUZBUmhVYXN3T1RqbklPSXZnP2k9MTAtMTI4LTk1LTUyJmU9NjM4NTAwMTgzOTYwNzY2MzQ0", event.getServerCallId()); + assertEquals("4c1f5600-a9c6-4343-8979-b638a98de98f", event.getCallConnectionId()); + assertEquals("30f0ad34-d615-4bf3-8476-5630ae7fc3db", event.getCorrelationId()); + assertEquals("Action completed successfully.", event.getResultInformation().getMessage()); + + assertNotNull(event.getMediaStreamingUpdateResult()); + assertEquals(MediaStreamingStatus.MEDIA_STREAMING_STOPPED, event.getMediaStreamingUpdateResult().getMediaStreamingStatus()); + assertEquals(MediaStreamingStatusDetails.SUBSCRIPTION_STOPPED, event.getMediaStreamingUpdateResult().getMediaStreamingStatusDetails()); + } + + @Test + public void parseMediaStreamingFailedEvent() { + String receivedEvent = "[{\n" + + "\"id\":\"a9bb7545-8f87-42aa-85d0-d7120dbe2414\",\n" + + "\"source\":\"calling/callConnections/761f5600-43ab-48a0-bbad-ecc5ad5b15bb\",\n" + + "\"type\":\"Microsoft.Communication.MediaStreamingFailed\",\n" + + "\"data\":{\"eventSource\":\"calling/callConnections/761f5600-43ab-48a0-bbad-ecc5ad5b15bb\",\n" + + "\"operationContext\":\"startMediaStreamingContext\",\n" + + "\"resultInformation\":{\"code\":500,\"subCode\":8603,\n" + + "\"message\":\"Action failed, not able to establish websocket connection.\"},\n" + + "\"mediaStreamingUpdate\":{\"contentType\":\"Audio\",\n" + + "\"mediaStreamingStatus\":\"mediaStreamingFailed\",\n" + + "\"mediaStreamingStatusDetails\":\"streamConnectionUnsuccessful\"},\n" + + "\"version\":\"2024-06-15-preview\",\"callConnectionId\":\"761f5600-43ab-48a0-bbad-ecc5ad5b15bb\",\n" + + "\"serverCallId\":\"aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LW1hc28tMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi94MVdMX0p3NnlVaW1aOEkzVi1MN3hnP2k9MTAtMTI4LTg0LTE3MSZlPTYzODQ5NzU2ODQ3MzUxNzU3Mg==\",\n" + + "\"correlationId\":\"6032c474-201d-4ad1-8900-f92a595a6d94\",\n" + + "\"publicEventType\":\"Microsoft.Communication.MediaStreamingFailed\"},\n" + + "\"time\":\"2024-05-02T12:38:31.242039+00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\n" + + "\"subject\":\"calling/callConnections/761f5600-43ab-48a0-bbad-ecc5ad5b15bb\"}]"; + + MediaStreamingFailed event = (MediaStreamingFailed) CallAutomationEventParser.parseEvents(receivedEvent).get(0); + assertNotNull(event); + assertEquals("aHR0cHM6Ly9hcGkuZmxpZ2h0cHJveHkuc2t5cGUuY29tL2FwaS92Mi9jcC9jb252LW1hc28tMDQtcHJvZC1ha3MuY29udi5za3lwZS5jb20vY29udi94MVdMX0p3NnlVaW1aOEkzVi1MN3hnP2k9MTAtMTI4LTg0LTE3MSZlPTYzODQ5NzU2ODQ3MzUxNzU3Mg==", event.getServerCallId()); + assertEquals("761f5600-43ab-48a0-bbad-ecc5ad5b15bb", event.getCallConnectionId()); + assertEquals("6032c474-201d-4ad1-8900-f92a595a6d94", event.getCorrelationId()); + assertEquals("Action failed, not able to establish websocket connection.", event.getResultInformation().getMessage()); + + assertNotNull(event.getMediaStreamingUpdateResult()); + assertEquals(MediaStreamingStatus.MEDIA_STREAMING_FAILED, event.getMediaStreamingUpdateResult().getMediaStreamingStatus()); + assertEquals(MediaStreamingStatusDetails.STREAM_CONNECTION_UNSUCCESSFUL, event.getMediaStreamingUpdateResult().getMediaStreamingStatusDetails()); + } } diff --git a/sdk/communication/azure-communication-callautomation/swagger/README.md b/sdk/communication/azure-communication-callautomation/swagger/README.md index ef67ad58215d..ac049ef9e06c 100644 --- a/sdk/communication/azure-communication-callautomation/swagger/README.md +++ b/sdk/communication/azure-communication-callautomation/swagger/README.md @@ -28,7 +28,7 @@ autorest README.md --java --v4 --use=@autorest/java@4.0.20 --use=@autorest/model ``` yaml tag: package-2023-10-03-preview require: - - https://github.com/Azure/azure-rest-api-specs/blob/77d25dd8426c4ba1619d15582a8c9d9b2f6890e8/specification/communication/data-plane/CallAutomation/readme.md + - https://github.com/Azure/azure-rest-api-specs/blob/ebedc156cf07929f3f72e71e5323ecdfa402267d/specification/communication/data-plane/CallAutomation/readme.md java: true output-folder: ../ license-header: MICROSOFT_MIT_SMALL @@ -254,6 +254,9 @@ directive: - remove-model: TranscriptionStopped - remove-model: TranscriptionUpdated - remove-model: TranscriptionFailed +- remove-model: MediaStreamingStarted +- remove-model: MediaStreamingStopped +- remove-model: MediaStreamingFailed ``` diff --git a/sdk/communication/azure-communication-callingserver/pom.xml b/sdk/communication/azure-communication-callingserver/pom.xml index b6000b9e0f8f..902b761a039a 100644 --- a/sdk/communication/azure-communication-callingserver/pom.xml +++ b/sdk/communication/azure-communication-callingserver/pom.xml @@ -54,7 +54,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure @@ -70,7 +70,7 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test @@ -132,19 +132,19 @@ com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -203,7 +203,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/communication/azure-communication-chat/pom.xml b/sdk/communication/azure-communication-chat/pom.xml index da4e82be4258..6ee8c7d49803 100644 --- a/sdk/communication/azure-communication-chat/pom.xml +++ b/sdk/communication/azure-communication-chat/pom.xml @@ -50,7 +50,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure @@ -66,7 +66,7 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test @@ -96,19 +96,19 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 compile com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -161,7 +161,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/communication/azure-communication-common-perf/pom.xml b/sdk/communication/azure-communication-common-perf/pom.xml index 5c3f0c3090df..6fdd38f13fed 100644 --- a/sdk/communication/azure-communication-common-perf/pom.xml +++ b/sdk/communication/azure-communication-common-perf/pom.xml @@ -39,18 +39,18 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-test - 1.24.2 + 1.25.0 diff --git a/sdk/communication/azure-communication-common/pom.xml b/sdk/communication/azure-communication-common/pom.xml index 2b5cd6525135..d659d4605d63 100644 --- a/sdk/communication/azure-communication-common/pom.xml +++ b/sdk/communication/azure-communication-common/pom.xml @@ -46,12 +46,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 compile diff --git a/sdk/communication/azure-communication-email/pom.xml b/sdk/communication/azure-communication-email/pom.xml index a4a9b036d58d..3bf8ab6c9b7a 100644 --- a/sdk/communication/azure-communication-email/pom.xml +++ b/sdk/communication/azure-communication-email/pom.xml @@ -55,12 +55,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure @@ -78,13 +78,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -96,13 +96,13 @@ com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -154,7 +154,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/communication/azure-communication-identity/pom.xml b/sdk/communication/azure-communication-identity/pom.xml index 8ffb4c762845..10f28882ed57 100644 --- a/sdk/communication/azure-communication-identity/pom.xml +++ b/sdk/communication/azure-communication-identity/pom.xml @@ -63,7 +63,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure @@ -103,31 +103,31 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test com.azure azure-identity - 1.12.0 + 1.12.1 test com.azure azure-core-http-netty - 1.14.2 + 1.15.0 compile @@ -175,7 +175,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/communication/azure-communication-jobrouter/assets.json b/sdk/communication/azure-communication-jobrouter/assets.json index b31c312f7260..30f460c18040 100644 --- a/sdk/communication/azure-communication-jobrouter/assets.json +++ b/sdk/communication/azure-communication-jobrouter/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/communication/azure-communication-jobrouter", - "Tag": "java/communication/azure-communication-jobrouter_b970df9fcf" + "Tag": "java/communication/azure-communication-jobrouter_db1da26178" } diff --git a/sdk/communication/azure-communication-jobrouter/customization/src/main/java/JobRouterSdkCustomization.java b/sdk/communication/azure-communication-jobrouter/customization/src/main/java/JobRouterSdkCustomization.java index f85667b535da..20deb030d45f 100644 --- a/sdk/communication/azure-communication-jobrouter/customization/src/main/java/JobRouterSdkCustomization.java +++ b/sdk/communication/azure-communication-jobrouter/customization/src/main/java/JobRouterSdkCustomization.java @@ -3,6 +3,7 @@ import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; import com.github.javaparser.ast.type.ClassOrInterfaceType; import org.slf4j.Logger; +import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.List; @@ -29,6 +30,13 @@ public void customize(LibraryCustomization customization, Logger logger) { addConnectionStringClientMethod(classCustomizationForJobRouterClientBuilder, "JobRouterClientBuilder"); addHttpPipelineAuthPolicyMethod(classCustomizationForJobRouterClientBuilder); updateHttpPipelineMethod(classCustomizationForJobRouterClientBuilder); + + logger.info("Customizing the ScoringRuleOptions class"); + PackageCustomization modelsPackageCustomization = customization.getPackage("com.azure.communication.jobrouter.models"); + ClassCustomization classCustomizationForScoringRuleOptions = modelsPackageCustomization.getClass("ScoringRuleOptions"); + classCustomizationForScoringRuleOptions + .getMethod("setIsBatchScoringEnabled") + .setModifier(Modifier.PRIVATE); } private void addAuthTraits(ClassCustomization classCustomization) { diff --git a/sdk/communication/azure-communication-jobrouter/pom.xml b/sdk/communication/azure-communication-jobrouter/pom.xml index bb6ae294c235..d9963d1725a3 100644 --- a/sdk/communication/azure-communication-jobrouter/pom.xml +++ b/sdk/communication/azure-communication-jobrouter/pom.xml @@ -51,7 +51,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure @@ -61,7 +61,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 io.projectreactor @@ -72,7 +72,7 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test @@ -102,13 +102,13 @@ com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -167,7 +167,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/RouterRuleAdapter.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/RouterRuleAdapter.java index 6aa3187d248b..cfbc47cbe48f 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/RouterRuleAdapter.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/converters/RouterRuleAdapter.java @@ -49,9 +49,9 @@ public static RouterRuleInternal getRouterRuleInternal(RouterRule routerRule) { } else if (routerRule.getClass() == WebhookRouterRule.class) { WebhookRouterRule webhookRouterRule = (WebhookRouterRule) routerRule; prioritizationRuleInternal = new WebhookRouterRuleInternal() - .setAuthorizationServerUri(webhookRouterRule.getAuthorizationServerUri()) + .setAuthorizationServerUri(webhookRouterRule.getAuthorizationServerUrl()) .setClientCredential(webhookRouterRule.getClientCredential()) - .setWebhookUri(webhookRouterRule.getWebhookUri()); + .setWebhookUri(webhookRouterRule.getWebhookUrl()); } } @@ -75,11 +75,11 @@ public static RouterRuleInternal convertRouterRuleToInternal(RouterRule rule) { return new StaticRouterRuleInternal().setValue(RouterValueAdapter.getValue(((StaticRouterRule) rule).getValue())); } else if (rule instanceof WebhookRouterRule) { WebhookRouterRule webhookRouterRule = (WebhookRouterRule) rule; - return new WebhookRouterRuleInternal().setWebhookUri(webhookRouterRule.getWebhookUri()) + return new WebhookRouterRuleInternal().setWebhookUri(webhookRouterRule.getWebhookUrl()) .setClientCredential(new OAuth2WebhookClientCredential() .setClientId(webhookRouterRule.getClientCredential().getClientId()) .setClientSecret(webhookRouterRule.getClientCredential().getClientSecret())) - .setAuthorizationServerUri(webhookRouterRule.getAuthorizationServerUri()); + .setAuthorizationServerUri(webhookRouterRule.getAuthorizationServerUrl()); } return null; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/BestWorkerMode.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/BestWorkerMode.java index b57f8c5dd8fa..b3bc0e453a3c 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/BestWorkerMode.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/BestWorkerMode.java @@ -30,8 +30,14 @@ public final class BestWorkerMode extends DistributionMode { private ScoringRuleOptions scoringRuleOptions; /** Creates an instance of BestWorkerMode class. */ - public BestWorkerMode() { - this.kind = DistributionModeKind.BEST_WORKER; + public BestWorkerMode() {} + + /** + * Returns kind discriminator. + * @return kind. + */ + public DistributionModeKind getKind() { + return DistributionModeKind.BEST_WORKER; } /** diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CancelExceptionAction.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CancelExceptionAction.java index 584d3ed1ee92..f11eaf39f71c 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CancelExceptionAction.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CancelExceptionAction.java @@ -29,8 +29,14 @@ public final class CancelExceptionAction extends ExceptionAction { private String dispositionCode; /** Creates an instance of CancelExceptionAction class. */ - public CancelExceptionAction() { - this.kind = ExceptionActionKind.CANCEL; + public CancelExceptionAction() {} + + /** + * Returns kind discriminator. + * @return kind. + */ + public ExceptionActionKind getKind() { + return ExceptionActionKind.CANCEL; } /** diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ConditionalQueueSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ConditionalQueueSelectorAttachment.java index 556075b6be11..20c2bff66436 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ConditionalQueueSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ConditionalQueueSelectorAttachment.java @@ -53,7 +53,14 @@ public ConditionalQueueSelectorAttachment( @JsonProperty(value = "queueSelectors") List queueSelectors) { this.condition = condition; this.queueSelectors = queueSelectors; - this.kind = QueueSelectorAttachmentKind.CONDITIONAL; + } + + /** + * Returns kind discriminator. + * @return kind. + */ + public QueueSelectorAttachmentKind getKind() { + return QueueSelectorAttachmentKind.CONDITIONAL; } /** diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ConditionalWorkerSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ConditionalWorkerSelectorAttachment.java index 894387412718..4b2bdd1f435d 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ConditionalWorkerSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ConditionalWorkerSelectorAttachment.java @@ -53,7 +53,14 @@ public ConditionalWorkerSelectorAttachment( @JsonProperty(value = "workerSelectors") List workerSelectors) { this.condition = condition; this.workerSelectors = workerSelectors; - this.kind = WorkerSelectorAttachmentKind.CONDITIONAL; + } + + /** + * Returns kind discriminator. + * @return kind. + */ + public WorkerSelectorAttachmentKind getKind() { + return WorkerSelectorAttachmentKind.CONDITIONAL; } /** diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DirectMapRouterRule.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DirectMapRouterRule.java index 2f84d7a71c45..b2149e4f73d0 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DirectMapRouterRule.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DirectMapRouterRule.java @@ -14,7 +14,13 @@ public final class DirectMapRouterRule extends RouterRule { /** Creates an instance of DirectMapRouterRule class. */ - public DirectMapRouterRule() { - this.kind = RouterRuleKind.DIRECT_MAP; + public DirectMapRouterRule() {} + + /** + * Returns kind discriminator. + * @return kind. + */ + public RouterRuleKind getKind() { + return RouterRuleKind.DIRECT_MAP; } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DistributionMode.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DistributionMode.java index 419c15d7fb70..3b58baf64644 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DistributionMode.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DistributionMode.java @@ -28,7 +28,7 @@ public abstract class DistributionMode { * kind discriminator. */ @JsonProperty(value = "kind") - protected DistributionModeKind kind; + private DistributionModeKind kind; /* * Governs the minimum desired number of active concurrent offers a job can have. @@ -123,7 +123,5 @@ public DistributionMode setBypassSelectors(Boolean bypassSelectors) { * Returns kind discriminator. * @return kind. */ - public DistributionModeKind getKind() { - return this.kind; - } + public abstract DistributionModeKind getKind(); } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionAction.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionAction.java index ed9e2a0ebb38..72611486eb36 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionAction.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionAction.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -20,12 +21,13 @@ @JsonSubTypes.Type(name = "manualReclassify", value = ManualReclassifyExceptionAction.class), @JsonSubTypes.Type(name = "reclassify", value = ReclassifyExceptionAction.class) }) +@Immutable public abstract class ExceptionAction { /** * kind discriminator. */ @JsonProperty(value = "kind") - protected ExceptionActionKind kind; + private ExceptionActionKind kind; /** Creates an instance of ExceptionAction class. */ public ExceptionAction() {} @@ -49,7 +51,5 @@ public String getId() { * Returns kind discriminator. * @return kind. */ - public ExceptionActionKind getKind() { - return this.kind; - } + public abstract ExceptionActionKind getKind(); } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionTrigger.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionTrigger.java index 8bdb47fda3ce..d9d5327668a0 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionTrigger.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionTrigger.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -19,12 +20,13 @@ @JsonSubTypes.Type(name = "queueLength", value = QueueLengthExceptionTrigger.class), @JsonSubTypes.Type(name = "waitTime", value = WaitTimeExceptionTrigger.class) }) +@Immutable public abstract class ExceptionTrigger { /** * kind discriminator. */ @JsonProperty(value = "kind") - protected ExceptionTriggerKind kind; + private ExceptionTriggerKind kind; /** Creates an instance of ExceptionTrigger class. */ public ExceptionTrigger() {} @@ -33,7 +35,5 @@ public ExceptionTrigger() {} * Returns kind discriminator. * @return kind. */ - public ExceptionTriggerKind getKind() { - return this.kind; - } + public abstract ExceptionTriggerKind getKind(); } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExpressionRouterRule.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExpressionRouterRule.java index 149e4acaf1c8..944c4a2d63de 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExpressionRouterRule.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExpressionRouterRule.java @@ -35,7 +35,14 @@ public final class ExpressionRouterRule extends RouterRule { @JsonCreator public ExpressionRouterRule(@JsonProperty(value = "expression") String expression) { this.expression = expression; - this.kind = RouterRuleKind.EXPRESSION; + } + + /** + * Returns kind discriminator. + * @return kind. + */ + public RouterRuleKind getKind() { + return RouterRuleKind.EXPRESSION; } /** diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/FunctionRouterRule.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/FunctionRouterRule.java index ada90799bbbb..ded04cfe37b9 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/FunctionRouterRule.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/FunctionRouterRule.java @@ -35,7 +35,14 @@ public final class FunctionRouterRule extends RouterRule { @JsonCreator public FunctionRouterRule(@JsonProperty(value = "functionUri") String functionUri) { this.functionUri = functionUri; - this.kind = RouterRuleKind.FUNCTION; + } + + /** + * Returns kind discriminator. + * @return kind. + */ + public RouterRuleKind getKind() { + return RouterRuleKind.FUNCTION; } /** diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/LongestIdleMode.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/LongestIdleMode.java index a107580c4e96..0ca81d91d9dd 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/LongestIdleMode.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/LongestIdleMode.java @@ -13,8 +13,14 @@ @Fluent public final class LongestIdleMode extends DistributionMode { /** Creates an instance of LongestIdleMode class. */ - public LongestIdleMode() { - this.kind = DistributionModeKind.LONGEST_IDLE; + public LongestIdleMode() {} + + /** + * Returns kind discriminator. + * @return kind. + */ + public DistributionModeKind getKind() { + return DistributionModeKind.LONGEST_IDLE; } /** {@inheritDoc} */ diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ManualReclassifyExceptionAction.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ManualReclassifyExceptionAction.java index df7caef0085f..c507796f5737 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ManualReclassifyExceptionAction.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ManualReclassifyExceptionAction.java @@ -35,8 +35,14 @@ public final class ManualReclassifyExceptionAction extends ExceptionAction { private List workerSelectors; /** Creates an instance of ManualReclassifyExceptionAction class. */ - public ManualReclassifyExceptionAction() { - this.kind = ExceptionActionKind.MANUAL_RECLASSIFY; + public ManualReclassifyExceptionAction() {} + + /** + * Returns kind discriminator. + * @return kind. + */ + public ExceptionActionKind getKind() { + return ExceptionActionKind.MANUAL_RECLASSIFY; } /** diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/PassThroughQueueSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/PassThroughQueueSelectorAttachment.java index c13ad012cdfd..8423781cf8f7 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/PassThroughQueueSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/PassThroughQueueSelectorAttachment.java @@ -39,7 +39,14 @@ public PassThroughQueueSelectorAttachment( @JsonProperty(value = "labelOperator") LabelOperator labelOperator) { this.key = key; this.labelOperator = labelOperator; - this.kind = QueueSelectorAttachmentKind.PASS_THROUGH; + } + + /** + * Returns kind discriminator. + * @return kind. + */ + public QueueSelectorAttachmentKind getKind() { + return QueueSelectorAttachmentKind.PASS_THROUGH; } /** diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/PassThroughWorkerSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/PassThroughWorkerSelectorAttachment.java index 3d220b9b084f..8993e79a71c3 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/PassThroughWorkerSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/PassThroughWorkerSelectorAttachment.java @@ -51,7 +51,14 @@ public PassThroughWorkerSelectorAttachment( @JsonProperty(value = "labelOperator") LabelOperator labelOperator) { this.key = key; this.labelOperator = labelOperator; - this.kind = WorkerSelectorAttachmentKind.PASS_THROUGH; + } + + /** + * Returns kind discriminator. + * @return kind. + */ + public WorkerSelectorAttachmentKind getKind() { + return WorkerSelectorAttachmentKind.PASS_THROUGH; } /** diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueLengthExceptionTrigger.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueLengthExceptionTrigger.java index 0f43ca81063b..09ee2a721feb 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueLengthExceptionTrigger.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueLengthExceptionTrigger.java @@ -29,7 +29,14 @@ public final class QueueLengthExceptionTrigger extends ExceptionTrigger { @JsonCreator public QueueLengthExceptionTrigger(@JsonProperty(value = "threshold") int threshold) { this.threshold = threshold; - this.kind = ExceptionTriggerKind.QUEUE_LENGTH; + } + + /** + * Returns kind discriminator. + * @return kind. + */ + public ExceptionTriggerKind getKind() { + return ExceptionTriggerKind.QUEUE_LENGTH; } /** diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueSelectorAttachment.java index af36d7317d86..5f17bf9af3d0 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/QueueSelectorAttachment.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -24,12 +25,13 @@ name = "weightedAllocation", value = WeightedAllocationQueueSelectorAttachment.class) }) +@Immutable public abstract class QueueSelectorAttachment { /** * kind discriminator. */ @JsonProperty(value = "kind") - protected QueueSelectorAttachmentKind kind; + private QueueSelectorAttachmentKind kind; /** Creates an instance of QueueSelectorAttachment class. */ public QueueSelectorAttachment() {} @@ -38,7 +40,5 @@ public QueueSelectorAttachment() {} * Returns kind discriminator. * @return kind. */ - public QueueSelectorAttachmentKind getKind() { - return this.kind; - } + public abstract QueueSelectorAttachmentKind getKind(); } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ReclassifyExceptionAction.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ReclassifyExceptionAction.java index fa2c57edceb4..9b9ccb17484b 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ReclassifyExceptionAction.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ReclassifyExceptionAction.java @@ -35,8 +35,14 @@ public final class ReclassifyExceptionAction extends ExceptionAction { private Map labelsToUpsert; /** Creates an instance of ReclassifyExceptionAction class. */ - public ReclassifyExceptionAction() { - this.kind = ExceptionActionKind.RECLASSIFY; + public ReclassifyExceptionAction() {} + + /** + * Returns kind discriminator. + * @return kind. + */ + public ExceptionActionKind getKind() { + return ExceptionActionKind.RECLASSIFY; } /** diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RoundRobinMode.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RoundRobinMode.java index c3f6beae9d83..9b500a1d8c10 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RoundRobinMode.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RoundRobinMode.java @@ -16,8 +16,14 @@ public final class RoundRobinMode extends DistributionMode { /** Creates an instance of RoundRobinMode class. */ - public RoundRobinMode() { - this.kind = DistributionModeKind.ROUND_ROBIN; + public RoundRobinMode() {} + + /** + * Returns kind discriminator. + * @return kind. + */ + public DistributionModeKind getKind() { + return DistributionModeKind.ROUND_ROBIN; } /** {@inheritDoc} */ diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterRule.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterRule.java index 0b10a599eb29..bd6b57f5fa07 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterRule.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterRule.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -27,13 +28,14 @@ @JsonSubTypes.Type(name = "static", value = StaticRouterRule.class), @JsonSubTypes.Type(name = "webhook", value = WebhookRouterRule.class) }) +@Immutable public abstract class RouterRule { /** * kind discriminator. */ @JsonProperty(value = "kind") - protected RouterRuleKind kind; + private RouterRuleKind kind; /** Creates an instance of RouterRule class. */ public RouterRule() {} @@ -42,7 +44,5 @@ public RouterRule() {} * Returns kind discriminator. * @return kind. */ - public RouterRuleKind getKind() { - return this.kind; - } + public abstract RouterRuleKind getKind(); } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RuleEngineQueueSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RuleEngineQueueSelectorAttachment.java index 33953961bc8a..a17057f47185 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RuleEngineQueueSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RuleEngineQueueSelectorAttachment.java @@ -41,7 +41,14 @@ public final class RuleEngineQueueSelectorAttachment extends QueueSelectorAttach @JsonCreator public RuleEngineQueueSelectorAttachment(@JsonProperty(value = "rule") RouterRule rule) { this.rule = rule; - this.kind = QueueSelectorAttachmentKind.RULE_ENGINE; + } + + /** + * Returns kind discriminator. + * @return kind. + */ + public QueueSelectorAttachmentKind getKind() { + return QueueSelectorAttachmentKind.RULE_ENGINE; } /** diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RuleEngineWorkerSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RuleEngineWorkerSelectorAttachment.java index dc8333074855..800c8fb25dd8 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RuleEngineWorkerSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RuleEngineWorkerSelectorAttachment.java @@ -41,7 +41,14 @@ public final class RuleEngineWorkerSelectorAttachment extends WorkerSelectorAtta @JsonCreator public RuleEngineWorkerSelectorAttachment(@JsonProperty(value = "rule") RouterRule rule) { this.rule = rule; - this.kind = WorkerSelectorAttachmentKind.RULE_ENGINE; + } + + /** + * Returns kind discriminator. + * @return kind. + */ + public WorkerSelectorAttachmentKind getKind() { + return WorkerSelectorAttachmentKind.RULE_ENGINE; } /** diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ScoringRuleOptions.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ScoringRuleOptions.java index 397e403ac548..81761c95b2ef 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ScoringRuleOptions.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ScoringRuleOptions.java @@ -130,20 +130,20 @@ public Boolean isBatchScoringEnabled() { * @param isBatchScoringEnabled the isBatchScoringEnabled value to set. * @return the ScoringRuleOptions object itself. */ - public ScoringRuleOptions setBatchScoringEnabled(Boolean isBatchScoringEnabled) { + private ScoringRuleOptions setIsBatchScoringEnabled(Boolean isBatchScoringEnabled) { this.isBatchScoringEnabled = isBatchScoringEnabled; return this; } /** - * Set the isBatchScoringEnabled property: If set to true, will score workers in batches, and the parameter name of + * Set the isBatchSco ringEnabled property: If set to true, will score workers in batches, and the parameter name of * the worker labels will be sent as `workers`. By default, set to false and the parameter name for the worker * labels will be sent as `worker`. Note: If enabled, use 'batchSize' to set batch size. * * @param isBatchScoringEnabled the isBatchScoringEnabled value to set. - * @return the ScoringRuleOptions object itself. + * @return theScoringRuleOptions object itself. */ - public ScoringRuleOptions setIsBatchScoringEnabled(Boolean isBatchScoringEnabled) { + public ScoringRuleOptions setBatchScoringEnabled(Boolean isBatchScoringEnabled) { this.isBatchScoringEnabled = isBatchScoringEnabled; return this; } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/StaticQueueSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/StaticQueueSelectorAttachment.java index bedef4ef5589..b5ca011c9c63 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/StaticQueueSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/StaticQueueSelectorAttachment.java @@ -30,7 +30,14 @@ public final class StaticQueueSelectorAttachment extends QueueSelectorAttachment @JsonCreator public StaticQueueSelectorAttachment(@JsonProperty(value = "queueSelector") RouterQueueSelector queueSelector) { this.queueSelector = queueSelector; - this.kind = QueueSelectorAttachmentKind.STATIC; + } + + /** + * Returns kind discriminator. + * @return kind. + */ + public QueueSelectorAttachmentKind getKind() { + return QueueSelectorAttachmentKind.STATIC; } /** diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/StaticRouterRule.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/StaticRouterRule.java index ab1bb1a3c620..a5b64841ca21 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/StaticRouterRule.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/StaticRouterRule.java @@ -25,8 +25,14 @@ public final class StaticRouterRule extends RouterRule { private RouterValue value; /** Creates an instance of StaticRouterRule class. */ - public StaticRouterRule() { - this.kind = RouterRuleKind.STATIC; + public StaticRouterRule() {} + + /** + * Returns kind discriminator. + * @return kind. + */ + public RouterRuleKind getKind() { + return RouterRuleKind.STATIC; } /** diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/StaticWorkerSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/StaticWorkerSelectorAttachment.java index 78974e365188..ba89d4759a58 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/StaticWorkerSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/StaticWorkerSelectorAttachment.java @@ -30,7 +30,14 @@ public final class StaticWorkerSelectorAttachment extends WorkerSelectorAttachme @JsonCreator public StaticWorkerSelectorAttachment(@JsonProperty(value = "workerSelector") RouterWorkerSelector workerSelector) { this.workerSelector = workerSelector; - this.kind = WorkerSelectorAttachmentKind.STATIC; + } + + /** + * Returns kind discriminator. + * @return kind. + */ + public WorkerSelectorAttachmentKind getKind() { + return WorkerSelectorAttachmentKind.STATIC; } /** diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WaitTimeExceptionTrigger.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WaitTimeExceptionTrigger.java index a4971b067bc2..d69063683294 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WaitTimeExceptionTrigger.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WaitTimeExceptionTrigger.java @@ -35,7 +35,14 @@ public final class WaitTimeExceptionTrigger extends ExceptionTrigger { @JsonCreator public WaitTimeExceptionTrigger(@JsonProperty(value = "thresholdSeconds") Duration threshold) { this.threshold = threshold; - this.kind = ExceptionTriggerKind.WAIT_TIME; + } + + /** + * Returns kind discriminator. + * @return kind. + */ + public ExceptionTriggerKind getKind() { + return ExceptionTriggerKind.WAIT_TIME; } /** diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WebhookRouterRule.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WebhookRouterRule.java index 75ae7a81f8a4..73748be1151c 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WebhookRouterRule.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WebhookRouterRule.java @@ -17,8 +17,8 @@ public final class WebhookRouterRule extends RouterRule { /* * Uri for Authorization Server. */ - @JsonProperty(value = "authorizationServerUri") - private String authorizationServerUri; + @JsonProperty(value = "authorizationServerUrl") + private String authorizationServerUrl; /* * OAuth2.0 Credentials used to Contoso's Authorization server. Reference: @@ -28,33 +28,39 @@ public final class WebhookRouterRule extends RouterRule { private OAuth2WebhookClientCredential clientCredential; /* - * Uri for Contoso's Web Server. + * Url for Contoso's Web Server. */ - @JsonProperty(value = "webhookUri") - private String webhookUri; + @JsonProperty(value = "webhookUrl") + private String webhookUrl; /** Creates an instance of WebhookRouterRule class. */ - public WebhookRouterRule() { - this.kind = RouterRuleKind.WEBHOOK; + public WebhookRouterRule() {} + + /** + * Returns kind discriminator. + * @return kind. + */ + public RouterRuleKind getKind() { + return RouterRuleKind.WEBHOOK; } /** - * Get the authorizationServerUri property: Uri for Authorization Server. + * Get the authorizationServerUrl property: Url for Authorization Server. * - * @return the authorizationServerUri value. + * @return the authorizationServerUrl value. */ - public String getAuthorizationServerUri() { - return this.authorizationServerUri; + public String getAuthorizationServerUrl() { + return this.authorizationServerUrl; } /** * Set the authorizationServerUri property: Uri for Authorization Server. * - * @param authorizationServerUri the authorizationServerUri value to set. + * @param authorizationServerUrl the authorizationServerUri value to set. * @return the WebhookRouterRule object itself. */ - public WebhookRouterRule setAuthorizationServerUri(String authorizationServerUri) { - this.authorizationServerUri = authorizationServerUri; + public WebhookRouterRule setAuthorizationServerUrl(String authorizationServerUrl) { + this.authorizationServerUrl = authorizationServerUrl; return this; } @@ -71,20 +77,20 @@ public OAuth2WebhookClientCredential getClientCredential() { /** * Get the webhookUri property: Uri for Contoso's Web Server. * - * @return the webhookUri value. + * @return the webhookUrl value. */ - public String getWebhookUri() { - return this.webhookUri; + public String getWebhookUrl() { + return this.getWebhookUrl(); } /** * Set the webhookUri property: Uri for Contoso's Web Server. * - * @param webhookUri the webhookUri value to set. + * @param webhookUrl the webhookUri value to set. * @return the WebhookRouterRule object itself. */ - public WebhookRouterRule setWebhookUri(String webhookUri) { - this.webhookUri = webhookUri; + public WebhookRouterRule setWebhookUrl(String webhookUrl) { + this.webhookUrl = webhookUrl; return this; } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WeightedAllocationQueueSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WeightedAllocationQueueSelectorAttachment.java index 666b55983909..a2dd2f533cc2 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WeightedAllocationQueueSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WeightedAllocationQueueSelectorAttachment.java @@ -32,7 +32,14 @@ public final class WeightedAllocationQueueSelectorAttachment extends QueueSelect public WeightedAllocationQueueSelectorAttachment( @JsonProperty(value = "allocations") List allocations) { this.allocations = allocations; - this.kind = QueueSelectorAttachmentKind.WEIGHTED_ALLOCATION; + } + + /** + * Returns kind discriminator. + * @return kind. + */ + public QueueSelectorAttachmentKind getKind() { + return QueueSelectorAttachmentKind.WEIGHTED_ALLOCATION; } /** diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WeightedAllocationWorkerSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WeightedAllocationWorkerSelectorAttachment.java index 9cdaceac4b01..5f1a65d69136 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WeightedAllocationWorkerSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WeightedAllocationWorkerSelectorAttachment.java @@ -32,7 +32,14 @@ public final class WeightedAllocationWorkerSelectorAttachment extends WorkerSele public WeightedAllocationWorkerSelectorAttachment( @JsonProperty(value = "allocations") List allocations) { this.allocations = allocations; - this.kind = WorkerSelectorAttachmentKind.WEIGHTED_ALLOCATION; + } + + /** + * Returns kind discriminator. + * @return kind. + */ + public WorkerSelectorAttachmentKind getKind() { + return WorkerSelectorAttachmentKind.WEIGHTED_ALLOCATION; } /** diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WorkerSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WorkerSelectorAttachment.java index 8834c28f447c..1b8fa463d7a1 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WorkerSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WorkerSelectorAttachment.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -24,12 +25,13 @@ name = "weightedAllocation", value = WeightedAllocationWorkerSelectorAttachment.class) }) +@Immutable public abstract class WorkerSelectorAttachment { /** * kind discriminator. */ @JsonProperty(value = "kind") - protected WorkerSelectorAttachmentKind kind; + private WorkerSelectorAttachmentKind kind; /** Creates an instance of WorkerSelectorAttachment class. */ public WorkerSelectorAttachment() {} @@ -38,7 +40,5 @@ public WorkerSelectorAttachment() {} * Returns kind discriminator. * @return kind. */ - public WorkerSelectorAttachmentKind getKind() { - return this.kind; - } + public abstract WorkerSelectorAttachmentKind getKind(); } diff --git a/sdk/communication/azure-communication-messages/pom.xml b/sdk/communication/azure-communication-messages/pom.xml index a92a260b1824..cc6e7be55dfa 100644 --- a/sdk/communication/azure-communication-messages/pom.xml +++ b/sdk/communication/azure-communication-messages/pom.xml @@ -51,7 +51,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure @@ -61,7 +61,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 org.junit.jupiter @@ -78,13 +78,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -108,13 +108,13 @@ com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -166,7 +166,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/communication/azure-communication-phonenumbers/pom.xml b/sdk/communication/azure-communication-phonenumbers/pom.xml index f595b0db6c38..29ef3727cd5a 100644 --- a/sdk/communication/azure-communication-phonenumbers/pom.xml +++ b/sdk/communication/azure-communication-phonenumbers/pom.xml @@ -63,7 +63,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure @@ -103,7 +103,7 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test @@ -129,19 +129,19 @@ com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -203,7 +203,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/communication/azure-communication-rooms/pom.xml b/sdk/communication/azure-communication-rooms/pom.xml index 770fe0ab910d..aaebb8acefae 100644 --- a/sdk/communication/azure-communication-rooms/pom.xml +++ b/sdk/communication/azure-communication-rooms/pom.xml @@ -59,7 +59,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure @@ -75,7 +75,7 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test @@ -105,25 +105,25 @@ com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test com.azure azure-identity - 1.12.0 + 1.12.1 test com.azure azure-core-http-netty - 1.14.2 + 1.15.0 @@ -136,7 +136,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/communication/azure-communication-sms/pom.xml b/sdk/communication/azure-communication-sms/pom.xml index 39d958e5375f..6239888d59e9 100644 --- a/sdk/communication/azure-communication-sms/pom.xml +++ b/sdk/communication/azure-communication-sms/pom.xml @@ -55,7 +55,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure @@ -65,7 +65,7 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test @@ -101,19 +101,19 @@ com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -159,7 +159,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/communication/azure-resourcemanager-communication/pom.xml b/sdk/communication/azure-resourcemanager-communication/pom.xml index cfacdc333677..f23890aa15ba 100644 --- a/sdk/communication/azure-resourcemanager-communication/pom.xml +++ b/sdk/communication/azure-resourcemanager-communication/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/pom.xml b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/pom.xml index 9c728ee997e3..ed292f0f8dd0 100644 --- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/pom.xml +++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/confidentialledger/azure-security-confidentialledger/README.md b/sdk/confidentialledger/azure-security-confidentialledger/README.md index 3e860f7c9dc4..5a41a30d9e04 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/README.md +++ b/sdk/confidentialledger/azure-security-confidentialledger/README.md @@ -49,7 +49,7 @@ To use the [DefaultAzureCredential][DefaultAzureCredential] provider shown below com.azure azure-identity - 1.11.4 + 1.12.0 ``` diff --git a/sdk/confidentialledger/azure-security-confidentialledger/pom.xml b/sdk/confidentialledger/azure-security-confidentialledger/pom.xml index 35a1a22c1f87..fbabf480ce88 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/pom.xml +++ b/sdk/confidentialledger/azure-security-confidentialledger/pom.xml @@ -46,12 +46,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 @@ -64,19 +64,19 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test com.azure azure-core-serializer-json-jackson - 1.4.11 + 1.4.12 test diff --git a/sdk/confluent/azure-resourcemanager-confluent/pom.xml b/sdk/confluent/azure-resourcemanager-confluent/pom.xml index 77ce69f47f92..305e4aac16b3 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/pom.xml +++ b/sdk/confluent/azure-resourcemanager-confluent/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/pom.xml b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/pom.xml index 9668138eecd0..465bfa840c1c 100644 --- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/pom.xml +++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/consumption/azure-resourcemanager-consumption/pom.xml b/sdk/consumption/azure-resourcemanager-consumption/pom.xml index c3d2648eb1e8..4a3878aaaebd 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/pom.xml +++ b/sdk/consumption/azure-resourcemanager-consumption/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-identity - 1.12.0 + 1.12.1 test com.azure azure-core-test - 1.24.2 + 1.25.0 test diff --git a/sdk/containerregistry/azure-containers-containerregistry-perf/pom.xml b/sdk/containerregistry/azure-containers-containerregistry-perf/pom.xml index 63c656c6f050..16c88d8391df 100644 --- a/sdk/containerregistry/azure-containers-containerregistry-perf/pom.xml +++ b/sdk/containerregistry/azure-containers-containerregistry-perf/pom.xml @@ -36,18 +36,18 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 @@ -58,7 +58,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 diff --git a/sdk/containerregistry/azure-containers-containerregistry/pom.xml b/sdk/containerregistry/azure-containers-containerregistry/pom.xml index 4821b8f4cab0..311fc4bc5a52 100644 --- a/sdk/containerregistry/azure-containers-containerregistry/pom.xml +++ b/sdk/containerregistry/azure-containers-containerregistry/pom.xml @@ -46,7 +46,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure @@ -56,7 +56,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 org.junit.jupiter @@ -105,19 +105,19 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -129,7 +129,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -160,7 +160,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/pom.xml b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/pom.xml index 4c9c3551bf49..790015e76d79 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/pom.xml +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/contentsafety/azure-ai-contentsafety/pom.xml b/sdk/contentsafety/azure-ai-contentsafety/pom.xml index 5be92c41dc2e..e249c7a46e08 100644 --- a/sdk/contentsafety/azure-ai-contentsafety/pom.xml +++ b/sdk/contentsafety/azure-ai-contentsafety/pom.xml @@ -50,12 +50,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 org.junit.jupiter @@ -72,13 +72,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/core/azure-core-amqp-experimental/pom.xml b/sdk/core/azure-core-amqp-experimental/pom.xml index 1824ff6aab6f..026496cd94fc 100644 --- a/sdk/core/azure-core-amqp-experimental/pom.xml +++ b/sdk/core/azure-core-amqp-experimental/pom.xml @@ -66,7 +66,7 @@ com.azure azure-core-amqp - 2.9.4 + 2.10.0-beta.1 diff --git a/sdk/core/azure-core-amqp/CHANGELOG.md b/sdk/core/azure-core-amqp/CHANGELOG.md index 8e2a63de7575..90af453d028b 100644 --- a/sdk/core/azure-core-amqp/CHANGELOG.md +++ b/sdk/core/azure-core-amqp/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 2.10.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 2.9.4 (2024-05-01) ### Features Added diff --git a/sdk/core/azure-core-amqp/pom.xml b/sdk/core/azure-core-amqp/pom.xml index 2633d333de29..5a9c092cd499 100644 --- a/sdk/core/azure-core-amqp/pom.xml +++ b/sdk/core/azure-core-amqp/pom.xml @@ -14,7 +14,7 @@ com.azure azure-core-amqp - 2.9.4 + 2.10.0-beta.1 jar Microsoft Azure Java Core AMQP Library @@ -78,7 +78,7 @@ com.azure azure-core - 1.49.0 + 1.50.0-beta.1 com.microsoft.azure @@ -139,7 +139,7 @@ com.azure azure-core-test - 1.25.0 + 1.26.0-beta.1 test diff --git a/sdk/core/azure-core-experimental/CHANGELOG.md b/sdk/core/azure-core-experimental/CHANGELOG.md index 8e0bc293126f..10f571930bb7 100644 --- a/sdk/core/azure-core-experimental/CHANGELOG.md +++ b/sdk/core/azure-core-experimental/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.51 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.50 (2024-05-01) ### Other Changes diff --git a/sdk/core/azure-core-experimental/pom.xml b/sdk/core/azure-core-experimental/pom.xml index 3775b80d5e75..aaacbfc94d44 100644 --- a/sdk/core/azure-core-experimental/pom.xml +++ b/sdk/core/azure-core-experimental/pom.xml @@ -15,7 +15,7 @@ com.azure azure-core-experimental jar - 1.0.0-beta.50 + 1.0.0-beta.51 Microsoft Azure Java Core Experimental Library This package contains experimental core types for Azure Java clients. @@ -80,7 +80,7 @@ com.azure azure-core - 1.49.0 + 1.50.0-beta.1 diff --git a/sdk/core/azure-core-http-jdk-httpclient/CHANGELOG.md b/sdk/core/azure-core-http-jdk-httpclient/CHANGELOG.md index c6f24b7d929a..3c59c64f53df 100644 --- a/sdk/core/azure-core-http-jdk-httpclient/CHANGELOG.md +++ b/sdk/core/azure-core-http-jdk-httpclient/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.14 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.13 (2024-05-01) ### Other Changes diff --git a/sdk/core/azure-core-http-jdk-httpclient/pom.xml b/sdk/core/azure-core-http-jdk-httpclient/pom.xml index 92b098750231..40282939dfda 100644 --- a/sdk/core/azure-core-http-jdk-httpclient/pom.xml +++ b/sdk/core/azure-core-http-jdk-httpclient/pom.xml @@ -15,7 +15,7 @@ com.azure azure-core-http-jdk-httpclient jar - 1.0.0-beta.13 + 1.0.0-beta.14 Microsoft Azure JDK HTTP Client Library This package contains the Azure HTTP client library using the JDK HttpClient API. @@ -78,27 +78,27 @@ com.azure azure-core - 1.49.0 + 1.50.0-beta.1 com.azure azure-core - 1.49.0 + 1.50.0-beta.1 test-jar test com.azure azure-core-test - 1.25.0 + 1.26.0-beta.1 test com.azure azure-core-test - 1.25.0 + 1.26.0-beta.1 test-jar test diff --git a/sdk/core/azure-core-http-netty/CHANGELOG.md b/sdk/core/azure-core-http-netty/CHANGELOG.md index ce7d5958069e..c62424c82130 100644 --- a/sdk/core/azure-core-http-netty/CHANGELOG.md +++ b/sdk/core/azure-core-http-netty/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.16.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.15.0 (2024-05-01) ### Bugs Fixed diff --git a/sdk/core/azure-core-http-netty/pom.xml b/sdk/core/azure-core-http-netty/pom.xml index 6bdbb6e5e0b1..fae57fc5b8bd 100644 --- a/sdk/core/azure-core-http-netty/pom.xml +++ b/sdk/core/azure-core-http-netty/pom.xml @@ -15,7 +15,7 @@ com.azure azure-core-http-netty jar - 1.15.0 + 1.16.0-beta.1 Microsoft Azure Netty HTTP Client Library This package contains the Netty HTTP client plugin for azure-core. @@ -83,7 +83,7 @@ com.azure azure-core - 1.49.0 + 1.50.0-beta.1 @@ -157,20 +157,20 @@ com.azure azure-core - 1.49.0 + 1.50.0-beta.1 test-jar test com.azure azure-core-test - 1.25.0 + 1.26.0-beta.1 test com.azure azure-core-test - 1.25.0 + 1.26.0-beta.1 test-jar test diff --git a/sdk/core/azure-core-http-okhttp/CHANGELOG.md b/sdk/core/azure-core-http-okhttp/CHANGELOG.md index faabb91025dc..f9b70ce977ed 100644 --- a/sdk/core/azure-core-http-okhttp/CHANGELOG.md +++ b/sdk/core/azure-core-http-okhttp/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.12.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.11.21 (2024-05-01) ### Other Changes diff --git a/sdk/core/azure-core-http-okhttp/pom.xml b/sdk/core/azure-core-http-okhttp/pom.xml index 261b83240c29..70640ecd77cb 100644 --- a/sdk/core/azure-core-http-okhttp/pom.xml +++ b/sdk/core/azure-core-http-okhttp/pom.xml @@ -15,7 +15,7 @@ com.azure azure-core-http-okhttp jar - 1.11.21 + 1.12.0-beta.1 Microsoft Azure OkHttp HTTP Client Library This package contains the OkHttp HTTP client plugin for azure-core. @@ -79,7 +79,7 @@ com.azure azure-core - 1.49.0 + 1.50.0-beta.1 @@ -98,20 +98,20 @@ com.azure azure-core - 1.49.0 + 1.50.0-beta.1 test-jar test com.azure azure-core-test - 1.25.0 + 1.26.0-beta.1 test com.azure azure-core-test - 1.25.0 + 1.26.0-beta.1 test-jar test diff --git a/sdk/core/azure-core-http-vertx/CHANGELOG.md b/sdk/core/azure-core-http-vertx/CHANGELOG.md index d5bd9554ede8..8c692e2a2dff 100644 --- a/sdk/core/azure-core-http-vertx/CHANGELOG.md +++ b/sdk/core/azure-core-http-vertx/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.19 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.18 (2024-05-01) ### Other Changes diff --git a/sdk/core/azure-core-http-vertx/pom.xml b/sdk/core/azure-core-http-vertx/pom.xml index 575c2c044153..b077001bce30 100644 --- a/sdk/core/azure-core-http-vertx/pom.xml +++ b/sdk/core/azure-core-http-vertx/pom.xml @@ -15,7 +15,7 @@ com.azure azure-core-http-vertx jar - 1.0.0-beta.18 + 1.0.0-beta.19 Microsoft Azure Vert.x HTTP Client Library This package contains the Vert.x HTTP client plugin for azure-core. @@ -79,7 +79,7 @@ com.azure azure-core - 1.49.0 + 1.50.0-beta.1 @@ -106,20 +106,20 @@ com.azure azure-core - 1.49.0 + 1.50.0-beta.1 test-jar test com.azure azure-core-test - 1.25.0 + 1.26.0-beta.1 test com.azure azure-core-test - 1.25.0 + 1.26.0-beta.1 test-jar test diff --git a/sdk/core/azure-core-management/CHANGELOG.md b/sdk/core/azure-core-management/CHANGELOG.md index e4481f3a61d8..925820f38911 100644 --- a/sdk/core/azure-core-management/CHANGELOG.md +++ b/sdk/core/azure-core-management/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.15.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.14.0 (2024-05-01) ### Features Added diff --git a/sdk/core/azure-core-management/pom.xml b/sdk/core/azure-core-management/pom.xml index e84a3836ba32..e961b7f3ab1a 100644 --- a/sdk/core/azure-core-management/pom.xml +++ b/sdk/core/azure-core-management/pom.xml @@ -13,7 +13,7 @@ com.azure azure-core-management - 1.14.0 + 1.15.0-beta.1 jar Microsoft Azure Management Java Core Library @@ -77,7 +77,7 @@ com.azure azure-core - 1.49.0 + 1.50.0-beta.1 @@ -107,7 +107,7 @@ com.azure azure-core-http-netty - 1.15.0 + 1.16.0-beta.1 test diff --git a/sdk/core/azure-core-metrics-opentelemetry/CHANGELOG.md b/sdk/core/azure-core-metrics-opentelemetry/CHANGELOG.md index 5f5b80686437..54e8588013c2 100644 --- a/sdk/core/azure-core-metrics-opentelemetry/CHANGELOG.md +++ b/sdk/core/azure-core-metrics-opentelemetry/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.20 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.19 (2024-05-01) ### Other Changes diff --git a/sdk/core/azure-core-metrics-opentelemetry/pom.xml b/sdk/core/azure-core-metrics-opentelemetry/pom.xml index f00b0692665b..c0af751b63aa 100644 --- a/sdk/core/azure-core-metrics-opentelemetry/pom.xml +++ b/sdk/core/azure-core-metrics-opentelemetry/pom.xml @@ -12,7 +12,7 @@ com.azure azure-core-metrics-opentelemetry - 1.0.0-beta.19 + 1.0.0-beta.20 Microsoft Azure OpenTelemetry metrics plugin This package contains the OpenTelemetry metrics plugin for Azure client libraries. @@ -54,7 +54,7 @@ com.azure azure-core - 1.49.0 + 1.50.0-beta.1 com.google.code.findbugs @@ -81,13 +81,13 @@ com.azure azure-core-test - 1.25.0 + 1.26.0-beta.1 test com.azure azure-core-http-netty - 1.15.0 + 1.16.0-beta.1 test diff --git a/sdk/core/azure-core-perf/pom.xml b/sdk/core/azure-core-perf/pom.xml index 2fd6ea2dbf94..977c2d10af63 100644 --- a/sdk/core/azure-core-perf/pom.xml +++ b/sdk/core/azure-core-perf/pom.xml @@ -25,17 +25,17 @@ com.azure azure-core - 1.49.0 + 1.50.0-beta.1 com.azure azure-core-http-netty - 1.15.0 + 1.16.0-beta.1 com.azure azure-core-http-okhttp - 1.11.21 + 1.12.0-beta.1 com.azure diff --git a/sdk/core/azure-core-serializer-avro-apache/CHANGELOG.md b/sdk/core/azure-core-serializer-avro-apache/CHANGELOG.md index f156a7ff6534..4215af3441ae 100644 --- a/sdk/core/azure-core-serializer-avro-apache/CHANGELOG.md +++ b/sdk/core/azure-core-serializer-avro-apache/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.47 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.46 (2024-05-01) ### Other Changes diff --git a/sdk/core/azure-core-serializer-avro-apache/pom.xml b/sdk/core/azure-core-serializer-avro-apache/pom.xml index eb9500357e7e..7845d3f184e1 100644 --- a/sdk/core/azure-core-serializer-avro-apache/pom.xml +++ b/sdk/core/azure-core-serializer-avro-apache/pom.xml @@ -15,7 +15,7 @@ com.azure azure-core-serializer-avro-apache jar - 1.0.0-beta.46 + 1.0.0-beta.47 Microsoft Azure Apache Avro Serializer Library This package contains the Apache Avro serializer client plugin for azure-core. @@ -78,12 +78,12 @@ com.azure azure-core - 1.49.0 + 1.50.0-beta.1 com.azure azure-core-experimental - 1.0.0-beta.50 + 1.0.0-beta.51 diff --git a/sdk/core/azure-core-serializer-avro-jackson/pom.xml b/sdk/core/azure-core-serializer-avro-jackson/pom.xml index 8da7949cd41a..e4e8024dcf87 100644 --- a/sdk/core/azure-core-serializer-avro-jackson/pom.xml +++ b/sdk/core/azure-core-serializer-avro-jackson/pom.xml @@ -70,12 +70,12 @@ com.azure azure-core - 1.49.0 + 1.50.0-beta.1 com.azure azure-core-experimental - 1.0.0-beta.50 + 1.0.0-beta.51 diff --git a/sdk/core/azure-core-serializer-json-gson/CHANGELOG.md b/sdk/core/azure-core-serializer-json-gson/CHANGELOG.md index aff12eeb3a12..9aaa86e7ed26 100644 --- a/sdk/core/azure-core-serializer-json-gson/CHANGELOG.md +++ b/sdk/core/azure-core-serializer-json-gson/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.3.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.2.12 (2024-05-01) ### Other Changes diff --git a/sdk/core/azure-core-serializer-json-gson/pom.xml b/sdk/core/azure-core-serializer-json-gson/pom.xml index e8a42af04ba6..102cf05fa701 100644 --- a/sdk/core/azure-core-serializer-json-gson/pom.xml +++ b/sdk/core/azure-core-serializer-json-gson/pom.xml @@ -15,7 +15,7 @@ com.azure azure-core-serializer-json-gson jar - 1.2.12 + 1.3.0-beta.1 Microsoft Azure Gson JSON Serializer Library This package contains the Gson JSON serializer client plugin for azure-core. @@ -79,7 +79,7 @@ com.azure azure-core - 1.49.0 + 1.50.0-beta.1 com.azure diff --git a/sdk/core/azure-core-serializer-json-jackson/CHANGELOG.md b/sdk/core/azure-core-serializer-json-jackson/CHANGELOG.md index c40f21203f78..f703eaca6404 100644 --- a/sdk/core/azure-core-serializer-json-jackson/CHANGELOG.md +++ b/sdk/core/azure-core-serializer-json-jackson/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.5.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.4.12 (2024-05-01) ### Other Changes diff --git a/sdk/core/azure-core-serializer-json-jackson/pom.xml b/sdk/core/azure-core-serializer-json-jackson/pom.xml index db5bddfaee68..94ec30f14c4b 100644 --- a/sdk/core/azure-core-serializer-json-jackson/pom.xml +++ b/sdk/core/azure-core-serializer-json-jackson/pom.xml @@ -15,7 +15,7 @@ com.azure azure-core-serializer-json-jackson jar - 1.4.12 + 1.5.0-beta.1 Microsoft Azure Jackson JSON Serializer Library This package contains the Jackson JSON serializer client plugin for azure-core. @@ -91,7 +91,7 @@ com.azure azure-core - 1.49.0 + 1.50.0-beta.1 diff --git a/sdk/core/azure-core-test/CHANGELOG.md b/sdk/core/azure-core-test/CHANGELOG.md index dee4e183dc0d..2b0b84825831 100644 --- a/sdk/core/azure-core-test/CHANGELOG.md +++ b/sdk/core/azure-core-test/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.26.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.25.0 (2024-05-01) ### Features Added diff --git a/sdk/core/azure-core-test/pom.xml b/sdk/core/azure-core-test/pom.xml index c31ab8189b1c..5bc7fade6ee1 100644 --- a/sdk/core/azure-core-test/pom.xml +++ b/sdk/core/azure-core-test/pom.xml @@ -13,7 +13,7 @@ com.azure azure-core-test jar - 1.25.0 + 1.26.0-beta.1 Microsoft Azure Java Core Test Library This package contains core test types for Azure Java clients. @@ -72,7 +72,7 @@ com.azure azure-core - 1.49.0 + 1.50.0-beta.1 diff --git a/sdk/core/azure-core-tracing-opentelemetry-samples/pom.xml b/sdk/core/azure-core-tracing-opentelemetry-samples/pom.xml index 05d3180085a2..daebbbff7e38 100644 --- a/sdk/core/azure-core-tracing-opentelemetry-samples/pom.xml +++ b/sdk/core/azure-core-tracing-opentelemetry-samples/pom.xml @@ -40,14 +40,14 @@ com.azure azure-core-tracing-opentelemetry - 1.0.0-beta.46 + 1.0.0-beta.47 com.azure azure-core-http-netty - 1.15.0 + 1.16.0-beta.1 test @@ -77,7 +77,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md b/sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md index 14eba26b91a1..81b657de879c 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md +++ b/sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.47 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.46 (2024-05-01) ### Breaking Changes diff --git a/sdk/core/azure-core-tracing-opentelemetry/pom.xml b/sdk/core/azure-core-tracing-opentelemetry/pom.xml index 3fe946e6ce08..ceb5e0d93769 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/pom.xml +++ b/sdk/core/azure-core-tracing-opentelemetry/pom.xml @@ -12,7 +12,7 @@ com.azure azure-core-tracing-opentelemetry - 1.0.0-beta.46 + 1.0.0-beta.47 Microsoft Azure OpenTelemetry tracing plugin This package contains the OpenTelemetry tracing plugin for Azure client libraries. @@ -67,7 +67,7 @@ com.azure azure-core - 1.49.0 + 1.50.0-beta.1 com.google.code.findbugs @@ -86,19 +86,19 @@ com.azure azure-core-experimental - 1.0.0-beta.50 + 1.0.0-beta.51 test com.azure azure-core-test - 1.25.0 + 1.26.0-beta.1 test com.azure azure-core-http-netty - 1.15.0 + 1.16.0-beta.1 test diff --git a/sdk/core/azure-core-version-tests/pom.xml b/sdk/core/azure-core-version-tests/pom.xml index d158c83a5b6b..2219f6dbd19a 100644 --- a/sdk/core/azure-core-version-tests/pom.xml +++ b/sdk/core/azure-core-version-tests/pom.xml @@ -62,12 +62,12 @@ com.azure azure-core - 1.49.0 + 1.50.0-beta.1 com.azure azure-core-serializer-json-jackson - 1.4.12 + 1.5.0-beta.1 com.fasterxml.jackson.core @@ -113,7 +113,7 @@ com.azure azure-core-test - 1.25.0 + 1.26.0-beta.1 io.projectreactor diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index e06e0ff78750..ae330f04e508 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.50.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.49.0 (2024-05-01) ### Features Added diff --git a/sdk/core/azure-core/pom.xml b/sdk/core/azure-core/pom.xml index 5e5c56843e51..f3ca63be12c6 100644 --- a/sdk/core/azure-core/pom.xml +++ b/sdk/core/azure-core/pom.xml @@ -15,7 +15,7 @@ com.azure azure-core jar - 1.49.0 + 1.50.0-beta.1 Microsoft Azure Java Core Library This package contains core types for Azure Java clients. diff --git a/sdk/cosmos/azure-cosmos-benchmark/pom.xml b/sdk/cosmos/azure-cosmos-benchmark/pom.xml index 24ed62af4562..7b600be0aaa6 100644 --- a/sdk/cosmos/azure-cosmos-benchmark/pom.xml +++ b/sdk/cosmos/azure-cosmos-benchmark/pom.xml @@ -63,7 +63,7 @@ Licensed under the MIT License. com.azure azure-identity - 1.12.0 + 1.12.1 com.azure diff --git a/sdk/cosmos/azure-cosmos-encryption/pom.xml b/sdk/cosmos/azure-cosmos-encryption/pom.xml index 9ca5f42b55b6..1d853540d269 100644 --- a/sdk/cosmos/azure-cosmos-encryption/pom.xml +++ b/sdk/cosmos/azure-cosmos-encryption/pom.xml @@ -80,7 +80,7 @@ Licensed under the MIT License. com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/doc/configuration-reference.md b/sdk/cosmos/azure-cosmos-kafka-connect/doc/configuration-reference.md index a326f75be4ac..9e5b224b60a1 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/doc/configuration-reference.md +++ b/sdk/cosmos/azure-cosmos-kafka-connect/doc/configuration-reference.md @@ -2,65 +2,65 @@ ## Generic Configuration -| Config Property Name | Default | Description | -|:--------------------------------------------------------------------|:-----------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `azure.cosmos.account.endpoint` | None | Cosmos DB Account Endpoint Uri | -| `azure.cosmos.account.environment` | `Azure` | The azure environment of the CosmosDB account: `Azure`, `AzureChina`, `AzureUsGovernment`, `AzureGermany`. | -| `azure.cosmos.account.tenantId` | `""` | The tenantId of the CosmosDB account. Required for `ServicePrincipal` authentication. | -| `azure.cosmos.auth.type` | `MasterKey` | There are two auth types are supported currently: `MasterKey`(PrimaryReadWriteKeys, SecondReadWriteKeys, PrimaryReadOnlyKeys, SecondReadWriteKeys), `ServicePrincipal` | -| `azure.cosmos.account.key` | `""` | Cosmos DB Account Key (only required in case of `auth.type` as `MasterKey`) | -| `azure.cosmos.auth.aad.clientId` | `""` | The clientId/ApplicationId of the service principal. Required for `ServicePrincipal` authentication. | -| `azure.cosmos.auth.aad.clientSecret` | `""` | The client secret/password of the service principal. | -| `azure.cosmos.mode.gateway` | `false` | Flag to indicate whether to use gateway mode. By default it is false, means SDK uses direct mode. https://learn.microsoft.com/azure/cosmos-db/nosql/sdk-connection-modes | -| `azure.cosmos.preferredRegionList` | `[]` | Preferred regions list to be used for a multi region Cosmos DB account. This is a comma separated value (e.g., `[East US, West US]` or `East US, West US`) provided preferred regions will be used as hint. You should use a collocated kafka cluster with your Cosmos DB account and pass the kafka cluster region as preferred region. See list of azure regions [here](https://docs.microsoft.com/dotnet/api/microsoft.azure.documents.locationnames?view=azure-dotnet&preserve-view=true). | -| `azure.cosmos.application.name` | `""` | Application name. Will be added as the userAgent suffix. | -| `azure.cosmos.throughputControl.enabled` | `false` | A flag to indicate whether throughput control is enabled. | -| `azure.cosmos.throughputControl.account.endpoint` | `""` | Cosmos DB Throughput Control Account Endpoint Uri. | -| `azure.cosmos.throughputControl.account.environment` | `Azure` | The azure environment of the CosmosDB account: `Azure`, `AzureChina`, `AzureUsGovernment`, `AzureGermany`. | -| `azure.cosmos.throughputControl.account.tenantId` | `""` | The tenantId of the CosmosDB account. Required for `ServicePrincipal` authentication. | -| `azure.cosmos.throughputControl.auth.type` | `MasterKey` | There are two auth types are supported currently: `MasterKey`(PrimaryReadWriteKeys, SecondReadWriteKeys, PrimaryReadOnlyKeys, SecondReadWriteKeys), `ServicePrincipal` | -| `azure.cosmos.throughputControl.account.key` | `""` | Cosmos DB Throughput Control Account Key (only required in case of `throughputControl.auth.type` as `MasterKey`). | -| `azure.cosmos.throughputControl.auth.aad.clientId` | `""` | The clientId/ApplicationId of the service principal. Required for `ServicePrincipal` authentication. | -| `azure.cosmos.throughputControl.auth.aad.clientSecret` | `""` | The client secret/password of the service principal. | -| `azure.cosmos.throughputControl.preferredRegionList` | `[]` | Preferred regions list to be used for a multi region Cosmos DB account. This is a comma separated value (e.g., `[East US, West US]` or `East US, West US`) provided preferred regions will be used as hint. You should use a collocated kafka cluster with your Cosmos DB account and pass the kafka cluster region as preferred region. See list of azure regions [here](https://docs.microsoft.com/dotnet/api/microsoft.azure.documents.locationnames?view=azure-dotnet&preserve-view=true). | -| `azure.cosmos.throughputControl.mode.gateway` | `false` | Flag to indicate whether to use gateway mode. By default it is false, means SDK uses direct mode. https://learn.microsoft.com/azure/cosmos-db/nosql/sdk-connection-modes | -| `azure.cosmos.throughputControl.group.name` | `""` | Throughput control group name. Since customer is allowed to create many groups for a container, the name should be unique. | -| `azure.cosmos.throughputControl.targetThroughput` | `-1` | Throughput control group target throughput. The value should be larger than 0. | -| `azure.cosmos.throughputControl.targetThroughputThreshold` | `-1` | Throughput control group target throughput threshold. The value should be between (0,1]. | -| `azure.cosmos.throughputControl.priorityLevel` | `None` | Throughput control group priority level. The value can be None, High or Low. | -| `azure.cosmos.throughputControl.globalControl.database.name` | `""` | Database which will be used for throughput global control. | -| `azure.cosmos.throughputControl.globalControl.container.name` | `""` | Container which will be used for throughput global control. | -| `azure.cosmos.throughputControl.globalControl.renewIntervalInMS` | `-1` | This controls how often the client is going to update the throughput usage of itself and adjust its own throughput share based on the throughput usage of other clients. Default is 5s, the allowed min value is 5s. | -| `azure.cosmos.throughputControl.globalControl.expireIntervalInMS` | `-1` | This controls how quickly we will detect the client has been offline and hence allow its throughput share to be taken by other clients. Default is 11s, the allowed min value is 2 * renewIntervalInMS + 1. | +| Config Property Name | Default | Description | +|:------------------------------------------------------------------|:-----------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `azure.cosmos.account.endpoint` | None | Cosmos DB Account Endpoint Uri | +| `azure.cosmos.account.environment` | `Azure` | The azure environment of the CosmosDB account: `Azure`, `AzureChina`, `AzureUsGovernment`, `AzureGermany`. | +| `azure.cosmos.account.tenantId` | `""` | The tenantId of the CosmosDB account. Required for `ServicePrincipal` authentication. | +| `azure.cosmos.auth.type` | `MasterKey` | There are two auth types are supported currently: `MasterKey`(PrimaryReadWriteKeys, SecondReadWriteKeys, PrimaryReadOnlyKeys, SecondReadWriteKeys), `ServicePrincipal` | +| `azure.cosmos.account.key` | `""` | Cosmos DB Account Key (only required in case of `auth.type` as `MasterKey`) | +| `azure.cosmos.auth.aad.clientId` | `""` | The clientId/ApplicationId of the service principal. Required for `ServicePrincipal` authentication. | +| `azure.cosmos.auth.aad.clientSecret` | `""` | The client secret/password of the service principal. | +| `azure.cosmos.mode.gateway` | `false` | Flag to indicate whether to use gateway mode. By default it is false, means SDK uses direct mode. https://learn.microsoft.com/azure/cosmos-db/nosql/sdk-connection-modes | +| `azure.cosmos.preferredRegionList` | `[]` | Preferred regions list to be used for a multi region Cosmos DB account. This is a comma separated value (e.g., `[East US, West US]` or `East US, West US`) provided preferred regions will be used as hint. You should use a collocated kafka cluster with your Cosmos DB account and pass the kafka cluster region as preferred region. See list of azure regions [here](https://docs.microsoft.com/dotnet/api/microsoft.azure.documents.locationnames?view=azure-dotnet&preserve-view=true). | +| `azure.cosmos.application.name` | `""` | Application name. Will be added as the userAgent suffix. | +| `azure.cosmos.throughputControl.enabled` | `false` | A flag to indicate whether throughput control is enabled. | +| `azure.cosmos.throughputControl.account.endpoint` | `""` | Cosmos DB Throughput Control Account Endpoint Uri. | +| `azure.cosmos.throughputControl.account.environment` | `Azure` | The azure environment of the CosmosDB account: `Azure`, `AzureChina`, `AzureUsGovernment`, `AzureGermany`. | +| `azure.cosmos.throughputControl.account.tenantId` | `""` | The tenantId of the CosmosDB account. Required for `ServicePrincipal` authentication. | +| `azure.cosmos.throughputControl.auth.type` | `MasterKey` | There are two auth types are supported currently: `MasterKey`(PrimaryReadWriteKeys, SecondReadWriteKeys, PrimaryReadOnlyKeys, SecondReadWriteKeys), `ServicePrincipal` | +| `azure.cosmos.throughputControl.account.key` | `""` | Cosmos DB Throughput Control Account Key (only required in case of `throughputControl.auth.type` as `MasterKey`). | +| `azure.cosmos.throughputControl.auth.aad.clientId` | `""` | The clientId/ApplicationId of the service principal. Required for `ServicePrincipal` authentication. | +| `azure.cosmos.throughputControl.auth.aad.clientSecret` | `""` | The client secret/password of the service principal. | +| `azure.cosmos.throughputControl.preferredRegionList` | `[]` | Preferred regions list to be used for a multi region Cosmos DB account. This is a comma separated value (e.g., `[East US, West US]` or `East US, West US`) provided preferred regions will be used as hint. You should use a collocated kafka cluster with your Cosmos DB account and pass the kafka cluster region as preferred region. See list of azure regions [here](https://docs.microsoft.com/dotnet/api/microsoft.azure.documents.locationnames?view=azure-dotnet&preserve-view=true). | +| `azure.cosmos.throughputControl.mode.gateway` | `false` | Flag to indicate whether to use gateway mode. By default it is false, means SDK uses direct mode. https://learn.microsoft.com/azure/cosmos-db/nosql/sdk-connection-modes | +| `azure.cosmos.throughputControl.group.name` | `""` | Throughput control group name. Since customer is allowed to create many groups for a container, the name should be unique. | +| `azure.cosmos.throughputControl.targetThroughput` | `-1` | Throughput control group target throughput. The value should be larger than 0. | +| `azure.cosmos.throughputControl.targetThroughputThreshold` | `-1` | Throughput control group target throughput threshold. The value should be between (0,1]. | +| `azure.cosmos.throughputControl.priorityLevel` | `None` | Throughput control group priority level. The value can be None, High or Low. | +| `azure.cosmos.throughputControl.globalControl.database.name` | `""` | Database which will be used for throughput global control. | +| `azure.cosmos.throughputControl.globalControl.container.name` | `""` | Container which will be used for throughput global control. | +| `azure.cosmos.throughputControl.globalControl.renewIntervalInMS` | `-1` | This controls how often the client is going to update the throughput usage of itself and adjust its own throughput share based on the throughput usage of other clients. Default is 5s, the allowed min value is 5s. | +| `azure.cosmos.throughputControl.globalControl.expireIntervalInMS` | `-1` | This controls how quickly we will detect the client has been offline and hence allow its throughput share to be taken by other clients. Default is 11s, the allowed min value is 2 * renewIntervalInMS + 1. | ## Source Connector Configuration -| Config Property Name | Default | Description | -|:--------------------------------------------------|:---------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `azure.cosmos.source.database.name` | None | Cosmos DB database name. | -| `azure.cosmos.source.containers.includeAll` | `false` | Flag to indicate whether reading from all containers. | -| `azure.cosmos.source.containers.includedList` | `[]` | Containers included. This config will be ignored if azure.cosmos.source.containers.includeAll is true. | -| `azure.cosmos.source.containers.topicMap` | `[]` | A comma delimited list of Kafka topics mapped to Cosmos containers. For example: topic1#con1,topic2#con2. By default, container name is used as the name of the kafka topic to publish data to, can use this property to override the default config | -| `azure.cosmos.source.changeFeed.startFrom` | `Beginning` | ChangeFeed Start from settings (Now, Beginning or a certain point in time (UTC) for example 2020-02-10T14:15:03) - the default value is 'Beginning'. | -| `azure.cosmos.source.changeFeed.mode` | `LatestVersion` | ChangeFeed mode (LatestVersion or AllVersionsAndDeletes). | -| `azure.cosmos.source.changeFeed.maxItemCountHint` | `1000` | The maximum number of documents returned in a single change feed request. But the number of items received might be higher than the specified value if multiple items are changed by the same transaction. | -| `azure.cosmos.source.metadata.poll.delay.ms` | `300000` | Indicates how often to check the metadata changes (including container split/merge, adding/removing/recreated containers). When changes are detected, it will reconfigure the tasks. Default is 5 minutes. | -| `azure.cosmos.source.metadata.storage.type` | `Kafka` | The storage type of the metadata. Two types are supported: Cosmos, Kafka. | -| `azure.cosmos.source.metadata.storage.name` | `_cosmos.metadata.topic` | The resource name of the metadata storage. If metadata storage type is Kafka topic, then this config refers to kafka topic name, the metadata topic will be created if it does not already exist, else it will use the pre-created topic. If metadata storage type is CosmosDB container, then this config refers to container name, please pre-create the metadata container partitioned by /id. | -| `azure.cosmos.source.messageKey.enabled` | `true` | Whether to set the kafka record message key. | -| `azure.cosmos.source.messageKey.field` | `id` | The field to use as the message key. | +| Config Property Name | Default | Description | +|:--------------------------------------------------|:-------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `azure.cosmos.source.database.name` | None | Cosmos DB database name. | +| `azure.cosmos.source.containers.includeAll` | `false` | Flag to indicate whether reading from all containers. | +| `azure.cosmos.source.containers.includedList` | `[]` | Containers included. This config will be ignored if azure.cosmos.source.containers.includeAll is true. | +| `azure.cosmos.source.containers.topicMap` | `[]` | A comma delimited list of Kafka topics mapped to Cosmos containers. For example: topic1#con1,topic2#con2. By default, container name is used as the name of the kafka topic to publish data to, can use this property to override the default config | +| `azure.cosmos.source.changeFeed.startFrom` | `Beginning` | ChangeFeed Start from settings (Now, Beginning or a certain point in time (UTC) for example 2020-02-10T14:15:03) - the default value is 'Beginning'. | +| `azure.cosmos.source.changeFeed.mode` | `LatestVersion` | ChangeFeed mode (LatestVersion or AllVersionsAndDeletes). | +| `azure.cosmos.source.changeFeed.maxItemCountHint` | `1000` | The maximum number of documents returned in a single change feed request. But the number of items received might be higher than the specified value if multiple items are changed by the same transaction. | +| `azure.cosmos.source.metadata.poll.delay.ms` | `300000` | Indicates how often to check the metadata changes (including container split/merge, adding/removing/recreated containers). When changes are detected, it will reconfigure the tasks. Default is 5 minutes. | +| `azure.cosmos.source.metadata.storage.type` | `Kafka` | The storage type of the metadata. Two types are supported: Cosmos, Kafka. | +| `azure.cosmos.source.metadata.storage.name` | `_cosmos.metadata.topic` | The resource name of the metadata storage. If metadata storage type is Kafka topic, then this config refers to kafka topic name, the metadata topic will be created if it does not already exist, else it will use the pre-created topic. If metadata storage type is `Cosmos`, then this config refers to container name, for `MasterKey` auth, this container will be created with `AutoScale` with 4000 RU if not already exists, for `ServicePrincipal` auth, it requires the container to be created ahead of time . | +| `azure.cosmos.source.messageKey.enabled` | `true` | Whether to set the kafka record message key. | +| `azure.cosmos.source.messageKey.field` | `id` | The field to use as the message key. | ## Sink Connector Configuration -| Config Property Name | Default | Description | -|:-------------------------------------------------------|:--------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `azure.cosmos.sink.database.name` | `""` | Cosmos DB database name. | -| `azure.cosmos.sink.containers.topicMap` | `""` | A comma delimited list of Kafka topics mapped to Cosmos containers. For example: topic1#con1,topic2#con2. | -| `azure.cosmos.sink.errors.tolerance.level` | `None` | Error tolerance level after exhausting all retries. `None` for fail on error. `All` for log and continue | -| `azure.cosmos.sink.bulk.enabled` | `true` | Flag to indicate whether Cosmos DB bulk mode is enabled for Sink connector. By default it is true. | -| `azure.cosmos.sink.bulk.maxConcurrentCosmosPartitions` | `-1` | Cosmos DB Item Write Max Concurrent Cosmos Partitions. If not specified it will be determined based on the number of the container's physical partitions which would indicate every batch is expected to have data from all Cosmos physical partitions. If specified it indicates from at most how many Cosmos Physical Partitions each batch contains data. So this config can be used to make bulk processing more efficient when input data in each batch has been repartitioned to balance to how many Cosmos partitions each batch needs to write. This is mainly useful for very large containers (with hundreds of physical partitions. | -| `azure.cosmos.sink.bulk.initialBatchSize` | `1` | Cosmos DB initial bulk micro batch size - a micro batch will be flushed to the backend when the number of documents enqueued exceeds this size - or the target payload size is met. The micro batch size is getting automatically tuned based on the throttling rate. By default the initial micro batch size is 1. Reduce this when you want to avoid that the first few requests consume too many RUs. | -| `azure.cosmos.sink.write.strategy` | `ItemOverwrite` | Cosmos DB Item write Strategy: `ItemOverwrite` (using upsert), `ItemAppend` (using create, ignore pre-existing items i.e., Conflicts), `ItemDelete` (deletes based on id/pk of data frame), `ItemDeleteIfNotModified` (deletes based on id/pk of data frame if etag hasn't changed since collecting id/pk), `ItemOverwriteIfNotModified` (using create if etag is empty, update/replace with etag pre-condition otherwise, if document was updated the pre-condition failure is ignored), `ItemPatch` (Partial update all documents based on the patch config) | -| `azure.cosmos.sink.maxRetryCount` | `10` | Cosmos DB max retry attempts on write failures for Sink connector. By default, the connector will retry on transient write errors for up to 10 times. | -| `azure.cosmos.sink.id.strategy` | `ProvidedInValueStrategy` | A strategy used to populate the document with an ``id``. Valid strategies are: ``TemplateStrategy``, ``FullKeyStrategy``, ``KafkaMetadataStrategy``, ``ProvidedInKeyStrategy``, ``ProvidedInValueStrategy``. Configuration properties prefixed with``id.strategy`` are passed through to the strategy. For example, when using ``id.strategy=TemplateStrategy`` , the property ``id.strategy.template`` is passed through to the template strategy and used to specify the template string to be used in constructing the ``id``. | -| `azure.cosmos.sink.write.patch.operationType.default` | `Set` | Default Cosmos DB patch operation type. Supported ones include none, add, set, replace, remove, increment. Choose none for no-op, for others please reference [here](https://docs.microsoft.com/azure/cosmos-db/partial-document-update#supported-operations) for full context. | -| `azure.cosmos.sink.write.patch.property.configs` | `""` | Cosmos DB patch json property configs. It can contain multiple definitions matching the following patterns separated by comma. property(jsonProperty).op(operationType) or property(jsonProperty).path(patchInCosmosdb).op(operationType) - The difference of the second pattern is that it also allows you to define a different cosmosdb path. Note: It does not support nested json property config. | -| `azure.cosmos.sink.write.patch.filter` | `""` | Used for [Conditional patch](https://docs.microsoft.com/azure/cosmos-db/partial-document-update-getting-started#java) | +| Config Property Name | Default | Description | +|:-----------------------------------------------------------|:--------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `azure.cosmos.sink.database.name` | `""` | Cosmos DB database name. | +| `azure.cosmos.sink.containers.topicMap` | `""` | A comma delimited list of Kafka topics mapped to Cosmos containers. For example: topic1#con1,topic2#con2. | +| `azure.cosmos.sink.errors.tolerance.level` | `None` | Error tolerance level after exhausting all retries. `None` for fail on error. `All` for log and continue | +| `azure.cosmos.sink.bulk.enabled` | `true` | Flag to indicate whether Cosmos DB bulk mode is enabled for Sink connector. By default it is true. | +| `azure.cosmos.sink.bulk.maxConcurrentCosmosPartitions` | `-1` | Cosmos DB Item Write Max Concurrent Cosmos Partitions. If not specified it will be determined based on the number of the container's physical partitions which would indicate every batch is expected to have data from all Cosmos physical partitions. If specified it indicates from at most how many Cosmos Physical Partitions each batch contains data. So this config can be used to make bulk processing more efficient when input data in each batch has been repartitioned to balance to how many Cosmos partitions each batch needs to write. This is mainly useful for very large containers (with hundreds of physical partitions. | +| `azure.cosmos.sink.bulk.initialBatchSize` | `1` | Cosmos DB initial bulk micro batch size - a micro batch will be flushed to the backend when the number of documents enqueued exceeds this size - or the target payload size is met. The micro batch size is getting automatically tuned based on the throttling rate. By default the initial micro batch size is 1. Reduce this when you want to avoid that the first few requests consume too many RUs. | +| `azure.cosmos.sink.write.strategy` | `ItemOverwrite` | Cosmos DB Item write Strategy: `ItemOverwrite` (using upsert), `ItemAppend` (using create, ignore pre-existing items i.e., Conflicts), `ItemDelete` (deletes based on id/pk of data frame), `ItemDeleteIfNotModified` (deletes based on id/pk of data frame if etag hasn't changed since collecting id/pk), `ItemOverwriteIfNotModified` (using create if etag is empty, update/replace with etag pre-condition otherwise, if document was updated the pre-condition failure is ignored), `ItemPatch` (Partial update all documents based on the patch config) | +| `azure.cosmos.sink.maxRetryCount` | `10` | Cosmos DB max retry attempts on write failures for Sink connector. By default, the connector will retry on transient write errors for up to 10 times. | +| `azure.cosmos.sink.id.strategy` | `ProvidedInValueStrategy` | A strategy used to populate the document with an ``id``. Valid strategies are: ``TemplateStrategy``, ``FullKeyStrategy``, ``KafkaMetadataStrategy``, ``ProvidedInKeyStrategy``, ``ProvidedInValueStrategy``. Configuration properties prefixed with``id.strategy`` are passed through to the strategy. For example, when using ``id.strategy=TemplateStrategy`` , the property ``id.strategy.template`` is passed through to the template strategy and used to specify the template string to be used in constructing the ``id``. | +| `azure.cosmos.sink.write.patch.operationType.default` | `Set` | Default Cosmos DB patch operation type. Supported ones include none, add, set, replace, remove, increment. Choose none for no-op, for others please reference [here](https://docs.microsoft.com/azure/cosmos-db/partial-document-update#supported-operations) for full context. | +| `azure.cosmos.sink.write.patch.property.configs` | `""` | Cosmos DB patch json property configs. It can contain multiple definitions matching the following patterns separated by comma. property(jsonProperty).op(operationType) or property(jsonProperty).path(patchInCosmosdb).op(operationType) - The difference of the second pattern is that it also allows you to define a different cosmosdb path. Note: It does not support nested json property config. | +| `azure.cosmos.sink.write.patch.filter` | `""` | Used for [Conditional patch](https://docs.microsoft.com/azure/cosmos-db/partial-document-update-getting-started#java) | diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/pom.xml b/sdk/cosmos/azure-cosmos-kafka-connect/pom.xml index 6681aeef5509..ae5e2dfef8f8 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/pom.xml +++ b/sdk/cosmos/azure-cosmos-kafka-connect/pom.xml @@ -126,7 +126,7 @@ Licensed under the MIT License. com.azure azure-identity - 1.12.0 + 1.12.1 com.azure diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/source/CosmosSourceConfig.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/source/CosmosSourceConfig.java index 2cc8ee56c734..ba7a2821ac20 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/source/CosmosSourceConfig.java +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/source/CosmosSourceConfig.java @@ -79,8 +79,9 @@ public class CosmosSourceConfig extends KafkaCosmosConfig { private static final String DEFAULT_METADATA_STORAGE_TYPE = CosmosMetadataStorageType.KAFKA.getName(); private static final String METADATA_STORAGE_NAME = "azure.cosmos.source.metadata.storage.name"; - private static final String METADATA_STORAGE_NAME_DOC = "The resource name of the metadata storage. If metadata storage type is Kafka topic, then this config refers to kafka topic name, the metadata topic will be created if it does not already exist, else it will use the pre-created topic." - + " If metadata storage type is CosmosDB container, then this config refers to container name, please pre-create the metadata container partitioned by /id."; + private static final String METADATA_STORAGE_NAME_DOC = "The resource name of the metadata storage." + + " If metadata storage type is Kafka topic, then this config refers to kafka topic name, the metadata topic will be created if it does not already exist, else it will use the pre-created topic." + + " If metadata storage type is `Cosmos`, then this config refers to container name, for `MasterKey` auth, this container will be created with `AutoScale` with 4000 RU if not already exists, for `ServicePrincipal` auth, it requires the container to be created ahead of time ."; private static final String METADATA_STORAGE_NAME_DISPLAY = "The metadata storage name."; private static final String DEFAULT_METADATA_STORAGE_NAME = "_cosmos.metadata.topic"; diff --git a/sdk/cosmos/azure-cosmos-spark_3_2-12/pom.xml b/sdk/cosmos/azure-cosmos-spark_3_2-12/pom.xml index c775c705de4f..53409ae7e7c8 100644 --- a/sdk/cosmos/azure-cosmos-spark_3_2-12/pom.xml +++ b/sdk/cosmos/azure-cosmos-spark_3_2-12/pom.xml @@ -90,7 +90,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 com.azure @@ -101,7 +101,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure diff --git a/sdk/cosmos/azure-cosmos-test/CHANGELOG.md b/sdk/cosmos/azure-cosmos-test/CHANGELOG.md index 27bdb326a33c..bb5bbe06a853 100644 --- a/sdk/cosmos/azure-cosmos-test/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos-test/CHANGELOG.md @@ -1,14 +1,9 @@ ## Release History -### 1.0.0-beta.7 (Unreleased) - -#### Features Added - -#### Breaking Changes +### 1.0.0-beta.7 (2024-05-03) #### Bugs Fixed - -#### Other Changes +* Fixed an issue where `FaultInjectionRule` can not apply on partition level when using `Gateway` Mode and non-session consistency - See [40005](https://github.com/Azure/azure-sdk-for-java/pull/40005) ### 1.0.0-beta.6 (2023-10-24) #### Features Added diff --git a/sdk/cosmos/azure-cosmos-test/README.md b/sdk/cosmos/azure-cosmos-test/README.md index 4dde463568a1..ee05caf2a704 100644 --- a/sdk/cosmos/azure-cosmos-test/README.md +++ b/sdk/cosmos/azure-cosmos-test/README.md @@ -9,7 +9,7 @@ Library containing core fault injection classes used to test Azure Cosmos DB SDK com.azure azure-cosmos-test - 1.0.0-beta.6 + 1.0.0-beta.7 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/cosmos/azure-cosmos-test/pom.xml b/sdk/cosmos/azure-cosmos-test/pom.xml index e94d58f1f5d3..cb2d32eb7ac6 100644 --- a/sdk/cosmos/azure-cosmos-test/pom.xml +++ b/sdk/cosmos/azure-cosmos-test/pom.xml @@ -56,7 +56,7 @@ Licensed under the MIT License. com.azure azure-cosmos - 4.60.0-beta.1 + 4.59.0 diff --git a/sdk/cosmos/azure-cosmos-tests/pom.xml b/sdk/cosmos/azure-cosmos-tests/pom.xml index 38abc7dbac7a..b55fefbf13ea 100644 --- a/sdk/cosmos/azure-cosmos-tests/pom.xml +++ b/sdk/cosmos/azure-cosmos-tests/pom.xml @@ -150,7 +150,7 @@ Licensed under the MIT License. com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/faultinjection/FaultInjectionServerErrorRuleOnGatewayTests.java b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/faultinjection/FaultInjectionServerErrorRuleOnGatewayTests.java index 2be8f657c269..524c9b86d0cd 100644 --- a/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/faultinjection/FaultInjectionServerErrorRuleOnGatewayTests.java +++ b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/faultinjection/FaultInjectionServerErrorRuleOnGatewayTests.java @@ -75,7 +75,7 @@ public FaultInjectionServerErrorRuleOnGatewayTests(CosmosClientBuilder clientBui this.subscriberValidationTimeout = TIMEOUT; } - @BeforeClass(groups = {"multi-master", "long"}, timeOut = TIMEOUT) + @BeforeClass(groups = {"multi-master", "fast"}, timeOut = TIMEOUT) public void beforeClass() { client = getClientBuilder().buildAsyncClient(); AsyncDocumentClient asyncDocumentClient = BridgeInternal.getContextClient(client); @@ -225,79 +225,95 @@ public void faultInjectionServerErrorRuleTests_Region() throws JsonProcessingExc } } - @Test(groups = {"multi-master", "long"}, timeOut = 4 * TIMEOUT) + @Test(groups = {"multi-master", "fast"}, timeOut = 4 * TIMEOUT) public void faultInjectionServerErrorRuleTests_Partition() throws JsonProcessingException { - for (int i = 0; i < 10; i++) { - cosmosAsyncContainer.createItem(TestItem.createNewItem()).block(); - } + CosmosAsyncClient testClient = null; - // getting one item from each feedRange - List feedRanges = cosmosAsyncContainer.getFeedRanges().block(); - assertThat(feedRanges.size()).isGreaterThan(1); + try { + testClient = this.getClientBuilder() + .consistencyLevel(this.databaseAccount.getConsistencyPolicy().getDefaultConsistencyLevel()) + .buildAsyncClient(); - String query = "select * from c"; - CosmosQueryRequestOptions cosmosQueryRequestOptions = new CosmosQueryRequestOptions(); - cosmosQueryRequestOptions.setFeedRange(feedRanges.get(0)); - TestItem itemOnFeedRange0 = cosmosAsyncContainer.queryItems(query, cosmosQueryRequestOptions, TestItem.class).blockFirst(); + CosmosAsyncContainer testContainer = + testClient + .getDatabase(cosmosAsyncContainer.getDatabase().getId()) + .getContainer(cosmosAsyncContainer.getId()); - cosmosQueryRequestOptions.setFeedRange(feedRanges.get(1)); - TestItem itemOnFeedRange1 = cosmosAsyncContainer.queryItems(query, cosmosQueryRequestOptions, TestItem.class).blockFirst(); + for (int i = 0; i < 10; i++) { + testContainer.createItem(TestItem.createNewItem()).block(); + } - // set rule by feed range - String feedRangeRuleId = "ServerErrorRule-FeedRange-" + UUID.randomUUID(); + // getting one item from each feedRange + List feedRanges = testContainer.getFeedRanges().block(); + assertThat(feedRanges.size()).isGreaterThan(1); + + String query = "select * from c"; + CosmosQueryRequestOptions cosmosQueryRequestOptions = new CosmosQueryRequestOptions(); + cosmosQueryRequestOptions.setFeedRange(feedRanges.get(0)); + TestItem itemOnFeedRange0 = testContainer.queryItems(query, cosmosQueryRequestOptions, TestItem.class).blockFirst(); + + cosmosQueryRequestOptions.setFeedRange(feedRanges.get(1)); + TestItem itemOnFeedRange1 = testContainer.queryItems(query, cosmosQueryRequestOptions, TestItem.class).blockFirst(); + + // set rule by feed range + String feedRangeRuleId = "ServerErrorRule-FeedRange-" + UUID.randomUUID(); + + FaultInjectionRule serverErrorRuleByFeedRange = + new FaultInjectionRuleBuilder(feedRangeRuleId) + .condition( + new FaultInjectionConditionBuilder() + .connectionType(FaultInjectionConnectionType.GATEWAY) + .endpoints(new FaultInjectionEndpointBuilder(feedRanges.get(0)).build()) + .build() + ) + .result( + FaultInjectionResultBuilders + .getResultBuilder(FaultInjectionServerErrorType.TOO_MANY_REQUEST) + .times(1) + .build() + ) + .duration(Duration.ofMinutes(5)) + .build(); + + CosmosFaultInjectionHelper.configureFaultInjectionRules(testContainer, Arrays.asList(serverErrorRuleByFeedRange)).block(); + assertThat( + serverErrorRuleByFeedRange.getRegionEndpoints().size() == this.readRegionMap.size() + && serverErrorRuleByFeedRange.getRegionEndpoints().containsAll(this.readRegionMap.keySet())); - FaultInjectionRule serverErrorRuleByFeedRange = - new FaultInjectionRuleBuilder(feedRangeRuleId) - .condition( - new FaultInjectionConditionBuilder() - .connectionType(FaultInjectionConnectionType.GATEWAY) - .endpoints(new FaultInjectionEndpointBuilder(feedRanges.get(0)).build()) - .build() - ) - .result( - FaultInjectionResultBuilders - .getResultBuilder(FaultInjectionServerErrorType.TOO_MANY_REQUEST) - .times(1) - .build() - ) - .duration(Duration.ofMinutes(5)) - .build(); + // Issue a read item for the same feed range as configured in the fault injection rule + CosmosDiagnostics cosmosDiagnostics = + testContainer + .readItem(itemOnFeedRange0.getId(), new PartitionKey(itemOnFeedRange0.getId()), JsonNode.class) + .block() + .getDiagnostics(); - CosmosFaultInjectionHelper.configureFaultInjectionRules(cosmosAsyncContainer, Arrays.asList(serverErrorRuleByFeedRange)).block(); - assertThat( - serverErrorRuleByFeedRange.getRegionEndpoints().size() == this.readRegionMap.size() - && serverErrorRuleByFeedRange.getRegionEndpoints().containsAll(this.readRegionMap.keySet())); - - // Issue a read item for the same feed range as configured in the fault injection rule - CosmosDiagnostics cosmosDiagnostics = - cosmosAsyncContainer - .readItem(itemOnFeedRange0.getId(), new PartitionKey(itemOnFeedRange0.getId()), JsonNode.class) - .block() - .getDiagnostics(); - - this.validateHitCount(serverErrorRuleByFeedRange, 1, OperationType.Read, ResourceType.Document); - this.validateFaultInjectionRuleApplied( - cosmosDiagnostics, - OperationType.Read, - HttpConstants.StatusCodes.TOO_MANY_REQUESTS, - HttpConstants.SubStatusCodes.USER_REQUEST_RATE_TOO_LARGE, - feedRangeRuleId, - true - ); - - // Issue a read item to different feed range - try { - cosmosDiagnostics = cosmosAsyncContainer - .readItem(itemOnFeedRange1.getId(), new PartitionKey(itemOnFeedRange1.getId()), JsonNode.class) - .block() - .getDiagnostics(); - this.validateNoFaultInjectionApplied(cosmosDiagnostics, OperationType.Read, FAULT_INJECTION_RULE_NON_APPLICABLE_ADDRESS); + this.validateHitCount(serverErrorRuleByFeedRange, 1, OperationType.Read, ResourceType.Document); + this.validateFaultInjectionRuleApplied( + cosmosDiagnostics, + OperationType.Read, + HttpConstants.StatusCodes.TOO_MANY_REQUESTS, + HttpConstants.SubStatusCodes.USER_REQUEST_RATE_TOO_LARGE, + feedRangeRuleId, + true + ); + + // Issue a read item to different feed range + try { + cosmosDiagnostics = testContainer + .readItem(itemOnFeedRange1.getId(), new PartitionKey(itemOnFeedRange1.getId()), JsonNode.class) + .block() + .getDiagnostics(); + this.validateNoFaultInjectionApplied(cosmosDiagnostics, OperationType.Read, FAULT_INJECTION_RULE_NON_APPLICABLE_ADDRESS); + } finally { + serverErrorRuleByFeedRange.disable(); + } } finally { - serverErrorRuleByFeedRange.disable(); + safeClose(testClient); } + } - @Test(groups = {"multi-master", "long"}, timeOut = 4 * TIMEOUT) + @Test(groups = {"multi-master", "fast"}, timeOut = 4 * TIMEOUT) public void faultInjectionServerErrorRuleTests_ServerResponseDelay() throws JsonProcessingException { // define another rule which can simulate timeout String timeoutRuleId = "serverErrorRule-responseDelay-" + UUID.randomUUID(); @@ -347,7 +363,7 @@ public void faultInjectionServerErrorRuleTests_ServerResponseDelay() throws Json } } - @Test(groups = {"multi-master", "long"}, timeOut = 4 * TIMEOUT) + @Test(groups = {"multi-master", "fast"}, timeOut = 4 * TIMEOUT) public void faultInjectionServerErrorRuleTests_ServerConnectionDelay() throws JsonProcessingException { // simulate high channel acquisition/connectionTimeout String ruleId = "serverErrorRule-serverConnectionDelay-" + UUID.randomUUID(); @@ -388,7 +404,7 @@ public void faultInjectionServerErrorRuleTests_ServerConnectionDelay() throws Js } } - @Test(groups = {"multi-master", "long"}, dataProvider = "faultInjectionServerErrorResponseProvider", timeOut = TIMEOUT) + @Test(groups = {"multi-master", "fast"}, dataProvider = "faultInjectionServerErrorResponseProvider", timeOut = TIMEOUT) public void faultInjectionServerErrorRuleTests_ServerErrorResponse( FaultInjectionServerErrorType serverErrorType, boolean canRetry, @@ -460,7 +476,7 @@ public void faultInjectionServerErrorRuleTests_ServerErrorResponse( } } - @Test(groups = {"multi-master", "long"}, dataProvider = "operationTypeProvider", timeOut = TIMEOUT) + @Test(groups = {"multi-master", "fast"}, dataProvider = "operationTypeProvider", timeOut = TIMEOUT) public void faultInjectionServerErrorRuleTests_HitLimit( OperationType operationType, FaultInjectionOperationType faultInjectionOperationType) throws JsonProcessingException { @@ -518,7 +534,7 @@ public void faultInjectionServerErrorRuleTests_HitLimit( } } - @AfterClass(groups = {"multi-master", "long"}, timeOut = SHUTDOWN_TIMEOUT, alwaysRun = true) + @AfterClass(groups = {"multi-master", "fast"}, timeOut = SHUTDOWN_TIMEOUT, alwaysRun = true) public void afterClass() { safeClose(client); } diff --git a/sdk/cosmos/azure-cosmos/pom.xml b/sdk/cosmos/azure-cosmos/pom.xml index 79afc13c71c1..b7270df0e39e 100644 --- a/sdk/cosmos/azure-cosmos/pom.xml +++ b/sdk/cosmos/azure-cosmos/pom.xml @@ -65,12 +65,12 @@ Licensed under the MIT License. com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/GlobalEndpointManager.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/GlobalEndpointManager.java index 7dc27b329c8c..3b4077ef7660 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/GlobalEndpointManager.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/GlobalEndpointManager.java @@ -303,7 +303,7 @@ private Mono startRefreshLocationTimerAsync(boolean initialization) { this::getDatabaseAccountAsync); return databaseAccountObs.flatMap(dbAccount -> { - logger.info("db account retrieved {}", databaseAccountObs); + logger.info("db account retrieved {}", dbAccount); this.refreshInBackground.set(false); return this.refreshLocationPrivateAsync(dbAccount); }); diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxGatewayStoreModel.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxGatewayStoreModel.java index 798e96353477..bd054cd6822b 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxGatewayStoreModel.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxGatewayStoreModel.java @@ -596,7 +596,7 @@ public Flux submitOpenConnectionTasksAndInitCaches(CosmosContainerProactiv @Override public void configureFaultInjectorProvider(IFaultInjectorProvider injectorProvider, Configs configs) { if (this.gatewayServerErrorInjector == null) { - this.gatewayServerErrorInjector = new GatewayServerErrorInjector(configs); + this.gatewayServerErrorInjector = new GatewayServerErrorInjector(configs, collectionCache, partitionKeyRangeCache); } this.gatewayServerErrorInjector.registerServerErrorInjector(injectorProvider.getServerErrorInjector()); diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/faultinjection/GatewayServerErrorInjector.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/faultinjection/GatewayServerErrorInjector.java index 812d405ab5ff..7c93bf31d04c 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/faultinjection/GatewayServerErrorInjector.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/faultinjection/GatewayServerErrorInjector.java @@ -3,13 +3,22 @@ package com.azure.cosmos.implementation.faultinjection; +import com.azure.cosmos.BridgeInternal; import com.azure.cosmos.CosmosException; import com.azure.cosmos.implementation.Configs; +import com.azure.cosmos.implementation.HttpConstants; +import com.azure.cosmos.implementation.PartitionKeyRange; +import com.azure.cosmos.implementation.ResourceType; import com.azure.cosmos.implementation.RxDocumentServiceRequest; import com.azure.cosmos.implementation.Utils; +import com.azure.cosmos.implementation.apachecommons.lang.StringUtils; +import com.azure.cosmos.implementation.caches.RxCollectionCache; +import com.azure.cosmos.implementation.caches.RxPartitionKeyRangeCache; import com.azure.cosmos.implementation.http.HttpRequest; import com.azure.cosmos.implementation.http.HttpResponse; import com.azure.cosmos.implementation.http.ReactorNettyRequestRecord; +import com.azure.cosmos.implementation.routing.PartitionKeyInternal; +import com.azure.cosmos.implementation.routing.PartitionKeyInternalHelper; import io.netty.channel.ConnectTimeoutException; import io.netty.handler.timeout.ReadTimeoutException; import reactor.core.publisher.Mono; @@ -25,12 +34,23 @@ public class GatewayServerErrorInjector { private final Configs configs; + private final RxCollectionCache collectionCache; + private final RxPartitionKeyRangeCache partitionKeyRangeCache; private List faultInjectors = new ArrayList<>(); - public GatewayServerErrorInjector(Configs configs) { + public GatewayServerErrorInjector( + Configs configs, + RxCollectionCache collectionCache, + RxPartitionKeyRangeCache partitionKeyRangeCache) { checkNotNull(configs, "Argument 'configs' can not be null"); this.configs = configs; + this.collectionCache = collectionCache; + this.partitionKeyRangeCache = partitionKeyRangeCache; + } + + public GatewayServerErrorInjector(Configs configs) { + this(configs, null, null); } public void registerServerErrorInjector(IServerErrorInjector serverErrorInjector) { @@ -38,18 +58,74 @@ public void registerServerErrorInjector(IServerErrorInjector serverErrorInjector this.faultInjectors.add(serverErrorInjector); } + private Mono> resolvePartitionKeyRange(RxDocumentServiceRequest request) { + // faultInjection rule can be configured to only apply for a certain partition + // but in the normal flow, only session consistency will populate the resolvePartitionKey when apply session token + // so for other consistencies, we need to calculate here + if (request.getResourceType() != ResourceType.Document) { + return Mono.just(Utils.ValueHolder.initialize(null)); + } + + if (this.collectionCache == null || this.partitionKeyRangeCache == null) { + return Mono.just(Utils.ValueHolder.initialize(null)); + } + + if (request == null || request.requestContext == null) { + return Mono.just(Utils.ValueHolder.initialize(null)); + } + + if (request.requestContext.resolvedPartitionKeyRange != null) { + return Mono.just(Utils.ValueHolder.initialize(request.requestContext.resolvedPartitionKeyRange)); + } + + return this.collectionCache + .resolveCollectionAsync( + BridgeInternal.getMetaDataDiagnosticContext(request.requestContext.cosmosDiagnostics), request) + .flatMap(collectionValueHolder -> { + return partitionKeyRangeCache + .tryLookupAsync( + BridgeInternal.getMetaDataDiagnosticContext(request.requestContext.cosmosDiagnostics), + collectionValueHolder.v.getResourceId(), + null, + null) + .flatMap(collectionRoutingMapValueHolder -> { + String partitionKeyRangeId = + request.getHeaders().get(HttpConstants.HttpHeaders.PARTITION_KEY_RANGE_ID); + PartitionKeyInternal partitionKeyInternal = request.getPartitionKeyInternal(); + if (StringUtils.isNotEmpty(partitionKeyRangeId)) { + PartitionKeyRange range = + collectionRoutingMapValueHolder.v.getRangeByPartitionKeyRangeId(partitionKeyRangeId); + request.requestContext.resolvedPartitionKeyRange = range; + } else if (partitionKeyInternal != null) { + String effectivePartitionKeyString = PartitionKeyInternalHelper + .getEffectivePartitionKeyString( + partitionKeyInternal, + collectionValueHolder.v.getPartitionKey()); + PartitionKeyRange range = + collectionRoutingMapValueHolder.v.getRangeByEffectivePartitionKey(effectivePartitionKeyString); + request.requestContext.resolvedPartitionKeyRange = range; + } + + return Mono.just(Utils.ValueHolder.initialize(request.requestContext.resolvedPartitionKeyRange)); + }); + }); + } + public Mono injectGatewayErrors( Duration responseTimeout, HttpRequest httpRequest, RxDocumentServiceRequest serviceRequest, Mono originalResponseMono) { - return injectGatewayErrors( - responseTimeout, - httpRequest, - serviceRequest, - originalResponseMono, - serviceRequest.requestContext.resolvedPartitionKeyRange != null - ? Arrays.asList(serviceRequest.requestContext.resolvedPartitionKeyRange.getId()) : null); + + return this.resolvePartitionKeyRange(serviceRequest) + .flatMap(resolvedPartitionKeyRangeValueHolder -> { + return injectGatewayErrors( + responseTimeout, + httpRequest, + serviceRequest, + originalResponseMono, + resolvedPartitionKeyRangeValueHolder.v == null ? null : Arrays.asList(resolvedPartitionKeyRangeValueHolder.v.getId())); + }); } public Mono injectGatewayErrors( diff --git a/sdk/cosmosdbforpostgresql/azure-resourcemanager-cosmosdbforpostgresql/pom.xml b/sdk/cosmosdbforpostgresql/azure-resourcemanager-cosmosdbforpostgresql/pom.xml index 2ab4fa2725b4..ed92db650b72 100644 --- a/sdk/cosmosdbforpostgresql/azure-resourcemanager-cosmosdbforpostgresql/pom.xml +++ b/sdk/cosmosdbforpostgresql/azure-resourcemanager-cosmosdbforpostgresql/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/costmanagement/azure-resourcemanager-costmanagement/pom.xml b/sdk/costmanagement/azure-resourcemanager-costmanagement/pom.xml index 3ecfe2691dbb..ccc94600045c 100644 --- a/sdk/costmanagement/azure-resourcemanager-costmanagement/pom.xml +++ b/sdk/costmanagement/azure-resourcemanager-costmanagement/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/customerinsights/azure-resourcemanager-customerinsights/pom.xml b/sdk/customerinsights/azure-resourcemanager-customerinsights/pom.xml index e394d5d165a5..6c354bf388a7 100644 --- a/sdk/customerinsights/azure-resourcemanager-customerinsights/pom.xml +++ b/sdk/customerinsights/azure-resourcemanager-customerinsights/pom.xml @@ -44,12 +44,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/pom.xml b/sdk/dashboard/azure-resourcemanager-dashboard/pom.xml index 6735682d909f..d49f4a934a2e 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/pom.xml +++ b/sdk/dashboard/azure-resourcemanager-dashboard/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/databox/azure-resourcemanager-databox/pom.xml b/sdk/databox/azure-resourcemanager-databox/pom.xml index 6d0a6da6999e..bef7e715dddd 100644 --- a/sdk/databox/azure-resourcemanager-databox/pom.xml +++ b/sdk/databox/azure-resourcemanager-databox/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/databoxedge/azure-resourcemanager-databoxedge/pom.xml b/sdk/databoxedge/azure-resourcemanager-databoxedge/pom.xml index 90d7b619bd38..7baf6613244b 100644 --- a/sdk/databoxedge/azure-resourcemanager-databoxedge/pom.xml +++ b/sdk/databoxedge/azure-resourcemanager-databoxedge/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/databricks/azure-resourcemanager-databricks/pom.xml b/sdk/databricks/azure-resourcemanager-databricks/pom.xml index f40c0ebe5526..e05f2532449c 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/pom.xml +++ b/sdk/databricks/azure-resourcemanager-databricks/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/datadog/azure-resourcemanager-datadog/pom.xml b/sdk/datadog/azure-resourcemanager-datadog/pom.xml index bb8cac34177e..8b729b7e8df0 100644 --- a/sdk/datadog/azure-resourcemanager-datadog/pom.xml +++ b/sdk/datadog/azure-resourcemanager-datadog/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/datafactory/azure-resourcemanager-datafactory/pom.xml b/sdk/datafactory/azure-resourcemanager-datafactory/pom.xml index f5ad35791d9b..f803d66916df 100644 --- a/sdk/datafactory/azure-resourcemanager-datafactory/pom.xml +++ b/sdk/datafactory/azure-resourcemanager-datafactory/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/pom.xml b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/pom.xml index 8fcfa9344ee9..0f5766d53cfc 100644 --- a/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/pom.xml +++ b/sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/datalakestore/azure-resourcemanager-datalakestore/pom.xml b/sdk/datalakestore/azure-resourcemanager-datalakestore/pom.xml index 1293a651191d..c357b7abcd4c 100644 --- a/sdk/datalakestore/azure-resourcemanager-datalakestore/pom.xml +++ b/sdk/datalakestore/azure-resourcemanager-datalakestore/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/datamigration/azure-resourcemanager-datamigration/pom.xml b/sdk/datamigration/azure-resourcemanager-datamigration/pom.xml index 2d3b77943b48..9e96a904842e 100644 --- a/sdk/datamigration/azure-resourcemanager-datamigration/pom.xml +++ b/sdk/datamigration/azure-resourcemanager-datamigration/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/pom.xml b/sdk/dataprotection/azure-resourcemanager-dataprotection/pom.xml index 5234fe64164b..a65a2470f2c1 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/pom.xml +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/defendereasm/azure-resourcemanager-defendereasm/pom.xml b/sdk/defendereasm/azure-resourcemanager-defendereasm/pom.xml index 0368e2132828..e5ff561a5e28 100644 --- a/sdk/defendereasm/azure-resourcemanager-defendereasm/pom.xml +++ b/sdk/defendereasm/azure-resourcemanager-defendereasm/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/pom.xml b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/pom.xml index ccd3ffd94af3..10354a64efc8 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/pom.xml +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/pom.xml b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/pom.xml index c33085a92982..129e237a227e 100644 --- a/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/pom.xml +++ b/sdk/deploymentmanager/azure-resourcemanager-deploymentmanager/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/pom.xml b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/pom.xml index 6d73037a8ffe..096cfe6bf100 100644 --- a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/pom.xml +++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/devcenter/azure-developer-devcenter/pom.xml b/sdk/devcenter/azure-developer-devcenter/pom.xml index b6429f628275..070971ad964a 100644 --- a/sdk/devcenter/azure-developer-devcenter/pom.xml +++ b/sdk/devcenter/azure-developer-devcenter/pom.xml @@ -43,12 +43,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 org.junit.jupiter @@ -59,13 +59,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/devcenter/azure-resourcemanager-devcenter/pom.xml b/sdk/devcenter/azure-resourcemanager-devcenter/pom.xml index d74602633a98..278a211e1f25 100644 --- a/sdk/devcenter/azure-resourcemanager-devcenter/pom.xml +++ b/sdk/devcenter/azure-resourcemanager-devcenter/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/devhub/azure-resourcemanager-devhub/pom.xml b/sdk/devhub/azure-resourcemanager-devhub/pom.xml index b30121b35bbb..77064c55ef8f 100644 --- a/sdk/devhub/azure-resourcemanager-devhub/pom.xml +++ b/sdk/devhub/azure-resourcemanager-devhub/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/pom.xml b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/pom.xml index 2857f9515347..49218f3e87d0 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/pom.xml +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/pom.xml @@ -45,12 +45,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 org.junit.jupiter @@ -61,7 +61,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -73,7 +73,7 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/pom.xml b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/pom.xml index eec0d615ed87..b8c7cf2a23b4 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/pom.xml +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/pom.xml @@ -51,23 +51,23 @@ Code generated by Microsoft (R) TypeSpec Code Generator. com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/pom.xml b/sdk/deviceupdate/azure-iot-deviceupdate/pom.xml index 9847e8def47a..9911bad91d56 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/pom.xml +++ b/sdk/deviceupdate/azure-iot-deviceupdate/pom.xml @@ -39,23 +39,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-identity - 1.12.0 + 1.12.1 test com.azure azure-core-test - 1.24.2 + 1.25.0 test diff --git a/sdk/deviceupdate/azure-resourcemanager-deviceupdate/pom.xml b/sdk/deviceupdate/azure-resourcemanager-deviceupdate/pom.xml index 698d0ad587da..a53b16663764 100644 --- a/sdk/deviceupdate/azure-resourcemanager-deviceupdate/pom.xml +++ b/sdk/deviceupdate/azure-resourcemanager-deviceupdate/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/devspaces/azure-resourcemanager-devspaces/pom.xml b/sdk/devspaces/azure-resourcemanager-devspaces/pom.xml index 7e018e3de93e..ba41298f801b 100644 --- a/sdk/devspaces/azure-resourcemanager-devspaces/pom.xml +++ b/sdk/devspaces/azure-resourcemanager-devspaces/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/pom.xml b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/pom.xml index 7e8d2f590de2..dd0fa150a56e 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/pom.xml +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/digitaltwins/azure-digitaltwins-core/pom.xml b/sdk/digitaltwins/azure-digitaltwins-core/pom.xml index ca1912a68560..1a8d8cf3555e 100644 --- a/sdk/digitaltwins/azure-digitaltwins-core/pom.xml +++ b/sdk/digitaltwins/azure-digitaltwins-core/pom.xml @@ -48,17 +48,17 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-serializer-json-jackson - 1.4.11 + 1.4.12 com.fasterxml.jackson.core @@ -70,25 +70,25 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -160,7 +160,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/pom.xml b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/pom.xml index dfab516ab531..0cb49f134222 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/pom.xml +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/pom.xml @@ -54,23 +54,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/dnsresolver/azure-resourcemanager-dnsresolver/pom.xml b/sdk/dnsresolver/azure-resourcemanager-dnsresolver/pom.xml index 633e419441d9..b021e1210c1b 100644 --- a/sdk/dnsresolver/azure-resourcemanager-dnsresolver/pom.xml +++ b/sdk/dnsresolver/azure-resourcemanager-dnsresolver/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/documentintelligence/azure-ai-documentintelligence/README.md b/sdk/documentintelligence/azure-ai-documentintelligence/README.md index 5051206d0d09..0a31b9b47d7e 100644 --- a/sdk/documentintelligence/azure-ai-documentintelligence/README.md +++ b/sdk/documentintelligence/azure-ai-documentintelligence/README.md @@ -90,7 +90,7 @@ Authentication with AAD requires some initial setup: com.azure azure-identity - 1.11.4 + 1.12.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/documentintelligence/azure-ai-documentintelligence/pom.xml b/sdk/documentintelligence/azure-ai-documentintelligence/pom.xml index 4abbe56f489b..ac1f2f2f12e5 100644 --- a/sdk/documentintelligence/azure-ai-documentintelligence/pom.xml +++ b/sdk/documentintelligence/azure-ai-documentintelligence/pom.xml @@ -47,12 +47,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 org.slf4j @@ -65,19 +65,19 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -101,7 +101,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -116,7 +116,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/dynatrace/azure-resourcemanager-dynatrace/pom.xml b/sdk/dynatrace/azure-resourcemanager-dynatrace/pom.xml index 1f50332a33c4..10d5303be6bc 100644 --- a/sdk/dynatrace/azure-resourcemanager-dynatrace/pom.xml +++ b/sdk/dynatrace/azure-resourcemanager-dynatrace/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/e2e/pom.xml b/sdk/e2e/pom.xml index f8fdae1adab4..a685a954f5a9 100644 --- a/sdk/e2e/pom.xml +++ b/sdk/e2e/pom.xml @@ -29,12 +29,12 @@ com.azure azure-core - 1.49.0 + 1.50.0-beta.1 com.azure azure-core-http-netty - 1.15.0 + 1.16.0-beta.1 com.azure @@ -70,7 +70,7 @@ com.azure azure-core-test - 1.25.0 + 1.26.0-beta.1 test diff --git a/sdk/easm/azure-analytics-defender-easm/pom.xml b/sdk/easm/azure-analytics-defender-easm/pom.xml index 83547a4ed28e..112ba3d517d5 100644 --- a/sdk/easm/azure-analytics-defender-easm/pom.xml +++ b/sdk/easm/azure-analytics-defender-easm/pom.xml @@ -48,12 +48,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 org.junit.jupiter @@ -90,13 +90,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/edgeorder/azure-resourcemanager-edgeorder/pom.xml b/sdk/edgeorder/azure-resourcemanager-edgeorder/pom.xml index ea0b311d2347..eb5e53652ea3 100644 --- a/sdk/edgeorder/azure-resourcemanager-edgeorder/pom.xml +++ b/sdk/edgeorder/azure-resourcemanager-edgeorder/pom.xml @@ -44,12 +44,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 diff --git a/sdk/edgezones/azure-resourcemanager-edgezones/pom.xml b/sdk/edgezones/azure-resourcemanager-edgezones/pom.xml index 5e9c9a6eee6c..9b0f6e2ca74a 100644 --- a/sdk/edgezones/azure-resourcemanager-edgezones/pom.xml +++ b/sdk/edgezones/azure-resourcemanager-edgezones/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/education/azure-resourcemanager-education/pom.xml b/sdk/education/azure-resourcemanager-education/pom.xml index 120dd5c27b80..04d8278d4800 100644 --- a/sdk/education/azure-resourcemanager-education/pom.xml +++ b/sdk/education/azure-resourcemanager-education/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/elastic/azure-resourcemanager-elastic/pom.xml b/sdk/elastic/azure-resourcemanager-elastic/pom.xml index 4052ea835fe3..30a7450ebd0e 100644 --- a/sdk/elastic/azure-resourcemanager-elastic/pom.xml +++ b/sdk/elastic/azure-resourcemanager-elastic/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/pom.xml b/sdk/elasticsan/azure-resourcemanager-elasticsan/pom.xml index fa555cd787c4..8681d41b0206 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/pom.xml +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/eventgrid/azure-messaging-eventgrid-cloudnative-cloudevents/pom.xml b/sdk/eventgrid/azure-messaging-eventgrid-cloudnative-cloudevents/pom.xml index d16878c23653..5d13cb1a4e76 100644 --- a/sdk/eventgrid/azure-messaging-eventgrid-cloudnative-cloudevents/pom.xml +++ b/sdk/eventgrid/azure-messaging-eventgrid-cloudnative-cloudevents/pom.xml @@ -83,7 +83,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure @@ -118,7 +118,7 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test diff --git a/sdk/eventgrid/azure-messaging-eventgrid-namespaces/pom.xml b/sdk/eventgrid/azure-messaging-eventgrid-namespaces/pom.xml index c0ffe5cd0922..da3775d7374b 100644 --- a/sdk/eventgrid/azure-messaging-eventgrid-namespaces/pom.xml +++ b/sdk/eventgrid/azure-messaging-eventgrid-namespaces/pom.xml @@ -48,12 +48,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 org.junit.jupiter @@ -70,13 +70,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/eventgrid/azure-messaging-eventgrid/pom.xml b/sdk/eventgrid/azure-messaging-eventgrid/pom.xml index f169b9799985..2cecbe06c200 100644 --- a/sdk/eventgrid/azure-messaging-eventgrid/pom.xml +++ b/sdk/eventgrid/azure-messaging-eventgrid/pom.xml @@ -72,7 +72,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure @@ -82,14 +82,14 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-serializer-json-jackson - 1.4.11 + 1.4.12 test @@ -101,7 +101,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -125,7 +125,7 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml b/sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml index 62d66c18aacf..31fb652e37c2 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml index bbd71c5e68df..e02a8d8a3678 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml +++ b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml @@ -61,13 +61,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-jedis/pom.xml b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-jedis/pom.xml index e06dd6056191..78befa6ea0e6 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-jedis/pom.xml +++ b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-jedis/pom.xml @@ -53,7 +53,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/eventhubs/azure-messaging-eventhubs-stress/pom.xml b/sdk/eventhubs/azure-messaging-eventhubs-stress/pom.xml index 4a55b0fe21cf..05f389908bad 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs-stress/pom.xml +++ b/sdk/eventhubs/azure-messaging-eventhubs-stress/pom.xml @@ -65,12 +65,12 @@ com.azure azure-core-tracing-opentelemetry - 1.0.0-beta.45 + 1.0.0-beta.46 com.azure azure-core-metrics-opentelemetry - 1.0.0-beta.18 + 1.0.0-beta.19 diff --git a/sdk/eventhubs/azure-messaging-eventhubs-track2-perf/pom.xml b/sdk/eventhubs/azure-messaging-eventhubs-track2-perf/pom.xml index f59807386fb8..ff48744e2576 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs-track2-perf/pom.xml +++ b/sdk/eventhubs/azure-messaging-eventhubs-track2-perf/pom.xml @@ -45,7 +45,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 diff --git a/sdk/eventhubs/azure-messaging-eventhubs/README.md b/sdk/eventhubs/azure-messaging-eventhubs/README.md index 1f19b14ccdc8..c2ad1c9ad750 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/README.md +++ b/sdk/eventhubs/azure-messaging-eventhubs/README.md @@ -137,7 +137,7 @@ platform. First, add the package: com.azure azure-identity - 1.11.4 + 1.12.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/eventhubs/azure-messaging-eventhubs/pom.xml b/sdk/eventhubs/azure-messaging-eventhubs/pom.xml index c756dcb2061d..031f1d57c31f 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/pom.xml +++ b/sdk/eventhubs/azure-messaging-eventhubs/pom.xml @@ -44,25 +44,25 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-amqp - 2.9.4 + 2.9.4 com.azure azure-identity - 1.12.0 + 1.12.1 test com.azure azure-core-test - 1.25.0 + 1.25.0 test @@ -114,7 +114,7 @@ com.azure azure-core-tracing-opentelemetry - 1.0.0-beta.45 + 1.0.0-beta.46 test @@ -142,7 +142,7 @@ com.azure azure-core-experimental - 1.0.0-beta.49 + 1.0.0-beta.50 test diff --git a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/pom.xml b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/pom.xml index 5f468a9c629d..f090a0669be0 100644 --- a/sdk/extendedlocation/azure-resourcemanager-extendedlocation/pom.xml +++ b/sdk/extendedlocation/azure-resourcemanager-extendedlocation/pom.xml @@ -44,12 +44,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 diff --git a/sdk/fluidrelay/azure-resourcemanager-fluidrelay/pom.xml b/sdk/fluidrelay/azure-resourcemanager-fluidrelay/pom.xml index 08b16a822c5a..56eede15cc84 100644 --- a/sdk/fluidrelay/azure-resourcemanager-fluidrelay/pom.xml +++ b/sdk/fluidrelay/azure-resourcemanager-fluidrelay/pom.xml @@ -44,12 +44,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure.resourcemanager @@ -60,13 +60,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/formrecognizer/azure-ai-formrecognizer-perf/pom.xml b/sdk/formrecognizer/azure-ai-formrecognizer-perf/pom.xml index 06e06cc77ab9..62752492073d 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer-perf/pom.xml +++ b/sdk/formrecognizer/azure-ai-formrecognizer-perf/pom.xml @@ -36,12 +36,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 @@ -105,7 +105,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/README.md b/sdk/formrecognizer/azure-ai-formrecognizer/README.md index 1943095524b9..81253a51b3fa 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/README.md +++ b/sdk/formrecognizer/azure-ai-formrecognizer/README.md @@ -167,7 +167,7 @@ Authentication with AAD requires some initial setup: com.azure azure-identity - 1.11.4 + 1.12.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/pom.xml b/sdk/formrecognizer/azure-ai-formrecognizer/pom.xml index cef83ed06274..dea2055b12dc 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/pom.xml +++ b/sdk/formrecognizer/azure-ai-formrecognizer/pom.xml @@ -52,31 +52,31 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -100,7 +100,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -115,7 +115,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/frontdoor/azure-resourcemanager-frontdoor/pom.xml b/sdk/frontdoor/azure-resourcemanager-frontdoor/pom.xml index c86f8c9e9da4..395deda047a2 100644 --- a/sdk/frontdoor/azure-resourcemanager-frontdoor/pom.xml +++ b/sdk/frontdoor/azure-resourcemanager-frontdoor/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/graphservices/azure-resourcemanager-graphservices/pom.xml b/sdk/graphservices/azure-resourcemanager-graphservices/pom.xml index dd7e65e8a555..ac12aed100a1 100644 --- a/sdk/graphservices/azure-resourcemanager-graphservices/pom.xml +++ b/sdk/graphservices/azure-resourcemanager-graphservices/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/pom.xml b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/pom.xml index b17c0d388421..6e598e13f97f 100644 --- a/sdk/hanaonazure/azure-resourcemanager-hanaonazure/pom.xml +++ b/sdk/hanaonazure/azure-resourcemanager-hanaonazure/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/pom.xml b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/pom.xml index 1bfea5c248d0..2a05de57cc95 100644 --- a/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/pom.xml +++ b/sdk/hardwaresecuritymodules/azure-resourcemanager-hardwaresecuritymodules/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/pom.xml b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/pom.xml index 1c0fa199c8a4..4b6b750f3e4f 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/pom.xml +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight-containers/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/pom.xml b/sdk/hdinsight/azure-resourcemanager-hdinsight/pom.xml index 39da8f78db34..e5ba1331b736 100644 --- a/sdk/hdinsight/azure-resourcemanager-hdinsight/pom.xml +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/pom.xml b/sdk/healthbot/azure-resourcemanager-healthbot/pom.xml index ee09a75af017..c3717fb7bfa1 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/pom.xml +++ b/sdk/healthbot/azure-resourcemanager-healthbot/pom.xml @@ -44,12 +44,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 diff --git a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/pom.xml b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/pom.xml index 19a6dc562dd4..795d067040a4 100644 --- a/sdk/healthcareapis/azure-resourcemanager-healthcareapis/pom.xml +++ b/sdk/healthcareapis/azure-resourcemanager-healthcareapis/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/healthinsights/azure-health-insights-cancerprofiling/pom.xml b/sdk/healthinsights/azure-health-insights-cancerprofiling/pom.xml index 303754f5b14b..394e8517ddc9 100644 --- a/sdk/healthinsights/azure-health-insights-cancerprofiling/pom.xml +++ b/sdk/healthinsights/azure-health-insights-cancerprofiling/pom.xml @@ -52,12 +52,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 org.junit.jupiter @@ -74,13 +74,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/healthinsights/azure-health-insights-clinicalmatching/pom.xml b/sdk/healthinsights/azure-health-insights-clinicalmatching/pom.xml index 6de4b045c742..5337ff430cd0 100644 --- a/sdk/healthinsights/azure-health-insights-clinicalmatching/pom.xml +++ b/sdk/healthinsights/azure-health-insights-clinicalmatching/pom.xml @@ -52,12 +52,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 org.junit.jupiter @@ -74,13 +74,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/pom.xml b/sdk/healthinsights/azure-health-insights-radiologyinsights/pom.xml index 8f95d6cd136a..fd1d0be13c94 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/pom.xml +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/pom.xml @@ -50,12 +50,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 org.junit.jupiter @@ -78,13 +78,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -96,7 +96,7 @@ com.azure azure-core-experimental - 1.0.0-beta.49 + 1.0.0-beta.50 diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/pom.xml b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/pom.xml index e277f7ec5957..956615575002 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/pom.xml +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/pom.xml b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/pom.xml index fa9f67b44444..2ba709079055 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/pom.xml +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/hybridcontainerservice/azure-resourcemanager-hybridcontainerservice/pom.xml b/sdk/hybridcontainerservice/azure-resourcemanager-hybridcontainerservice/pom.xml index a5664e21374a..d62191bd7b86 100644 --- a/sdk/hybridcontainerservice/azure-resourcemanager-hybridcontainerservice/pom.xml +++ b/sdk/hybridcontainerservice/azure-resourcemanager-hybridcontainerservice/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/pom.xml b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/pom.xml index ceb23bb7a5a5..148318ef91b4 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/pom.xml +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/pom.xml b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/pom.xml index a413071efc3a..ddfb42753743 100644 --- a/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/pom.xml +++ b/sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/identity/azure-identity-broker/CHANGELOG.md b/sdk/identity/azure-identity-broker/CHANGELOG.md index 229b0eec4254..47e72455d437 100644 --- a/sdk/identity/azure-identity-broker/CHANGELOG.md +++ b/sdk/identity/azure-identity-broker/CHANGELOG.md @@ -10,6 +10,14 @@ ### Other Changes +## 1.1.1 (2024-05-02) + +### Other Changes + +#### Dependency Updates +- +- Upgraded `azure-identity` from `1.12.0` to version `1.12.1`. + ## 1.1.0 (2024-04-08) ### Features Added diff --git a/sdk/identity/azure-identity-broker/README.md b/sdk/identity/azure-identity-broker/README.md index 1ab5a19d332f..6705e6905062 100644 --- a/sdk/identity/azure-identity-broker/README.md +++ b/sdk/identity/azure-identity-broker/README.md @@ -46,7 +46,7 @@ To take dependency on a particular version of the library that isn't present in com.azure azure-identity-broker - 1.0.4 + 1.1.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/identity/azure-identity-extensions/pom.xml b/sdk/identity/azure-identity-extensions/pom.xml index 70fcceab73c8..63548790a343 100644 --- a/sdk/identity/azure-identity-extensions/pom.xml +++ b/sdk/identity/azure-identity-extensions/pom.xml @@ -34,7 +34,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 diff --git a/sdk/identity/azure-identity-perf/pom.xml b/sdk/identity/azure-identity-perf/pom.xml index 54f9e4c79337..a1fd31978704 100644 --- a/sdk/identity/azure-identity-perf/pom.xml +++ b/sdk/identity/azure-identity-perf/pom.xml @@ -36,12 +36,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 diff --git a/sdk/identity/azure-identity/CHANGELOG.md b/sdk/identity/azure-identity/CHANGELOG.md index 15beaa987653..4f6a9036f3d0 100644 --- a/sdk/identity/azure-identity/CHANGELOG.md +++ b/sdk/identity/azure-identity/CHANGELOG.md @@ -10,6 +10,14 @@ ### Other Changes +## 1.12.1 (2024-05-02) + +### Other Changes + +#### Dependency Updates +- Upgraded `azure-core` from `1.48.0` to version `1.49.0`. +- Upgraded `azure-core-http-netty` from `1.14.2` to version `1.15.0`. + ## 1.12.0 (2024-04-08) ### Features Added diff --git a/sdk/identity/azure-identity/README.md b/sdk/identity/azure-identity/README.md index 85a2e8b6f624..c7333c8e8f44 100644 --- a/sdk/identity/azure-identity/README.md +++ b/sdk/identity/azure-identity/README.md @@ -46,7 +46,7 @@ To take dependency on a particular version of the library that isn't present in com.azure azure-identity - 1.11.4 + 1.12.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/identity/azure-identity/pom.xml b/sdk/identity/azure-identity/pom.xml index 7e2bf61b6749..973bcff00872 100644 --- a/sdk/identity/azure-identity/pom.xml +++ b/sdk/identity/azure-identity/pom.xml @@ -31,12 +31,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure @@ -56,7 +56,7 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test diff --git a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/pom.xml b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/pom.xml index dfd2621ecd38..6369a7f16bca 100644 --- a/sdk/imagebuilder/azure-resourcemanager-imagebuilder/pom.xml +++ b/sdk/imagebuilder/azure-resourcemanager-imagebuilder/pom.xml @@ -50,17 +50,17 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test @@ -78,7 +78,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/pom.xml b/sdk/iotcentral/azure-resourcemanager-iotcentral/pom.xml index 5771c40cc033..fe5b69c7ad42 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/pom.xml +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/pom.xml @@ -44,12 +44,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure.resourcemanager @@ -60,13 +60,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/iotfirmwaredefense/azure-resourcemanager-iotfirmwaredefense/pom.xml b/sdk/iotfirmwaredefense/azure-resourcemanager-iotfirmwaredefense/pom.xml index c9c8ba1ec864..4b04a4724aa6 100644 --- a/sdk/iotfirmwaredefense/azure-resourcemanager-iotfirmwaredefense/pom.xml +++ b/sdk/iotfirmwaredefense/azure-resourcemanager-iotfirmwaredefense/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/iothub/azure-resourcemanager-iothub/pom.xml b/sdk/iothub/azure-resourcemanager-iothub/pom.xml index 379aa513ed5d..f45e88c9c584 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/pom.xml +++ b/sdk/iothub/azure-resourcemanager-iothub/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/keyvault/azure-security-keyvault-administration/pom.xml b/sdk/keyvault/azure-security-keyvault-administration/pom.xml index f4e730332345..2358a7694e43 100644 --- a/sdk/keyvault/azure-security-keyvault-administration/pom.xml +++ b/sdk/keyvault/azure-security-keyvault-administration/pom.xml @@ -48,7 +48,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure @@ -58,7 +58,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 @@ -94,19 +94,19 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -124,7 +124,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -139,7 +139,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/keyvault/azure-security-keyvault-certificates/pom.xml b/sdk/keyvault/azure-security-keyvault-certificates/pom.xml index 1de15ab61437..92d1b55f2287 100644 --- a/sdk/keyvault/azure-security-keyvault-certificates/pom.xml +++ b/sdk/keyvault/azure-security-keyvault-certificates/pom.xml @@ -47,7 +47,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure @@ -58,7 +58,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 @@ -89,25 +89,25 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -155,7 +155,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/keyvault/azure-security-keyvault-jca/pom.xml b/sdk/keyvault/azure-security-keyvault-jca/pom.xml index 80917369c595..68ab36114719 100644 --- a/sdk/keyvault/azure-security-keyvault-jca/pom.xml +++ b/sdk/keyvault/azure-security-keyvault-jca/pom.xml @@ -86,7 +86,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 test diff --git a/sdk/keyvault/azure-security-keyvault-keys/pom.xml b/sdk/keyvault/azure-security-keyvault-keys/pom.xml index ccf90146e3d8..73076bb9428b 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/pom.xml +++ b/sdk/keyvault/azure-security-keyvault-keys/pom.xml @@ -50,7 +50,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 @@ -62,7 +62,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 @@ -93,25 +93,25 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -140,7 +140,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/keyvault/azure-security-keyvault-perf/pom.xml b/sdk/keyvault/azure-security-keyvault-perf/pom.xml index 3421ea82fd2b..c6d05ddbf2cd 100644 --- a/sdk/keyvault/azure-security-keyvault-perf/pom.xml +++ b/sdk/keyvault/azure-security-keyvault-perf/pom.xml @@ -41,12 +41,12 @@ com.azure azure-identity - 1.12.0 + 1.12.1 com.azure azure-core-test - 1.24.2 + 1.25.0 com.azure @@ -57,12 +57,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 @@ -126,7 +126,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 diff --git a/sdk/keyvault/azure-security-keyvault-secrets/pom.xml b/sdk/keyvault/azure-security-keyvault-secrets/pom.xml index 9e3ec2acae67..b385dc052e3b 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/pom.xml +++ b/sdk/keyvault/azure-security-keyvault-secrets/pom.xml @@ -46,7 +46,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 @@ -58,20 +58,20 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -109,14 +109,14 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -131,7 +131,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/keyvault/azure-security-test-keyvault-jca/pom.xml b/sdk/keyvault/azure-security-test-keyvault-jca/pom.xml index fefc45eb308c..016f683c6b29 100644 --- a/sdk/keyvault/azure-security-test-keyvault-jca/pom.xml +++ b/sdk/keyvault/azure-security-test-keyvault-jca/pom.xml @@ -82,7 +82,7 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/pom.xml b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/pom.xml index 3a59c9e6d37e..df2697d113a0 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/pom.xml +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/kusto/azure-resourcemanager-kusto/pom.xml b/sdk/kusto/azure-resourcemanager-kusto/pom.xml index 4f3091da7686..d9029116c3e6 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/pom.xml +++ b/sdk/kusto/azure-resourcemanager-kusto/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/labservices/azure-resourcemanager-labservices/pom.xml b/sdk/labservices/azure-resourcemanager-labservices/pom.xml index 9b95608409f2..6fc37018dd2f 100644 --- a/sdk/labservices/azure-resourcemanager-labservices/pom.xml +++ b/sdk/labservices/azure-resourcemanager-labservices/pom.xml @@ -44,12 +44,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 diff --git a/sdk/largeinstance/azure-resourcemanager-largeinstance/pom.xml b/sdk/largeinstance/azure-resourcemanager-largeinstance/pom.xml index 3dac3bb7d9ab..fb6975f4e041 100644 --- a/sdk/largeinstance/azure-resourcemanager-largeinstance/pom.xml +++ b/sdk/largeinstance/azure-resourcemanager-largeinstance/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/loadtesting/azure-developer-loadtesting/pom.xml b/sdk/loadtesting/azure-developer-loadtesting/pom.xml index f24030b6d0ca..df3c48e460d8 100644 --- a/sdk/loadtesting/azure-developer-loadtesting/pom.xml +++ b/sdk/loadtesting/azure-developer-loadtesting/pom.xml @@ -43,12 +43,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 org.junit.jupiter @@ -59,13 +59,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/loadtesting/azure-resourcemanager-loadtesting/pom.xml b/sdk/loadtesting/azure-resourcemanager-loadtesting/pom.xml index 7e1bf72f905b..19883aadf3a1 100644 --- a/sdk/loadtesting/azure-resourcemanager-loadtesting/pom.xml +++ b/sdk/loadtesting/azure-resourcemanager-loadtesting/pom.xml @@ -45,23 +45,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/pom.xml b/sdk/loganalytics/azure-resourcemanager-loganalytics/pom.xml index de929c52bc73..5631069ebd22 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/pom.xml +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/loganalytics/microsoft-azure-loganalytics/pom.xml b/sdk/loganalytics/microsoft-azure-loganalytics/pom.xml index 1c51726287e1..428e1e32bae2 100644 --- a/sdk/loganalytics/microsoft-azure-loganalytics/pom.xml +++ b/sdk/loganalytics/microsoft-azure-loganalytics/pom.xml @@ -75,7 +75,7 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test diff --git a/sdk/logic/azure-resourcemanager-logic/pom.xml b/sdk/logic/azure-resourcemanager-logic/pom.xml index ecb729e16298..1235a60fb3b2 100644 --- a/sdk/logic/azure-resourcemanager-logic/pom.xml +++ b/sdk/logic/azure-resourcemanager-logic/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/logz/azure-resourcemanager-logz/pom.xml b/sdk/logz/azure-resourcemanager-logz/pom.xml index 30d27c5aa2f6..15df8012fa52 100644 --- a/sdk/logz/azure-resourcemanager-logz/pom.xml +++ b/sdk/logz/azure-resourcemanager-logz/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/machinelearning/azure-resourcemanager-machinelearning/pom.xml b/sdk/machinelearning/azure-resourcemanager-machinelearning/pom.xml index 1b0f634acbd2..135ecd753652 100644 --- a/sdk/machinelearning/azure-resourcemanager-machinelearning/pom.xml +++ b/sdk/machinelearning/azure-resourcemanager-machinelearning/pom.xml @@ -44,12 +44,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure.resourcemanager @@ -78,13 +78,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/machinelearningservices/azure-resourcemanager-machinelearningservices/pom.xml b/sdk/machinelearningservices/azure-resourcemanager-machinelearningservices/pom.xml index ac3edd41e63b..b8f75794700c 100644 --- a/sdk/machinelearningservices/azure-resourcemanager-machinelearningservices/pom.xml +++ b/sdk/machinelearningservices/azure-resourcemanager-machinelearningservices/pom.xml @@ -44,12 +44,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/pom.xml b/sdk/maintenance/azure-resourcemanager-maintenance/pom.xml index ae141b087774..5e18339ed8d7 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/pom.xml +++ b/sdk/maintenance/azure-resourcemanager-maintenance/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/managedapplications/azure-resourcemanager-managedapplications/pom.xml b/sdk/managedapplications/azure-resourcemanager-managedapplications/pom.xml index b24b8007e59e..7022e9dc67be 100644 --- a/sdk/managedapplications/azure-resourcemanager-managedapplications/pom.xml +++ b/sdk/managedapplications/azure-resourcemanager-managedapplications/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/pom.xml b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/pom.xml index ecd466143413..a5381a40236f 100644 --- a/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/pom.xml +++ b/sdk/managednetworkfabric/azure-resourcemanager-managednetworkfabric/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/managementgroups/azure-resourcemanager-managementgroups/pom.xml b/sdk/managementgroups/azure-resourcemanager-managementgroups/pom.xml index a55907c4fe3d..7cbbef840df3 100644 --- a/sdk/managementgroups/azure-resourcemanager-managementgroups/pom.xml +++ b/sdk/managementgroups/azure-resourcemanager-managementgroups/pom.xml @@ -53,23 +53,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/maps/azure-maps-elevation/pom.xml b/sdk/maps/azure-maps-elevation/pom.xml index 99e5af1ff6a8..656e9faec5c4 100644 --- a/sdk/maps/azure-maps-elevation/pom.xml +++ b/sdk/maps/azure-maps-elevation/pom.xml @@ -51,35 +51,35 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test com.azure azure-identity - 1.12.0 + 1.12.1 test com.azure azure-core-test - 1.24.2 + 1.25.0 test @@ -118,7 +118,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/maps/azure-maps-geolocation/pom.xml b/sdk/maps/azure-maps-geolocation/pom.xml index 6d657c53dfb5..307153389c17 100644 --- a/sdk/maps/azure-maps-geolocation/pom.xml +++ b/sdk/maps/azure-maps-geolocation/pom.xml @@ -55,35 +55,35 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test com.azure azure-identity - 1.12.0 + 1.12.1 test com.azure azure-core-test - 1.24.2 + 1.25.0 test @@ -122,7 +122,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/maps/azure-maps-render/pom.xml b/sdk/maps/azure-maps-render/pom.xml index a8520f3d1e59..880502be161f 100644 --- a/sdk/maps/azure-maps-render/pom.xml +++ b/sdk/maps/azure-maps-render/pom.xml @@ -64,35 +64,35 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test com.azure azure-identity - 1.12.0 + 1.12.1 test com.azure azure-core-test - 1.24.2 + 1.25.0 test @@ -131,7 +131,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/maps/azure-maps-route/pom.xml b/sdk/maps/azure-maps-route/pom.xml index e229bd7e1af2..79ddc49533a3 100644 --- a/sdk/maps/azure-maps-route/pom.xml +++ b/sdk/maps/azure-maps-route/pom.xml @@ -63,36 +63,36 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test com.azure azure-identity - 1.12.0 + 1.12.1 test com.azure azure-core-test - 1.24.2 + 1.25.0 test @@ -137,7 +137,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/maps/azure-maps-search/pom.xml b/sdk/maps/azure-maps-search/pom.xml index b1d4dcba17a7..8a544a3a92e0 100644 --- a/sdk/maps/azure-maps-search/pom.xml +++ b/sdk/maps/azure-maps-search/pom.xml @@ -65,35 +65,35 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test com.azure azure-identity - 1.12.0 + 1.12.1 test com.azure azure-core-test - 1.24.2 + 1.25.0 test @@ -132,7 +132,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/maps/azure-maps-timezone/pom.xml b/sdk/maps/azure-maps-timezone/pom.xml index 2f210bc6bc87..c820ce8b4b95 100644 --- a/sdk/maps/azure-maps-timezone/pom.xml +++ b/sdk/maps/azure-maps-timezone/pom.xml @@ -61,35 +61,35 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test com.azure azure-identity - 1.12.0 + 1.12.1 test com.azure azure-core-test - 1.24.2 + 1.25.0 test @@ -128,7 +128,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/maps/azure-maps-traffic/pom.xml b/sdk/maps/azure-maps-traffic/pom.xml index dfd14f3e55a4..357df211fb51 100644 --- a/sdk/maps/azure-maps-traffic/pom.xml +++ b/sdk/maps/azure-maps-traffic/pom.xml @@ -52,35 +52,35 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test com.azure azure-identity - 1.12.0 + 1.12.1 test com.azure azure-core-test - 1.24.2 + 1.25.0 test @@ -119,7 +119,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/maps/azure-maps-weather/pom.xml b/sdk/maps/azure-maps-weather/pom.xml index a6b82b5a4b96..21341c4c85e2 100644 --- a/sdk/maps/azure-maps-weather/pom.xml +++ b/sdk/maps/azure-maps-weather/pom.xml @@ -62,35 +62,35 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test com.azure azure-identity - 1.12.0 + 1.12.1 test com.azure azure-core-test - 1.24.2 + 1.25.0 test @@ -129,7 +129,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/maps/azure-resourcemanager-maps/pom.xml b/sdk/maps/azure-resourcemanager-maps/pom.xml index 9e2845c6b292..9f05a1aa34b0 100644 --- a/sdk/maps/azure-resourcemanager-maps/pom.xml +++ b/sdk/maps/azure-resourcemanager-maps/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/mariadb/azure-resourcemanager-mariadb/pom.xml b/sdk/mariadb/azure-resourcemanager-mariadb/pom.xml index 0c435a5c41c2..4d48e2e79916 100644 --- a/sdk/mariadb/azure-resourcemanager-mariadb/pom.xml +++ b/sdk/mariadb/azure-resourcemanager-mariadb/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/marketplaceordering/azure-resourcemanager-marketplaceordering/pom.xml b/sdk/marketplaceordering/azure-resourcemanager-marketplaceordering/pom.xml index 74c9c7bc7df9..fdbc1edb5e41 100644 --- a/sdk/marketplaceordering/azure-resourcemanager-marketplaceordering/pom.xml +++ b/sdk/marketplaceordering/azure-resourcemanager-marketplaceordering/pom.xml @@ -44,12 +44,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 diff --git a/sdk/mediaservices/azure-resourcemanager-mediaservices/pom.xml b/sdk/mediaservices/azure-resourcemanager-mediaservices/pom.xml index 5364afd9b4d8..455663d13ce1 100644 --- a/sdk/mediaservices/azure-resourcemanager-mediaservices/pom.xml +++ b/sdk/mediaservices/azure-resourcemanager-mediaservices/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor-perf/pom.xml b/sdk/metricsadvisor/azure-ai-metricsadvisor-perf/pom.xml index 221864475046..dec4e3ab909b 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor-perf/pom.xml +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor-perf/pom.xml @@ -35,12 +35,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/README.md b/sdk/metricsadvisor/azure-ai-metricsadvisor/README.md index fcd985950136..71b797c9cde7 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/README.md +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/README.md @@ -112,7 +112,7 @@ Authentication with AAD requires some initial setup: com.azure azure-identity - 1.11.4 + 1.12.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/pom.xml b/sdk/metricsadvisor/azure-ai-metricsadvisor/pom.xml index 9feb53f48e22..692aa61b4ef6 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/pom.xml +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/pom.xml @@ -45,12 +45,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure @@ -62,19 +62,19 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -98,7 +98,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -113,7 +113,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/pom.xml b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/pom.xml index 782817ca4c9f..0840ead6d6c4 100644 --- a/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/pom.xml +++ b/sdk/migrationdiscoverysap/azure-resourcemanager-migrationdiscoverysap/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/mixedreality/azure-mixedreality-authentication/pom.xml b/sdk/mixedreality/azure-mixedreality-authentication/pom.xml index 7d31410e6bed..9315c02c9a29 100644 --- a/sdk/mixedreality/azure-mixedreality-authentication/pom.xml +++ b/sdk/mixedreality/azure-mixedreality-authentication/pom.xml @@ -34,31 +34,31 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -94,7 +94,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -119,7 +119,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/mixedreality/azure-resourcemanager-mixedreality/pom.xml b/sdk/mixedreality/azure-resourcemanager-mixedreality/pom.xml index f5c8a81aaaf0..fef5c414467d 100644 --- a/sdk/mixedreality/azure-resourcemanager-mixedreality/pom.xml +++ b/sdk/mixedreality/azure-resourcemanager-mixedreality/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/pom.xml b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/pom.xml index 0f68e92c836a..5d4c26f41c77 100644 --- a/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/pom.xml +++ b/sdk/mobilenetwork/azure-resourcemanager-mobilenetwork/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/modelsrepository/azure-iot-modelsrepository/pom.xml b/sdk/modelsrepository/azure-iot-modelsrepository/pom.xml index 080ca4632280..84c0f6050e97 100644 --- a/sdk/modelsrepository/azure-iot-modelsrepository/pom.xml +++ b/sdk/modelsrepository/azure-iot-modelsrepository/pom.xml @@ -46,37 +46,37 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -148,7 +148,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/monitor/azure-monitor-ingestion-perf/pom.xml b/sdk/monitor/azure-monitor-ingestion-perf/pom.xml index 994742bd97fc..9d6fbf46217f 100644 --- a/sdk/monitor/azure-monitor-ingestion-perf/pom.xml +++ b/sdk/monitor/azure-monitor-ingestion-perf/pom.xml @@ -36,18 +36,18 @@ com.azure azure-identity - 1.12.0 + 1.12.1 com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 diff --git a/sdk/monitor/azure-monitor-ingestion/README.md b/sdk/monitor/azure-monitor-ingestion/README.md index 9746b6520b98..8dd87e5055e3 100644 --- a/sdk/monitor/azure-monitor-ingestion/README.md +++ b/sdk/monitor/azure-monitor-ingestion/README.md @@ -76,7 +76,7 @@ To use the [DefaultAzureCredential][DefaultAzureCredential] provider shown below com.azure azure-identity - 1.11.4 + 1.12.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/monitor/azure-monitor-ingestion/pom.xml b/sdk/monitor/azure-monitor-ingestion/pom.xml index 751db19ef054..31ac26fe7064 100644 --- a/sdk/monitor/azure-monitor-ingestion/pom.xml +++ b/sdk/monitor/azure-monitor-ingestion/pom.xml @@ -66,12 +66,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure @@ -101,7 +101,7 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test @@ -113,7 +113,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/pom.xml b/sdk/monitor/azure-monitor-opentelemetry-exporter/pom.xml index cb32b0cf362f..cc0f04e15e92 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/pom.xml +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/pom.xml @@ -44,12 +44,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 io.opentelemetry @@ -164,13 +164,13 @@ com.azure azure-core-tracing-opentelemetry - 1.0.0-beta.45 + 1.0.0-beta.46 test com.azure azure-core-test - 1.25.0 + 1.25.0 test @@ -182,7 +182,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/monitor/azure-monitor-query-perf/pom.xml b/sdk/monitor/azure-monitor-query-perf/pom.xml index 11f9abccaebb..d398951cb5a2 100644 --- a/sdk/monitor/azure-monitor-query-perf/pom.xml +++ b/sdk/monitor/azure-monitor-query-perf/pom.xml @@ -36,18 +36,18 @@ com.azure azure-identity - 1.12.0 + 1.12.1 com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 diff --git a/sdk/monitor/azure-monitor-query/README.md b/sdk/monitor/azure-monitor-query/README.md index 257508df5ac9..a3061aeed430 100644 --- a/sdk/monitor/azure-monitor-query/README.md +++ b/sdk/monitor/azure-monitor-query/README.md @@ -86,7 +86,7 @@ To use the [DefaultAzureCredential][DefaultAzureCredential] provider shown below com.azure azure-identity - 1.11.4 + 1.12.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/monitor/azure-monitor-query/pom.xml b/sdk/monitor/azure-monitor-query/pom.xml index 8571b6eeb3ee..96dc29243de2 100644 --- a/sdk/monitor/azure-monitor-query/pom.xml +++ b/sdk/monitor/azure-monitor-query/pom.xml @@ -42,12 +42,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure @@ -75,19 +75,19 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-core-serializer-json-jackson - 1.4.11 + 1.4.12 test diff --git a/sdk/mysql/azure-resourcemanager-mysql/pom.xml b/sdk/mysql/azure-resourcemanager-mysql/pom.xml index 113e566c4442..89d02b81952a 100644 --- a/sdk/mysql/azure-resourcemanager-mysql/pom.xml +++ b/sdk/mysql/azure-resourcemanager-mysql/pom.xml @@ -45,23 +45,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml index f210688ae6e3..62a2d8568f3d 100644 --- a/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml +++ b/sdk/mysqlflexibleserver/azure-resourcemanager-mysqlflexibleserver/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/netapp/azure-resourcemanager-netapp/pom.xml b/sdk/netapp/azure-resourcemanager-netapp/pom.xml index 279395504109..8b3f2f83c4ab 100644 --- a/sdk/netapp/azure-resourcemanager-netapp/pom.xml +++ b/sdk/netapp/azure-resourcemanager-netapp/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/pom.xml b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/pom.xml index 56bb521f33ac..b96ce3ab166f 100644 --- a/sdk/networkanalytics/azure-resourcemanager-networkanalytics/pom.xml +++ b/sdk/networkanalytics/azure-resourcemanager-networkanalytics/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/networkcloud/azure-resourcemanager-networkcloud/pom.xml b/sdk/networkcloud/azure-resourcemanager-networkcloud/pom.xml index c6fa5824190e..9ddb398ad77d 100644 --- a/sdk/networkcloud/azure-resourcemanager-networkcloud/pom.xml +++ b/sdk/networkcloud/azure-resourcemanager-networkcloud/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/networkfunction/azure-resourcemanager-networkfunction/pom.xml b/sdk/networkfunction/azure-resourcemanager-networkfunction/pom.xml index 8fcf731728f3..b86c7ad58bb2 100644 --- a/sdk/networkfunction/azure-resourcemanager-networkfunction/pom.xml +++ b/sdk/networkfunction/azure-resourcemanager-networkfunction/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/pom.xml b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/pom.xml index b472147da228..124e60f80f16 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/pom.xml +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/nginx/azure-resourcemanager-nginx/pom.xml b/sdk/nginx/azure-resourcemanager-nginx/pom.xml index b7bf2678fb69..5213d1960d96 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/pom.xml +++ b/sdk/nginx/azure-resourcemanager-nginx/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/pom.xml b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/pom.xml index cde4dd9b329f..532b228bc942 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/pom.xml +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/oep/azure-resourcemanager-oep/pom.xml b/sdk/oep/azure-resourcemanager-oep/pom.xml index b4eb3143c263..c06508942cfb 100644 --- a/sdk/oep/azure-resourcemanager-oep/pom.xml +++ b/sdk/oep/azure-resourcemanager-oep/pom.xml @@ -44,12 +44,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 diff --git a/sdk/openai/azure-ai-openai-assistants/pom.xml b/sdk/openai/azure-ai-openai-assistants/pom.xml index a549f206d3cd..f2c4f8e177a1 100644 --- a/sdk/openai/azure-ai-openai-assistants/pom.xml +++ b/sdk/openai/azure-ai-openai-assistants/pom.xml @@ -61,12 +61,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 @@ -81,25 +81,25 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -148,7 +148,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/openai/azure-ai-openai/README.md b/sdk/openai/azure-ai-openai/README.md index a5931f79b513..b02646953455 100644 --- a/sdk/openai/azure-ai-openai/README.md +++ b/sdk/openai/azure-ai-openai/README.md @@ -105,7 +105,7 @@ Authentication with AAD requires some initial setup: com.azure azure-identity - 1.11.4 + 1.12.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/openai/azure-ai-openai/pom.xml b/sdk/openai/azure-ai-openai/pom.xml index bd14a3390594..d6e636c28fc7 100644 --- a/sdk/openai/azure-ai-openai/pom.xml +++ b/sdk/openai/azure-ai-openai/pom.xml @@ -58,12 +58,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 @@ -78,13 +78,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -96,13 +96,13 @@ com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -143,7 +143,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/operationsmanagement/azure-resourcemanager-operationsmanagement/pom.xml b/sdk/operationsmanagement/azure-resourcemanager-operationsmanagement/pom.xml index 174a6bbf7d50..4739d84fbad7 100644 --- a/sdk/operationsmanagement/azure-resourcemanager-operationsmanagement/pom.xml +++ b/sdk/operationsmanagement/azure-resourcemanager-operationsmanagement/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/orbital/azure-resourcemanager-orbital/pom.xml b/sdk/orbital/azure-resourcemanager-orbital/pom.xml index 5f64214f3e38..91f799b06661 100644 --- a/sdk/orbital/azure-resourcemanager-orbital/pom.xml +++ b/sdk/orbital/azure-resourcemanager-orbital/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/pom.xml b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/pom.xml index 8c94d9f82066..1f26e567ddb2 100644 --- a/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/pom.xml +++ b/sdk/paloaltonetworks/azure-resourcemanager-paloaltonetworks-ngfw/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/peering/azure-resourcemanager-peering/pom.xml b/sdk/peering/azure-resourcemanager-peering/pom.xml index 6b26ffc2d209..502444fe2cfd 100644 --- a/sdk/peering/azure-resourcemanager-peering/pom.xml +++ b/sdk/peering/azure-resourcemanager-peering/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/personalizer/azure-ai-personalizer/pom.xml b/sdk/personalizer/azure-ai-personalizer/pom.xml index b42bdbcc28a0..e57ba41b5ee7 100644 --- a/sdk/personalizer/azure-ai-personalizer/pom.xml +++ b/sdk/personalizer/azure-ai-personalizer/pom.xml @@ -49,31 +49,31 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -97,7 +97,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -112,7 +112,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/pom.xml b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/pom.xml index dfc392a267ca..35842bff9162 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/pom.xml +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/policyinsights/azure-resourcemanager-policyinsights/pom.xml b/sdk/policyinsights/azure-resourcemanager-policyinsights/pom.xml index 50d0814f0b85..d9347c44efc0 100644 --- a/sdk/policyinsights/azure-resourcemanager-policyinsights/pom.xml +++ b/sdk/policyinsights/azure-resourcemanager-policyinsights/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/postgresql/azure-resourcemanager-postgresql/pom.xml b/sdk/postgresql/azure-resourcemanager-postgresql/pom.xml index 4f42e43e32a5..51a294ffd9cb 100644 --- a/sdk/postgresql/azure-resourcemanager-postgresql/pom.xml +++ b/sdk/postgresql/azure-resourcemanager-postgresql/pom.xml @@ -45,23 +45,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/pom.xml b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/pom.xml index 14415548685c..70b796387190 100644 --- a/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/pom.xml +++ b/sdk/postgresqlflexibleserver/azure-resourcemanager-postgresqlflexibleserver/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/pom.xml b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/pom.xml index 8e0b9bbce695..e90760793c47 100644 --- a/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/pom.xml +++ b/sdk/powerbidedicated/azure-resourcemanager-powerbidedicated/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/providerhub/azure-resourcemanager-providerhub/pom.xml b/sdk/providerhub/azure-resourcemanager-providerhub/pom.xml index 0a88535b4ff8..d5d4418af3f9 100644 --- a/sdk/providerhub/azure-resourcemanager-providerhub/pom.xml +++ b/sdk/providerhub/azure-resourcemanager-providerhub/pom.xml @@ -50,12 +50,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure.resourcemanager @@ -66,13 +66,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/purview/azure-analytics-purview-administration/README.md b/sdk/purview/azure-analytics-purview-administration/README.md index 0b81c92d8695..f850e82e639d 100644 --- a/sdk/purview/azure-analytics-purview-administration/README.md +++ b/sdk/purview/azure-analytics-purview-administration/README.md @@ -48,7 +48,7 @@ To use the [DefaultAzureCredential][DefaultAzureCredential] provider shown below com.azure azure-identity - 1.11.4 + 1.12.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/purview/azure-analytics-purview-administration/pom.xml b/sdk/purview/azure-analytics-purview-administration/pom.xml index 394b99fb78cc..d304cd4f1110 100644 --- a/sdk/purview/azure-analytics-purview-administration/pom.xml +++ b/sdk/purview/azure-analytics-purview-administration/pom.xml @@ -42,12 +42,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 @@ -60,13 +60,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/purview/azure-analytics-purview-catalog/README.md b/sdk/purview/azure-analytics-purview-catalog/README.md index 185f682fe839..17d1980db0bc 100644 --- a/sdk/purview/azure-analytics-purview-catalog/README.md +++ b/sdk/purview/azure-analytics-purview-catalog/README.md @@ -51,7 +51,7 @@ To use the [DefaultAzureCredential][DefaultAzureCredential] provider shown below com.azure azure-identity - 1.11.4 + 1.12.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/purview/azure-analytics-purview-catalog/pom.xml b/sdk/purview/azure-analytics-purview-catalog/pom.xml index 1354ac17ab6c..61cf77f866a3 100644 --- a/sdk/purview/azure-analytics-purview-catalog/pom.xml +++ b/sdk/purview/azure-analytics-purview-catalog/pom.xml @@ -42,12 +42,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 @@ -60,13 +60,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/purview/azure-analytics-purview-datamap/pom.xml b/sdk/purview/azure-analytics-purview-datamap/pom.xml index dfc64e4e1da9..751134a472d0 100644 --- a/sdk/purview/azure-analytics-purview-datamap/pom.xml +++ b/sdk/purview/azure-analytics-purview-datamap/pom.xml @@ -50,12 +50,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 org.junit.jupiter @@ -78,13 +78,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/purview/azure-analytics-purview-scanning/README.md b/sdk/purview/azure-analytics-purview-scanning/README.md index c1ca47efb968..207359590b58 100644 --- a/sdk/purview/azure-analytics-purview-scanning/README.md +++ b/sdk/purview/azure-analytics-purview-scanning/README.md @@ -50,7 +50,7 @@ To use the [DefaultAzureCredential][DefaultAzureCredential] provider shown below com.azure azure-identity - 1.11.4 + 1.12.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/purview/azure-analytics-purview-scanning/pom.xml b/sdk/purview/azure-analytics-purview-scanning/pom.xml index 0a8a066d4e2d..fa56476d5c11 100644 --- a/sdk/purview/azure-analytics-purview-scanning/pom.xml +++ b/sdk/purview/azure-analytics-purview-scanning/pom.xml @@ -42,12 +42,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 @@ -66,13 +66,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/purview/azure-analytics-purview-sharing/pom.xml b/sdk/purview/azure-analytics-purview-sharing/pom.xml index d80e6b7990bc..00e44549b714 100644 --- a/sdk/purview/azure-analytics-purview-sharing/pom.xml +++ b/sdk/purview/azure-analytics-purview-sharing/pom.xml @@ -50,12 +50,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 org.junit.jupiter @@ -72,13 +72,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/purview/azure-analytics-purview-workflow/README.md b/sdk/purview/azure-analytics-purview-workflow/README.md index 53c9c00ce0c9..1fef6f8c98b4 100644 --- a/sdk/purview/azure-analytics-purview-workflow/README.md +++ b/sdk/purview/azure-analytics-purview-workflow/README.md @@ -29,7 +29,7 @@ To use the [UsernamePasswordCredential][username_password_credential] provider s com.azure azure-identity - 1.11.4 + 1.12.0 ``` diff --git a/sdk/purview/azure-analytics-purview-workflow/pom.xml b/sdk/purview/azure-analytics-purview-workflow/pom.xml index 623d5de86570..daad6ff14111 100644 --- a/sdk/purview/azure-analytics-purview-workflow/pom.xml +++ b/sdk/purview/azure-analytics-purview-workflow/pom.xml @@ -51,12 +51,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 org.junit.jupiter @@ -73,13 +73,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/purview/azure-resourcemanager-purview/pom.xml b/sdk/purview/azure-resourcemanager-purview/pom.xml index 78f265051bb1..49b5a4f75fdb 100644 --- a/sdk/purview/azure-resourcemanager-purview/pom.xml +++ b/sdk/purview/azure-resourcemanager-purview/pom.xml @@ -45,23 +45,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/quantum/azure-quantum-jobs/pom.xml b/sdk/quantum/azure-quantum-jobs/pom.xml index 9f9806b75b51..17e7fbe9be72 100644 --- a/sdk/quantum/azure-quantum-jobs/pom.xml +++ b/sdk/quantum/azure-quantum-jobs/pom.xml @@ -50,12 +50,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 @@ -70,13 +70,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/quantum/azure-resourcemanager-quantum/pom.xml b/sdk/quantum/azure-resourcemanager-quantum/pom.xml index 431f4f942d07..f7cfa6dff44c 100644 --- a/sdk/quantum/azure-resourcemanager-quantum/pom.xml +++ b/sdk/quantum/azure-resourcemanager-quantum/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/qumulo/azure-resourcemanager-qumulo/pom.xml b/sdk/qumulo/azure-resourcemanager-qumulo/pom.xml index d8bbf40c7ca2..143ca3718da1 100644 --- a/sdk/qumulo/azure-resourcemanager-qumulo/pom.xml +++ b/sdk/qumulo/azure-resourcemanager-qumulo/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/quota/azure-resourcemanager-quota/pom.xml b/sdk/quota/azure-resourcemanager-quota/pom.xml index 654e6fb38ccd..eed293092753 100644 --- a/sdk/quota/azure-resourcemanager-quota/pom.xml +++ b/sdk/quota/azure-resourcemanager-quota/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/pom.xml b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/pom.xml index d10816d2fb27..4c52e850a803 100644 --- a/sdk/recoveryservices/azure-resourcemanager-recoveryservices/pom.xml +++ b/sdk/recoveryservices/azure-resourcemanager-recoveryservices/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/pom.xml b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/pom.xml index ec622e92c0d4..9c51ce3c136e 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/pom.xml +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/pom.xml b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/pom.xml index f10f9a8824cf..39726fb87eed 100644 --- a/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/pom.xml +++ b/sdk/recoveryservicesdatareplication/azure-resourcemanager-recoveryservicesdatareplication/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/pom.xml b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/pom.xml index f4ec105bb66d..631a179dcd1e 100644 --- a/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/pom.xml +++ b/sdk/recoveryservicessiterecovery/azure-resourcemanager-recoveryservicessiterecovery/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/pom.xml b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/pom.xml index a8fdb85fafad..16b9ec0585bb 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/pom.xml +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/relay/azure-resourcemanager-relay/pom.xml b/sdk/relay/azure-resourcemanager-relay/pom.xml index cf30757ef1ef..28438a20288d 100644 --- a/sdk/relay/azure-resourcemanager-relay/pom.xml +++ b/sdk/relay/azure-resourcemanager-relay/pom.xml @@ -44,12 +44,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 diff --git a/sdk/remoterendering/azure-mixedreality-remoterendering/pom.xml b/sdk/remoterendering/azure-mixedreality-remoterendering/pom.xml index a67697979d6b..fe520f42c35e 100644 --- a/sdk/remoterendering/azure-mixedreality-remoterendering/pom.xml +++ b/sdk/remoterendering/azure-mixedreality-remoterendering/pom.xml @@ -31,7 +31,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure @@ -43,19 +43,19 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -91,13 +91,13 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test com.azure azure-core-http-netty - 1.14.2 + 1.15.0 compile @@ -111,7 +111,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/reservations/azure-resourcemanager-reservations/pom.xml b/sdk/reservations/azure-resourcemanager-reservations/pom.xml index 073b1e61fbd2..929cea4bb8ab 100644 --- a/sdk/reservations/azure-resourcemanager-reservations/pom.xml +++ b/sdk/reservations/azure-resourcemanager-reservations/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/pom.xml b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/pom.xml index e6337bb72b79..e33e00de78e3 100644 --- a/sdk/resourceconnector/azure-resourcemanager-resourceconnector/pom.xml +++ b/sdk/resourceconnector/azure-resourcemanager-resourceconnector/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/resourcegraph/azure-resourcemanager-resourcegraph/pom.xml b/sdk/resourcegraph/azure-resourcemanager-resourcegraph/pom.xml index c1af612319eb..bc8726111fcc 100644 --- a/sdk/resourcegraph/azure-resourcemanager-resourcegraph/pom.xml +++ b/sdk/resourcegraph/azure-resourcemanager-resourcegraph/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/pom.xml b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/pom.xml index 928bc9210126..ba2e245aaee3 100644 --- a/sdk/resourcehealth/azure-resourcemanager-resourcehealth/pom.xml +++ b/sdk/resourcehealth/azure-resourcemanager-resourcehealth/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/resourcemanager/azure-resourcemanager-appplatform/pom.xml b/sdk/resourcemanager/azure-resourcemanager-appplatform/pom.xml index bfc291dec640..e2c95f834ef9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appplatform/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-appplatform/pom.xml @@ -96,7 +96,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/pom.xml b/sdk/resourcemanager/azure-resourcemanager-appservice/pom.xml index ef59fbbf95f8..24bd9eefa9e8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/pom.xml @@ -107,7 +107,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/pom.xml b/sdk/resourcemanager/azure-resourcemanager-authorization/pom.xml index 9afecacf393c..d494ba12f838 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/pom.xml @@ -83,7 +83,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanager/azure-resourcemanager-cdn/pom.xml b/sdk/resourcemanager/azure-resourcemanager-cdn/pom.xml index fb0f70837110..fe7d4b77ab3b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-cdn/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-cdn/pom.xml @@ -81,7 +81,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanager/azure-resourcemanager-compute/pom.xml b/sdk/resourcemanager/azure-resourcemanager-compute/pom.xml index af9d3e6b689a..45b735db3efb 100644 --- a/sdk/resourcemanager/azure-resourcemanager-compute/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-compute/pom.xml @@ -112,7 +112,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanager/azure-resourcemanager-containerinstance/pom.xml b/sdk/resourcemanager/azure-resourcemanager-containerinstance/pom.xml index b31d01fc035c..baac256d8684 100644 --- a/sdk/resourcemanager/azure-resourcemanager-containerinstance/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-containerinstance/pom.xml @@ -114,7 +114,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanager/azure-resourcemanager-containerregistry/pom.xml b/sdk/resourcemanager/azure-resourcemanager-containerregistry/pom.xml index ec25d2a1308e..7944fe5d0b0e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-containerregistry/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-containerregistry/pom.xml @@ -77,7 +77,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanager/azure-resourcemanager-containerservice/pom.xml b/sdk/resourcemanager/azure-resourcemanager-containerservice/pom.xml index 208c83658d8b..0965d172614b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-containerservice/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-containerservice/pom.xml @@ -79,7 +79,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanager/azure-resourcemanager-cosmos/pom.xml b/sdk/resourcemanager/azure-resourcemanager-cosmos/pom.xml index e3b3b6661d9a..cce2ad8ef0dd 100644 --- a/sdk/resourcemanager/azure-resourcemanager-cosmos/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-cosmos/pom.xml @@ -91,7 +91,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanager/azure-resourcemanager-dns/pom.xml b/sdk/resourcemanager/azure-resourcemanager-dns/pom.xml index 9f32d6839ecb..64e9166bbab9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-dns/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-dns/pom.xml @@ -87,7 +87,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanager/azure-resourcemanager-eventhubs/pom.xml b/sdk/resourcemanager/azure-resourcemanager-eventhubs/pom.xml index 3e2c6c1549ec..c7de377933ba 100644 --- a/sdk/resourcemanager/azure-resourcemanager-eventhubs/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-eventhubs/pom.xml @@ -81,7 +81,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/pom.xml b/sdk/resourcemanager/azure-resourcemanager-keyvault/pom.xml index 2363c47ce906..cb2457610b00 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/pom.xml @@ -103,7 +103,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/pom.xml b/sdk/resourcemanager/azure-resourcemanager-monitor/pom.xml index 7cde991c40f1..35237f9e2f30 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/pom.xml @@ -78,7 +78,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanager/azure-resourcemanager-msi/pom.xml b/sdk/resourcemanager/azure-resourcemanager-msi/pom.xml index 1660606cdde1..c8c080cda37f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-msi/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-msi/pom.xml @@ -73,7 +73,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanager/azure-resourcemanager-network/pom.xml b/sdk/resourcemanager/azure-resourcemanager-network/pom.xml index d985b890f40c..e441f26de7fc 100644 --- a/sdk/resourcemanager/azure-resourcemanager-network/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-network/pom.xml @@ -81,7 +81,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanager/azure-resourcemanager-perf/pom.xml b/sdk/resourcemanager/azure-resourcemanager-perf/pom.xml index 6247d3576aec..3f31453d58e2 100644 --- a/sdk/resourcemanager/azure-resourcemanager-perf/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-perf/pom.xml @@ -41,12 +41,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 diff --git a/sdk/resourcemanager/azure-resourcemanager-privatedns/pom.xml b/sdk/resourcemanager/azure-resourcemanager-privatedns/pom.xml index 2d010f3074ef..4952385c06f8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-privatedns/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-privatedns/pom.xml @@ -84,7 +84,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanager/azure-resourcemanager-redis/pom.xml b/sdk/resourcemanager/azure-resourcemanager-redis/pom.xml index 5ac0f3d3cb18..400c8d119520 100644 --- a/sdk/resourcemanager/azure-resourcemanager-redis/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-redis/pom.xml @@ -78,7 +78,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/pom.xml b/sdk/resourcemanager/azure-resourcemanager-resources/pom.xml index 98d5b7c5bb32..0eb8b5b498aa 100644 --- a/sdk/resourcemanager/azure-resourcemanager-resources/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-resources/pom.xml @@ -60,12 +60,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 org.slf4j @@ -88,7 +88,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanager/azure-resourcemanager-samples/pom.xml b/sdk/resourcemanager/azure-resourcemanager-samples/pom.xml index be4b2b34b093..708b387ded37 100644 --- a/sdk/resourcemanager/azure-resourcemanager-samples/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-samples/pom.xml @@ -64,17 +64,17 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-identity - 1.12.0 + 1.12.1 com.jcraft diff --git a/sdk/resourcemanager/azure-resourcemanager-search/pom.xml b/sdk/resourcemanager/azure-resourcemanager-search/pom.xml index c9df6bc8451e..97a643d4c676 100644 --- a/sdk/resourcemanager/azure-resourcemanager-search/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-search/pom.xml @@ -75,7 +75,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanager/azure-resourcemanager-servicebus/pom.xml b/sdk/resourcemanager/azure-resourcemanager-servicebus/pom.xml index 4c838f1b07a3..5f5e3d96eb61 100644 --- a/sdk/resourcemanager/azure-resourcemanager-servicebus/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-servicebus/pom.xml @@ -75,7 +75,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanager/azure-resourcemanager-sql/pom.xml b/sdk/resourcemanager/azure-resourcemanager-sql/pom.xml index b68bf8147d82..d8083fa7a271 100644 --- a/sdk/resourcemanager/azure-resourcemanager-sql/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-sql/pom.xml @@ -91,7 +91,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/pom.xml b/sdk/resourcemanager/azure-resourcemanager-storage/pom.xml index 210d270ad0c0..7d60c1900cb9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-storage/pom.xml @@ -89,7 +89,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanager/azure-resourcemanager-test/pom.xml b/sdk/resourcemanager/azure-resourcemanager-test/pom.xml index a555122036fa..1546e2077050 100644 --- a/sdk/resourcemanager/azure-resourcemanager-test/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-test/pom.xml @@ -52,27 +52,27 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-identity - 1.12.0 + 1.12.1 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 diff --git a/sdk/resourcemanager/azure-resourcemanager-trafficmanager/pom.xml b/sdk/resourcemanager/azure-resourcemanager-trafficmanager/pom.xml index 3969f55be934..6375f939fdc9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-trafficmanager/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-trafficmanager/pom.xml @@ -75,7 +75,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanager/azure-resourcemanager/pom.xml b/sdk/resourcemanager/azure-resourcemanager/pom.xml index b6bfe27c81dd..4af1b38e220e 100644 --- a/sdk/resourcemanager/azure-resourcemanager/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager/pom.xml @@ -71,12 +71,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure.resourcemanager @@ -214,19 +214,19 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -282,7 +282,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/resourcemanagerhybrid/README.md b/sdk/resourcemanagerhybrid/README.md index 4ee4b5ea0bf5..5fbadce0fbac 100644 --- a/sdk/resourcemanagerhybrid/README.md +++ b/sdk/resourcemanagerhybrid/README.md @@ -85,7 +85,7 @@ Azure Management Libraries require a `TokenCredential` implementation for authen com.azure azure-identity - 1.11.4 + 1.12.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/pom.xml index af6806056a18..3055692f2bd4 100644 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/pom.xml +++ b/sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/pom.xml @@ -101,7 +101,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/pom.xml index 1fcc0db6c6ac..10a811a0c097 100644 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/pom.xml +++ b/sdk/resourcemanagerhybrid/azure-resourcemanager-authorization/pom.xml @@ -81,7 +81,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/pom.xml index b0197d166f1d..26c3fa65e7dd 100644 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/pom.xml +++ b/sdk/resourcemanagerhybrid/azure-resourcemanager-compute/pom.xml @@ -111,7 +111,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/pom.xml index e4dd8241f396..53c445215235 100644 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/pom.xml +++ b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerregistry/pom.xml @@ -81,7 +81,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/pom.xml index 03002491fe28..f49a7a694b92 100644 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/pom.xml +++ b/sdk/resourcemanagerhybrid/azure-resourcemanager-containerservice/pom.xml @@ -77,7 +77,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/pom.xml index 78839695a6df..37b14911e4da 100644 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/pom.xml +++ b/sdk/resourcemanagerhybrid/azure-resourcemanager-dns/pom.xml @@ -86,7 +86,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/pom.xml index e128abbcee8a..28f0d00b2e91 100644 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/pom.xml +++ b/sdk/resourcemanagerhybrid/azure-resourcemanager-eventhubs/pom.xml @@ -80,7 +80,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/pom.xml index 4d2e7df07df6..8f26f0c2c5d4 100644 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/pom.xml +++ b/sdk/resourcemanagerhybrid/azure-resourcemanager-keyvault/pom.xml @@ -102,7 +102,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/pom.xml index 29aa703f0e83..2ea6596073f4 100644 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/pom.xml +++ b/sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/pom.xml @@ -77,7 +77,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/pom.xml index c3676ad2a077..31573344b9ac 100644 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-network/pom.xml +++ b/sdk/resourcemanagerhybrid/azure-resourcemanager-network/pom.xml @@ -81,7 +81,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/pom.xml index d0ff246eb8cc..d38064245774 100644 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/pom.xml +++ b/sdk/resourcemanagerhybrid/azure-resourcemanager-resources/pom.xml @@ -59,12 +59,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 org.slf4j @@ -87,7 +87,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/pom.xml index fb8ec1260a9e..3079a77c370c 100644 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/pom.xml +++ b/sdk/resourcemanagerhybrid/azure-resourcemanager-storage/pom.xml @@ -74,7 +74,7 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager-test/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager-test/pom.xml index b335e80edfae..017abe22e3b2 100644 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager-test/pom.xml +++ b/sdk/resourcemanagerhybrid/azure-resourcemanager-test/pom.xml @@ -52,32 +52,32 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-identity - 1.12.0 + 1.12.1 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-serializer-json-jackson - 1.4.11 + 1.4.12 diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager/pom.xml index e4c1bcb1e723..15f9b3b90230 100644 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/pom.xml +++ b/sdk/resourcemanagerhybrid/azure-resourcemanager/pom.xml @@ -147,19 +147,19 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -196,7 +196,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/resourcemover/azure-resourcemanager-resourcemover/pom.xml b/sdk/resourcemover/azure-resourcemanager-resourcemover/pom.xml index b9e0c7c5734a..8ec1e0775d68 100644 --- a/sdk/resourcemover/azure-resourcemanager-resourcemover/pom.xml +++ b/sdk/resourcemover/azure-resourcemanager-resourcemover/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/schemaregistry/azure-data-schemaregistry-apacheavro/README.md b/sdk/schemaregistry/azure-data-schemaregistry-apacheavro/README.md index 5ecc88649b94..7af30a89a79f 100644 --- a/sdk/schemaregistry/azure-data-schemaregistry-apacheavro/README.md +++ b/sdk/schemaregistry/azure-data-schemaregistry-apacheavro/README.md @@ -51,7 +51,7 @@ with the Azure SDK, please include the `azure-identity` package: com.azure azure-identity - 1.11.4 + 1.12.0 ``` diff --git a/sdk/schemaregistry/azure-data-schemaregistry-apacheavro/pom.xml b/sdk/schemaregistry/azure-data-schemaregistry-apacheavro/pom.xml index c4e65876c09d..1b7e42a32cff 100644 --- a/sdk/schemaregistry/azure-data-schemaregistry-apacheavro/pom.xml +++ b/sdk/schemaregistry/azure-data-schemaregistry-apacheavro/pom.xml @@ -50,7 +50,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure @@ -104,13 +104,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/schemaregistry/azure-data-schemaregistry-jsonschema/README.md b/sdk/schemaregistry/azure-data-schemaregistry-jsonschema/README.md index 414b018ad6cb..2093523a716f 100644 --- a/sdk/schemaregistry/azure-data-schemaregistry-jsonschema/README.md +++ b/sdk/schemaregistry/azure-data-schemaregistry-jsonschema/README.md @@ -50,7 +50,7 @@ with the Azure SDK, please include the `azure-identity` package: com.azure azure-identity - 1.11.4 + 1.12.0 ``` diff --git a/sdk/schemaregistry/azure-data-schemaregistry-jsonschema/pom.xml b/sdk/schemaregistry/azure-data-schemaregistry-jsonschema/pom.xml index bf6dfddccc17..c90f60c49595 100644 --- a/sdk/schemaregistry/azure-data-schemaregistry-jsonschema/pom.xml +++ b/sdk/schemaregistry/azure-data-schemaregistry-jsonschema/pom.xml @@ -49,7 +49,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure @@ -85,13 +85,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/schemaregistry/azure-data-schemaregistry/README.md b/sdk/schemaregistry/azure-data-schemaregistry/README.md index 7f5f07a97908..3d5918679bc4 100644 --- a/sdk/schemaregistry/azure-data-schemaregistry/README.md +++ b/sdk/schemaregistry/azure-data-schemaregistry/README.md @@ -75,7 +75,7 @@ To use the [DefaultAzureCredential][DefaultAzureCredential] provider shown below com.azure azure-identity - 1.11.4 + 1.12.0 ``` diff --git a/sdk/schemaregistry/azure-data-schemaregistry/pom.xml b/sdk/schemaregistry/azure-data-schemaregistry/pom.xml index b8725bb3f266..672b5838c011 100644 --- a/sdk/schemaregistry/azure-data-schemaregistry/pom.xml +++ b/sdk/schemaregistry/azure-data-schemaregistry/pom.xml @@ -52,12 +52,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 @@ -94,13 +94,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/scvmm/azure-resourcemanager-scvmm/pom.xml b/sdk/scvmm/azure-resourcemanager-scvmm/pom.xml index 9e1d26ea53d7..d2764ea6490e 100644 --- a/sdk/scvmm/azure-resourcemanager-scvmm/pom.xml +++ b/sdk/scvmm/azure-resourcemanager-scvmm/pom.xml @@ -44,12 +44,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 diff --git a/sdk/search/azure-search-documents/pom.xml b/sdk/search/azure-search-documents/pom.xml index 2a92185aefa7..974db62b9f51 100644 --- a/sdk/search/azure-search-documents/pom.xml +++ b/sdk/search/azure-search-documents/pom.xml @@ -62,7 +62,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure @@ -72,12 +72,12 @@ com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-serializer-json-jackson - 1.4.11 + 1.4.12 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/search/azure-search-perf/pom.xml b/sdk/search/azure-search-perf/pom.xml index d5e059ee78cb..99c82327d705 100644 --- a/sdk/search/azure-search-perf/pom.xml +++ b/sdk/search/azure-search-perf/pom.xml @@ -35,12 +35,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 diff --git a/sdk/security/azure-resourcemanager-security/pom.xml b/sdk/security/azure-resourcemanager-security/pom.xml index 0266ed05ffc1..87e11f36a998 100644 --- a/sdk/security/azure-resourcemanager-security/pom.xml +++ b/sdk/security/azure-resourcemanager-security/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/securitydevops/azure-resourcemanager-securitydevops/pom.xml b/sdk/securitydevops/azure-resourcemanager-securitydevops/pom.xml index 631df6f9d4a3..a1eaed2c65bc 100644 --- a/sdk/securitydevops/azure-resourcemanager-securitydevops/pom.xml +++ b/sdk/securitydevops/azure-resourcemanager-securitydevops/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/securityinsights/azure-resourcemanager-securityinsights/pom.xml b/sdk/securityinsights/azure-resourcemanager-securityinsights/pom.xml index 71ead875bbe5..5d35c522cdaf 100644 --- a/sdk/securityinsights/azure-resourcemanager-securityinsights/pom.xml +++ b/sdk/securityinsights/azure-resourcemanager-securityinsights/pom.xml @@ -44,12 +44,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 diff --git a/sdk/selfhelp/azure-resourcemanager-selfhelp/pom.xml b/sdk/selfhelp/azure-resourcemanager-selfhelp/pom.xml index ece43f87f84b..aada4fd31496 100644 --- a/sdk/selfhelp/azure-resourcemanager-selfhelp/pom.xml +++ b/sdk/selfhelp/azure-resourcemanager-selfhelp/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/servicebus/azure-messaging-servicebus-stress/pom.xml b/sdk/servicebus/azure-messaging-servicebus-stress/pom.xml index b3d5b01d22ff..863ce3a617b8 100644 --- a/sdk/servicebus/azure-messaging-servicebus-stress/pom.xml +++ b/sdk/servicebus/azure-messaging-servicebus-stress/pom.xml @@ -67,12 +67,12 @@ com.azure azure-core-tracing-opentelemetry - 1.0.0-beta.45 + 1.0.0-beta.46 com.azure azure-core-metrics-opentelemetry - 1.0.0-beta.18 + 1.0.0-beta.19 diff --git a/sdk/servicebus/azure-messaging-servicebus-track2-perf/pom.xml b/sdk/servicebus/azure-messaging-servicebus-track2-perf/pom.xml index 27324f344262..ddeb33bf3870 100644 --- a/sdk/servicebus/azure-messaging-servicebus-track2-perf/pom.xml +++ b/sdk/servicebus/azure-messaging-servicebus-track2-perf/pom.xml @@ -34,12 +34,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 diff --git a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md index fb7bdc4d6d32..62e74ebff15c 100644 --- a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md @@ -9,6 +9,7 @@ ### Bugs Fixed - Fixes the session message disposition to use management node as fall back. ([#39913](https://github.com/Azure/azure-sdk-for-java/issues/ 39913)) +- Fixes the session processor idle timeout to fall back to RetryOptions::tryTimeout. ([#39993](https://github.com/Azure/azure-sdk-for-java/issues/39993)) ### Other Changes diff --git a/sdk/servicebus/azure-messaging-servicebus/README.md b/sdk/servicebus/azure-messaging-servicebus/README.md index 413c54396d3c..4cd5ddc50248 100644 --- a/sdk/servicebus/azure-messaging-servicebus/README.md +++ b/sdk/servicebus/azure-messaging-servicebus/README.md @@ -89,7 +89,7 @@ First, add the package: com.azure azure-identity - 1.11.4 + 1.12.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/servicebus/azure-messaging-servicebus/pom.xml b/sdk/servicebus/azure-messaging-servicebus/pom.xml index c7c279120b9c..e0687d632fa7 100644 --- a/sdk/servicebus/azure-messaging-servicebus/pom.xml +++ b/sdk/servicebus/azure-messaging-servicebus/pom.xml @@ -57,7 +57,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure @@ -67,37 +67,37 @@ com.azure azure-core-amqp - 2.9.4 + 2.9.4 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-test - 1.25.0 + 1.25.0 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -148,14 +148,14 @@ com.azure azure-core-experimental - 1.0.0-beta.49 + 1.0.0-beta.50 test com.azure azure-core-tracing-opentelemetry - 1.0.0-beta.45 + 1.0.0-beta.46 test @@ -184,7 +184,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/SessionsMessagePump.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/SessionsMessagePump.java index c9cc2b352fd3..2afe6d63cedc 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/SessionsMessagePump.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/SessionsMessagePump.java @@ -167,7 +167,7 @@ final class SessionsMessagePump { this.instrumentation = Objects.requireNonNull(instrumentation, "'instrumentation' cannot be null"); this.sessionAcquirer = Objects.requireNonNull(sessionAcquirer, "'sessionAcquirer' cannot be null"); this.maxSessionLockRenew = Objects.requireNonNull(maxSessionLockRenew, "'maxSessionLockRenew' cannot be null."); - this.sessionIdleTimeout = sessionIdleTimeout; + this.sessionIdleTimeout = sessionIdleTimeout != null ? sessionIdleTimeout : retryPolicy.getRetryOptions().getTryTimeout(); this.maxConcurrentSessions = maxConcurrentSessions; this.concurrencyPerSession = concurrencyPerSession; this.prefetch = prefetch; diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/IntegrationTestBase.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/IntegrationTestBase.java index edff2426fec0..4921dda64f3a 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/IntegrationTestBase.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/IntegrationTestBase.java @@ -471,10 +471,16 @@ protected final Configuration v1OrV2(boolean isV2) { if (isV2) { configSource.put("com.azure.messaging.servicebus.nonSession.asyncReceive.v2", "true"); configSource.put("com.azure.messaging.servicebus.nonSession.syncReceive.v2", "true"); + configSource.put("com.azure.messaging.servicebus.session.processor.asyncReceive.v2", "true"); + configSource.put("com.azure.messaging.servicebus.session.reactor.asyncReceive.v2", "true"); + configSource.put("com.azure.messaging.servicebus.session.syncReceive.v2", "true"); configSource.put("com.azure.messaging.servicebus.sendAndManageRules.v2", "true"); } else { configSource.put("com.azure.messaging.servicebus.nonSession.asyncReceive.v2", "false"); configSource.put("com.azure.messaging.servicebus.nonSession.syncReceive.v2", "false"); + configSource.put("com.azure.messaging.servicebus.session.processor.asyncReceive.v2", "false"); + configSource.put("com.azure.messaging.servicebus.session.reactor.asyncReceive.v2", "false"); + configSource.put("com.azure.messaging.servicebus.session.syncReceive.v2", "false"); configSource.put("com.azure.messaging.servicebus.sendAndManageRules.v2", "false"); } return new ConfigurationBuilder(configSource) diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/pom.xml b/sdk/servicefabric/azure-resourcemanager-servicefabric/pom.xml index fd08ce4d8641..11162a92f26a 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/pom.xml +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/servicelinker/azure-resourcemanager-servicelinker/pom.xml b/sdk/servicelinker/azure-resourcemanager-servicelinker/pom.xml index afbc68cee54c..d59c8b6298e5 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/pom.xml +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/pom.xml @@ -44,17 +44,17 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/pom.xml b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/pom.xml index e6553ef1b8c2..7546f84a8112 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/pom.xml +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/signalr/azure-resourcemanager-signalr/pom.xml b/sdk/signalr/azure-resourcemanager-signalr/pom.xml index 3b63128c1b38..3b4aadd39663 100644 --- a/sdk/signalr/azure-resourcemanager-signalr/pom.xml +++ b/sdk/signalr/azure-resourcemanager-signalr/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/sphere/azure-resourcemanager-sphere/pom.xml b/sdk/sphere/azure-resourcemanager-sphere/pom.xml index 3461d6eaa21f..fb5ad78b6a8c 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/pom.xml +++ b/sdk/sphere/azure-resourcemanager-sphere/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/spring/spring-cloud-azure-actuator-autoconfigure/pom.xml b/sdk/spring/spring-cloud-azure-actuator-autoconfigure/pom.xml index 0a0f4e08fc7e..1fba53d1705f 100644 --- a/sdk/spring/spring-cloud-azure-actuator-autoconfigure/pom.xml +++ b/sdk/spring/spring-cloud-azure-actuator-autoconfigure/pom.xml @@ -63,7 +63,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 true diff --git a/sdk/spring/spring-cloud-azure-actuator/pom.xml b/sdk/spring/spring-cloud-azure-actuator/pom.xml index a6e0fd7274ff..de867f093e46 100644 --- a/sdk/spring/spring-cloud-azure-actuator/pom.xml +++ b/sdk/spring/spring-cloud-azure-actuator/pom.xml @@ -51,7 +51,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 true diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml b/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml index ac7344ffe605..9aca0209389d 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml @@ -43,7 +43,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure @@ -53,7 +53,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 com.azure diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/pom.xml b/sdk/spring/spring-cloud-azure-autoconfigure/pom.xml index 1c62570da79c..6cd733b405b2 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/pom.xml +++ b/sdk/spring/spring-cloud-azure-autoconfigure/pom.xml @@ -151,13 +151,13 @@ com.azure azure-core - 1.48.0 + 1.49.0 true com.azure azure-identity - 1.12.0 + 1.12.1 true diff --git a/sdk/spring/spring-cloud-azure-core/pom.xml b/sdk/spring/spring-cloud-azure-core/pom.xml index 15eaead90876..e52f7d5e25ef 100644 --- a/sdk/spring/spring-cloud-azure-core/pom.xml +++ b/sdk/spring/spring-cloud-azure-core/pom.xml @@ -41,22 +41,22 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-identity - 1.12.0 + 1.12.1 com.azure azure-core-amqp - 2.9.3 + 2.9.4 com.azure azure-core-management - 1.13.0 + 1.14.0 diff --git a/sdk/spring/spring-cloud-azure-integration-tests/pom.xml b/sdk/spring/spring-cloud-azure-integration-tests/pom.xml index ceda5d77f5b0..a27b86269a21 100644 --- a/sdk/spring/spring-cloud-azure-integration-tests/pom.xml +++ b/sdk/spring/spring-cloud-azure-integration-tests/pom.xml @@ -131,7 +131,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 diff --git a/sdk/spring/spring-cloud-azure-starter-monitor-test/pom.xml b/sdk/spring/spring-cloud-azure-starter-monitor-test/pom.xml index fdc0b6f6c483..4117f0adbe44 100644 --- a/sdk/spring/spring-cloud-azure-starter-monitor-test/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-monitor-test/pom.xml @@ -60,7 +60,7 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test diff --git a/sdk/spring/spring-cloud-azure-starter-servicebus-jms/pom.xml b/sdk/spring/spring-cloud-azure-starter-servicebus-jms/pom.xml index 42ea6e7e02c2..42e4ce22afa9 100644 --- a/sdk/spring/spring-cloud-azure-starter-servicebus-jms/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-servicebus-jms/pom.xml @@ -122,13 +122,13 @@ currently released version and a lower version is resolved. --> com.azure azure-core - 1.48.0 + 1.49.0 true com.azure azure-identity - 1.12.0 + 1.12.1 true diff --git a/sdk/spring/spring-cloud-azure-trace-sleuth/pom.xml b/sdk/spring/spring-cloud-azure-trace-sleuth/pom.xml index ac4c691702ef..08f755475e38 100644 --- a/sdk/spring/spring-cloud-azure-trace-sleuth/pom.xml +++ b/sdk/spring/spring-cloud-azure-trace-sleuth/pom.xml @@ -66,7 +66,7 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test diff --git a/sdk/spring/spring-integration-azure-servicebus/pom.xml b/sdk/spring/spring-integration-azure-servicebus/pom.xml index 089d3c18f02e..55c5376e7452 100644 --- a/sdk/spring/spring-integration-azure-servicebus/pom.xml +++ b/sdk/spring/spring-integration-azure-servicebus/pom.xml @@ -70,7 +70,7 @@ com.azure azure-core-serializer-json-jackson - 1.4.11 + 1.4.12 test diff --git a/sdk/spring/spring-messaging-azure-servicebus/pom.xml b/sdk/spring/spring-messaging-azure-servicebus/pom.xml index 5462aa00ba45..5a8526bbca21 100644 --- a/sdk/spring/spring-messaging-azure-servicebus/pom.xml +++ b/sdk/spring/spring-messaging-azure-servicebus/pom.xml @@ -55,7 +55,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 org.springframework @@ -122,7 +122,7 @@ com.azure azure-core-serializer-json-jackson - 1.4.11 + 1.4.12 test diff --git a/sdk/spring/spring-messaging-azure-storage-queue/pom.xml b/sdk/spring/spring-messaging-azure-storage-queue/pom.xml index 620bfb1ddc5f..8df3a2d0ca0f 100644 --- a/sdk/spring/spring-messaging-azure-storage-queue/pom.xml +++ b/sdk/spring/spring-messaging-azure-storage-queue/pom.xml @@ -54,7 +54,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 @@ -98,7 +98,7 @@ com.azure azure-core-serializer-json-jackson - 1.4.11 + 1.4.12 test diff --git a/sdk/springappdiscovery/azure-resourcemanager-springappdiscovery/pom.xml b/sdk/springappdiscovery/azure-resourcemanager-springappdiscovery/pom.xml index 4d579b89c23e..01bef12ff971 100644 --- a/sdk/springappdiscovery/azure-resourcemanager-springappdiscovery/pom.xml +++ b/sdk/springappdiscovery/azure-resourcemanager-springappdiscovery/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/pom.xml b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/pom.xml index 026be9327447..cfbde5ba6a7d 100644 --- a/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/pom.xml +++ b/sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/standbypool/azure-resourcemanager-standbypool/pom.xml b/sdk/standbypool/azure-resourcemanager-standbypool/pom.xml index 8e9a6854e660..0786c388ac65 100644 --- a/sdk/standbypool/azure-resourcemanager-standbypool/pom.xml +++ b/sdk/standbypool/azure-resourcemanager-standbypool/pom.xml @@ -51,23 +51,23 @@ Code generated by Microsoft (R) AutoRest Code Generator. com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/storage/azure-storage-blob-batch/pom.xml b/sdk/storage/azure-storage-blob-batch/pom.xml index a6f0735ea871..e2bec14ebe69 100644 --- a/sdk/storage/azure-storage-blob-batch/pom.xml +++ b/sdk/storage/azure-storage-blob-batch/pom.xml @@ -55,12 +55,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure @@ -95,13 +95,13 @@ com.azure azure-core-test - 1.25.0 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -125,13 +125,13 @@ com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -165,7 +165,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/storage/azure-storage-blob-changefeed/pom.xml b/sdk/storage/azure-storage-blob-changefeed/pom.xml index 1a86be6400d9..83432f89e669 100644 --- a/sdk/storage/azure-storage-blob-changefeed/pom.xml +++ b/sdk/storage/azure-storage-blob-changefeed/pom.xml @@ -62,12 +62,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure @@ -102,13 +102,13 @@ com.azure azure-core-test - 1.25.0 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -140,13 +140,13 @@ com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -198,7 +198,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/storage/azure-storage-blob-cryptography/pom.xml b/sdk/storage/azure-storage-blob-cryptography/pom.xml index 442cac45c2fa..e621d002af51 100644 --- a/sdk/storage/azure-storage-blob-cryptography/pom.xml +++ b/sdk/storage/azure-storage-blob-cryptography/pom.xml @@ -56,12 +56,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure @@ -86,7 +86,7 @@ com.azure azure-core-test - 1.25.0 + 1.25.0 test @@ -126,7 +126,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -156,13 +156,13 @@ com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -196,7 +196,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/storage/azure-storage-blob-nio/pom.xml b/sdk/storage/azure-storage-blob-nio/pom.xml index 8b2ca9f476f2..04303e035c9c 100644 --- a/sdk/storage/azure-storage-blob-nio/pom.xml +++ b/sdk/storage/azure-storage-blob-nio/pom.xml @@ -53,12 +53,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure @@ -83,7 +83,7 @@ com.azure azure-core-test - 1.25.0 + 1.25.0 test @@ -119,13 +119,13 @@ com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -179,7 +179,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/storage/azure-storage-blob-stress/pom.xml b/sdk/storage/azure-storage-blob-stress/pom.xml index fe67d52f5589..4f0aed7eacfd 100644 --- a/sdk/storage/azure-storage-blob-stress/pom.xml +++ b/sdk/storage/azure-storage-blob-stress/pom.xml @@ -30,12 +30,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure @@ -68,7 +68,7 @@ com.azure azure-core-tracing-opentelemetry - 1.0.0-beta.45 + 1.0.0-beta.46 diff --git a/sdk/storage/azure-storage-blob/pom.xml b/sdk/storage/azure-storage-blob/pom.xml index c0655ef15bb4..9b5114104bea 100644 --- a/sdk/storage/azure-storage-blob/pom.xml +++ b/sdk/storage/azure-storage-blob/pom.xml @@ -70,12 +70,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure @@ -114,13 +114,13 @@ com.azure azure-core-test - 1.25.0 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -182,13 +182,13 @@ com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -291,7 +291,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/storage/azure-storage-common/pom.xml b/sdk/storage/azure-storage-common/pom.xml index 1a7f8a1478ab..e7b785ddeccb 100644 --- a/sdk/storage/azure-storage-common/pom.xml +++ b/sdk/storage/azure-storage-common/pom.xml @@ -58,12 +58,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 @@ -85,13 +85,13 @@ com.azure azure-core-test - 1.25.0 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -115,13 +115,13 @@ com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -206,7 +206,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/storage/azure-storage-file-datalake-stress/pom.xml b/sdk/storage/azure-storage-file-datalake-stress/pom.xml index 1210e977cba0..19f639763822 100644 --- a/sdk/storage/azure-storage-file-datalake-stress/pom.xml +++ b/sdk/storage/azure-storage-file-datalake-stress/pom.xml @@ -30,12 +30,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure @@ -68,7 +68,7 @@ com.azure azure-core-tracing-opentelemetry - 1.0.0-beta.45 + 1.0.0-beta.46 diff --git a/sdk/storage/azure-storage-file-datalake/pom.xml b/sdk/storage/azure-storage-file-datalake/pom.xml index 011ca4fc0068..b387394d7825 100644 --- a/sdk/storage/azure-storage-file-datalake/pom.xml +++ b/sdk/storage/azure-storage-file-datalake/pom.xml @@ -66,12 +66,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure @@ -106,13 +106,13 @@ com.azure azure-core-test - 1.25.0 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -142,13 +142,13 @@ com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -222,7 +222,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/storage/azure-storage-file-share-stress/pom.xml b/sdk/storage/azure-storage-file-share-stress/pom.xml index 87f919894d28..d1e5560be6ad 100644 --- a/sdk/storage/azure-storage-file-share-stress/pom.xml +++ b/sdk/storage/azure-storage-file-share-stress/pom.xml @@ -30,12 +30,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure @@ -68,7 +68,7 @@ com.azure azure-core-tracing-opentelemetry - 1.0.0-beta.45 + 1.0.0-beta.46 diff --git a/sdk/storage/azure-storage-file-share/pom.xml b/sdk/storage/azure-storage-file-share/pom.xml index 7e166f01ec9f..4515240b37fc 100644 --- a/sdk/storage/azure-storage-file-share/pom.xml +++ b/sdk/storage/azure-storage-file-share/pom.xml @@ -71,12 +71,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure @@ -106,7 +106,7 @@ com.azure azure-core-test - 1.25.0 + 1.25.0 test @@ -136,7 +136,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -148,13 +148,13 @@ com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -209,7 +209,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/storage/azure-storage-internal-avro/pom.xml b/sdk/storage/azure-storage-internal-avro/pom.xml index 67c071a4be93..4b118063b76c 100644 --- a/sdk/storage/azure-storage-internal-avro/pom.xml +++ b/sdk/storage/azure-storage-internal-avro/pom.xml @@ -53,7 +53,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure @@ -88,7 +88,7 @@ com.azure azure-core-test - 1.25.0 + 1.25.0 test diff --git a/sdk/storage/azure-storage-perf/pom.xml b/sdk/storage/azure-storage-perf/pom.xml index ecb30d7b6175..41d959a0e33c 100644 --- a/sdk/storage/azure-storage-perf/pom.xml +++ b/sdk/storage/azure-storage-perf/pom.xml @@ -55,12 +55,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 @@ -130,7 +130,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 diff --git a/sdk/storage/azure-storage-queue/pom.xml b/sdk/storage/azure-storage-queue/pom.xml index ec69df8eed26..6327d32743e2 100644 --- a/sdk/storage/azure-storage-queue/pom.xml +++ b/sdk/storage/azure-storage-queue/pom.xml @@ -66,12 +66,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure @@ -90,7 +90,7 @@ com.azure azure-core-test - 1.25.0 + 1.25.0 test @@ -120,19 +120,19 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -187,7 +187,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/storage/azure-storage-stress/pom.xml b/sdk/storage/azure-storage-stress/pom.xml index 64e1c784b8c7..8350241c9e3b 100644 --- a/sdk/storage/azure-storage-stress/pom.xml +++ b/sdk/storage/azure-storage-stress/pom.xml @@ -30,12 +30,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure @@ -63,7 +63,7 @@ com.azure azure-core-tracing-opentelemetry - 1.0.0-beta.45 + 1.0.0-beta.46 diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/pom.xml b/sdk/storageactions/azure-resourcemanager-storageactions/pom.xml index be28a80b68b8..478113ffb667 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/pom.xml +++ b/sdk/storageactions/azure-resourcemanager-storageactions/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/pom.xml b/sdk/storagecache/azure-resourcemanager-storagecache/pom.xml index 601fb8f3607f..8f1e1d0e4fcb 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/pom.xml +++ b/sdk/storagecache/azure-resourcemanager-storagecache/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/storageimportexport/azure-resourcemanager-storageimportexport/pom.xml b/sdk/storageimportexport/azure-resourcemanager-storageimportexport/pom.xml index 3d2dc49ea5cb..9e47cb3e6e48 100644 --- a/sdk/storageimportexport/azure-resourcemanager-storageimportexport/pom.xml +++ b/sdk/storageimportexport/azure-resourcemanager-storageimportexport/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/storagemover/azure-resourcemanager-storagemover/pom.xml b/sdk/storagemover/azure-resourcemanager-storagemover/pom.xml index 13b9c88c5ccc..063ce81afa64 100644 --- a/sdk/storagemover/azure-resourcemanager-storagemover/pom.xml +++ b/sdk/storagemover/azure-resourcemanager-storagemover/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/pom.xml b/sdk/storagepool/azure-resourcemanager-storagepool/pom.xml index f9a657b69aa9..8cd3ec1e5b69 100644 --- a/sdk/storagepool/azure-resourcemanager-storagepool/pom.xml +++ b/sdk/storagepool/azure-resourcemanager-storagepool/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/streamanalytics/azure-resourcemanager-streamanalytics/pom.xml b/sdk/streamanalytics/azure-resourcemanager-streamanalytics/pom.xml index 46f5bad86822..7dc44128c3f3 100644 --- a/sdk/streamanalytics/azure-resourcemanager-streamanalytics/pom.xml +++ b/sdk/streamanalytics/azure-resourcemanager-streamanalytics/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/subscription/azure-resourcemanager-subscription/pom.xml b/sdk/subscription/azure-resourcemanager-subscription/pom.xml index 9034425ab02e..2898c44010ec 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/pom.xml +++ b/sdk/subscription/azure-resourcemanager-subscription/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/support/azure-resourcemanager-support/pom.xml b/sdk/support/azure-resourcemanager-support/pom.xml index b418368e5725..1352bbdc463a 100644 --- a/sdk/support/azure-resourcemanager-support/pom.xml +++ b/sdk/support/azure-resourcemanager-support/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/synapse/azure-analytics-synapse-accesscontrol/pom.xml b/sdk/synapse/azure-analytics-synapse-accesscontrol/pom.xml index d4575847fed9..0a533d44215a 100644 --- a/sdk/synapse/azure-analytics-synapse-accesscontrol/pom.xml +++ b/sdk/synapse/azure-analytics-synapse-accesscontrol/pom.xml @@ -41,31 +41,31 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -89,7 +89,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -103,7 +103,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/synapse/azure-analytics-synapse-artifacts/pom.xml b/sdk/synapse/azure-analytics-synapse-artifacts/pom.xml index 2179b1a2f846..6970544a274f 100644 --- a/sdk/synapse/azure-analytics-synapse-artifacts/pom.xml +++ b/sdk/synapse/azure-analytics-synapse-artifacts/pom.xml @@ -41,31 +41,31 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -89,7 +89,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -103,7 +103,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/pom.xml b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/pom.xml index 1d002b3feda0..b226fa2cfcec 100644 --- a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/pom.xml +++ b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/pom.xml @@ -41,31 +41,31 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -89,7 +89,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -103,7 +103,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/synapse/azure-analytics-synapse-monitoring/pom.xml b/sdk/synapse/azure-analytics-synapse-monitoring/pom.xml index 1e83efecfe79..7eb95c650d20 100644 --- a/sdk/synapse/azure-analytics-synapse-monitoring/pom.xml +++ b/sdk/synapse/azure-analytics-synapse-monitoring/pom.xml @@ -41,31 +41,31 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -89,7 +89,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -103,7 +103,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/synapse/azure-analytics-synapse-spark/pom.xml b/sdk/synapse/azure-analytics-synapse-spark/pom.xml index 3c839d29bdd5..af50d888b303 100644 --- a/sdk/synapse/azure-analytics-synapse-spark/pom.xml +++ b/sdk/synapse/azure-analytics-synapse-spark/pom.xml @@ -47,31 +47,31 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -95,7 +95,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -109,7 +109,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/synapse/azure-resourcemanager-synapse/pom.xml b/sdk/synapse/azure-resourcemanager-synapse/pom.xml index 60deb441e6d6..e9b540d24be3 100644 --- a/sdk/synapse/azure-resourcemanager-synapse/pom.xml +++ b/sdk/synapse/azure-resourcemanager-synapse/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/tables/azure-data-tables-perf/pom.xml b/sdk/tables/azure-data-tables-perf/pom.xml index 96910f81b08e..9c7f29b11ec8 100644 --- a/sdk/tables/azure-data-tables-perf/pom.xml +++ b/sdk/tables/azure-data-tables-perf/pom.xml @@ -30,7 +30,7 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 com.azure @@ -41,12 +41,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 diff --git a/sdk/tables/azure-data-tables/pom.xml b/sdk/tables/azure-data-tables/pom.xml index 74167d7d36e5..0a173e4e707b 100644 --- a/sdk/tables/azure-data-tables/pom.xml +++ b/sdk/tables/azure-data-tables/pom.xml @@ -48,12 +48,12 @@ Licensed under the MIT License. com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure @@ -92,13 +92,13 @@ Licensed under the MIT License. com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/template/azure-sdk-template-three/pom.xml b/sdk/template/azure-sdk-template-three/pom.xml index 461d988504cd..e8b3d64ae080 100644 --- a/sdk/template/azure-sdk-template-three/pom.xml +++ b/sdk/template/azure-sdk-template-three/pom.xml @@ -41,7 +41,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure diff --git a/sdk/template/azure-sdk-template-two/pom.xml b/sdk/template/azure-sdk-template-two/pom.xml index 7144fd45980a..035c5f0e714a 100644 --- a/sdk/template/azure-sdk-template-two/pom.xml +++ b/sdk/template/azure-sdk-template-two/pom.xml @@ -41,7 +41,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure diff --git a/sdk/template/azure-sdk-template/pom.xml b/sdk/template/azure-sdk-template/pom.xml index f59c5765430f..b5de7593b099 100644 --- a/sdk/template/azure-sdk-template/pom.xml +++ b/sdk/template/azure-sdk-template/pom.xml @@ -41,7 +41,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 org.junit.jupiter diff --git a/sdk/template/azure-template-perf/pom.xml b/sdk/template/azure-template-perf/pom.xml index 6a3b4746d5a3..4960fba08ce2 100644 --- a/sdk/template/azure-template-perf/pom.xml +++ b/sdk/template/azure-template-perf/pom.xml @@ -37,7 +37,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 diff --git a/sdk/template/azure-template-stress/pom.xml b/sdk/template/azure-template-stress/pom.xml index cea5548cf189..21894bfdd6b2 100644 --- a/sdk/template/azure-template-stress/pom.xml +++ b/sdk/template/azure-template-stress/pom.xml @@ -33,28 +33,28 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 io.vertx diff --git a/sdk/textanalytics/azure-ai-textanalytics-perf/pom.xml b/sdk/textanalytics/azure-ai-textanalytics-perf/pom.xml index 0e3bcfb59ffe..2c67be09fe48 100644 --- a/sdk/textanalytics/azure-ai-textanalytics-perf/pom.xml +++ b/sdk/textanalytics/azure-ai-textanalytics-perf/pom.xml @@ -38,12 +38,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 @@ -107,7 +107,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 diff --git a/sdk/textanalytics/azure-ai-textanalytics/README.md b/sdk/textanalytics/azure-ai-textanalytics/README.md index abade4defd47..748e39b75bbc 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/README.md +++ b/sdk/textanalytics/azure-ai-textanalytics/README.md @@ -141,7 +141,7 @@ Authentication with AAD requires some initial setup: com.azure azure-identity - 1.11.4 + 1.12.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/textanalytics/azure-ai-textanalytics/pom.xml b/sdk/textanalytics/azure-ai-textanalytics/pom.xml index f45b9e98c5d4..c3bda200c3d0 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/pom.xml +++ b/sdk/textanalytics/azure-ai-textanalytics/pom.xml @@ -46,12 +46,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.azure @@ -73,19 +73,19 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-core-http-okhttp - 1.11.20 + 1.11.21 test com.azure azure-core-http-vertx - 1.0.0-beta.17 + 1.0.0-beta.18 test @@ -109,7 +109,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -124,7 +124,7 @@ com.azure azure-core-http-jdk-httpclient - 1.0.0-beta.12 + 1.0.0-beta.13 test diff --git a/sdk/timeseriesinsights/azure-resourcemanager-timeseriesinsights/pom.xml b/sdk/timeseriesinsights/azure-resourcemanager-timeseriesinsights/pom.xml index b4cf1ef9d6e7..15fc532d1983 100644 --- a/sdk/timeseriesinsights/azure-resourcemanager-timeseriesinsights/pom.xml +++ b/sdk/timeseriesinsights/azure-resourcemanager-timeseriesinsights/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/tools/azure-sdk-build-tool/pom.xml b/sdk/tools/azure-sdk-build-tool/pom.xml index a8752c033b59..b78e9db6457c 100644 --- a/sdk/tools/azure-sdk-build-tool/pom.xml +++ b/sdk/tools/azure-sdk-build-tool/pom.xml @@ -101,12 +101,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 diff --git a/sdk/translation/azure-ai-documenttranslator/pom.xml b/sdk/translation/azure-ai-documenttranslator/pom.xml index 9158d31c671e..c61ac4544575 100644 --- a/sdk/translation/azure-ai-documenttranslator/pom.xml +++ b/sdk/translation/azure-ai-documenttranslator/pom.xml @@ -41,17 +41,17 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-experimental - 1.0.0-beta.49 + 1.0.0-beta.50 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 @@ -76,13 +76,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -100,7 +100,7 @@ com.azure azure-core-serializer-json-jackson - 1.4.11 + 1.4.12 test diff --git a/sdk/translation/azure-ai-translation-text/pom.xml b/sdk/translation/azure-ai-translation-text/pom.xml index 28794993525e..e4c9ee13278a 100644 --- a/sdk/translation/azure-ai-translation-text/pom.xml +++ b/sdk/translation/azure-ai-translation-text/pom.xml @@ -47,17 +47,17 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-experimental - 1.0.0-beta.49 + 1.0.0-beta.50 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 @@ -82,13 +82,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test @@ -106,7 +106,7 @@ com.azure azure-core-serializer-json-jackson - 1.4.11 + 1.4.12 test diff --git a/sdk/videoanalyzer/azure-media-videoanalyzer-edge/pom.xml b/sdk/videoanalyzer/azure-media-videoanalyzer-edge/pom.xml index 412d6e8543ec..da247f2e918a 100644 --- a/sdk/videoanalyzer/azure-media-videoanalyzer-edge/pom.xml +++ b/sdk/videoanalyzer/azure-media-videoanalyzer-edge/pom.xml @@ -35,7 +35,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 org.junit.jupiter @@ -58,7 +58,7 @@ com.azure azure-core-serializer-json-jackson - 1.4.11 + 1.4.12 test diff --git a/sdk/videoanalyzer/azure-resourcemanager-videoanalyzer/pom.xml b/sdk/videoanalyzer/azure-resourcemanager-videoanalyzer/pom.xml index b6075df4b8de..1428a3272950 100644 --- a/sdk/videoanalyzer/azure-resourcemanager-videoanalyzer/pom.xml +++ b/sdk/videoanalyzer/azure-resourcemanager-videoanalyzer/pom.xml @@ -44,12 +44,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 diff --git a/sdk/vision/azure-ai-vision-imageanalysis/pom.xml b/sdk/vision/azure-ai-vision-imageanalysis/pom.xml index b6203a721aa1..b96e26bc7fbf 100644 --- a/sdk/vision/azure-ai-vision-imageanalysis/pom.xml +++ b/sdk/vision/azure-ai-vision-imageanalysis/pom.xml @@ -48,12 +48,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 org.junit.jupiter @@ -90,13 +90,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/vmwarecloudsimple/azure-resourcemanager-vmwarecloudsimple/pom.xml b/sdk/vmwarecloudsimple/azure-resourcemanager-vmwarecloudsimple/pom.xml index 22467b57d379..6ced62fd3510 100644 --- a/sdk/vmwarecloudsimple/azure-resourcemanager-vmwarecloudsimple/pom.xml +++ b/sdk/vmwarecloudsimple/azure-resourcemanager-vmwarecloudsimple/pom.xml @@ -44,23 +44,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/pom.xml b/sdk/voiceservices/azure-resourcemanager-voiceservices/pom.xml index 62c8f8e00136..ac1524ce18e7 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/pom.xml +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/pom.xml @@ -50,23 +50,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/webpubsub/azure-messaging-webpubsub-client/pom.xml b/sdk/webpubsub/azure-messaging-webpubsub-client/pom.xml index 8515c6dc87af..6e99065451f8 100644 --- a/sdk/webpubsub/azure-messaging-webpubsub-client/pom.xml +++ b/sdk/webpubsub/azure-messaging-webpubsub-client/pom.xml @@ -42,7 +42,7 @@ com.azure azure-core - 1.48.0 + 1.49.0 @@ -56,7 +56,7 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test @@ -80,7 +80,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/webpubsub/azure-messaging-webpubsub/pom.xml b/sdk/webpubsub/azure-messaging-webpubsub/pom.xml index 6f33192de7b0..43285d85cbb5 100644 --- a/sdk/webpubsub/azure-messaging-webpubsub/pom.xml +++ b/sdk/webpubsub/azure-messaging-webpubsub/pom.xml @@ -36,12 +36,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-http-netty - 1.14.2 + 1.15.0 com.nimbusds @@ -53,7 +53,7 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test @@ -89,7 +89,7 @@ com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/pom.xml b/sdk/webpubsub/azure-resourcemanager-webpubsub/pom.xml index eab21d35b4a9..2105826564a5 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/pom.xml +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/pom.xml @@ -51,23 +51,23 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/workloads/azure-resourcemanager-workloads/pom.xml b/sdk/workloads/azure-resourcemanager-workloads/pom.xml index d841252d6607..b94fb98e04c7 100644 --- a/sdk/workloads/azure-resourcemanager-workloads/pom.xml +++ b/sdk/workloads/azure-resourcemanager-workloads/pom.xml @@ -50,12 +50,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 com.azure.resourcemanager @@ -78,13 +78,13 @@ com.azure azure-core-test - 1.24.2 + 1.25.0 test com.azure azure-identity - 1.12.0 + 1.12.1 test diff --git a/sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/pom.xml b/sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/pom.xml index bb2fd98069f9..e34564edef9c 100644 --- a/sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/pom.xml +++ b/sdk/workloadssapvirtualinstance/azure-resourcemanager-workloadssapvirtualinstance/pom.xml @@ -51,12 +51,12 @@ com.azure azure-core - 1.48.0 + 1.49.0 com.azure azure-core-management - 1.13.0 + 1.14.0 From df7e838ca7f63fcf034f68bb81fce94113b6e8ab Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Thu, 9 May 2024 11:07:17 -0700 Subject: [PATCH 10/33] [Cosmos][VectorSearch] Non Streaming Order By Query (#40096) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Initial changes * Initial changes * Increment versions for core releases (#40003) Increment package versions for core releases * Ensure ServiceBus session idle timeout fall back to retry-options::try-timeout (#39994) * Added Alpha3 Java Media Streaming Events (#40002) * Added Alpha3 Java Media Streaming Events * updating readme to add the media streaming events to remove model --------- Co-authored-by: Vinothini Dharmaraj * Update version of github-event-processor to 1.0.0-dev.20240502.2 (#40012) Co-authored-by: James Suplizio * Prepare May 2024 Identity Release (#40006) * Prepare Identity Broker May 2024 Release (#40014) * Increment package versions for identity releases (#40015) * [JobRouter] SDK Review updates (#40011) * SDK Review updates * Update auto-generated models * Add customization * Fix customization * Update package * Update tests * Linting * FixFaultInjectionRuleFailedToApplyPerPartitionInGatewayMode (#40005) * fix fault injection rule failed to apply per partition in gateway mode --------- Co-authored-by: annie-mac * azure-cosmos-test_1.0.0.beta.7Release (#40021) * release azure-cosmos-test 1.0.0.beta.7 --------- Co-authored-by: annie-mac * Fixed existsById API in ReactiveCosmosTemplate (#40022) * Fixed existsById API in ReactiveCosmosTemplate * Added changelog * Initial changes * Initial changes * Skip Recorded test and delete Event record until test proxy to work with Event recordings (#40029) Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> * Fix invalid CODEOWNERS (#40032) * Initial changes * ServiceBus: fix session tracing (#39962) * remove additional matrix * Fix session processing and disposition instrumentation * return matrix config * review suggestions * [Automation] Generate SDK based on TypeSpec 0.15.15 (#40048) * [CODEOWNERS] Updates for org changes (#40049) * [CODEOWNERS] Updates for org changes The focus of these changes is to remove an individual who no longer is responsible for the products which their GH account is associated to. * Move from using the docker image to java2docfx for docs validation (#39744) * Move from using the docker image to java2docfx for docs validation * Temporarily turn on docs processing for template libraries for testing * Actually install the rex validation tool * Fix the if not Test-Path statement * Update java2docfx version and add a couple of diagnostics output lines * Add missing close paren * Ensure that Sort-Object always returns an array even if there's only one item * add another piece of diagnostics output * trying one more thing * remove some diag, add other * Remove the additional diagnostics, add permanent output message * Invoke java -jar on java2docfx to show the help command to ensure the install is okay * fiddling with the java -jar command * Set the working directory to the java2docfx directory before executing the mvn dependency download * Actually create the directory before trying to set location...oops * Update rex validation to verify MAVEN_HOME is set * Updates for Java PR 39875 which had changes from this PR that were more immediate * Update java2docfx version * remove check for MAVEN_HOME which was only for testing * Update the version of java2docfx to test a fix * Update version of java2docfx to 1.0.4 * revert template's ci.yml changes that were only necessary to test java2docfx * owners (#39686) * Use ClientLogger in testing output (#40010) Use ClientLogger in testing output * Fix null pointer exception and context usage (#40053) * Rename AML to AzureMachineLearning (#40056) * Fixed the Key Vault `test-resources.json` file to properly configure a deployment script for certificate creation. (#40037) * Close response body in bearer policy (#40052) * Running Prepare-Release for azure-messaging-servicebus 7.17.0 (#40058) * mgmt, TypeSpec code generation pipeline (#39963) * typespec generation pipeline echo command PR_TITLE * generation typespec Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines * remove typespec pipeline file * fix pr title * address comments * Add codeowner linter owners (#39997) * Update to ESRP task version that supports federated auth (#40059) * Increment package versions for cosmos releases (#40031) * Update azure-sdk-build-tools Repository Resource Refs in Yaml files (#39627) * Add reduced embeddings sample to azure-search-documents (#40069) * Add reduced embeddings sample * Fix cspell * Fix link * Search May Preview Regen Updates (#40057) * Search May Preview Regeneration - Still need to add varargs convenience * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * adding varargs * Additional adjustments to FieldBuilder and Search Index Customizations * Updating cspell.json * Adjust `SearchScoreThreshold` customization Re-enable code generation in CI * Updates: - Updated Cspell - Rename `maxStoragePerIndex` property to `maxStoragePerIndexInBytes` in SearchServiceLimits - Set `hybridSearch` property to be type `HybridSearch` in SearchRequest - Add `hybridSearch` to SearchOptions and `SearchAsyncClient.createSearchRequest()` * Adding Support and testing byte[] and List within field builder * Fix linting --------- Co-authored-by: alzimmermsft <48699787+alzimmermsft@users.noreply.github.com> * Preparing Search May 2024 Beta Release (#40071) * Preparing Search May 2024 Beta Release * Preparing Search May 2024 Beta Release * Resolving comments * Fixing build issues * eng, update autorest.java, improve error output in sdk automation (#40073) * improve error output * autorest.java 4.1.29 * Merge to main after spring cloud azure 4.18.0 released (#40075) * Prepare for Spring Cloud Azure 4.18.0 release (#40063) * update version client * update version/changelog/readme * update changelog * Increment versions for spring releases (#40074) * Increment package versions for spring releases * Update version_client.txt * Update pom.xml --------- Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> * Miscellaneous Core performance improvements (#39552) Miscellaneous Core performance improvements * Increment package versions for search releases (#40072) * Update io.fabric8:kubernetes-client (#40086) 5.12.3 -> 6.12.1 * Increment package versions for servicebus releases (#40094) * Emit stable auto-instrumented otel metrics (#39960) * Update otel metrics logic * add runtime metrics * adding a few metrics I forgot * small correction * Update * Fix * Update * Delete pre-stable metrics --------- Co-authored-by: Harsimar Kaur (from Dev Box) --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac Co-authored-by: Kushagra Thapar Co-authored-by: minwoolee-msft <77083090+minwoolee-msft@users.noreply.github.com> Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> Co-authored-by: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Co-authored-by: Liudmila Molkova Co-authored-by: Jesse Squire Co-authored-by: Harsimar Kaur Co-authored-by: vcolin7 Co-authored-by: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Co-authored-by: Wes Haggard Co-authored-by: Patrick Hallisey Co-authored-by: Jair Myree Co-authored-by: Weidong Xu Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> Co-authored-by: Helen <56097766+heyams@users.noreply.github.com> Co-authored-by: Harsimar Kaur (from Dev Box) --- .github/CODEOWNERS | 18 +- .github/CODEOWNERS_baseline_errors.txt | 5 + eng/emitter-package-lock.json | 36 +- eng/emitter-package.json | 10 +- eng/mgmt/automation/changelog.py | 4 +- eng/mgmt/automation/generate.py | 8 +- eng/mgmt/automation/generate_data.py | 6 +- eng/mgmt/automation/generate_utils.py | 2 +- eng/mgmt/automation/generation.yml | 30 +- eng/mgmt/automation/generation_data.yml | 2 +- eng/mgmt/automation/parameters.py | 2 +- eng/mgmt/automation/sdk_generate.py | 6 +- eng/pipelines/docindex.yml | 24 +- .../templates/stages/1es-redirect.yml | 2 +- .../stages/archetype-java-release-batch.yml | 13 +- .../stages/archetype-java-release-patch.yml | 5 +- .../stages/archetype-java-release.yml | 11 +- .../steps/install-rex-validation-tool.yml | 22 + .../templates/steps/java-publishing.yml | 8 +- eng/repo-docs/docms/daily.update.setting.xml | 10 + eng/scripts/Language-Settings.ps1 | 487 +++--------------- eng/scripts/docs/java2docfx.version.txt | 1 + eng/versioning/external_dependencies.txt | 2 +- eng/versioning/version_client.txt | 110 ++-- .../ConfigurationAsyncClient.java | 197 +++---- .../appconfiguration/ConfigurationClient.java | 154 ++---- .../ConfigurationClientBuilder.java | 5 +- .../implementation/Utility.java | 100 +--- .../ConfigurationClientTest.java | 28 +- .../security/attestation/AttestationTest.java | 26 +- .../spring-cloud-azure-dependencies/pom.xml | 6 +- .../pom.xml | 2 +- ...tomationAsyncClientAutomatedLiveTests.java | 3 + .../CallAutomationAutomatedLiveTestBase.java | 56 +- .../CallAutomationLiveTestBase.java | 24 +- ...CallConnectionAsyncAutomatedLiveTests.java | 8 +- .../CallDialogAsyncAutomatedLiveTests.java | 2 + .../CallMediaAsyncAutomatedLiveTests.java | 3 + .../CallRecordingAutomatedLiveTests.java | 3 + .../createACSCallAndUnmixedAudioTest.json | 1 - ...createACSCallUnmixedAudioAffinityTest.json | 1 - ...articipantFinallyCancelAddParticipant.json | 1 - ...FinallyRemoveParticipantAutomatedTest.json | 1 - ...PCallAndAnswerThenHangupAutomatedTest.json | 1 - .../createVOIPCallAndRejectAutomatedTest.json | 1 - .../dialogActionInACallAutomatedTest.json | 1 - .../dtmfActionsInACallAutomatedTest.json | 1 - .../playMediaInACallAutomatedTest.json | 1 - .../CallAutomationLiveTestBase.java | 6 +- .../DownloadContentAsyncLiveTests.java | 9 +- .../communication/chat/ChatClientTest.java | 30 +- .../chat/CommunicationLoggerPolicy.java | 5 +- .../CommunicationIdentityClientTestBase.java | 5 +- .../ClassificationPolicyAsyncLiveTests.java | 5 +- .../ClassificationPolicyLiveTests.java | 5 +- .../RouterJobAsyncLiveTests.java | 13 +- .../RouterJobLiveTests.java | 17 +- .../RouterWorkerAsyncLiveTests.java | 5 +- .../RouterWorkerLiveTests.java | 5 +- .../CommunicationMessagesTestBase.java | 5 +- .../PhoneNumbersIntegrationTestBase.java | 8 +- .../SipRoutingIntegrationTestBase.java | 10 +- .../rooms/RoomsAsyncClientTests.java | 121 +++-- .../communication/rooms/RoomsTestBase.java | 40 +- .../azure/communication/sms/SmsTestBase.java | 8 +- .../ConfidentialLedgerClientTestBase.java | 7 +- .../containerregistry/TestUtils.java | 3 +- .../implementation/JdkHttpUtils.java | 6 +- .../NettyAsyncHttpResponseBase.java | 18 +- .../http/netty/implementation/Utility.java | 7 +- .../polling/LROPollerTests.java | 20 +- sdk/core/azure-core/spotbugs-exclude.xml | 6 + .../java/com/azure/core/http/HttpHeaders.java | 17 +- .../BearerTokenAuthenticationPolicy.java | 24 +- .../core/http/policy/RedirectPolicy.java | 2 - .../com/azure/core/http/rest/RestProxy.java | 2 - .../http/rest/AsyncRestProxy.java | 2 - .../http/rest/RestProxyBase.java | 2 - .../http/rest/SwaggerMethodParser.java | 2 + .../util/HttpHeadersAccessHelper.java | 62 +++ .../util/serializer/SerializerEncoding.java | 58 ++- .../PolicyConsumesResponseBodyTest.java | 430 ++++++++++++++++ sdk/cosmos/azure-cosmos-kafka-connect/pom.xml | 2 +- sdk/cosmos/azure-cosmos-test/CHANGELOG.md | 9 + sdk/cosmos/azure-cosmos-test/pom.xml | 2 +- sdk/cosmos/azure-cosmos-tests/pom.xml | 2 +- sdk/cosmos/azure-cosmos/CHANGELOG.md | 2 + .../azure/cosmos/implementation/Configs.java | 15 + .../CosmosQueryRequestOptionsImpl.java | 22 + .../DocumentQueryExecutionContextFactory.java | 36 +- ...onStreamingOrderByBadRequestException.java | 20 + .../NonStreamingOrderByDocumentProducer.java | 43 ++ ...gOrderByDocumentQueryExecutionContext.java | 264 ++++++++++ .../query/NonStreamingOrderByUtils.java | 111 ++++ ...ParallelDocumentQueryExecutionContext.java | 3 +- ...ipelinedDocumentQueryExecutionContext.java | 19 +- .../query/PipelinedQueryExecutionContext.java | 2 +- .../PipelinedQueryExecutionContextBase.java | 3 +- .../implementation/query/QueryFeature.java | 3 +- .../implementation/query/QueryInfo.java | 6 + .../query/QueryPlanRetriever.java | 3 +- .../models/CosmosQueryRequestOptions.java | 9 + .../cosmos/models/ModelBridgeInternal.java | 5 + .../core/DigitalTwinsTestBase.java | 5 +- .../eventhubs/EventDataAggregatorTest.java | 6 +- ...EventHubBufferedPartitionProducerTest.java | 6 +- ...redProducerAsyncClientIntegrationTest.java | 7 +- .../EventHubConsumerAsyncClientTest.java | 5 +- .../eventhubs/EventHubConsumerClientTest.java | 12 +- .../EventPositionIntegrationTest.java | 3 +- .../EventProcessorClientBuilderTest.java | 97 ++-- .../eventhubs/IntegrationTestBase.java | 5 +- .../messaging/eventhubs/LongRunningTest.java | 70 +-- .../PartitionBasedLoadBalancerTest.java | 7 +- .../eventhubs/ProxySelectorTest.java | 5 +- .../AmqpReceiveLinkProcessorTest.java | 10 +- .../README.md | 8 +- .../certificates/CertificateClientTest.java | 6 +- .../keyvault/keys/KeyAsyncClientTest.java | 5 +- .../security/keyvault/keys/KeyClientTest.java | 6 +- .../cryptography/CryptographyClientTest.java | 6 +- .../CryptographyClientTestBase.java | 9 +- .../secrets/SecretAsyncClientTest.java | 6 +- .../keyvault/secrets/SecretClientTest.java | 6 +- sdk/keyvault/test-resources.json | 46 +- .../ingestion/LogsIngestionTestBase.java | 6 +- .../ingestion/implementation/UtilsTest.java | 6 +- .../implementation/MetricDataMapper.java | 33 +- .../DefaultHeartBeatPropertyProvider.java | 2 +- .../heartbeat/HeartbeatTests.java | 50 +- .../assistants/AzureFunctionsSyncTests.java | 6 +- .../assistants/AzureRetrievalSyncTest.java | 6 +- .../assistants/AzureRunThreadAsyncTest.java | 30 +- .../assistants/AzureRunThreadSyncTest.java | 30 +- .../openai/assistants/FunctionsSyncTests.java | 6 +- .../openai/assistants/RetrievalSyncTest.java | 6 +- .../openai/assistants/RunThreadAsyncTest.java | 30 +- .../openai/assistants/RunThreadSyncTest.java | 30 +- .../models/FunctionCallPreset.java | 8 +- .../quantum/jobs/QuantumClientTestBase.java | 16 +- .../appplatform/AppPlatformTest.java | 14 +- .../appservice/OneDeployTests.java | 2 +- .../implementation/RetryTests.java | 13 +- .../VirtualMachineImageOperationsTests.java | 6 +- ...tualMachineManagedDiskOperationsTests.java | 6 +- .../VirtualMachineOperationsTests.java | 6 +- ...lMachineRelatedResourcesDeletionTests.java | 16 +- .../KubernetesClustersTests.java | 10 +- .../MonitorActivityAndMetricsTests.java | 8 +- .../resources/DeploymentsTests.java | 6 +- .../fluentcore/dag/BreadSliceImpl.java | 6 +- .../fluentcore/dag/DAGErrorTests.java | 46 +- .../fluentcore/dag/DAGraphTests.java | 34 +- .../resources/fluentcore/dag/OrderImpl.java | 6 +- .../resources/fluentcore/dag/PanCakeImpl.java | 12 +- .../resources/fluentcore/dag/PastaImpl.java | 12 +- .../resources/fluentcore/dag/PizzaImpl.java | 10 +- .../fluentcore/dag/ProxyTaskGroupTests.java | 5 +- .../fluentcore/dag/SandwichImpl.java | 6 +- .../azure-resourcemanager-samples/pom.xml | 6 +- .../ApplicationGatewayTests.java | 10 +- .../AzureResourceManagerTests.java | 140 ++--- .../resourcemanager/PrivateLinkTests.java | 28 +- .../TestApplicationGateway.java | 138 ++--- .../com/azure/resourcemanager/TestCdn.java | 8 +- ...hPublicIpAddressWithSystemAssignedMSI.java | 10 +- .../com/azure/resourcemanager/TestDns.java | 70 +-- .../TestExpressRouteCircuit.java | 22 +- .../resourcemanager/TestLoadBalancer.java | 31 +- .../TestLocalNetworkGateway.java | 10 +- .../com/azure/resourcemanager/TestNSG.java | 14 +- .../azure/resourcemanager/TestNetwork.java | 14 +- .../resourcemanager/TestNetworkInterface.java | 6 +- .../resourcemanager/TestNetworkWatcher.java | 20 +- .../azure/resourcemanager/TestPrivateDns.java | 62 +-- .../resourcemanager/TestPublicIPAddress.java | 8 +- .../resourcemanager/TestPublicIPPrefix.java | 8 +- .../com/azure/resourcemanager/TestRedis.java | 6 +- .../resourcemanager/TestRouteTables.java | 18 +- .../resourcemanager/TestSearchService.java | 13 +- .../azure/resourcemanager/TestTemplate.java | 19 +- .../resourcemanager/TestTrafficManager.java | 5 +- .../com/azure/resourcemanager/TestUtils.java | 33 +- .../TestVirtualNetworkGateway.java | 8 +- .../azure-search-documents/CHANGELOG.md | 23 +- sdk/search/azure-search-documents/README.md | 2 +- sdk/search/azure-search-documents/pom.xml | 7 +- .../implementation/util/FieldBuilder.java | 2 + ...va => AzureMachineLearningParameters.java} | 53 +- ...va => AzureMachineLearningVectorizer.java} | 35 +- .../indexes/models/SearchServiceLimits.java | 26 +- .../models/VectorSearchVectorizer.java | 8 +- .../src/samples/README.md | 3 +- .../VectorSearchReducedEmbeddings.java | 347 +++++++++++++ .../documents/indexes/FieldBuilderTests.java | 17 +- .../azure-search-documents/swagger/README.md | 30 +- sdk/search/azure-search-perf/pom.xml | 2 +- .../azure-messaging-servicebus-stress/pom.xml | 2 +- .../pom.xml | 2 +- .../azure-messaging-servicebus/CHANGELOG.md | 10 +- .../azure-messaging-servicebus/README.md | 2 +- .../azure-messaging-servicebus/docs/pom.xml | 2 +- .../azure-messaging-servicebus/pom.xml | 2 +- .../azure/messaging/servicebus/FluxTrace.java | 5 +- .../messaging/servicebus/FluxTraceV2.java | 71 --- .../servicebus/ServiceBusAsyncConsumer.java | 17 +- .../ServiceBusSessionReceiverAsyncClient.java | 2 +- .../ServiceBusSingleSessionManager.java | 12 +- .../servicebus/SessionsMessagePump.java | 13 +- .../servicebus/TracingFluxOperator.java | 82 +++ .../ServiceBusReceiverInstrumentation.java | 72 ++- .../instrumentation/ServiceBusTracer.java | 10 +- .../servicebus/ProxySelectorTest.java | 5 +- .../messaging/servicebus/ReceiveLinkTest.java | 12 +- .../ServiceBusMixClientIntegrationTest.java | 43 +- .../ServiceBusReceiverAsyncClientTest.java | 6 +- ...ceBusSenderAsyncClientIntegrationTest.java | 9 +- .../ServiceBusSessionManagerTest.java | 17 +- .../azure/messaging/servicebus/TestUtils.java | 5 +- .../servicebus/TracingIntegrationTests.java | 56 ++ .../ServiceBusReceiveLinkProcessorTest.java | 19 +- ...erviceBusReceiverInstrumentationTests.java | 6 +- sdk/spring/CHANGELOG.md | 13 + sdk/spring/README.md | 2 +- .../azure-spring-data-cosmos/CHANGELOG.md | 14 +- sdk/spring/azure-spring-data-cosmos/README.md | 2 +- sdk/spring/azure-spring-data-cosmos/pom.xml | 2 +- .../cosmos/core/ReactiveCosmosTemplate.java | 3 +- .../cosmos/core/ReactiveCosmosTemplateIT.java | 20 + .../ReactiveUUIDIdDomainRepositoryIT.java | 3 + ...dDomainPartitionPartitionRepositoryIT.java | 3 + .../CHANGELOG.md | 6 +- .../pom.xml | 8 +- .../spring-cloud-azure-actuator/CHANGELOG.md | 6 +- .../spring-cloud-azure-actuator/pom.xml | 4 +- .../CHANGELOG.md | 6 +- .../pom.xml | 4 +- .../CHANGELOG.md | 6 +- .../pom.xml | 6 +- .../config/implementation/TestUtils.java | 5 +- .../CHANGELOG.md | 6 +- .../spring-cloud-azure-autoconfigure/pom.xml | 18 +- .../aad/implementation/TestJwks.java | 5 +- .../UserPrincipalMicrosoftGraphTests.java | 5 +- .../ThreadInterruptedStatusRestoreTest.java | 14 +- .../AzureServiceBusJmsPropertiesTests.java | 8 +- .../spring-cloud-azure-core/CHANGELOG.md | 6 +- sdk/spring/spring-cloud-azure-core/pom.xml | 2 +- .../CHANGELOG.md | 6 +- .../pom.xml | 6 +- .../CHANGELOG.md | 6 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 28 +- .../CHANGELOG.md | 6 +- .../pom.xml | 4 +- .../spring-cloud-azure-service/CHANGELOG.md | 6 +- sdk/spring/spring-cloud-azure-service/pom.xml | 6 +- .../pom.xml | 4 +- .../pom.xml | 4 +- .../pom.xml | 6 +- .../CHANGELOG.md | 6 +- .../README.md | 4 +- .../pom.xml | 6 +- .../pom.xml | 4 +- .../spring-cloud-azure-starter-cosmos/pom.xml | 4 +- .../pom.xml | 6 +- .../pom.xml | 4 +- .../pom.xml | 4 +- .../pom.xml | 6 +- .../pom.xml | 6 +- .../pom.xml | 6 +- .../pom.xml | 4 +- .../pom.xml | 4 +- .../pom.xml | 4 +- .../pom.xml | 4 +- .../pom.xml | 6 +- .../spring-cloud-azure-starter-redis/pom.xml | 4 +- .../pom.xml | 4 +- .../pom.xml | 6 +- .../pom.xml | 4 +- .../pom.xml | 4 +- .../pom.xml | 4 +- .../pom.xml | 8 +- .../pom.xml | 4 +- .../pom.xml | 4 +- sdk/spring/spring-cloud-azure-starter/pom.xml | 4 +- .../CHANGELOG.md | 6 +- .../pom.xml | 4 +- .../CHANGELOG.md | 6 +- .../pom.xml | 8 +- .../CHANGELOG.md | 6 +- .../pom.xml | 6 +- .../CHANGELOG.md | 6 +- .../pom.xml | 8 +- .../CHANGELOG.md | 6 +- .../spring-cloud-azure-trace-sleuth/pom.xml | 4 +- .../CHANGELOG.md | 6 +- .../spring-integration-azure-core/pom.xml | 4 +- .../CHANGELOG.md | 6 +- .../pom.xml | 8 +- .../CHANGELOG.md | 6 +- .../pom.xml | 10 +- .../CHANGELOG.md | 6 +- .../pom.xml | 6 +- .../CHANGELOG.md | 6 +- .../spring-messaging-azure-eventhubs/pom.xml | 6 +- .../core/EventHubsTemplateTests.java | 35 +- .../CHANGELOG.md | 6 +- .../spring-messaging-azure-servicebus/pom.xml | 8 +- .../CHANGELOG.md | 6 +- .../pom.xml | 6 +- .../spring-messaging-azure/CHANGELOG.md | 6 +- sdk/spring/spring-messaging-azure/pom.xml | 4 +- .../storage/blob/RequestRetryTestFactory.java | 7 +- .../com/azure/storage/blob/RetryTests.java | 3 +- .../storage/file/share/DirectoryApiTests.java | 6 +- .../ImageAnalysisClientTestBase.java | 118 +++-- .../webpubsub/client/GroupMessageTests.java | 8 +- 319 files changed, 3800 insertions(+), 2489 deletions(-) create mode 100644 eng/pipelines/templates/steps/install-rex-validation-tool.yml create mode 100644 eng/scripts/docs/java2docfx.version.txt delete mode 100644 sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createACSCallAndUnmixedAudioTest.json delete mode 100644 sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createACSCallUnmixedAudioAffinityTest.json delete mode 100644 sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenAddParticipantFinallyCancelAddParticipant.json delete mode 100644 sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenAddParticipantFinallyRemoveParticipantAutomatedTest.json delete mode 100644 sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenHangupAutomatedTest.json delete mode 100644 sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndRejectAutomatedTest.json delete mode 100644 sdk/communication/azure-communication-callautomation/src/test/resources/session-records/dialogActionInACallAutomatedTest.json delete mode 100644 sdk/communication/azure-communication-callautomation/src/test/resources/session-records/dtmfActionsInACallAutomatedTest.json delete mode 100644 sdk/communication/azure-communication-callautomation/src/test/resources/session-records/playMediaInACallAutomatedTest.json create mode 100644 sdk/core/azure-core/src/test/java/com/azure/core/http/policy/PolicyConsumesResponseBodyTest.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByBadRequestException.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentProducer.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java rename sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/{AMLParameters.java => AzureMachineLearningParameters.java} (79%) rename sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/{AMLVectorizer.java => AzureMachineLearningVectorizer.java} (69%) create mode 100644 sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/VectorSearchReducedEmbeddings.java delete mode 100644 sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/FluxTraceV2.java create mode 100644 sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/TracingFluxOperator.java diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 193c8b69c4f4..b2005c647e31 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -396,10 +396,10 @@ # ServiceOwners: @raedJarrar @jifems # PRLabel: %DevCenter -/sdk/devcenter/ @sebrenna @mharlan +/sdk/devcenter/ @sebrenna # ServiceLabel: %DevCenter -# ServiceOwners: @sebrenna @mharlan +# ServiceOwners: @sebrenna # ServiceLabel: %Device Provisioning Service # ServiceOwners: @nberdy @@ -430,7 +430,7 @@ # ServiceLabel: %Event Grid # AzureSdkOwners: @billwert -# ServiceOwners: @jfggdl +# ServiceOwners: @Kishp01 @ahamad-MS # PRLabel: %Event Hubs /sdk/eventhubs/ @conniey @anuchandy @lmolkova @@ -558,7 +558,7 @@ # ServiceOwners: @ambhatna @savjani # PRLabel: %OpenTelemetry -/sdk/monitor/azure-monitor-opentelemetry-exporter/ @trask @ramthi @heyams @jeanbisutti +/sdk/monitor/azure-monitor-opentelemetry-exporter/ @trask @ramthi @heyams @jeanbisutti @harsimar # ServiceLabel: %Network # ServiceOwners: @aznetsuppgithub @@ -647,9 +647,6 @@ # ServiceLabel: %Redis Cache # ServiceOwners: @yegu-ms -# ServiceLabel: %Relay -# ServiceOwners: @jfggdl - # PRLabel: %Remote Rendering /sdk/remoterendering/ @MichaelZp0 @ChristopherManthei @@ -796,13 +793,13 @@ /sdk/spring-experimental/ @chenrujun @netyyyy @saragluna @moarychan # PRLabel: %Monitor - Spring -/sdk/spring/spring-cloud-azure-starter-monitor @jeanbisutti @trask @ramthi @heyams +/sdk/spring/spring-cloud-azure-starter-monitor @jeanbisutti @trask @ramthi @heyams @harsimar # PRLabel: %Monitor - Spring -/sdk/spring/spring-cloud-azure-starter-monitor-test @jeanbisutti @trask @ramthi @heyams +/sdk/spring/spring-cloud-azure-starter-monitor-test @jeanbisutti @trask @ramthi @heyams @harsimar # ServiceLabel: %Monitor - Spring -# AzureSdkOwners: @jeanbisutti @trask @ramthi @heyams +# AzureSdkOwners: @jeanbisutti @trask @ramthi @heyams @harsimar # PRLabel: %azure-spring /sdk/spring/spring-cloud-azure-appconfiguration-config*/ @mrm9084 @chenrujun @netyyyy @saragluna @moarychan @@ -853,3 +850,4 @@ # Add owners for notifications for specific pipelines /eng/pipelines/aggregate-reports.yml @joshfree @jonathangiles +/eng/common/pipelines/codeowners-linter.yml @alzimmermsft @srnagar @lmolkova diff --git a/.github/CODEOWNERS_baseline_errors.txt b/.github/CODEOWNERS_baseline_errors.txt index e0dbd7daa065..faf15e0ee168 100644 --- a/.github/CODEOWNERS_baseline_errors.txt +++ b/.github/CODEOWNERS_baseline_errors.txt @@ -267,3 +267,8 @@ ccmixpdevs is an invalid user. Ensure the user exists, is public member of Azure ccmbpxpcrew is an invalid user. Ensure the user exists, is public member of Azure and has write permissions. TiagoCrewGitHubIssues is an invalid user. Ensure the user exists, is public member of Azure and has write permissions. ccmshowbackdevs is an invalid user. Ensure the user exists, is public member of Azure and has write permissions. +sagivf is not a public member of Azure. +Aviv-Yaniv is not a public member of Azure. +tmahmood-microsoft is not a public member of Azure. +Kishp01 is not a public member of Azure. +ahamad-MS is an invalid user. Ensure the user exists, is public member of Azure and has write permissions. \ No newline at end of file diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index d74bddeb2891..7d1f72e79429 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -5,13 +5,13 @@ "packages": { "": { "dependencies": { - "@azure-tools/typespec-java": "0.15.14" + "@azure-tools/typespec-java": "0.15.15" }, "devDependencies": { "@azure-tools/typespec-autorest": "0.41.1", "@azure-tools/typespec-azure-core": "0.41.0", "@azure-tools/typespec-azure-resource-manager": "0.41.0", - "@azure-tools/typespec-client-generator-core": "0.41.6", + "@azure-tools/typespec-client-generator-core": "0.41.8", "@typespec/compiler": "0.55.0", "@typespec/http": "0.55.0", "@typespec/openapi": "0.55.0", @@ -114,9 +114,9 @@ } }, "node_modules/@azure-tools/typespec-client-generator-core": { - "version": "0.41.6", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.41.6.tgz", - "integrity": "sha512-pEv0LQb415QioO6hsYYXWwmsG6Ka3J7SRUgf5zlA6/m6inc8OR1MwFGHdTTjzbp3jG0GDr1C/T7jF1Jy+edyfw==", + "version": "0.41.8", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.41.8.tgz", + "integrity": "sha512-d72LPwkEio/swqyAAgcuOaw+K4ghSbZcRjpjsvddxHWHh25ZukjD2hU/BfCtidnKptgKjs79fV++w2MYE6sTyw==", "dependencies": { "change-case": "~5.4.4", "pluralize": "^8.0.0" @@ -133,9 +133,9 @@ } }, "node_modules/@azure-tools/typespec-java": { - "version": "0.15.14", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-java/-/typespec-java-0.15.14.tgz", - "integrity": "sha512-Cpa92KG09UMAq76oM21x/PswYSjuE3LMLtqYv21JEz30TcjaL0/KVtVum2hKzK9s2/eZzY70acaMNkuDQyQVBw==", + "version": "0.15.15", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-java/-/typespec-java-0.15.15.tgz", + "integrity": "sha512-46zyPBkDF5NEbL4DEwDt/WiiQgTvsLI1CtiYD5Cfjt+stbmSNVb77urcxlzqgEbQiFPCV6UJWGnuu09ilYT/Dw==", "dependencies": { "@autorest/codemodel": "~4.20.0", "js-yaml": "~4.1.0", @@ -167,19 +167,19 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "version": "7.24.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.5.tgz", + "integrity": "sha512-3q93SSKX2TWCG30M2G2kwaKeTYgEUp5Snjuj8qm729SObL6nbtUldAi37qbxkD5gg3xnBio+f9nqpSepGZMvxA==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.24.2", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.2.tgz", - "integrity": "sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==", + "version": "7.24.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.5.tgz", + "integrity": "sha512-8lLmua6AVh/8SLJRRVD6V8p73Hir9w5mJrhE+IPpILG31KKlI9iz5zmBYKcWPS59qSfgP9RaSBQSHHE81WKuEw==", "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", + "@babel/helper-validator-identifier": "^7.24.5", "chalk": "^2.4.2", "js-tokens": "^4.0.0", "picocolors": "^1.0.0" @@ -973,9 +973,9 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/yaml": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.1.tgz", - "integrity": "sha512-pIXzoImaqmfOrL7teGUBt/T7ZDnyeGBWyXQBvOVhLkWLN37GXv8NMLK406UY6dS51JfcQHsmcW5cJ441bHg6Lg==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.2.tgz", + "integrity": "sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA==", "bin": { "yaml": "bin.mjs" }, diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 15fe2aad5a8e..d566172a15d6 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,16 +1,16 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-java": "0.15.14" + "@azure-tools/typespec-java": "0.15.15" }, "devDependencies": { - "@typespec/versioning": "0.55.0", - "@azure-tools/typespec-client-generator-core": "0.41.6", - "@typespec/http": "0.55.0", - "@typespec/openapi": "0.55.0", + "@azure-tools/typespec-client-generator-core": "0.41.8", "@typespec/rest": "0.55.0", "@typespec/compiler": "0.55.0", + "@typespec/openapi": "0.55.0", "@azure-tools/typespec-azure-core": "0.41.0", + "@typespec/versioning": "0.55.0", + "@typespec/http": "0.55.0", "@azure-tools/typespec-azure-resource-manager": "0.41.0", "@azure-tools/typespec-autorest": "0.41.1" } diff --git a/eng/mgmt/automation/changelog.py b/eng/mgmt/automation/changelog.py index fd62451eae7e..72f7a5767305 100755 --- a/eng/mgmt/automation/changelog.py +++ b/eng/mgmt/automation/changelog.py @@ -9,7 +9,7 @@ from parameters import * from generate import update_parameters from generate_utils import get_version -from generate import compile_package +from generate_utils import compile_arm_package from generate import compare_with_maven_package os.chdir(pwd) @@ -31,7 +31,7 @@ def main(): update_parameters(args.get('suffix')) if args.get('compile'): - compile_package(sdk_root, service) + compile_arm_package(sdk_root, service) versions = get_version(sdk_root, service).split(';') stable_version = versions[1] diff --git a/eng/mgmt/automation/generate.py b/eng/mgmt/automation/generate.py index da692c27e539..1c56b9e154b7 100755 --- a/eng/mgmt/automation/generate.py +++ b/eng/mgmt/automation/generate.py @@ -24,7 +24,7 @@ ) from generate_utils import ( compare_with_maven_package, - compile_package, + compile_arm_package, generate, get_and_update_service_from_api_specs, get_suffix_from_api_specs, @@ -187,7 +187,7 @@ def sdk_automation_autorest(config: dict) -> List[dict]: tag=tag, ) if succeeded: - compile_package(sdk_root, module) + compile_arm_package(sdk_root, module) packages.append({ 'packageName': @@ -256,7 +256,7 @@ def sdk_automation_typespec_project(tsp_project: str, config: dict) -> dict: update_root_pom(sdk_root, service) # compile - succeeded = compile_package(sdk_root, module) + succeeded = compile_arm_package(sdk_root, module) # output if sdk_folder and module and service: @@ -359,7 +359,7 @@ def main(): ) if succeeded: - succeeded = compile_package(sdk_root, module) + succeeded = compile_arm_package(sdk_root, module) if succeeded: compare_with_maven_package(sdk_root, service, stable_version, current_version, module) diff --git a/eng/mgmt/automation/generate_data.py b/eng/mgmt/automation/generate_data.py index aee8301e8d57..fa885c58a0e9 100755 --- a/eng/mgmt/automation/generate_data.py +++ b/eng/mgmt/automation/generate_data.py @@ -335,7 +335,11 @@ def compile_package(sdk_root: str, group_id: str, module: str) -> bool: sdk_root, group_id, module) logging.info(command) if os.system(command) != 0: - logging.error('[COMPILE] Maven build fail') + error_message = ('[COMPILE] Maven build fail.\n' + 'One reason of the compilation failure is that the existing code customization in SDK repository being incompatible with the class generated from updated TypeSpec source. In such case, you can ignore the failure, and fix the customization in SDK repository.\n' + 'You can inquire in "Language - Java" Teams channel. Please include the link of this Pull Request in the query.') + logging.error(error_message) + print(error_message, file=sys.stderr) return False return True diff --git a/eng/mgmt/automation/generate_utils.py b/eng/mgmt/automation/generate_utils.py index 8194eae9be2b..422db00d3471 100644 --- a/eng/mgmt/automation/generate_utils.py +++ b/eng/mgmt/automation/generate_utils.py @@ -95,7 +95,7 @@ def generate( return True -def compile_package(sdk_root, module) -> bool: +def compile_arm_package(sdk_root: str, module: str) -> bool: if os.system( 'mvn --no-transfer-progress clean verify -f {0}/pom.xml -Dmaven.javadoc.skip -Dgpg.skip -DskipTestCompile -Djacoco.skip -Drevapi.skip -pl {1}:{2} -am'.format( sdk_root, GROUP_ID, module)) != 0: diff --git a/eng/mgmt/automation/generation.yml b/eng/mgmt/automation/generation.yml index d1423af5d341..ef7306beaa24 100644 --- a/eng/mgmt/automation/generation.yml +++ b/eng/mgmt/automation/generation.yml @@ -12,7 +12,9 @@ variables: - name: MAVEN_OPTS value: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)' - name: NodeVersion - value: '16.x' + value: '18.x' +- name: fromTypeSpec + value: $[ne(variables['TSP_CONFIG'], '')] steps: - bash: | @@ -29,6 +31,12 @@ steps: - bash: | npm install -g autorest displayName: 'Install autorest' + condition: eq(variables.fromTypeSpec, false) + +- bash: | + npm install -g @azure-tools/typespec-client-generator-cli + displayName: 'Install tsp-client' + condition: eq(variables.fromTypeSpec, true) # - template: /eng/common/testproxy/test-proxy-tool.yml # parameters: @@ -38,13 +46,27 @@ steps: - bash: | export PATH=$JAVA_HOME_11_X64/bin:$PATH java -version + set -x + ./eng/mgmt/automation/generate.py --tsp-config "$(TSP_CONFIG)" --version "$(VERSION)" --auto-commit-external-change --user-name "azure-sdk" --user-email "azuresdk@microsoft.com" + displayName: Generation from TypeSpec + condition: eq(variables.fromTypeSpec, true) + +- bash: | + export PATH=$JAVA_HOME_11_X64/bin:$PATH + java -version + set -x ./eng/mgmt/automation/generate.py --readme "$(README)" --tag "$(TAG)" --autorest-options="$(AUTOREST_OPTIONS)" --service "$(SERVICE)" --version "$(VERSION)" --suffix "$(SUFFIX)" --auto-commit-external-change --user-name "azure-sdk" --user-email "azuresdk@microsoft.com" - displayName: Generation + displayName: Generation from Swagger + condition: eq(variables.fromTypeSpec, false) - template: /eng/common/pipelines/templates/steps/create-pull-request.yml parameters: PRBranchName: fluent-lite-generation-$(Build.BuildId) - CommitMsg: '[Automation] Generate Fluent Lite from $(README)#$(TAG)' - PRTitle: '[Automation] Generate Fluent Lite from $(README)#$(TAG)' + ${{ if variables.fromTypeSpec }}: + CommitMsg: '[Automation] Generate Fluent Lite from TypeSpec $(README)' + PRTitle: '[Automation] Generate Fluent Lite from TypeSpec $(README)' + ${{ else }}: + CommitMsg: '[Automation] Generate Fluent Lite from Swagger $(README)#$(TAG)' + PRTitle: '[Automation] Generate Fluent Lite from Swagger $(README)#$(TAG)' PRLabels: 'Mgmt - Track 2' OpenAsDraft: '$(DRAFT_PULL_REQUEST)' diff --git a/eng/mgmt/automation/generation_data.yml b/eng/mgmt/automation/generation_data.yml index 55378d235324..7cacdc1877c9 100644 --- a/eng/mgmt/automation/generation_data.yml +++ b/eng/mgmt/automation/generation_data.yml @@ -12,7 +12,7 @@ variables: - name: MAVEN_OPTS value: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)' - name: NodeVersion - value: '16.x' + value: '18.x' steps: - bash: | diff --git a/eng/mgmt/automation/parameters.py b/eng/mgmt/automation/parameters.py index 158efbd6c896..85fe90bc5d0a 100644 --- a/eng/mgmt/automation/parameters.py +++ b/eng/mgmt/automation/parameters.py @@ -16,7 +16,7 @@ SDK_ROOT = '../../../' # related to file dir AUTOREST_CORE_VERSION = '3.9.7' -AUTOREST_JAVA = '@autorest/java@4.1.28' +AUTOREST_JAVA = '@autorest/java@4.1.29' DEFAULT_VERSION = '1.0.0-beta.1' GROUP_ID = 'com.azure.resourcemanager' API_SPECS_FILE = 'api-specs.yaml' diff --git a/eng/mgmt/automation/sdk_generate.py b/eng/mgmt/automation/sdk_generate.py index e6ffeaceeccc..d1d1e9a0a51e 100755 --- a/eng/mgmt/automation/sdk_generate.py +++ b/eng/mgmt/automation/sdk_generate.py @@ -20,7 +20,7 @@ ) from generate_utils import ( compare_with_maven_package, - compile_package, + compile_arm_package, generate, get_and_update_service_from_api_specs, get_suffix_from_api_specs, @@ -215,7 +215,7 @@ def sdk_automation_autorest(config: dict) -> List[dict]: tag = tag, ) if succeeded: - compile_package(sdk_root, module) + compile_arm_package(sdk_root, module) packages.append({ 'packageName': @@ -294,7 +294,7 @@ def main(): ) if succeeded: - succeeded = compile_package(sdk_root, module) + succeeded = compile_arm_package(sdk_root, module) if succeeded: compare_with_maven_package(sdk_root, service, stable_version, current_version, module) diff --git a/eng/pipelines/docindex.yml b/eng/pipelines/docindex.yml index 0cb3f6205908..c128f858955d 100644 --- a/eng/pipelines/docindex.yml +++ b/eng/pipelines/docindex.yml @@ -13,7 +13,6 @@ jobs: DailyDocRepoLocation: $(Pipeline.Workspace)/daily DocRepoOwner: Azure DocRepoName: azure-docs-sdk-java - DocValidationImageId: azuresdkimages.azurecr.io/javarefautocr:latest steps: # Sync docs repo onboarding files/folders - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml @@ -29,10 +28,6 @@ jobs: WorkingDirectory: $(DocRepoLocation) - Name: azure-sdk/$(DocRepoName) WorkingDirectory: $(DailyDocRepoLocation) - # Pull and build the docker image. - - template: /eng/common/pipelines/templates/steps/docker-pull-image.yml - parameters: - ImageId: "$(DocValidationImageId)" - task: Powershell@2 inputs: @@ -46,7 +41,7 @@ jobs: inputs: pwsh: true filePath: eng/common/scripts/Update-DocsMsPackages.ps1 - arguments: -DocRepoLocation $(DocRepoLocation) -ImageId '$(DocValidationImageId)' + arguments: -DocRepoLocation $(DocRepoLocation) displayName: Update Docs Onboarding for main branch condition: and(succeeded(), or(eq(variables['Build.Reason'], 'Schedule'), eq(variables['Force.MainUpdate'], 'true'))) @@ -85,7 +80,7 @@ jobs: parameters: BaseRepoBranch: $(DefaultBranch) BaseRepoOwner: $(DocRepoOwner) - CommitMsg: "Update docs CI configuration" + CommitMsg: "Update docs CI configuration Build: $(System.CollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)" TargetRepoName: $(DocRepoName) TargetRepoOwner: $(DocRepoOwner) WorkingDirectory: $(DocRepoLocation) @@ -95,20 +90,7 @@ jobs: parameters: DailyBranchVariableName: DailyDocsBranchName - # Docs daily updates is supposed to download packages from public feed repository, so we have to specify additional repositories in a POM or the profile. - # Here is maven documentation: https://maven.apache.org/guides/mini/guide-multiple-repositories.html - - powershell: | - # Linux mvn `setting.xml` is sitting under path `~/.m2/setting.xml` - Get-Command mvn - if (!(Test-Path '~/.m2/')) { - mkdir ~/.m2/ - } - if (Test-Path '~/.m2/setting.xml') { - Write-Host "'setting.xml' exists. Overwriting the file to support multiple repositories." - } - Copy-Item "./eng/repo-docs/docms/daily.update.setting.xml" -Destination "~/.m2/settings.xml" - displayName: 'Configure mvn' - workingDirectory: $(Build.SourcesDirectory) + - template: /eng/pipelines/templates/steps/mvn-linux-settings-for-docs.yml - task: Powershell@2 inputs: diff --git a/eng/pipelines/templates/stages/1es-redirect.yml b/eng/pipelines/templates/stages/1es-redirect.yml index d97a6c8e6fec..0cad046eea7a 100644 --- a/eng/pipelines/templates/stages/1es-redirect.yml +++ b/eng/pipelines/templates/stages/1es-redirect.yml @@ -11,7 +11,7 @@ resources: - repository: azure-sdk-build-tools type: git name: internal/azure-sdk-build-tools - ref: refs/tags/azure-sdk-build-tools_20240320.1 + ref: refs/tags/azure-sdk-build-tools_20240507.1 parameters: - name: stages diff --git a/eng/pipelines/templates/stages/archetype-java-release-batch.yml b/eng/pipelines/templates/stages/archetype-java-release-batch.yml index 24a2d7c7e723..7b0cf0945427 100644 --- a/eng/pipelines/templates/stages/archetype-java-release-batch.yml +++ b/eng/pipelines/templates/stages/archetype-java-release-batch.yml @@ -319,10 +319,6 @@ stages: image: azsdk-pool-mms-ubuntu-2004-1espt os: linux - variables: - - name: DocValidationImageId - value: azuresdkimages.azurecr.io/javarefautocr:latest - strategy: runOnce: deploy: @@ -341,6 +337,8 @@ stages: - template: /eng/pipelines/templates/steps/mvn-linux-repository-settings.yml + - template: /eng/pipelines/templates/steps/install-rex-validation-tool.yml + - template: /eng/common/pipelines/templates/steps/update-docsms-metadata.yml parameters: PackageInfoLocations: @@ -354,7 +352,6 @@ stages: SparseCheckoutPaths: - docs-ref-services/ - metadata/ - DocValidationImageId: "$(DocValidationImageId)" - deployment: PublishDocs displayName: Publish Docs to GitHubIO Blob Storage @@ -464,9 +461,6 @@ stages: name: azsdk-pool-mms-ubuntu-2004-general image: azsdk-pool-mms-ubuntu-2004-1espt os: linux - variables: - - name: DocValidationImageId - value: azuresdkimages.azurecr.io/javarefautocr:latest steps: - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml parameters: @@ -485,6 +479,8 @@ stages: - template: /eng/pipelines/templates/steps/mvn-linux-repository-settings.yml + - template: /eng/pipelines/templates/steps/install-rex-validation-tool.yml + - template: /eng/common/pipelines/templates/steps/update-docsms-metadata.yml parameters: PackageInfoLocations: @@ -499,6 +495,5 @@ stages: SparseCheckoutPaths: - docs-ref-services/ - metadata/ - DocValidationImageId: "$(DocValidationImageId)" - template: /eng/common/pipelines/templates/steps/docsms-ensure-validation.yml diff --git a/eng/pipelines/templates/stages/archetype-java-release-patch.yml b/eng/pipelines/templates/stages/archetype-java-release-patch.yml index 50e817b937fd..c22cff36f32c 100644 --- a/eng/pipelines/templates/stages/archetype-java-release-patch.yml +++ b/eng/pipelines/templates/stages/archetype-java-release-patch.yml @@ -239,8 +239,6 @@ stages: variables: - template: /eng/pipelines/templates/variables/globals.yml - - name: DocValidationImageId - value: azuresdkimages.azurecr.io/javarefautocr:latest strategy: runOnce: @@ -261,6 +259,8 @@ stages: - template: /eng/pipelines/templates/steps/mvn-linux-repository-settings.yml + - template: /eng/pipelines/templates/steps/install-rex-validation-tool.yml + - template: /eng/common/pipelines/templates/steps/update-docsms-metadata.yml parameters: PackageInfoLocations: @@ -274,7 +274,6 @@ stages: SparseCheckoutPaths: - docs-ref-services/ - metadata/ - DocValidationImageId: "$(DocValidationImageId)" - deployment: PublishDocs displayName: Publish Docs to GitHubIO Blob Storage diff --git a/eng/pipelines/templates/stages/archetype-java-release.yml b/eng/pipelines/templates/stages/archetype-java-release.yml index bcb7e5c37892..6d689be35605 100644 --- a/eng/pipelines/templates/stages/archetype-java-release.yml +++ b/eng/pipelines/templates/stages/archetype-java-release.yml @@ -257,8 +257,6 @@ stages: variables: - template: /eng/pipelines/templates/variables/globals.yml - - name: DocValidationImageId - value: azuresdkimages.azurecr.io/javarefautocr:latest strategy: runOnce: @@ -275,10 +273,11 @@ stages: - download: current displayName: 'Download Artifact: ${{parameters.ArtifactName}}' artifact: ${{parameters.ArtifactName}} - # Pull and build the docker image. - template: /eng/pipelines/templates/steps/mvn-linux-repository-settings.yml + - template: /eng/pipelines/templates/steps/install-rex-validation-tool.yml + - template: /eng/common/pipelines/templates/steps/update-docsms-metadata.yml parameters: PackageInfoLocations: @@ -290,7 +289,6 @@ stages: SparseCheckoutPaths: - docs-ref-services/ - metadata/ - DocValidationImageId: "$(DocValidationImageId)" - ${{if ne(artifact.skipPublishDocGithubIo, 'true')}}: - deployment: PublishDocs @@ -446,8 +444,6 @@ stages: os: linux variables: - template: /eng/pipelines/templates/variables/globals.yml - - name: DocValidationImageId - value: azuresdkimages.azurecr.io/javarefautocr:latest steps: - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml parameters: @@ -466,6 +462,8 @@ stages: - template: /eng/pipelines/templates/steps/mvn-linux-repository-settings.yml + - template: /eng/pipelines/templates/steps/install-rex-validation-tool.yml + - template: /eng/common/pipelines/templates/steps/update-docsms-metadata.yml parameters: PackageInfoLocations: @@ -480,6 +478,5 @@ stages: SparseCheckoutPaths: - docs-ref-services/ - metadata/ - DocValidationImageId: "$(DocValidationImageId)" - template: /eng/common/pipelines/templates/steps/docsms-ensure-validation.yml diff --git a/eng/pipelines/templates/steps/install-rex-validation-tool.yml b/eng/pipelines/templates/steps/install-rex-validation-tool.yml new file mode 100644 index 000000000000..904e04402123 --- /dev/null +++ b/eng/pipelines/templates/steps/install-rex-validation-tool.yml @@ -0,0 +1,22 @@ +steps: + # Create a java2docfx subdirectory in the $(Build.BinariesDirectory) and install the java2docfx there + # This way, the jar file is in its own subdirectory and isolated. + - pwsh: | + $java2docfxVer = Get-Content eng/scripts/docs/java2docfx.version.txt + $java2docfxDir = Join-Path $(Build.BinariesDirectory) "java2docfx" + New-Item $java2docfxDir -ItemType Directory | Out-Null + $originLocation = Get-Location + try { + # Set the location into the created java2docfx directory . Running mvn from the repository root + # picks up the root POM and processes that while doing the dependency:copy in spite of + # the fact it has nothing to do with this download. + Set-Location $java2docfxDir + Write-Host "mvn dependency:copy -Dartifact=""com.microsoft:java2docfx:$java2docfxVer"" -DoutputDirectory=""$java2docfxDir""" + mvn dependency:copy -Dartifact="com.microsoft:java2docfx:$java2docfxVer" -DoutputDirectory="$java2docfxDir" + $java2docfxJarLoc = Join-Path $java2docfxDir -ChildPath "java2docfx-$java2docfxVer.jar" + Write-Host "Testing the install, running java -jar $java2docfxJarLoc -h" + java -jar $java2docfxJarLoc -h + } finally { + Set-Location $originLocation + } + displayName: Install java2docfx for package validation \ No newline at end of file diff --git a/eng/pipelines/templates/steps/java-publishing.yml b/eng/pipelines/templates/steps/java-publishing.yml index 6f8aeecf8156..016495e8e130 100644 --- a/eng/pipelines/templates/steps/java-publishing.yml +++ b/eng/pipelines/templates/steps/java-publishing.yml @@ -107,10 +107,14 @@ steps: -Path ${{ parameters.OutputDirectory }} -InformationAction Continue - ${{if and(eq(parameters.ShouldPublish, 'true'), ne(parameters.StageOnly, 'true'))}}: - - task: EsrpRelease@4 + - task: EsrpRelease@7 displayName: 'Publish to ESRP' inputs: - ConnectedServiceName: 'ESRP Release Service' + ConnectedServiceName: 'Azure SDK Engineering System' + ClientId: '5f81938c-2544-4f1f-9251-dd9de5b8a81b' + KeyVaultName: 'AzureSDKEngKeyVault' + AuthCertName: 'azure-sdk-esrp-release-auth-certificate' + SignCertName: 'azure-sdk-esrp-release-sign-certificate' Intent: 'PackageDistribution' ContentType: 'Maven' FolderLocation: ${{ parameters.OutputDirectory }} diff --git a/eng/repo-docs/docms/daily.update.setting.xml b/eng/repo-docs/docms/daily.update.setting.xml index fc1b359a3a62..f30128b6d146 100644 --- a/eng/repo-docs/docms/daily.update.setting.xml +++ b/eng/repo-docs/docms/daily.update.setting.xml @@ -18,6 +18,16 @@ true + + docs-public-packages + https://docfx.pkgs.visualstudio.com/docfx/_packaging/docs-public-packages/maven/v1 + + true + + + true + + diff --git a/eng/scripts/Language-Settings.ps1 b/eng/scripts/Language-Settings.ps1 index 27cfa73218be..dfbd0f1ba16c 100644 --- a/eng/scripts/Language-Settings.ps1 +++ b/eng/scripts/Language-Settings.ps1 @@ -163,7 +163,11 @@ function Get-java-DocsMsDevLanguageSpecificPackageInfo($packageInfo, $packageSou # through the javadoc, like track 1 libraries whose javadoc.jar files don't contain anything, in # the metadata json files. if ($namespaces.Count -gt 0) { + Write-Host "Get-java-DocsMsDevLanguageSpecificPackageInfo:adding namespaces property with the following namespaces:" + $namespaces | Write-Host $packageInfo | Add-Member -Type NoteProperty -Name "Namespaces" -Value $namespaces + } else { + Write-Host "Get-java-DocsMsDevLanguageSpecificPackageInfo: no namespaces to add" } } return $packageInfo @@ -262,412 +266,6 @@ function Get-java-GithubIoDocIndex() GenerateDocfxTocContent -tocContent $tocContent -lang "Java" -campaignId "UA-62780441-42" } -# a "package.json configures target packages for all the monikers in a Repository, it also has a slightly different -# schema than the moniker-specific json config that is seen in python and js -function Update-java-CIConfig($pkgs, $ciRepo, $locationInDocRepo, $monikerId=$null) -{ - $pkgJsonLoc = (Join-Path -Path $ciRepo -ChildPath $locationInDocRepo) - - if (-not (Test-Path $pkgJsonLoc)) { - Write-Error "Unable to locate package json at location $pkgJsonLoc, exiting." - exit(1) - } - - $allJsonData = Get-Content $pkgJsonLoc | ConvertFrom-Json - - $visibleInCI = @{} - - for ($i=0; $i -lt $allJsonData[$monikerId].packages.Length; $i++) { - $pkgDef = $allJsonData[$monikerId].packages[$i] - $visibleInCI[$pkgDef.packageArtifactId] = $i - } - - foreach ($releasingPkg in $pkgs) { - if ($visibleInCI.ContainsKey($releasingPkg.PackageId)) { - $packagesIndex = $visibleInCI[$releasingPkg.PackageId] - $existingPackageDef = $allJsonData[$monikerId].packages[$packagesIndex] - $existingPackageDef.packageVersion = $releasingPkg.PackageVersion - } - else { - $newItem = New-Object PSObject -Property @{ - packageDownloadUrl = $PackageRepositoryUri - packageGroupId = $releasingPkg.GroupId - packageArtifactId = $releasingPkg.PackageId - packageVersion = $releasingPkg.PackageVersion - inputPath = @() - excludePath = @() - } - - $allJsonData[$monikerId].packages += $newItem - } - } - - $jsonContent = $allJsonData | ConvertTo-Json -Depth 10 | % {$_ -replace "(?m) (?<=^(?: )*)", " " } - - Set-Content -Path $pkgJsonLoc -Value $jsonContent -} - -$PackageExclusions = @{ - "azure-core-experimental" = "Don't want to include an experimental package."; - "azure-core-test" = "Don't want to include the test framework package."; - "azure-sdk-bom" = "Don't want to include the sdk bom."; - "azure-storage-internal-avro" = "No external APIs."; - "azure-cosmos-spark_3-1_2-12" = "Javadoc dependency issue."; - "azure-cosmos-spark_3-2_2-12" = "Javadoc dependency issue."; - "azure-cosmos-spark_3-3_2-12" = "Javadoc dependency issue."; - "azure-cosmos-spark_3-4_2-12" = "Javadoc dependency issue."; - "azure-cosmos-spark_3-5_2-12" = "Javadoc dependency issue."; - "azure-cosmos-test" = "Don't want to include the test framework package."; - "azure-aot-graalvm-support-netty" = "No Javadocs for the package."; - "azure-aot-graalvm-support" = "No Javadocs for the package."; - "azure-sdk-template" = "Depends on unreleased core."; - "azure-sdk-template-two" = "Depends on unreleased core."; - "azure-sdk-template-three" = "Depends on unreleased core."; - "azure-ai-personalizer" = "No java docs in this package."; - "azure-sdk-build-tool" = "Do not release docs for this package."; - "azure-resourcemanager-voiceservices" = "Doc build attempts to download a package that does not have published sources."; - "azure-resourcemanager-storagemover" = "Attempts to azure-sdk-build-tool and fails"; - "azure-security-keyvault-jca" = "Consistently hangs docs build, might be a spring package https://github.com/Azure/azure-sdk-for-java/issues/35389"; -} - -# Validates if the package will succeed in the CI build by validating the -# existence of a com folder in the unzipped source package -function SourcePackageHasComFolder($artifactNamePrefix, $packageDirectory) { - try - { - $packageArtifact = "${artifactNamePrefix}:jar:sources" - $mvnResults = mvn ` - dependency:copy ` - -Dartifact="$packageArtifact" ` - -DoutputDirectory="$packageDirectory" - - if ($LASTEXITCODE) { - LogWarning "Could not download source artifact: $packageArtifact" - $mvnResults | Write-Host - return $false - } - - $sourcesJarPath = (Get-ChildItem -File -Path $packageDirectory -Filter "*-sources.jar")[0] - $sourcesExtractPath = Join-Path $packageDirectory "sources" - - # Ensure that the sources folder is empty before extracting the jar - # otherwise there could be file collisions from a previous extraction run on - # the same system. - Remove-Item $sourcesExtractPath/* -Force -Recurse -ErrorAction Ignore - - Add-Type -AssemblyName System.IO.Compression.FileSystem - [System.IO.Compression.ZipFile]::ExtractToDirectory($sourcesJarPath, $sourcesExtractPath) - - if (!(Test-Path "$sourcesExtractPath\com")) { - LogWarning "Could not locate 'com' folder extracting $packageArtifact" - return $false - } - } - catch - { - LogError "Exception while updating checking if package can be documented: $($package.packageGroupId):$($package.packageArtifactId)" - LogError $_ - LogError $_.ScriptStackTrace - return $false - } - - return $true -} - -function PackageDependenciesResolve($artifactNamePrefix, $packageDirectory) { - - $pomArtifactName = "${artifactNamePrefix}:pom" - $artifactDownloadOutput = mvn ` - dependency:copy ` - -Dartifact="$pomArtifactName" ` - -DoutputDirectory="$packageDirectory" - - if ($LASTEXITCODE) { - LogWarning "Could not download pom artifact: $pomArtifactName" - $artifactDownloadOutput | Write-Host - return $false - } - - $downloadedPomPath = (Get-ChildItem -File -Path $packageDirectory -Filter '*.pom')[0] - - # -P '!azure-mgmt-sdk-test-jar' excludes the unpublished test jar from - # dependencies - $copyDependencyOutput = mvn ` - -f $downloadedPomPath ` - dependency:copy-dependencies ` - -P '!azure-mgmt-sdk-test-jar' ` - -DoutputDirectory="$packageDirectory" - - if ($LASTEXITCODE) { - LogWarning "Could not resolve dependencies for: $pomArtifactName" - $copyDependencyOutput | Write-Host - return $false - } - - return $true -} - -function ValidatePackage($groupId, $artifactId, $version, $DocValidationImageId) { - return ValidatePackages @{ Group = $groupId; Name = $artifactId; Version = $version; } $DocValidationImageId -} - -function ValidatePackages([array]$packageInfos, $DocValidationImageId) { - $workingDirectory = Join-Path ([System.IO.Path]::GetTempPath()) "validation" - if (!(Test-Path $workingDirectory)) { - New-Item -ItemType Directory -Force -Path $workingDirectory | Out-Null - } - - # Add more validation by replicating as much of the docs CI process as - # possible - # https://github.com/Azure/azure-sdk-for-python/issues/20109 - if (!$DocValidationImageId) - { - return FallbackValidation -packageInfos $packageInfos -workingDirectory $workingDirectory - } - else - { - return DockerValidation -packageInfos $packageInfos -DocValidationImageId $DocValidationImageId -workingDirectory $workingDirectory - } -} - -function FallbackValidation ($packageInfos, $workingDirectory) { - $results = @() - - foreach ($packageInfo in $packageInfos) { - $groupId = $packageInfo.Group - $artifactId = $packageInfo.Name - $version = $packageInfo.Version - - Write-Host "Validating using mvn command directly on $artifactId." - - $artifactNamePrefix = "${groupId}:${artifactId}:${version}" - - $packageDirectory = Join-Path $workingDirectory "${groupId}__${artifactId}__${version}" - New-Item -ItemType Directory -Path $packageDirectory -Force | Out-Null - - $isValid = (SourcePackageHasComFolder $artifactNamePrefix $packageDirectory) ` - -and (PackageDependenciesResolve $artifactNamePrefix $packageDirectory) - - if (!$isValid) { - LogWarning "Package $artifactNamePrefix ref docs validation failed." - } - - $results += $isValid - } - - $allValid = $results.Where({ $_ -eq $false }).Count -eq 0 - - return $allValid -} - -function DockerValidation ($packageInfos, $DocValidationImageId, $workingDirectory) { - Write-Host "Validating $($packageInfos.Length) package(s) using $DocValidationImageId." - - $containerWorkingDirectory = '/workdir/out' - $configurationFileName = 'configuration.json' - - $hostConfigurationPath = Join-Path $workingDirectory $configurationFileName - - # Cannot use Join-Path because the container and host path separators may differ - $containerConfigurationPath = "$containerWorkingDirectory/$configurationFileName" - - $configuration = [ordered]@{ - "output_path" = "docs-ref-autogen"; - "packages" = @($packageInfos | ForEach-Object { [ordered]@{ - packageGroupId = $_.Group; - packageArtifactId = $_.Name; - packageVersion = $_.Version; - packageDownloadUrl = $PackageRepositoryUri; - } }); - } - - Set-Content -Path $hostConfigurationPath -Value ($configuration | ConvertTo-Json) | Out-Null - - docker run -v "${workingDirectory}:${containerWorkingDirectory}" ` - -e TARGET_CONFIGURATION_PATH=$containerConfigurationPath $DocValidationImageId 2>&1 ` - | Where-Object { -not ($_ -match '^Progress .*B\s*$') } ` # Remove progress messages - | Out-Host - - if ($LASTEXITCODE -ne 0) { - LogWarning "The `docker` command failed with exit code $LASTEXITCODE." - - # The docker exit codes: https://docs.docker.com/engine/reference/run/#exit-status - # If the docker validation failed because of docker itself instead of the application, or if we don't know which - # package failed, fall back to mvn validation - if ($LASTEXITCODE -in 125..127 -Or $packageInfos.Length -gt 1) { - return FallbackValidation -packageInfos $packageInfos -workingDirectory $workingDirectory - } - - return $false - } - - return $true -} - -function Update-java-DocsMsPackages($DocsRepoLocation, $DocsMetadata, $DocValidationImageId) { - Write-Host "Excluded packages:" - foreach ($excludedPackage in $PackageExclusions.Keys) { - Write-Host " $excludedPackage - $($PackageExclusions[$excludedPackage])" - } - - # Also exclude 'spring' packages - # https://github.com/Azure/azure-sdk-for-java/issues/23087 - $FilteredMetadata = $DocsMetadata.Where({ !($PackageExclusions.ContainsKey($_.Package) -or $_.Type -eq 'spring') }) - - UpdateDocsMsPackages ` - (Join-Path $DocsRepoLocation 'package.json') ` - 'preview' ` - $FilteredMetadata ` - $DocValidationImageId - - UpdateDocsMsPackages ` - (Join-Path $DocsRepoLocation 'package.json') ` - 'latest' ` - $FilteredMetadata ` - $DocValidationImageId -} - -function UpdateDocsMsPackages($DocConfigFile, $Mode, $DocsMetadata, $DocValidationImageId) { - $packageConfig = Get-Content $DocConfigFile -Raw | ConvertFrom-Json - - $packageOutputPath = 'docs-ref-autogen' - if ($Mode -eq 'preview') { - $packageOutputPath = 'preview/docs-ref-autogen' - } - $targetPackageList = $packageConfig.Where({ $_.output_path -eq $packageOutputPath}) - if ($targetPackageList.Length -eq 0) { - LogError "Unable to find package config for $packageOutputPath in $DocConfigFile" - exit 1 - } elseif ($targetPackageList.Length -gt 1) { - LogError "Found multiple package configs for $packageOutputPath in $DocConfigFile" - exit 1 - } - - $targetPackageList = $targetPackageList[0] - - $outputPackages = @() - foreach ($package in $targetPackageList.packages) { - $packageGroupId = $package.packageGroupId - $packageName = $package.packageArtifactId - - $matchingPublishedPackageArray = $DocsMetadata.Where({ - $_.Package -eq $packageName -and $_.GroupId -eq $packageGroupId - }) - - # If this package does not match any published packages keep it in the list. - # This handles packages which are not tracked in metadata but still need to - # be built in Docs CI. - if ($matchingPublishedPackageArray.Count -eq 0) { - Write-Host "Keep non-tracked package: $packageName" - $outputPackages += $package - continue - } - - if ($matchingPublishedPackageArray.Count -gt 1) { - LogWarning "Found more than one matching published package in metadata for $packageName; only updating first entry" - } - $matchingPublishedPackage = $matchingPublishedPackageArray[0] - - if ($Mode -eq 'preview' -and !$matchingPublishedPackage.VersionPreview.Trim()) { - # If we are in preview mode and the package does not have a superseding - # preview version, remove the package from the list. - Write-Host "Remove superseded preview package: $packageName" - continue - } - - if ($Mode -eq 'latest' -and !$matchingPublishedPackage.VersionGA.Trim()) { - LogWarning "Metadata is missing GA version for GA package $packageName. Keeping existing package." - $outputPackages += $package - continue - } - - $packageVersion = $($matchingPublishedPackage.VersionGA) - if ($Mode -eq 'preview') { - if (!$matchingPublishedPackage.VersionPreview.Trim()) { - LogWarning "Metadata is missing preview version for preview package $packageName. Keeping existing package." - $outputPackages += $package - continue - } - $packageVersion = $matchingPublishedPackage.VersionPreview - } - - # If upgrading the package, run basic sanity checks against the package - if ($package.packageVersion -ne $packageVersion) { - Write-Host "Validating new version detected for $packageName ($packageVersion)" - $validatePackageResult = ValidatePackage $package.packageGroupId $package.packageArtifactId $packageVersion $DocValidationImageId - - if (!$validatePackageResult) { - LogWarning "Package is not valid: $packageName. Keeping old version." - $outputPackages += $package - continue - } - - $package.packageVersion = $packageVersion - } - - Write-Host "Keeping tracked package: $packageName." - $outputPackages += $package - } - - $outputPackagesHash = @{} - foreach ($package in $outputPackages) { - $outputPackagesHash["$($package.packageGroupId):$($package.packageArtifactId)"] = $true - } - - $remainingPackages = @() - if ($Mode -eq 'preview') { - $remainingPackages = $DocsMetadata.Where({ - ![string]::IsNullOrWhiteSpace($_.VersionPreview) -and !$outputPackagesHash.ContainsKey("$($_.GroupId):$($_.Package)") - }) - } else { - $remainingPackages = $DocsMetadata.Where({ - ![string]::IsNullOrWhiteSpace($_.VersionGA) -and !$outputPackagesHash.ContainsKey("$($_.GroupId):$($_.Package)") - }) - } - - # Add packages that exist in the metadata but are not onboarded in docs config - foreach ($package in $remainingPackages) { - $packageName = $package.Package - $packageGroupId = $package.GroupId - $packageVersion = $package.VersionGA - if ($Mode -eq 'preview') { - $packageVersion = $package.VersionPreview - } - - Write-Host "Validating new package $($packageGroupId):$($packageName):$($packageVersion)" - $validatePackageResult = ValidatePackage $packageGroupId $packageName $packageVersion $DocValidationImageId - if (!$validatePackageResult) { - LogWarning "Package is not valid: ${packageGroupId}:$packageName. Cannot onboard." - continue - } - - Write-Host "Add new package from metadata: ${packageGroupId}:$packageName" - $package = [ordered]@{ - packageArtifactId = $packageName - packageGroupId = $packageGroupId - packageVersion = $packageVersion - packageDownloadUrl = $PackageRepositoryUri - } - - $outputPackages += $package - } - - $targetPackageList.packages = $outputPackages - - # It is assumed that there is a matching config from above when the number of - # matching $targetPackageList is 1 - foreach ($config in $packageConfig) { - if ($config.output_path -eq $packageOutputPath) { - $config = $targetPackageList - break - } - } - - $outputJson = ConvertTo-Json $packageConfig -Depth 100 - Set-Content -Path $DocConfigFile -Value $outputJson - Write-Host "Onboarding configuration $Mode written to: $DocConfigFile" -} - # function is used to filter packages to submit to API view tool function Find-java-Artifacts-For-Apireview($artifactDir, $pkgName) { @@ -754,6 +352,8 @@ function GetExistingPackageVersions ($PackageName, $GroupId=$null) } } +# Defined in common.ps1 +# $GetDocsMsMetadataForPackageFn = "Get-${Language}-DocsMsMetadataForPackage" function Get-java-DocsMsMetadataForPackage($PackageInfo) { $readmeName = $PackageInfo.Name.ToLower() Write-Host "Docs.ms Readme name: $($readmeName)" @@ -787,12 +387,81 @@ function Validate-java-DocMsPackages ($PackageInfo, $PackageInfos, $DocValidatio $PackageInfos = @($PackageInfo) } - if (!(ValidatePackages $PackageInfos $DocValidationImageId)) { - Write-Error "Package validation failed" -ErrorAction Continue + # The install-rex-validation-tool.yml will install the java2docfx jar file into the Build.BinariesDirectory + # which is a DevOps variable for the directory. In PS that variable is BUILD_BINARIESDIRECTORY. + # The reason why this is necessary is that the command for java2docfx is in the following format: + # java –jar java2docfx-1.0.0.jar.jar --packagesJsonFile "C\temp\package.json" + # or + # java –jar java2docfx-1.0.0.jar --package "::" + # which means we need to know where, exactly, because the java command requires the full path + # to the jar file as an argument + $java2docfxJar = $null + if (!$Env:BUILD_BINARIESDIRECTORY) { + LogError "Env:BUILD_BINARIESDIRECTORY is not set and this is where the java2docfx jar file should be installed." + return $false + } + $java2docfxDir = Join-Path $Env:BUILD_BINARIESDIRECTORY "java2docfx" + if (!(Test-Path $java2docfxDir)) { + LogError "There should be a java2docfx directory under Env:BUILD_BINARIESDIRECTORY. Ensure that the /eng/pipelines/templates/steps/install-rex-validation-tool.yml template was run prior to whatever step is running this." + return $false + } + $java2docfxJarLoc = @(Get-ChildItem -Path $java2docfxDir -File -Filter "java2docfx*.jar") + if (!$java2docfxJarLoc) { + LogError "The java2docfx jar file should be installed in $java2docfxDir and is not there." return $false + } else { + # In theory, this shouldn't happen as the install-rex-validation-tool.yml is the only thing + # that'll ever install the jar + if ($java2docfxJarLoc.Count -gt 1) { + Write-Host "There were $($java2docfxJarLoc.Count) java2docfx jar files found in $Build_BinariesDirectory, using the first one" + } + $java2docfxJar = $java2docfxJarLoc[0] + Write-Host "java2docfx jar location=$java2docfxJar" + } + + $allSuccess = $true + $originLocation = Get-Location + foreach ($packageInfo in $PackageInfos) { + $artifact = "$($packageInfo.Group):$($packageInfo.Name):$($packageInfo.Version)" + $tempDirectory = Join-Path ([System.IO.Path]::GetTempPath()) "$($packageInfo.Group)-$($packageInfo.Name)-$($packageInfo.Version)" + New-Item $tempDirectory -ItemType Directory | Out-Null + # Set the location to the temp directory. The reason being is that it'll effectively be empty, no + # other jars, no POM files aka nothing Java related to pick up. + Set-Location $tempDirectory + try { + Write-Host "Calling java2docfx for $artifact" + Write-Host "java -jar ""$java2docfxJar"" -p ""$artifact""" + $java2docfxResults = java ` + -jar "$java2docfxJar"` + -p "$artifact" + # JRS-TODO: The -o option is something I'm currently questioning the behavior of but + # I can do some initial testing without that option being set + # -p "$artifact" ` + # -o "$tempDirectory" + + if ($LASTEXITCODE -ne 0) { + LogWarning "java2docfx failed for $artifact" + $java2docfxResults | Write-Host + $allSuccess = $false + } + } + catch { + LogError "Exception while trying to download: $artifact" + LogError $_ + LogError $_.ScriptStackTrace + $allSuccess = $false + } + finally { + # Ensure that the origianl location is restored + Set-Location $originLocation + # everything is contained within the temp directory, clean it up every time + if (Test-Path $tempDirectory) { + Remove-Item $tempDirectory -Recurse -Force + } + } } - return $true + return $allSuccess } function Get-java-EmitterName() { diff --git a/eng/scripts/docs/java2docfx.version.txt b/eng/scripts/docs/java2docfx.version.txt new file mode 100644 index 000000000000..a6a3a43c3a04 --- /dev/null +++ b/eng/scripts/docs/java2docfx.version.txt @@ -0,0 +1 @@ +1.0.4 \ No newline at end of file diff --git a/eng/versioning/external_dependencies.txt b/eng/versioning/external_dependencies.txt index d5644c733269..4300df19b15d 100644 --- a/eng/versioning/external_dependencies.txt +++ b/eng/versioning/external_dependencies.txt @@ -54,7 +54,7 @@ commons-codec:commons-codec;1.15 commons-net:commons-net;3.9.0 io.cloudevents:cloudevents-api;2.2.0 io.cloudevents:cloudevents-core;2.2.0 -io.fabric8:kubernetes-client;5.12.3 +io.fabric8:kubernetes-client;6.12.1 io.micrometer:micrometer-core;1.9.17 io.micrometer:micrometer-registry-azure-monitor;1.9.17 io.micrometer:micrometer-registry-graphite;1.9.17 diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index bc256bc3f118..0566ad82773d 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -110,7 +110,7 @@ com.azure.cosmos.spark:azure-cosmos-spark_3-2_2-12;4.30.0;4.31.0-beta.1 com.azure.cosmos.spark:azure-cosmos-spark_3-3_2-12;4.30.0;4.31.0-beta.1 com.azure.cosmos.spark:azure-cosmos-spark_3-4_2-12;4.30.0;4.31.0-beta.1 com.azure.cosmos.spark:azure-cosmos-spark_3-5_2-12;4.30.0;4.31.0-beta.1 -com.azure:azure-cosmos-test;1.0.0-beta.6;1.0.0-beta.7 +com.azure:azure-cosmos-test;1.0.0-beta.7;1.0.0-beta.8 com.azure:azure-cosmos-tests;1.0.0-beta.1;1.0.0-beta.1 com.azure.cosmos.kafka:azure-cosmos-kafka-connect;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-data-appconfiguration;1.6.0;1.7.0-beta.1 @@ -155,7 +155,7 @@ com.azure:azure-messaging-eventhubs-checkpointstore-jedis;1.0.0-beta.2;1.0.0-bet com.azure:azure-messaging-eventhubs-stress;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-eventhubs-track1-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-eventhubs-track2-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-messaging-servicebus;7.16.0;7.17.0-beta.1 +com.azure:azure-messaging-servicebus;7.17.0;7.18.0-beta.1 com.azure:azure-messaging-servicebus-stress;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-servicebus-track1-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-servicebus-track2-perf;1.0.0-beta.1;1.0.0-beta.1 @@ -170,7 +170,7 @@ com.azure:azure-monitor-query;1.3.1;1.4.0-beta.1 com.azure:azure-monitor-query-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-perf-test-parent;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-quantum-jobs;1.0.0-beta.1;1.0.0-beta.2 -com.azure:azure-search-documents;11.6.4;11.7.0-beta.3 +com.azure:azure-search-documents;11.6.4;11.7.0-beta.4 com.azure:azure-search-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-security-attestation;1.1.23;1.2.0-beta.1 com.azure:azure-security-confidentialledger;1.0.19;1.1.0-beta.1 @@ -184,7 +184,7 @@ com.azure:azure-security-keyvault-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-sdk-template;1.1.1234;1.2.2-beta.1 com.azure:azure-sdk-template-two;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-sdk-template-three;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-spring-data-cosmos;3.44.0;3.45.0-beta.1 +com.azure:azure-spring-data-cosmos;3.45.0;3.46.0-beta.1 com.azure:azure-storage-blob;12.25.4;12.26.0-beta.2 com.azure:azure-storage-blob-batch;12.21.4;12.22.0-beta.2 com.azure:azure-storage-blob-changefeed;12.0.0-beta.20;12.0.0-beta.21 @@ -208,58 +208,58 @@ com.azure:identity-test-vm;1.0-SNAPSHOT;1.0-SNAPSHOT com.azure:identity-test-webapp;0.0.1-SNAPSHOT;0.0.1-SNAPSHOT com.azure.spring:azure-monitor-spring-native;1.0.0-beta.1;1.0.0-beta.1 com.azure.spring:azure-monitor-spring-native-test;1.0.0-beta.1;1.0.0-beta.1 -com.azure.spring:spring-cloud-azure-appconfiguration-config-web;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-appconfiguration-config;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-feature-management-web;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-feature-management;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-appconfiguration-config;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-dependencies;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-messaging-azure;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-messaging-azure-eventhubs;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-messaging-azure-servicebus;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-messaging-azure-storage-queue;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-integration-azure-core;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-integration-azure-eventhubs;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-integration-azure-servicebus;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-integration-azure-storage-queue;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-core;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-actuator-autoconfigure;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-actuator;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-autoconfigure;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-resourcemanager;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-service;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-active-directory;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-active-directory-b2c;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-actuator;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-appconfiguration;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-cosmos;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-data-cosmos;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-eventhubs;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-eventgrid;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-jdbc-mysql;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-jdbc-postgresql;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-redis;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-keyvault;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-keyvault-certificates;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-keyvault-secrets;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-appconfiguration-config-web;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-appconfiguration-config;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-feature-management-web;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-feature-management;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-appconfiguration-config;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-dependencies;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-messaging-azure;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-messaging-azure-eventhubs;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-messaging-azure-servicebus;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-messaging-azure-storage-queue;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-integration-azure-core;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-integration-azure-eventhubs;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-integration-azure-servicebus;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-integration-azure-storage-queue;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-core;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-actuator-autoconfigure;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-actuator;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-autoconfigure;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-resourcemanager;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-service;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-active-directory;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-active-directory-b2c;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-actuator;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-appconfiguration;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-cosmos;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-data-cosmos;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-eventhubs;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-eventgrid;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-jdbc-mysql;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-jdbc-postgresql;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-redis;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-keyvault;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-keyvault-certificates;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-keyvault-secrets;4.18.0;4.19.0-beta.1 com.azure.spring:spring-cloud-azure-starter-monitor;1.0.0-beta.5;1.0.0-beta.6 -com.azure.spring:spring-cloud-azure-starter-servicebus-jms;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-servicebus;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-storage;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-storage-blob;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-storage-file-share;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-storage-queue;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-integration-eventhubs;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-integration-servicebus;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-integration-storage-queue;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-stream-eventhubs;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-stream-servicebus;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-starter;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-stream-binder-eventhubs-core;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-stream-binder-eventhubs;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-stream-binder-servicebus-core;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-stream-binder-servicebus;4.17.0;4.18.0-beta.1 -com.azure.spring:spring-cloud-azure-trace-sleuth;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-servicebus-jms;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-servicebus;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-storage;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-storage-blob;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-storage-file-share;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-storage-queue;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-integration-eventhubs;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-integration-servicebus;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-integration-storage-queue;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-stream-eventhubs;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-stream-servicebus;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-starter;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-stream-binder-eventhubs-core;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-stream-binder-eventhubs;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-stream-binder-servicebus-core;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-stream-binder-servicebus;4.18.0;4.19.0-beta.1 +com.azure.spring:spring-cloud-azure-trace-sleuth;4.18.0;4.19.0-beta.1 com.azure.resourcemanager:azure-resourcemanager;2.38.0;2.39.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-appplatform;2.38.0;2.39.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-appservice;2.38.0;2.39.0-beta.1 diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationAsyncClient.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationAsyncClient.java index ef014fb4d65e..e044d4ca5cc4 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationAsyncClient.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationAsyncClient.java @@ -21,8 +21,10 @@ import com.azure.core.util.polling.PollOperationDetails; import com.azure.core.util.polling.PollerFlux; import com.azure.data.appconfiguration.implementation.AzureAppConfigurationImpl; +import com.azure.data.appconfiguration.implementation.ConfigurationSettingDeserializationHelper; import com.azure.data.appconfiguration.implementation.CreateSnapshotUtilClient; import com.azure.data.appconfiguration.implementation.SyncTokenPolicy; +import com.azure.data.appconfiguration.implementation.Utility; import com.azure.data.appconfiguration.implementation.models.GetKeyValueHeaders; import com.azure.data.appconfiguration.implementation.models.KeyValue; import com.azure.data.appconfiguration.models.ConfigurationSetting; @@ -44,13 +46,9 @@ import static com.azure.core.util.FluxUtil.monoError; import static com.azure.core.util.FluxUtil.withContext; -import static com.azure.data.appconfiguration.implementation.ConfigurationSettingDeserializationHelper.toConfigurationSettingWithPagedResponse; -import static com.azure.data.appconfiguration.implementation.ConfigurationSettingDeserializationHelper.toConfigurationSettingWithResponse; import static com.azure.data.appconfiguration.implementation.Utility.ETAG_ANY; -import static com.azure.data.appconfiguration.implementation.Utility.addTracingNamespace; import static com.azure.data.appconfiguration.implementation.Utility.getETag; import static com.azure.data.appconfiguration.implementation.Utility.getPageETag; -import static com.azure.data.appconfiguration.implementation.Utility.handleNotModifiedErrorToValidResponse; import static com.azure.data.appconfiguration.implementation.Utility.toKeyValue; import static com.azure.data.appconfiguration.implementation.Utility.toSettingFieldsList; import static com.azure.data.appconfiguration.implementation.Utility.updateSnapshotAsync; @@ -354,7 +352,7 @@ public Mono addConfigurationSetting(String key, String lab /** * Adds a configuration value in the service if that key and label does not exist. The label value of the * ConfigurationSetting is optional. - * + *

* For more configuration setting types, see {@link FeatureFlagConfigurationSetting} and * {@link SecretReferenceConfigurationSetting}. * @@ -391,7 +389,7 @@ public Mono addConfigurationSetting(ConfigurationSetting s /** * Adds a configuration value in the service if that key and label does not exist. The label value of the * ConfigurationSetting is optional. - * + *

* For more configuration setting types, see {@link FeatureFlagConfigurationSetting} and * {@link SecretReferenceConfigurationSetting}. * @@ -429,9 +427,8 @@ public Mono> addConfigurationSettingWithResponse( return withContext( context -> validateSettingAsync(setting).flatMap( settingInternal -> serviceClient.putKeyValueWithResponseAsync(settingInternal.getKey(), - settingInternal.getLabel(), null, ETAG_ANY, toKeyValue(settingInternal), - addTracingNamespace(context)) - .map(response -> toConfigurationSettingWithResponse(response)))); + settingInternal.getLabel(), null, ETAG_ANY, toKeyValue(settingInternal), context) + .map(ConfigurationSettingDeserializationHelper::toConfigurationSettingWithResponse))); } /** @@ -471,7 +468,7 @@ public Mono setConfigurationSetting(String key, String lab /** * Creates or updates a configuration value in the service. Partial updates are not supported and the entire * configuration setting is updated. - * + *

* For more configuration setting types, see {@link FeatureFlagConfigurationSetting} and * {@link SecretReferenceConfigurationSetting}. * @@ -515,10 +512,10 @@ public Mono setConfigurationSetting(ConfigurationSetting s /** * Creates or updates a configuration value in the service. Partial updates are not supported and the entire * configuration setting is updated. - * + *

* For more configuration setting types, see {@link FeatureFlagConfigurationSetting} and * {@link SecretReferenceConfigurationSetting}. - * + *

* If {@link ConfigurationSetting#getETag() ETag} is specified, the configuration value is updated if the current * setting's ETag matches. If the ETag's value is equal to the wildcard character ({@code "*"}), the setting will * always be updated. @@ -574,8 +571,8 @@ public Mono> setConfigurationSettingWithResponse( context -> validateSettingAsync(setting).flatMap( settingInternal -> serviceClient.putKeyValueWithResponseAsync(settingInternal.getKey(), settingInternal.getLabel(), getETag(ifUnchanged, settingInternal), null, - toKeyValue(settingInternal), addTracingNamespace(context)) - .map(response -> toConfigurationSettingWithResponse(response)))); + toKeyValue(settingInternal), context) + .map(ConfigurationSettingDeserializationHelper::toConfigurationSettingWithResponse))); } /** @@ -716,25 +713,20 @@ public Mono getConfigurationSetting(ConfigurationSetting s @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getConfigurationSettingWithResponse(ConfigurationSetting setting, OffsetDateTime acceptDateTime, boolean ifChanged) { - return withContext( - context -> validateSettingAsync(setting).flatMap( - settingInternal -> - serviceClient.getKeyValueWithResponseAsync(settingInternal.getKey(), settingInternal.getLabel(), - acceptDateTime == null ? null : acceptDateTime.toString(), null, - getETag(ifChanged, settingInternal), null, addTracingNamespace(context)) - .onErrorResume( - HttpResponseException.class, - (Function>>) throwable -> { - HttpResponseException e = (HttpResponseException) throwable; - HttpResponse httpResponse = e.getResponse(); - if (httpResponse.getStatusCode() == 304) { - return Mono.just(new ResponseBase( - httpResponse.getRequest(), httpResponse.getStatusCode(), - httpResponse.getHeaders(), null, null)); - } - return Mono.error(throwable); - }) - .map(response -> toConfigurationSettingWithResponse(response)))); + return withContext(context -> validateSettingAsync(setting).flatMap(settingInternal -> + serviceClient.getKeyValueWithResponseAsync(settingInternal.getKey(), settingInternal.getLabel(), + acceptDateTime == null ? null : acceptDateTime.toString(), null, + getETag(ifChanged, settingInternal), null, context) + .onErrorResume(HttpResponseException.class, + (Function>>) throwable -> { + HttpResponseException e = (HttpResponseException) throwable; + HttpResponse httpResponse = e.getResponse(); + if (httpResponse.getStatusCode() == 304) { + return Mono.just(new ResponseBase(httpResponse.getRequest(), + httpResponse.getStatusCode(), httpResponse.getHeaders(), null, null)); + } + return Mono.error(throwable); + }).map(ConfigurationSettingDeserializationHelper::toConfigurationSettingWithResponse))); } /** @@ -770,7 +762,7 @@ public Mono deleteConfigurationSetting(String key, String * {@link ConfigurationSetting#getLabel() label} and optional ETag combination from the service. * For more configuration setting types, see {@link FeatureFlagConfigurationSetting} and * {@link SecretReferenceConfigurationSetting}. - * + *

* If {@link ConfigurationSetting#getETag() ETag} is specified and is not the wildcard character ({@code "*"}), then * the setting is only deleted if the ETag matches the current ETag; this means that no one has updated the * ConfigurationSetting yet. @@ -809,10 +801,10 @@ public Mono deleteConfigurationSetting(ConfigurationSettin /** * Deletes the {@link ConfigurationSetting} with a matching {@link ConfigurationSetting#getKey() key}, and optional * {@link ConfigurationSetting#getLabel() label} and optional ETag combination from the service. - * + *

* For more configuration setting types, see {@link FeatureFlagConfigurationSetting} and * {@link SecretReferenceConfigurationSetting}. - * + *

* If {@link ConfigurationSetting#getETag() ETag} is specified and is not the wildcard character ({@code "*"}), then * the setting is only deleted if the ETag matches the current ETag; this means that no one has updated the * ConfigurationSetting yet. @@ -855,8 +847,8 @@ public Mono> deleteConfigurationSettingWithRespon boolean ifUnchanged) { return withContext(context -> validateSettingAsync(setting).flatMap( settingInternal -> serviceClient.deleteKeyValueWithResponseAsync(settingInternal.getKey(), - settingInternal.getLabel(), getETag(ifUnchanged, settingInternal), addTracingNamespace(context)) - .map(response -> toConfigurationSettingWithResponse(response)))); + settingInternal.getLabel(), getETag(ifUnchanged, settingInternal), context) + .map(ConfigurationSettingDeserializationHelper::toConfigurationSettingWithResponse))); } /** @@ -901,7 +893,7 @@ public Mono setReadOnly(String key, String label, boolean /** * Sets the read-only status for the {@link ConfigurationSetting}. - * + *

* For more configuration setting types, see {@link FeatureFlagConfigurationSetting} and * {@link SecretReferenceConfigurationSetting}. * @@ -949,7 +941,7 @@ public Mono setReadOnly(ConfigurationSetting setting, bool /** * Sets the read-only status for the {@link ConfigurationSetting}. - * + *

* For more configuration setting types, see {@link FeatureFlagConfigurationSetting} and * {@link SecretReferenceConfigurationSetting}. * @@ -1000,16 +992,14 @@ public Mono setReadOnly(ConfigurationSetting setting, bool @ServiceMethod(returns = ReturnType.SINGLE) public Mono> setReadOnlyWithResponse(ConfigurationSetting setting, boolean isReadOnly) { - return withContext(context -> validateSettingAsync(setting).flatMap( - settingInternal -> { - final String key = settingInternal.getKey(); - final String label = settingInternal.getLabel(); - final Context contextInternal = addTracingNamespace(context); - return (isReadOnly - ? serviceClient.putLockWithResponseAsync(key, label, null, null, contextInternal) - : serviceClient.deleteLockWithResponseAsync(key, label, null, null, contextInternal)) - .map(response -> toConfigurationSettingWithResponse(response)); - })); + return withContext(context -> validateSettingAsync(setting).flatMap(settingInternal -> { + final String key = settingInternal.getKey(); + final String label = settingInternal.getLabel(); + return (isReadOnly + ? serviceClient.putLockWithResponseAsync(key, label, null, null, context) + : serviceClient.deleteLockWithResponseAsync(key, label, null, null, context)) + .map(ConfigurationSettingDeserializationHelper::toConfigurationSettingWithResponse); + })); } /** @@ -1042,31 +1032,19 @@ public PagedFlux listConfigurationSettings(SettingSelector final List settingFields = selector == null ? null : toSettingFieldsList(selector.getFields()); final List matchConditionsList = selector == null ? null : selector.getMatchConditions(); AtomicInteger pageETagIndex = new AtomicInteger(0); - return new PagedFlux<>( - () -> withContext(context -> serviceClient.getKeyValuesSinglePageAsync( - keyFilter, - labelFilter, - null, - acceptDateTime, - settingFields, - null, - null, - getPageETag(matchConditionsList, pageETagIndex), - addTracingNamespace(context)) - .onErrorResume(HttpResponseException.class, - (Function>>) throwable -> - handleNotModifiedErrorToValidResponse(throwable)) - .map(pagedResponse -> toConfigurationSettingWithPagedResponse(pagedResponse))), - nextLink -> withContext(context -> serviceClient.getKeyValuesNextSinglePageAsync( - nextLink, - acceptDateTime, - null, - getPageETag(matchConditionsList, pageETagIndex), - addTracingNamespace(context)) - .onErrorResume(HttpResponseException.class, - (Function>>) throwable -> - handleNotModifiedErrorToValidResponse(throwable)) - .map(pagedResponse -> toConfigurationSettingWithPagedResponse(pagedResponse))) + return new PagedFlux<>(() -> withContext(context -> serviceClient.getKeyValuesSinglePageAsync(keyFilter, + labelFilter, null, acceptDateTime, settingFields, null, null, + getPageETag(matchConditionsList, pageETagIndex), context) + .onErrorResume(HttpResponseException.class, + (Function>>) + Utility::handleNotModifiedErrorToValidResponse) + .map(ConfigurationSettingDeserializationHelper::toConfigurationSettingWithPagedResponse)), + nextLink -> withContext(context -> serviceClient.getKeyValuesNextSinglePageAsync(nextLink, + acceptDateTime, null, getPageETag(matchConditionsList, pageETagIndex), context) + .onErrorResume(HttpResponseException.class, + (Function>>) + Utility::handleNotModifiedErrorToValidResponse) + .map(ConfigurationSettingDeserializationHelper::toConfigurationSettingWithPagedResponse)) ); } @@ -1124,29 +1102,13 @@ public PagedFlux listConfigurationSettingsForSnapshot(Stri */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listConfigurationSettingsForSnapshot(String snapshotName, - List fields) { - return new PagedFlux<>( - () -> withContext( - context -> serviceClient.getKeyValuesSinglePageAsync( - null, - null, - null, - null, - fields, - snapshotName, - null, - null, - addTracingNamespace(context)) - .map(pagedResponse -> toConfigurationSettingWithPagedResponse(pagedResponse))), - nextLink -> withContext( - context -> serviceClient.getKeyValuesNextSinglePageAsync( - nextLink, - null, - null, - null, - addTracingNamespace(context)) - .map(pagedResponse -> toConfigurationSettingWithPagedResponse(pagedResponse))) - ); + List fields) { + return new PagedFlux<>(() -> withContext(context -> serviceClient.getKeyValuesSinglePageAsync(null, null, null, + null, fields, snapshotName, null, null, context) + .map(ConfigurationSettingDeserializationHelper::toConfigurationSettingWithPagedResponse)), + nextLink -> withContext(context -> serviceClient.getKeyValuesNextSinglePageAsync(nextLink, null, null, null, + context) + .map(ConfigurationSettingDeserializationHelper::toConfigurationSettingWithPagedResponse))); } /** @@ -1154,7 +1116,7 @@ public PagedFlux listConfigurationSettingsForSnapshot(Stri * in descending order from their {@link ConfigurationSetting#getLastModified() lastModified} date. * Revisions expire after a period of time, see Pricing * for more information. - * + *

* If {@code selector} is {@code null}, then all the {@link ConfigurationSetting ConfigurationSettings} are fetched * in their current state. Otherwise, the results returned match the parameters given in {@code selector}. * @@ -1181,21 +1143,12 @@ public PagedFlux listRevisions(SettingSelector selector) { final String labelFilter = selector == null ? null : selector.getLabelFilter(); final String acceptDateTime = selector == null ? null : selector.getAcceptDateTime(); final List settingFields = selector == null ? null : toSettingFieldsList(selector.getFields()); - return new PagedFlux<>( - () -> withContext( - context -> serviceClient.getRevisionsSinglePageAsync( - keyFilter, - labelFilter, - null, - acceptDateTime, - settingFields, - addTracingNamespace(context)) - .map(pagedResponse -> toConfigurationSettingWithPagedResponse(pagedResponse))), - nextLink -> withContext( - context -> - serviceClient.getRevisionsNextSinglePageAsync(nextLink, acceptDateTime, - addTracingNamespace(context)) - .map(pagedResponse -> toConfigurationSettingWithPagedResponse(pagedResponse)))); + return new PagedFlux<>(() -> withContext(context -> serviceClient.getRevisionsSinglePageAsync(keyFilter, + labelFilter, null, acceptDateTime, settingFields, context) + .map(ConfigurationSettingDeserializationHelper::toConfigurationSettingWithPagedResponse)), + nextLink -> withContext(context -> serviceClient.getRevisionsNextSinglePageAsync(nextLink, acceptDateTime, + context) + .map(ConfigurationSettingDeserializationHelper::toConfigurationSettingWithPagedResponse))); } /** @@ -1440,17 +1393,11 @@ public Mono> recoverSnapshotWithResponse( @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listSnapshots(SnapshotSelector selector) { try { - return new PagedFlux<>( - () -> withContext( - context -> serviceClient.getSnapshotsSinglePageAsync( - selector == null ? null : selector.getNameFilter(), - null, - selector == null ? null : selector.getFields(), - selector == null ? null : selector.getStatus(), - addTracingNamespace(context))), - nextLink -> withContext( - context -> serviceClient.getSnapshotsNextSinglePageAsync(nextLink, addTracingNamespace(context))) - ); + return new PagedFlux<>(() -> withContext(context -> serviceClient.getSnapshotsSinglePageAsync( + selector == null ? null : selector.getNameFilter(), null, + selector == null ? null : selector.getFields(), selector == null ? null : selector.getStatus(), + context)), nextLink -> withContext(context -> + serviceClient.getSnapshotsNextSinglePageAsync(nextLink, context))); } catch (RuntimeException ex) { return new PagedFlux<>(() -> monoError(LOGGER, ex)); } diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClient.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClient.java index 94d07ff34f5c..30e97c8af057 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClient.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClient.java @@ -46,8 +46,6 @@ import static com.azure.data.appconfiguration.implementation.ConfigurationSettingDeserializationHelper.toConfigurationSettingWithPagedResponse; import static com.azure.data.appconfiguration.implementation.ConfigurationSettingDeserializationHelper.toConfigurationSettingWithResponse; import static com.azure.data.appconfiguration.implementation.Utility.ETAG_ANY; -import static com.azure.data.appconfiguration.implementation.Utility.addTracingNamespace; -import static com.azure.data.appconfiguration.implementation.Utility.enableSyncRestProxy; import static com.azure.data.appconfiguration.implementation.Utility.getETag; import static com.azure.data.appconfiguration.implementation.Utility.getPageETag; import static com.azure.data.appconfiguration.implementation.Utility.handleNotModifiedErrorToValidResponse; @@ -356,7 +354,7 @@ public ConfigurationSetting addConfigurationSetting(String key, String label, St /** * Adds a configuration value in the service if that key and label does not exist. The label value of the * ConfigurationSetting is optional. - * + *

* For more configuration setting types, see {@link FeatureFlagConfigurationSetting} and * {@link SecretReferenceConfigurationSetting}. * @@ -392,7 +390,7 @@ public ConfigurationSetting addConfigurationSetting(ConfigurationSetting setting /** * Adds a configuration value in the service if that key and label does not exist. The label value of the * ConfigurationSetting is optional. - * + *

* For more configuration setting types, see {@link FeatureFlagConfigurationSetting} and * {@link SecretReferenceConfigurationSetting}. * @@ -433,7 +431,7 @@ public Response addConfigurationSettingWithResponse(Config // return an error. final ResponseBase response = serviceClient.putKeyValueWithResponse(setting.getKey(), setting.getLabel(), null, ETAG_ANY, - toKeyValue(setting), enableSyncRestProxy(addTracingNamespace(context))); + toKeyValue(setting), context); return toConfigurationSettingWithResponse(response); } @@ -475,7 +473,7 @@ public ConfigurationSetting setConfigurationSetting(String key, String label, St /** * Creates or updates a configuration value in the service. Partial updates are not supported and the entire * configuration setting is updated. - * + *

* For more configuration setting types, see {@link FeatureFlagConfigurationSetting} and * {@link SecretReferenceConfigurationSetting}. * @@ -521,10 +519,10 @@ public ConfigurationSetting setConfigurationSetting(ConfigurationSetting setting /** * Creates or updates a configuration value in the service. Partial updates are not supported and the entire * configuration setting is updated. - * + *

* For more configuration setting types, see {@link FeatureFlagConfigurationSetting} and * {@link SecretReferenceConfigurationSetting}. - * + *

* If {@link ConfigurationSetting#getETag() ETag} is specified, the configuration value is updated if the current * setting's ETag matches. If the ETag's value is equal to the wildcard character ({@code "*"}), the setting will * always be updated. @@ -578,9 +576,8 @@ public Response setConfigurationSettingWithResponse(Config boolean ifUnchanged, Context context) { validateSetting(setting); final ResponseBase response = - serviceClient.putKeyValueWithResponse(setting.getKey(), setting.getLabel(), - getETag(ifUnchanged, setting), null, toKeyValue(setting), - enableSyncRestProxy(addTracingNamespace(context))); + serviceClient.putKeyValueWithResponse(setting.getKey(), setting.getLabel(), getETag(ifUnchanged, setting), + null, toKeyValue(setting), context); return toConfigurationSettingWithResponse(response); } @@ -646,7 +643,7 @@ public ConfigurationSetting getConfigurationSetting(String key, String label, Of /** * Attempts to get the ConfigurationSetting with a matching {@link ConfigurationSetting#getKey() key}, and optional * {@link ConfigurationSetting#getLabel() label}, optional {@code acceptDateTime} and optional ETag combination. - * + *

* For more configuration setting types, see {@link FeatureFlagConfigurationSetting} and * {@link SecretReferenceConfigurationSetting}. * @@ -681,7 +678,7 @@ public ConfigurationSetting getConfigurationSetting(ConfigurationSetting setting /** * Attempts to get the ConfigurationSetting with a matching {@link ConfigurationSetting#getKey() key}, and optional * {@link ConfigurationSetting#getLabel() label}, optional {@code acceptDateTime} and optional ETag combination. - * + *

* For more configuration setting types, see {@link FeatureFlagConfigurationSetting} and * {@link SecretReferenceConfigurationSetting}. * @@ -725,8 +722,8 @@ public Response getConfigurationSettingWithResponse(Config try { final ResponseBase response = serviceClient.getKeyValueWithResponse(setting.getKey(), setting.getLabel(), - acceptDateTime == null ? null : acceptDateTime.toString(), null, - getETag(ifChanged, setting), null, enableSyncRestProxy(addTracingNamespace(context))); + acceptDateTime == null ? null : acceptDateTime.toString(), null, getETag(ifChanged, setting), null, + context); return toConfigurationSettingWithResponse(response); } catch (HttpResponseException ex) { final HttpResponse httpResponse = ex.getResponse(); @@ -769,7 +766,7 @@ public ConfigurationSetting deleteConfigurationSetting(String key, String label) /** * Deletes the {@link ConfigurationSetting} with a matching {@link ConfigurationSetting#getKey() key}, and optional * {@link ConfigurationSetting#getLabel() label} and optional ETag combination. - * + *

* For more configuration setting types, see {@link FeatureFlagConfigurationSetting} and * {@link SecretReferenceConfigurationSetting}. * @@ -806,10 +803,10 @@ public ConfigurationSetting deleteConfigurationSetting(ConfigurationSetting sett /** * Deletes the {@link ConfigurationSetting} with a matching {@link ConfigurationSetting#getKey() key}, and optional * {@link ConfigurationSetting#getLabel() label} and optional ETag combination. - * + *

* For more configuration setting types, see {@link FeatureFlagConfigurationSetting} and * {@link SecretReferenceConfigurationSetting}. - * + *

* If {@link ConfigurationSetting#getETag() ETag} is specified and is not the wildcard character ({@code "*"}), then * the setting is only deleted if the ETag matches the current ETag; this means that no one has updated the * ConfigurationSetting yet. @@ -852,7 +849,7 @@ public Response deleteConfigurationSettingWithResponse(Con validateSetting(setting); final ResponseBase response = serviceClient.deleteKeyValueWithResponse(setting.getKey(), setting.getLabel(), - getETag(ifUnchanged, setting), enableSyncRestProxy(addTracingNamespace(context))); + getETag(ifUnchanged, setting), context); return toConfigurationSettingWithResponse(response); } @@ -898,7 +895,7 @@ public ConfigurationSetting setReadOnly(String key, String label, boolean isRead /** * Sets the read-only status for the {@link ConfigurationSetting}. - * + *

* For more configuration setting types, see {@link FeatureFlagConfigurationSetting} and * {@link SecretReferenceConfigurationSetting}. * @@ -945,7 +942,7 @@ public ConfigurationSetting setReadOnly(ConfigurationSetting setting, boolean is /** * Sets the read-only status for the {@link ConfigurationSetting}. - * + *

* For more configuration setting types, see {@link FeatureFlagConfigurationSetting} and * {@link SecretReferenceConfigurationSetting}. * @@ -995,7 +992,6 @@ public Response setReadOnlyWithResponse(ConfigurationSetti validateSetting(setting); final String key = setting.getKey(); final String label = setting.getLabel(); - context = enableSyncRestProxy(addTracingNamespace(context)); return isReadOnly ? toConfigurationSettingWithResponse(serviceClient.putLockWithResponse(key, label, null, null, context)) @@ -1061,34 +1057,21 @@ public PagedIterable listConfigurationSettings(SettingSele final List settingFields = selector == null ? null : toSettingFieldsList(selector.getFields()); final List matchConditionsList = selector == null ? null : selector.getMatchConditions(); AtomicInteger pageETagIndex = new AtomicInteger(0); - return new PagedIterable<>( - () -> { - PagedResponse pagedResponse; - try { - pagedResponse = serviceClient.getKeyValuesSinglePage( - keyFilter, - labelFilter, - null, - acceptDateTime, - settingFields, - null, - null, - getPageETag(matchConditionsList, pageETagIndex), - enableSyncRestProxy(addTracingNamespace(context))); - } catch (HttpResponseException ex) { - return handleNotModifiedErrorToValidResponse(ex, LOGGER); - } - return toConfigurationSettingWithPagedResponse(pagedResponse); - }, + return new PagedIterable<>(() -> { + PagedResponse pagedResponse; + try { + pagedResponse = serviceClient.getKeyValuesSinglePage(keyFilter, labelFilter, null, acceptDateTime, + settingFields, null, null, getPageETag(matchConditionsList, pageETagIndex), context); + } catch (HttpResponseException ex) { + return handleNotModifiedErrorToValidResponse(ex, LOGGER); + } + return toConfigurationSettingWithPagedResponse(pagedResponse); + }, nextLink -> { PagedResponse pagedResponse; try { - pagedResponse = serviceClient.getKeyValuesNextSinglePage( - nextLink, - acceptDateTime, - null, - getPageETag(matchConditionsList, pageETagIndex), - enableSyncRestProxy(addTracingNamespace(context))); + pagedResponse = serviceClient.getKeyValuesNextSinglePage(nextLink, acceptDateTime, null, + getPageETag(matchConditionsList, pageETagIndex), context); } catch (HttpResponseException ex) { return handleNotModifiedErrorToValidResponse(ex, LOGGER); } @@ -1152,28 +1135,16 @@ public PagedIterable listConfigurationSettingsForSnapshot( */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listConfigurationSettingsForSnapshot(String snapshotName, - List fields, - Context context) { - return new PagedIterable<>( - () -> { - final PagedResponse pagedResponse = serviceClient.getKeyValuesSinglePage( - null, - null, - null, - null, - fields, - snapshotName, - null, - null, - enableSyncRestProxy(addTracingNamespace(context))); - return toConfigurationSettingWithPagedResponse(pagedResponse); - }, - nextLink -> { - final PagedResponse pagedResponse = serviceClient.getKeyValuesNextSinglePage(nextLink, - null, null, null, enableSyncRestProxy(addTracingNamespace(context))); - return toConfigurationSettingWithPagedResponse(pagedResponse); - } - ); + List fields, Context context) { + return new PagedIterable<>(() -> { + final PagedResponse pagedResponse = serviceClient.getKeyValuesSinglePage(null, null, null, null, + fields, snapshotName, null, null, context); + return toConfigurationSettingWithPagedResponse(pagedResponse); + }, nextLink -> { + final PagedResponse pagedResponse = serviceClient.getKeyValuesNextSinglePage(nextLink, null, null, + null, context); + return toConfigurationSettingWithPagedResponse(pagedResponse); + }); } /** @@ -1181,8 +1152,7 @@ public PagedIterable listConfigurationSettingsForSnapshot( * in descending order from their {@link ConfigurationSetting#getLastModified() lastModified} date. * Revisions expire after a period of time, see Pricing * for more information. - * - * + *

* If {@code selector} is {@code null}, then all the {@link ConfigurationSetting ConfigurationSettings} are fetched * in their current state. Otherwise, the results returned match the parameters given in {@code selector}. * @@ -1217,7 +1187,7 @@ public PagedIterable listRevisions(SettingSelector selecto * in descending order from their {@link ConfigurationSetting#getLastModified() lastModified} date. * Revisions expire after a period of time, see Pricing * for more information. - * + *

* If {@code selector} is {@code null}, then all the {@link ConfigurationSetting ConfigurationSettings} are fetched * in their current state. Otherwise, the results returned match the parameters given in {@code selector}. * @@ -1243,23 +1213,16 @@ public PagedIterable listRevisions(SettingSelector selecto @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listRevisions(SettingSelector selector, Context context) { final String acceptDateTime = selector == null ? null : selector.getAcceptDateTime(); - return new PagedIterable<>( - () -> { - final PagedResponse pagedResponse = serviceClient.getRevisionsSinglePage( - selector == null ? null : selector.getKeyFilter(), - selector == null ? null : selector.getLabelFilter(), - null, - acceptDateTime, - selector == null ? null : toSettingFieldsList(selector.getFields()), - enableSyncRestProxy(addTracingNamespace(context))); - return toConfigurationSettingWithPagedResponse(pagedResponse); - }, - nextLink -> { - final PagedResponse pagedResponse = serviceClient.getRevisionsNextSinglePage(nextLink, - acceptDateTime, enableSyncRestProxy(addTracingNamespace(context))); - return toConfigurationSettingWithPagedResponse(pagedResponse); - } - ); + return new PagedIterable<>(() -> { + final PagedResponse pagedResponse = serviceClient.getRevisionsSinglePage( + selector == null ? null : selector.getKeyFilter(), selector == null ? null : selector.getLabelFilter(), + null, acceptDateTime, selector == null ? null : toSettingFieldsList(selector.getFields()), context); + return toConfigurationSettingWithPagedResponse(pagedResponse); + }, nextLink -> { + final PagedResponse pagedResponse = serviceClient.getRevisionsNextSinglePage(nextLink, + acceptDateTime, context); + return toConfigurationSettingWithPagedResponse(pagedResponse); + }); } /** @@ -1525,15 +1488,10 @@ public PagedIterable listSnapshots(SnapshotSelector selec */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listSnapshots(SnapshotSelector selector, Context context) { - return new PagedIterable<>( - () -> serviceClient.getSnapshotsSinglePage( - selector == null ? null : selector.getNameFilter(), - null, - selector == null ? null : selector.getFields(), - selector == null ? null : selector.getStatus(), - enableSyncRestProxy(addTracingNamespace(context))), - nextLink -> serviceClient.getSnapshotsNextSinglePage(nextLink, - enableSyncRestProxy(addTracingNamespace(context)))); + return new PagedIterable<>(() -> serviceClient.getSnapshotsSinglePage( + selector == null ? null : selector.getNameFilter(), null, selector == null ? null : selector.getFields(), + selector == null ? null : selector.getStatus(), context), + nextLink -> serviceClient.getSnapshotsNextSinglePage(nextLink, context)); } /** diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java index a743a01d56bc..489a1b35b7d3 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java @@ -12,6 +12,7 @@ import com.azure.core.credential.TokenCredential; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeader; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; @@ -126,8 +127,8 @@ public final class ConfigurationClientBuilder implements CLIENT_VERSION = properties.getOrDefault("version", "UnknownVersion"); ADD_HEADERS_POLICY = new AddHeadersPolicy(new HttpHeaders() .set("x-ms-return-client-request-id", "true") - .set("Content-Type", "application/json") - .set("Accept", "application/vnd.microsoft.azconfig.kv+json")); + .set(HttpHeaderName.CONTENT_TYPE, "application/json") + .set(HttpHeaderName.ACCEPT, "application/vnd.microsoft.azconfig.kv+json")); } private static final ClientLogger LOGGER = new ClientLogger(ConfigurationClientBuilder.class); diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/Utility.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/Utility.java index 5bc1cca355d7..f40318800e33 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/Utility.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/Utility.java @@ -13,6 +13,7 @@ import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.data.appconfiguration.implementation.models.KeyValue; import com.azure.data.appconfiguration.implementation.models.SnapshotUpdateParameters; @@ -24,19 +25,15 @@ import reactor.core.publisher.Mono; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Objects; import java.util.concurrent.atomic.AtomicInteger; -import static com.azure.core.util.tracing.Tracer.AZ_TRACING_NAMESPACE_KEY; - /** * App Configuration Utility methods, use internally. */ public class Utility { - private static final String HTTP_REST_PROXY_SYNC_PROXY_ENABLE = "com.azure.core.http.restproxy.syncproxy.enable"; - public static final String APP_CONFIG_TRACING_NAMESPACE_VALUE = "Microsoft.AppConfiguration"; - public static final String ID = "id"; public static final String DESCRIPTION = "description"; public static final String DISPLAY_NAME = "display_name"; @@ -67,36 +64,9 @@ public static KeyValue toKeyValue(ConfigurationSetting setting) { .setTags(setting.getTags()); } - // List to SettingFields[] - public static SettingFields[] toSettingFieldsArray(List settingFieldsList) { - int size = settingFieldsList.size(); - SettingFields[] fields = new SettingFields[size]; - for (int i = 0; i < size; i++) { - fields[i] = settingFieldsList.get(i); - } - return fields; - } - // SettingFields[] to List public static List toSettingFieldsList(SettingFields[] settingFieldsArray) { - int size = settingFieldsArray.length; - List settingFieldsList = new ArrayList<>(size); - for (int i = 0; i < size; i++) { - settingFieldsList.add(settingFieldsArray[i]); - } - return settingFieldsList; - } - - // Iterable to List - public static List iterableToList(Iterable iterable) { - if (iterable == null) { - return null; - } - List outputList = new ArrayList<>(); - for (E item : iterable) { - outputList.add(item); - } - return outputList; + return new ArrayList<>(Arrays.asList(settingFieldsArray)); } /* @@ -117,14 +87,6 @@ public static String getETag(boolean isETagRequired, ConfigurationSetting settin return isETagRequired ? getETagValue(setting.getETag()) : null; } - public static String getETagSnapshot(boolean isETagRequired, ConfigurationSnapshot snapshot) { - if (!isETagRequired) { - return null; - } - Objects.requireNonNull(snapshot); - return getETagValue(snapshot.getETag()); - } - /* * Ensure that setting is not null. And, key cannot be null because it is part of the service REST URL. */ @@ -149,24 +111,6 @@ public static Mono validateSettingAsync(ConfigurationSetti return Mono.just(setting); } - /** - * Enable the sync stack rest proxy. - * - * @param context It offers a means of passing arbitrary data (key-value pairs) to pipeline policies. - * Most applications do not need to pass arbitrary data to the pipeline and can pass Context.NONE or null. - * - * @return The Context. - */ - public static Context enableSyncRestProxy(Context context) { - context = context == null ? Context.NONE : context; - return context.addData(HTTP_REST_PROXY_SYNC_PROXY_ENABLE, true); - } - - public static Context addTracingNamespace(Context context) { - context = context == null ? Context.NONE : context; - return context.addData(AZ_TRACING_NAMESPACE_KEY, APP_CONFIG_TRACING_NAMESPACE_VALUE); - } - public static Response updateSnapshotSync(String snapshotName, MatchConditions matchConditions, ConfigurationSnapshotStatus status, AzureAppConfigurationImpl serviceClient, Context context) { @@ -203,44 +147,44 @@ public static String parseNextLink(String nextLink) { // Async handler public static Mono> handleNotModifiedErrorToValidResponse(HttpResponseException error) { HttpResponse httpResponse = error.getResponse(); + if (httpResponse == null) { + return Mono.error(error); + } + String continuationToken = parseNextLink(httpResponse.getHeaderValue(HttpHeaderName.LINK)); if (httpResponse.getStatusCode() == 304) { - return Mono.just( - new PagedResponseBase<>( - httpResponse.getRequest(), - httpResponse.getStatusCode(), - httpResponse.getHeaders(), - null, - continuationToken, - null)); + return Mono.just(new PagedResponseBase<>(httpResponse.getRequest(), httpResponse.getStatusCode(), + httpResponse.getHeaders(), null, continuationToken, null)); } + return Mono.error(error); } // Sync Handler public static PagedResponse handleNotModifiedErrorToValidResponse(HttpResponseException error, ClientLogger logger) { HttpResponse httpResponse = error.getResponse(); + if (httpResponse == null) { + throw logger.logExceptionAsError(error); + } + String continuationToken = parseNextLink(httpResponse.getHeaderValue(HttpHeaderName.LINK)); if (httpResponse.getStatusCode() == 304) { - return new PagedResponseBase<>( - httpResponse.getRequest(), - httpResponse.getStatusCode(), - httpResponse.getHeaders(), - null, - continuationToken, - null); + return new PagedResponseBase<>(httpResponse.getRequest(), httpResponse.getStatusCode(), + httpResponse.getHeaders(), null, continuationToken, null); } + throw logger.logExceptionAsError(error); } // Get the ETag from a list public static String getPageETag(List matchConditionsList, AtomicInteger pageETagIndex) { - int pageETagListSize = (matchConditionsList == null || matchConditionsList.isEmpty()) - ? 0 - : matchConditionsList.size(); + if (CoreUtils.isNullOrEmpty(matchConditionsList)) { + return null; + } + String nextPageETag = null; int pageETagIndexValue = pageETagIndex.get(); - if (pageETagIndexValue < pageETagListSize) { + if (pageETagIndexValue < matchConditionsList.size()) { nextPageETag = matchConditionsList.get(pageETagIndexValue).getIfNoneMatch(); pageETagIndex.set(pageETagIndexValue + 1); } diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/ConfigurationClientTest.java b/sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/ConfigurationClientTest.java index 3d0c3e5a491e..744dddcf1bee 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/ConfigurationClientTest.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/ConfigurationClientTest.java @@ -777,15 +777,11 @@ public void listConfigurationSettingsAcceptDateTime(HttpClient httpClient, Confi final ConfigurationSetting updated2 = new ConfigurationSetting().setKey(original.getKey()).setValue("anotherValue2"); // Create 3 revisions of the same key. - try { - assertConfigurationEquals(original, client.setConfigurationSettingWithResponse(original, false, Context.NONE).getValue()); - Thread.sleep(2000); - assertConfigurationEquals(updated, client.setConfigurationSettingWithResponse(updated, false, Context.NONE).getValue()); - Thread.sleep(2000); - assertConfigurationEquals(updated2, client.setConfigurationSettingWithResponse(updated2, false, Context.NONE).getValue()); - } catch (InterruptedException ex) { - // Do nothing. - } + assertConfigurationEquals(original, client.setConfigurationSettingWithResponse(original, false, Context.NONE).getValue()); + sleepIfRunningAgainstService(2000); + assertConfigurationEquals(updated, client.setConfigurationSettingWithResponse(updated, false, Context.NONE).getValue()); + sleepIfRunningAgainstService(2000); + assertConfigurationEquals(updated2, client.setConfigurationSettingWithResponse(updated2, false, Context.NONE).getValue()); // Gets all versions of this value so we can get the one we want at that particular date. List revisions = client.listRevisions(new SettingSelector().setKeyFilter(keyName)).stream().collect(Collectors.toList()); @@ -886,15 +882,11 @@ public void listRevisionsAcceptDateTime(HttpClient httpClient, ConfigurationServ final ConfigurationSetting updated2 = new ConfigurationSetting().setKey(original.getKey()).setValue("anotherValue2"); // Create 3 revisions of the same key. - try { - assertConfigurationEquals(original, client.setConfigurationSettingWithResponse(original, false, Context.NONE).getValue()); - Thread.sleep(2000); - assertConfigurationEquals(updated, client.setConfigurationSettingWithResponse(updated, false, Context.NONE).getValue()); - Thread.sleep(2000); - assertConfigurationEquals(updated2, client.setConfigurationSettingWithResponse(updated2, false, Context.NONE).getValue()); - } catch (InterruptedException ex) { - // Do nothing. - } + assertConfigurationEquals(original, client.setConfigurationSettingWithResponse(original, false, Context.NONE).getValue()); + sleepIfRunningAgainstService(2000); + assertConfigurationEquals(updated, client.setConfigurationSettingWithResponse(updated, false, Context.NONE).getValue()); + sleepIfRunningAgainstService(2000); + assertConfigurationEquals(updated2, client.setConfigurationSettingWithResponse(updated2, false, Context.NONE).getValue()); // Gets all versions of this value. List revisions = client.listRevisions(new SettingSelector().setKeyFilter(keyName)).stream().collect(Collectors.toList()); diff --git a/sdk/attestation/azure-security-attestation/src/test/java/com/azure/security/attestation/AttestationTest.java b/sdk/attestation/azure-security-attestation/src/test/java/com/azure/security/attestation/AttestationTest.java index 21c89af0fc57..0dada17dbdf1 100644 --- a/sdk/attestation/azure-security-attestation/src/test/java/com/azure/security/attestation/AttestationTest.java +++ b/sdk/attestation/azure-security-attestation/src/test/java/com/azure/security/attestation/AttestationTest.java @@ -9,6 +9,7 @@ import com.azure.core.test.utils.TestUtils; import com.azure.core.util.BinaryData; import com.azure.core.util.Context; +import com.azure.core.util.logging.LogLevel; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.security.attestation.models.AttestationData; import com.azure.security.attestation.models.AttestationDataInterpretation; @@ -354,7 +355,8 @@ void testTpmAttestation(HttpClient httpClient, String clientUri) { .setAttestationSigner(new AttestationSigningKey(getIsolatedSigningCertificate(), getIsolatedSigningKey()))); if (result.getPolicyResolution() != PolicyModification.UPDATED) { - System.out.printf("Unexpected resolution setting TPM policy: %s", result.getPolicyResolution().toString()); + LOGGER.log(LogLevel.VERBOSE, + () -> "Unexpected resolution setting TPM policy: " + result.getPolicyResolution()); return; } @@ -373,11 +375,11 @@ void testTpmAttestation(HttpClient httpClient, String clientUri) { Object deserializedResponse = assertDoesNotThrow(() -> ADAPTER.deserialize(tpmResponse.getTpmResult().toBytes(), Object.class, SerializerEncoding.JSON)); - assertTrue(deserializedResponse instanceof LinkedHashMap); + assertInstanceOf(LinkedHashMap.class, deserializedResponse); @SuppressWarnings("unchecked") LinkedHashMap initialResponse = (LinkedHashMap) deserializedResponse; assertTrue(initialResponse.containsKey("payload")); - assertTrue(initialResponse.get("payload") instanceof LinkedHashMap); + assertInstanceOf(LinkedHashMap.class, initialResponse.get("payload")); @SuppressWarnings("unchecked") LinkedHashMap payload = (LinkedHashMap) initialResponse.get("payload"); assertTrue(payload.containsKey("challenge")); @@ -402,7 +404,8 @@ void testTpmAttestationWithResult(HttpClient httpClient, String clientUri) { .setAttestationSigner(new AttestationSigningKey(getIsolatedSigningCertificate(), getIsolatedSigningKey()))); if (result.getPolicyResolution() != PolicyModification.UPDATED) { - System.out.printf("Unexpected resolution setting TPM policy: %s", result.getPolicyResolution().toString()); + LOGGER.log(LogLevel.VERBOSE, + () -> "Unexpected resolution setting TPM policy: " + result.getPolicyResolution()); return; } @@ -423,11 +426,11 @@ void testTpmAttestationWithResult(HttpClient httpClient, String clientUri) { Object deserializedResponse = assertDoesNotThrow(() -> ADAPTER.deserialize( tpmResponse.getValue().getTpmResult().toBytes(), Object.class, SerializerEncoding.JSON)); - assertTrue(deserializedResponse instanceof LinkedHashMap); + assertInstanceOf(LinkedHashMap.class, deserializedResponse); @SuppressWarnings("unchecked") LinkedHashMap initialResponse = (LinkedHashMap) deserializedResponse; assertTrue(initialResponse.containsKey("payload")); - assertTrue(initialResponse.get("payload") instanceof LinkedHashMap); + assertInstanceOf(LinkedHashMap.class, initialResponse.get("payload")); @SuppressWarnings("unchecked") LinkedHashMap payload = (LinkedHashMap) initialResponse.get("payload"); assertTrue(payload.containsKey("challenge")); @@ -450,7 +453,8 @@ void testTpmAttestationAsync(HttpClient httpClient, String clientUri) { .setAttestationSigner(new AttestationSigningKey(getIsolatedSigningCertificate(), getIsolatedSigningKey()))); if (result.getPolicyResolution() != PolicyModification.UPDATED) { - System.out.printf("Unexpected resolution setting TPM policy: %s", result.getPolicyResolution().toString()); + LOGGER.log(LogLevel.VERBOSE, + () -> "Unexpected resolution setting TPM policy: " + result.getPolicyResolution()); return; } @@ -469,11 +473,11 @@ void testTpmAttestationAsync(HttpClient httpClient, String clientUri) { .assertNext(tpmResponse -> { Object deserializedResponse = assertDoesNotThrow(() -> ADAPTER.deserialize( tpmResponse.getTpmResult().toBytes(), Object.class, SerializerEncoding.JSON)); - assertTrue(deserializedResponse instanceof LinkedHashMap); + assertInstanceOf(LinkedHashMap.class, deserializedResponse); @SuppressWarnings("unchecked") LinkedHashMap initialResponse = (LinkedHashMap) deserializedResponse; assertTrue(initialResponse.containsKey("payload")); - assertTrue(initialResponse.get("payload") instanceof LinkedHashMap); + assertInstanceOf(LinkedHashMap.class, initialResponse.get("payload")); @SuppressWarnings("unchecked") LinkedHashMap payload = (LinkedHashMap) initialResponse.get("payload"); assertTrue(payload.containsKey("challenge")); @@ -669,7 +673,7 @@ private static void verifyAttestationResult(TestMode testMode, String clientUri, assertNull(result.getNonce()); if (expectJson) { - assertTrue(result.getRuntimeClaims() instanceof Map); + assertInstanceOf(Map.class, result.getRuntimeClaims()); @SuppressWarnings("unchecked") Map runtimeClaims = (Map) result.getRuntimeClaims(); Map expectedClaims = assertDoesNotThrow(() -> @@ -685,7 +689,7 @@ static void assertObjectEqual(Map expected, Map LOGGER.verbose("Key: " + key); assertTrue(actual.containsKey(key)); if (expected.get(key) instanceof Map) { - assertTrue(actual.get(key) instanceof Map); + assertInstanceOf(Map.class, actual.get(key)); @SuppressWarnings("unchecked") Map expectedInner = (Map) expected.get(key); @SuppressWarnings("unchecked") diff --git a/sdk/boms/spring-cloud-azure-dependencies/pom.xml b/sdk/boms/spring-cloud-azure-dependencies/pom.xml index 01737e7633d1..cbb7b2fd5ae8 100644 --- a/sdk/boms/spring-cloud-azure-dependencies/pom.xml +++ b/sdk/boms/spring-cloud-azure-dependencies/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-dependencies - 4.18.0-beta.1 + 4.19.0-beta.1 pom Spring Cloud Azure Dependencies @@ -51,14 +51,14 @@ com.azure azure-sdk-bom - 1.2.22 + 1.2.23 pom import com.azure azure-spring-data-cosmos - 3.45.0-beta.1 + 3.46.0-beta.1 com.azure.resourcemanager diff --git a/sdk/communication/azure-communication-callautomation/pom.xml b/sdk/communication/azure-communication-callautomation/pom.xml index 32b5e27eb7b8..722ac6b09f44 100644 --- a/sdk/communication/azure-communication-callautomation/pom.xml +++ b/sdk/communication/azure-communication-callautomation/pom.xml @@ -71,7 +71,7 @@ com.azure azure-messaging-servicebus - 7.16.0 + 7.17.0 test diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAsyncClientAutomatedLiveTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAsyncClientAutomatedLiveTests.java index 31efad130aa1..27e11915f67f 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAsyncClientAutomatedLiveTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAsyncClientAutomatedLiveTests.java @@ -17,6 +17,7 @@ import com.azure.communication.identity.CommunicationIdentityAsyncClient; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.Response; +import com.azure.core.test.annotation.DoNotRecord; import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -32,6 +33,7 @@ import static org.junit.jupiter.api.Assertions.fail; public class CallAutomationAsyncClientAutomatedLiveTests extends CallAutomationAutomatedLiveTestBase { + @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") @DisabledIfEnvironmentVariable( @@ -132,6 +134,7 @@ public void createVOIPCallAndAnswerThenHangupAutomatedTest(HttpClient httpClient } } + @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") @DisabledIfEnvironmentVariable( diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAutomatedLiveTestBase.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAutomatedLiveTestBase.java index 500d2108a25c..a7a831b0b173 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAutomatedLiveTestBase.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationAutomatedLiveTestBase.java @@ -8,28 +8,27 @@ import com.azure.communication.callautomation.models.events.CallAutomationEventBase; import com.azure.communication.common.CommunicationIdentifier; import com.azure.core.amqp.AmqpTransportType; +import com.azure.core.http.HttpClient; import com.azure.core.http.HttpMethod; import com.azure.core.http.HttpRequest; import com.azure.core.http.HttpResponse; import com.azure.core.test.TestMode; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.messaging.servicebus.ServiceBusClientBuilder; import com.azure.messaging.servicebus.ServiceBusErrorContext; import com.azure.messaging.servicebus.ServiceBusException; import com.azure.messaging.servicebus.ServiceBusFailureReason; import com.azure.messaging.servicebus.ServiceBusProcessorClient; -import com.azure.core.http.HttpClient; import com.azure.messaging.servicebus.ServiceBusReceivedMessage; import com.azure.messaging.servicebus.ServiceBusReceivedMessageContext; +import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; -import com.azure.core.util.CoreUtils; -import java.util.StringJoiner; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; @@ -39,11 +38,15 @@ import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; +import java.util.StringJoiner; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; public class CallAutomationAutomatedLiveTestBase extends CallAutomationLiveTestBase { + private static final ClientLogger LOGGER = new ClientLogger(CallAutomationAutomatedLiveTestBase.class); + protected ConcurrentHashMap processorStore; // Key: callerId + receiverId, Value: incomingCallContext protected ConcurrentHashMap incomingCallContextStore; @@ -60,7 +63,7 @@ public class CallAutomationAutomatedLiveTestBase extends CallAutomationLiveTestB protected static final String BOT_APP_ID = Configuration.getGlobalConfiguration() .get("BOT_APP_ID", "REDACTED-bedb-REDACTED-b8c6-REDACTED"); - private static final StringJoiner JSON_PROPERTIES_TO_REDACT + private static final StringJoiner JSON_PROPERTIES_TO_REDACT = new StringJoiner("\":\"|\"", "\"", "\":\"") .add("value") .add("rawId") @@ -70,11 +73,11 @@ public class CallAutomationAutomatedLiveTestBase extends CallAutomationLiveTestB .add("ivrContext") .add("incomingCallContext") .add("serverCallId"); - + protected static final Pattern JSON_PROPERTY_VALUE_REDACTION_PATTERN = Pattern.compile(String.format("(?:%s)(.*?)(?:\",|\"})", JSON_PROPERTIES_TO_REDACT), Pattern.CASE_INSENSITIVE); - + protected static final String URL_REGEX = "(?<=http:\\/\\/|https:\\/\\/)([^\\/?]+)"; @Override @@ -206,11 +209,12 @@ private void messageBodyHandler(String body) { } protected void errorHandler(ServiceBusErrorContext context, CountDownLatch countdownLatch) { - System.out.printf("Error when receiving messages from namespace: '%s'. Entity: '%s'%n", - context.getFullyQualifiedNamespace(), context.getEntityPath()); + LOGGER.log(LogLevel.VERBOSE, () -> String.format( + "Error when receiving messages from namespace: '%s'. Entity: '%s'%n", + context.getFullyQualifiedNamespace(), context.getEntityPath())); if (!(context.getException() instanceof ServiceBusException)) { - System.out.printf("Non-ServiceBusException occurred: %s%n", context.getException()); + LOGGER.log(LogLevel.VERBOSE, () -> "Non-ServiceBusException occurred: " + context.getException()); return; } @@ -220,22 +224,20 @@ protected void errorHandler(ServiceBusErrorContext context, CountDownLatch count if (reason == ServiceBusFailureReason.MESSAGING_ENTITY_DISABLED || reason == ServiceBusFailureReason.MESSAGING_ENTITY_NOT_FOUND || reason == ServiceBusFailureReason.UNAUTHORIZED) { - System.out.printf("An unrecoverable error occurred. Stopping processing with reason %s: %s%n", - reason, exception.getMessage()); + LOGGER.log(LogLevel.VERBOSE, () -> String.format( + "An unrecoverable error occurred. Stopping processing with reason %s: %s%n", + reason, exception.getMessage())); countdownLatch.countDown(); } else if (reason == ServiceBusFailureReason.MESSAGE_LOCK_LOST) { - System.out.printf("Message lock lost for message: %s%n", context.getException()); + LOGGER.log(LogLevel.VERBOSE, + () -> String.format("Message lock lost for message: %s%n", context.getException())); } else if (reason == ServiceBusFailureReason.SERVICE_BUSY) { - try { - // Choosing an arbitrary amount of time to wait until trying again. - TimeUnit.SECONDS.sleep(1); - } catch (InterruptedException e) { - System.err.println("Unable to sleep for period of time"); - } + // Choosing an arbitrary amount of time to wait until trying again. + sleepIfRunningAgainstService(1000); } else { - System.out.printf("Error source %s, reason %s, message: %s%n", context.getErrorSource(), - reason, context.getException()); + LOGGER.log(LogLevel.VERBOSE, () -> String.format("Error source %s, reason %s, message: %s%n", + context.getErrorSource(), reason, context.getException())); } } @@ -260,7 +262,7 @@ protected String waitForIncomingCallContext(String uniqueId, Duration timeOut) t if (incomingCallContext != null) { return incomingCallContext; } - Thread.sleep(1000); + sleepIfRunningAgainstService(1000); } return null; } @@ -275,11 +277,11 @@ protected T waitForEvent(Class eventType, return event; } } - Thread.sleep(1000); + sleepIfRunningAgainstService(1000); } return null; } - + protected String redact(String content, Matcher matcher) { while (matcher.find()) { String captureGroup = matcher.group(1); diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationLiveTestBase.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationLiveTestBase.java index fbd9a81bd697..ca45f40b8eba 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationLiveTestBase.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallAutomationLiveTestBase.java @@ -62,17 +62,17 @@ public class CallAutomationLiveTestBase extends TestProxyTestBase { protected static final String MEDIA_SOURCE = Configuration.getGlobalConfiguration() .get("ACS_MEDIA_SOURCE", "https://contoso.com/music.wav"); protected static final String URL_REGEX = "(?<=http:\\/\\/|https:\\/\\/)([^\\/?]+)"; - + protected CommunicationIdentityClientBuilder getCommunicationIdentityClientUsingConnectionString(HttpClient httpClient) { CommunicationIdentityClientBuilder builder = new CommunicationIdentityClientBuilder() .connectionString(CONNECTION_STRING) .httpClient(getHttpClientOrUsePlayback(httpClient)); - + if (getTestMode() == TestMode.RECORD) { builder.addPolicy(interceptorManager.getRecordPolicy()); } addTestProxyTestSanitizersAndMatchers(interceptorManager); - + return builder; } @@ -88,12 +88,12 @@ protected CallAutomationClientBuilder getCallAutomationClientUsingConnectionStri .connectionString(CONNECTION_STRING) .httpClient(getHttpClientOrUsePlayback(httpClient)); } - + if (getTestMode() == TestMode.RECORD) { builder.addPolicy(interceptorManager.getRecordPolicy()); } addTestProxyTestSanitizersAndMatchers(interceptorManager); - + return builder; } @@ -137,12 +137,6 @@ protected Mono logHeaders(String testName, HttpPipelineNextPolicy }); } - protected void waitForOperationCompletion(int milliSeconds) throws InterruptedException { - if (getTestMode() != TestMode.PLAYBACK) { - Thread.sleep(milliSeconds); - } - } - static class FakeCredentials implements TokenCredential { @Override public Mono getToken(TokenRequestContext tokenRequestContext) { @@ -159,15 +153,15 @@ protected String redact(String content, Matcher matcher) { } return content; } - + protected void addTestProxyTestSanitizersAndMatchers(InterceptorManager interceptorManager) { - + if (interceptorManager.isLiveMode()) { return; } List customSanitizers = new ArrayList<>(); - + customSanitizers.add(new TestProxySanitizer("Authorization", null, "REDACTED", TestProxySanitizerType.HEADER)); customSanitizers.add(new TestProxySanitizer("x-ms-client-request-id", null, "REDACTED", TestProxySanitizerType.HEADER)); customSanitizers.add(new TestProxySanitizer("x-ms-content-sha256", null, "REDACTED", TestProxySanitizerType.HEADER)); @@ -187,7 +181,7 @@ protected void addTestProxyTestSanitizersAndMatchers(InterceptorManager intercep customSanitizers.add(new TestProxySanitizer("$..mediaSubscriptionId", null, "REDACTED", TestProxySanitizerType.BODY_KEY)); customSanitizers.add(new TestProxySanitizer("$..dataSubscriptionId", null, "REDACTED", TestProxySanitizerType.BODY_KEY)); customSanitizers.add(new TestProxySanitizer(URL_REGEX, "REDACTED", TestProxySanitizerType.BODY_REGEX)); - + interceptorManager.addSanitizers(customSanitizers); if (interceptorManager.isPlaybackMode()) { diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionAsyncAutomatedLiveTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionAsyncAutomatedLiveTests.java index c807992bf2a3..69662ce92337 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionAsyncAutomatedLiveTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallConnectionAsyncAutomatedLiveTests.java @@ -15,14 +15,14 @@ import com.azure.communication.callautomation.models.RemoveParticipantResult; import com.azure.communication.callautomation.models.events.AddParticipantSucceeded; import com.azure.communication.callautomation.models.events.CallConnected; -import com.azure.communication.callautomation.models.events.RemoveParticipantSucceeded; import com.azure.communication.callautomation.models.events.CancelAddParticipantSucceeded; +import com.azure.communication.callautomation.models.events.RemoveParticipantSucceeded; import com.azure.communication.common.CommunicationIdentifier; import com.azure.communication.common.CommunicationUserIdentifier; import com.azure.communication.identity.CommunicationIdentityAsyncClient; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.Response; - +import com.azure.core.test.annotation.DoNotRecord; import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -39,6 +39,7 @@ public class CallConnectionAsyncAutomatedLiveTests extends CallAutomationAutomatedLiveTestBase { + @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") @DisabledIfEnvironmentVariable( @@ -157,6 +158,7 @@ public void createVOIPCallAndAnswerThenAddParticipantFinallyRemoveParticipantAut } } + @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") @DisabledIfEnvironmentVariable( @@ -232,7 +234,7 @@ public void createVOIPCallAndAnswerThenAddParticipantFinallyCancelAddParticipant assertNotNull(addParticipantsResultResponse); // ensure invitation is sent - Thread.sleep(3000); + sleepIfRunningAgainstService(3000); // cancel add participant CancelAddParticipantOperationResult cancelAddParticipantResponse = createCallResult diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallDialogAsyncAutomatedLiveTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallDialogAsyncAutomatedLiveTests.java index c12f8a6f6e83..4dac2c5d8b31 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallDialogAsyncAutomatedLiveTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallDialogAsyncAutomatedLiveTests.java @@ -12,6 +12,7 @@ import com.azure.communication.identity.CommunicationIdentityAsyncClient; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.Response; +import com.azure.core.test.annotation.DoNotRecord; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; @@ -25,6 +26,7 @@ public class CallDialogAsyncAutomatedLiveTests extends CallAutomationAutomatedLiveTestBase { + @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") @DisabledIfEnvironmentVariable( diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaAsyncAutomatedLiveTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaAsyncAutomatedLiveTests.java index 60e5034b3d1d..a7d6c8f17887 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaAsyncAutomatedLiveTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallMediaAsyncAutomatedLiveTests.java @@ -24,6 +24,7 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.rest.Response; import com.azure.core.test.TestMode; +import com.azure.core.test.annotation.DoNotRecord; import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import org.junit.jupiter.params.ParameterizedTest; @@ -42,6 +43,7 @@ public class CallMediaAsyncAutomatedLiveTests extends CallAutomationAutomatedLiveTestBase { + @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") @DisabledIfEnvironmentVariable( @@ -128,6 +130,7 @@ public void playMediaInACallAutomatedTest(HttpClient httpClient) { } } + @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") @DisabledIfEnvironmentVariable( diff --git a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingAutomatedLiveTests.java b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingAutomatedLiveTests.java index 98e6ee049631..8187e92aaef8 100644 --- a/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingAutomatedLiveTests.java +++ b/sdk/communication/azure-communication-callautomation/src/test/java/com/azure/communication/callautomation/CallRecordingAutomatedLiveTests.java @@ -21,6 +21,7 @@ import com.azure.communication.common.CommunicationUserIdentifier; import com.azure.communication.identity.CommunicationIdentityClient; import com.azure.core.http.HttpClient; +import com.azure.core.test.annotation.DoNotRecord; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -34,6 +35,7 @@ import static org.junit.jupiter.api.Assertions.fail; public class CallRecordingAutomatedLiveTests extends CallAutomationAutomatedLiveTestBase { + @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") public void createACSCallAndUnmixedAudioTest(HttpClient httpClient) { @@ -118,6 +120,7 @@ public void createACSCallAndUnmixedAudioTest(HttpClient httpClient) { } } + @DoNotRecord(skipInPlayback = true) @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") public void createACSCallUnmixedAudioAffinityTest(HttpClient httpClient) { diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createACSCallAndUnmixedAudioTest.json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createACSCallAndUnmixedAudioTest.json deleted file mode 100644 index 41689d777012..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createACSCallAndUnmixedAudioTest.json +++ /dev/null @@ -1 +0,0 @@ -["{\"to\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"from\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"serverCallId\":\"REDACTED\",\"callerDisplayName\":\"\",\"incomingCallContext\":\"REDACTED\",\"correlationId\":\"802fc64d-4d4e-4280-be90-228202784cd6\"}","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-d9b1-40b6-805b-56cef20d7f13\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-d9b1-40b6-805b-56cef20d7f13\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-d9b1-40b6-805b-56cef20d7f13\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"802fc64d-4d4e-4280-be90-228202784cd6\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-04-24T19:17:14.5301986\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-d9b1-40b6-805b-56cef20d7f13\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-d9b1-40b6-805b-56cef20d7f13\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-d9b1-40b6-805b-56cef20d7f13\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-d9b1-40b6-805b-56cef20d7f13\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"802fc64d-4d4e-4280-be90-228202784cd6\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:17:14.5301986\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-d9b1-40b6-805b-56cef20d7f13\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-d9b1-40b6-805b-56cef20d7f13\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-d9b1-40b6-805b-56cef20d7f13\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":3,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-d9b1-40b6-805b-56cef20d7f13\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"802fc64d-4d4e-4280-be90-228202784cd6\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:17:19.8119571\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-d9b1-40b6-805b-56cef20d7f13\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-d9b1-40b6-805b-56cef20d7f13\",\"type\":\"Microsoft.Communication.CallDisconnected\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-d9b1-40b6-805b-56cef20d7f13\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-d9b1-40b6-805b-56cef20d7f13\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"802fc64d-4d4e-4280-be90-228202784cd6\",\"publicEventType\":\"Microsoft.Communication.CallDisconnected\"},\"time\":\"2024-04-24T19:17:20.2182933\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-d9b1-40b6-805b-56cef20d7f13\"}]"] \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createACSCallUnmixedAudioAffinityTest.json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createACSCallUnmixedAudioAffinityTest.json deleted file mode 100644 index 3b6fc1e33a39..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createACSCallUnmixedAudioAffinityTest.json +++ /dev/null @@ -1 +0,0 @@ -["{\"to\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"from\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"serverCallId\":\"REDACTED\",\"callerDisplayName\":\"\",\"incomingCallContext\":\"REDACTED\",\"correlationId\":\"54f85e11-3105-433f-aac8-19cf1df95d36\"}","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-78fd-4327-bf24-44ec170f86cd\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-78fd-4327-bf24-44ec170f86cd\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-78fd-4327-bf24-44ec170f86cd\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"54f85e11-3105-433f-aac8-19cf1df95d36\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:17:26.4688368\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-78fd-4327-bf24-44ec170f86cd\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-78fd-4327-bf24-44ec170f86cd\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-78fd-4327-bf24-44ec170f86cd\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-78fd-4327-bf24-44ec170f86cd\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"54f85e11-3105-433f-aac8-19cf1df95d36\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-04-24T19:17:26.4688368\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-78fd-4327-bf24-44ec170f86cd\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-78fd-4327-bf24-44ec170f86cd\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-78fd-4327-bf24-44ec170f86cd\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":3,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-78fd-4327-bf24-44ec170f86cd\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"54f85e11-3105-433f-aac8-19cf1df95d36\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:17:30.9536716\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-78fd-4327-bf24-44ec170f86cd\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-78fd-4327-bf24-44ec170f86cd\",\"type\":\"Microsoft.Communication.CallDisconnected\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-78fd-4327-bf24-44ec170f86cd\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-78fd-4327-bf24-44ec170f86cd\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"54f85e11-3105-433f-aac8-19cf1df95d36\",\"publicEventType\":\"Microsoft.Communication.CallDisconnected\"},\"time\":\"2024-04-24T19:17:31.3599728\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-78fd-4327-bf24-44ec170f86cd\"}]"] \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenAddParticipantFinallyCancelAddParticipant.json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenAddParticipantFinallyCancelAddParticipant.json deleted file mode 100644 index 8bc5f1f63488..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenAddParticipantFinallyCancelAddParticipant.json +++ /dev/null @@ -1 +0,0 @@ -["{\"to\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"from\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"serverCallId\":\"REDACTED\",\"callerDisplayName\":\"\",\"incomingCallContext\":\"REDACTED\",\"correlationId\":\"7d16dfce-c0c5-490d-8105-7debd7893a32\"}","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-cbad-484c-bcde-27c5edc765db\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-cbad-484c-bcde-27c5edc765db\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-cbad-484c-bcde-27c5edc765db\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"7d16dfce-c0c5-490d-8105-7debd7893a32\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-04-24T19:16:37.484509\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-cbad-484c-bcde-27c5edc765db\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-8ff1-4fe6-a575-d0e702b71497\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-8ff1-4fe6-a575-d0e702b71497\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-8ff1-4fe6-a575-d0e702b71497\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"7d16dfce-c0c5-490d-8105-7debd7893a32\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-04-24T19:16:37.5001327\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-8ff1-4fe6-a575-d0e702b71497\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-8ff1-4fe6-a575-d0e702b71497\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-8ff1-4fe6-a575-d0e702b71497\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-8ff1-4fe6-a575-d0e702b71497\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"7d16dfce-c0c5-490d-8105-7debd7893a32\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:37.5157768\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-8ff1-4fe6-a575-d0e702b71497\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-cbad-484c-bcde-27c5edc765db\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-cbad-484c-bcde-27c5edc765db\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-cbad-484c-bcde-27c5edc765db\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"7d16dfce-c0c5-490d-8105-7debd7893a32\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:37.5157768\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-cbad-484c-bcde-27c5edc765db\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-8ff1-4fe6-a575-d0e702b71497\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-8ff1-4fe6-a575-d0e702b71497\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":3,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-8ff1-4fe6-a575-d0e702b71497\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"7d16dfce-c0c5-490d-8105-7debd7893a32\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:39.5471963\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-8ff1-4fe6-a575-d0e702b71497\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-cbad-484c-bcde-27c5edc765db\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-cbad-484c-bcde-27c5edc765db\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":3,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-cbad-484c-bcde-27c5edc765db\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"7d16dfce-c0c5-490d-8105-7debd7893a32\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:39.5471963\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-cbad-484c-bcde-27c5edc765db\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-8ff1-4fe6-a575-d0e702b71497\",\"type\":\"Microsoft.Communication.CancelAddParticipantSucceeded\",\"data\":{\"invitationId\":\"03b7d0e2-1d59-4f37-9fd1-f827d275eb59\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-8ff1-4fe6-a575-d0e702b71497\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"7d16dfce-c0c5-490d-8105-7debd7893a32\",\"publicEventType\":\"Microsoft.Communication.CancelAddParticipantSucceeded\"},\"time\":\"2024-04-24T19:16:41.2504076\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-8ff1-4fe6-a575-d0e702b71497\"}]"] \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenAddParticipantFinallyRemoveParticipantAutomatedTest.json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenAddParticipantFinallyRemoveParticipantAutomatedTest.json deleted file mode 100644 index cb7d3ec5caf6..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenAddParticipantFinallyRemoveParticipantAutomatedTest.json +++ /dev/null @@ -1 +0,0 @@ -["{\"to\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"from\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"serverCallId\":\"REDACTED\",\"callerDisplayName\":\"\",\"incomingCallContext\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\"}","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-c9dd-4c59-b2b3-d50aaa67159f\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-c9dd-4c59-b2b3-d50aaa67159f\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-c9dd-4c59-b2b3-d50aaa67159f\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-04-24T19:16:23.5615833\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-c9dd-4c59-b2b3-d50aaa67159f\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-7b70-4bfd-b026-739e6c663e81\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-04-24T19:16:23.6240133\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-c9dd-4c59-b2b3-d50aaa67159f\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-c9dd-4c59-b2b3-d50aaa67159f\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-c9dd-4c59-b2b3-d50aaa67159f\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:23.6083905\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-c9dd-4c59-b2b3-d50aaa67159f\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-7b70-4bfd-b026-739e6c663e81\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:23.6240133\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":3,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-7b70-4bfd-b026-739e6c663e81\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:26.4836617\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\"}]","{\"to\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"from\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"serverCallId\":\"REDACTED\",\"callerDisplayName\":\"\",\"incomingCallContext\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\"}","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-c9dd-4c59-b2b3-d50aaa67159f\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-c9dd-4c59-b2b3-d50aaa67159f\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":3,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-c9dd-4c59-b2b3-d50aaa67159f\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:26.5148471\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-c9dd-4c59-b2b3-d50aaa67159f\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-9ebd-43a1-95f7-92e9994edb3f\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-9ebd-43a1-95f7-92e9994edb3f\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-9ebd-43a1-95f7-92e9994edb3f\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-04-24T19:16:28.2649797\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-9ebd-43a1-95f7-92e9994edb3f\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\",\"type\":\"Microsoft.Communication.AddParticipantSucceeded\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\",\"participant\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-7b70-4bfd-b026-739e6c663e81\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.AddParticipantSucceeded\"},\"time\":\"2024-04-24T19:16:28.358734\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":4,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-7b70-4bfd-b026-739e6c663e81\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:28.358734\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-c9dd-4c59-b2b3-d50aaa67159f\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-c9dd-4c59-b2b3-d50aaa67159f\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":4,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-c9dd-4c59-b2b3-d50aaa67159f\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:28.358734\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-c9dd-4c59-b2b3-d50aaa67159f\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-9ebd-43a1-95f7-92e9994edb3f\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-9ebd-43a1-95f7-92e9994edb3f\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":6,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-9ebd-43a1-95f7-92e9994edb3f\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:28.6244317\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-9ebd-43a1-95f7-92e9994edb3f\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-c9dd-4c59-b2b3-d50aaa67159f\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-c9dd-4c59-b2b3-d50aaa67159f\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":6,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-c9dd-4c59-b2b3-d50aaa67159f\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:28.8431467\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-c9dd-4c59-b2b3-d50aaa67159f\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":5,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-7b70-4bfd-b026-739e6c663e81\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:28.8431467\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-9ebd-43a1-95f7-92e9994edb3f\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-9ebd-43a1-95f7-92e9994edb3f\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":7,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-9ebd-43a1-95f7-92e9994edb3f\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:29.0931748\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-9ebd-43a1-95f7-92e9994edb3f\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-c9dd-4c59-b2b3-d50aaa67159f\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-c9dd-4c59-b2b3-d50aaa67159f\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":6,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-c9dd-4c59-b2b3-d50aaa67159f\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:29.3119818\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-c9dd-4c59-b2b3-d50aaa67159f\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":6,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-7b70-4bfd-b026-739e6c663e81\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:29.3119818\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-9ebd-43a1-95f7-92e9994edb3f\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-9ebd-43a1-95f7-92e9994edb3f\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":9,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-9ebd-43a1-95f7-92e9994edb3f\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:29.5775742\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-9ebd-43a1-95f7-92e9994edb3f\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-c9dd-4c59-b2b3-d50aaa67159f\",\"type\":\"Microsoft.Communication.CallDisconnected\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-c9dd-4c59-b2b3-d50aaa67159f\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-c9dd-4c59-b2b3-d50aaa67159f\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.CallDisconnected\"},\"time\":\"2024-04-24T19:16:29.6557095\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-c9dd-4c59-b2b3-d50aaa67159f\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-9ebd-43a1-95f7-92e9994edb3f\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-9ebd-43a1-95f7-92e9994edb3f\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":9,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-9ebd-43a1-95f7-92e9994edb3f\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:30.0464126\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-9ebd-43a1-95f7-92e9994edb3f\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\",\"type\":\"Microsoft.Communication.RemoveParticipantSucceeded\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\",\"participant\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-7b70-4bfd-b026-739e6c663e81\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.RemoveParticipantSucceeded\"},\"time\":\"2024-04-24T19:16:29.6557095\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":7,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-7b70-4bfd-b026-739e6c663e81\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:29.7807154\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-9ebd-43a1-95f7-92e9994edb3f\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-9ebd-43a1-95f7-92e9994edb3f\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":9,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-9ebd-43a1-95f7-92e9994edb3f\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:30.5151508\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-9ebd-43a1-95f7-92e9994edb3f\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":8,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-7b70-4bfd-b026-739e6c663e81\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:30.6089007\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-9ebd-43a1-95f7-92e9994edb3f\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-9ebd-43a1-95f7-92e9994edb3f\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":11,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-9ebd-43a1-95f7-92e9994edb3f\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:30.9996063\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-9ebd-43a1-95f7-92e9994edb3f\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":9,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-7b70-4bfd-b026-739e6c663e81\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"448c7527-7911-4149-b835-e49afb83a6bf\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:31.1246381\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-7b70-4bfd-b026-739e6c663e81\"}]"] \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenHangupAutomatedTest.json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenHangupAutomatedTest.json deleted file mode 100644 index ecc6d9ed6c24..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndAnswerThenHangupAutomatedTest.json +++ /dev/null @@ -1 +0,0 @@ -["{\"to\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"from\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"serverCallId\":\"REDACTED\",\"callerDisplayName\":\"\",\"incomingCallContext\":\"REDACTED\",\"correlationId\":\"b94e5319-f526-4538-aaef-6d59b28d3aa2\"}","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-4f90-4199-9a2c-e07e3af80407\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-4f90-4199-9a2c-e07e3af80407\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-4f90-4199-9a2c-e07e3af80407\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"b94e5319-f526-4538-aaef-6d59b28d3aa2\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-04-24T19:16:12.9357522\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-4f90-4199-9a2c-e07e3af80407\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-2077-4ee0-b8ac-017ad075c7bb\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-2077-4ee0-b8ac-017ad075c7bb\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-2077-4ee0-b8ac-017ad075c7bb\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"b94e5319-f526-4538-aaef-6d59b28d3aa2\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-04-24T19:16:12.9670517\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-2077-4ee0-b8ac-017ad075c7bb\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-2077-4ee0-b8ac-017ad075c7bb\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-2077-4ee0-b8ac-017ad075c7bb\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-2077-4ee0-b8ac-017ad075c7bb\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"b94e5319-f526-4538-aaef-6d59b28d3aa2\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:12.9984379\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-2077-4ee0-b8ac-017ad075c7bb\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-4f90-4199-9a2c-e07e3af80407\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-4f90-4199-9a2c-e07e3af80407\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-4f90-4199-9a2c-e07e3af80407\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"b94e5319-f526-4538-aaef-6d59b28d3aa2\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:13.0451895\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-4f90-4199-9a2c-e07e3af80407\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-4f90-4199-9a2c-e07e3af80407\",\"type\":\"Microsoft.Communication.CallDisconnected\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-4f90-4199-9a2c-e07e3af80407\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-4f90-4199-9a2c-e07e3af80407\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"b94e5319-f526-4538-aaef-6d59b28d3aa2\",\"publicEventType\":\"Microsoft.Communication.CallDisconnected\"},\"time\":\"2024-04-24T19:16:14.4514859\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-4f90-4199-9a2c-e07e3af80407\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-2077-4ee0-b8ac-017ad075c7bb\",\"type\":\"Microsoft.Communication.CallDisconnected\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-2077-4ee0-b8ac-017ad075c7bb\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-2077-4ee0-b8ac-017ad075c7bb\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"b94e5319-f526-4538-aaef-6d59b28d3aa2\",\"publicEventType\":\"Microsoft.Communication.CallDisconnected\"},\"time\":\"2024-04-24T19:16:14.529611\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-2077-4ee0-b8ac-017ad075c7bb\"}]"] \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndRejectAutomatedTest.json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndRejectAutomatedTest.json deleted file mode 100644 index b2a384ab4c74..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/createVOIPCallAndRejectAutomatedTest.json +++ /dev/null @@ -1 +0,0 @@ -["{\"to\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"from\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"serverCallId\":\"REDACTED\",\"callerDisplayName\":\"\",\"incomingCallContext\":\"REDACTED\",\"correlationId\":\"5556ad81-73a7-4fa7-a5c7-b4b7d08a2001\"}","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-c0ef-474b-8b58-ad685a4b1ce9\",\"type\":\"Microsoft.Communication.CreateCallFailed\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-c0ef-474b-8b58-ad685a4b1ce9\",\"resultInformation\":{\"code\":603,\"subCode\":0,\"message\":\"Decline. DiagCode: 603#0.@\"},\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-c0ef-474b-8b58-ad685a4b1ce9\",\"correlationId\":\"5556ad81-73a7-4fa7-a5c7-b4b7d08a2001\",\"publicEventType\":\"Microsoft.Communication.CreateCallFailed\"},\"time\":\"2024-04-24T19:16:06.0905745\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-c0ef-474b-8b58-ad685a4b1ce9\"}]"] \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/dialogActionInACallAutomatedTest.json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/dialogActionInACallAutomatedTest.json deleted file mode 100644 index 4647cc0dd9a7..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/dialogActionInACallAutomatedTest.json +++ /dev/null @@ -1 +0,0 @@ -["{\"to\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"from\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"serverCallId\":\"REDACTED\",\"callerDisplayName\":\"\",\"incomingCallContext\":\"REDACTED\",\"correlationId\":\"41820b15-8dca-430f-b226-b3d26a3f80b5\"}","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-688b-44d7-8081-1282028cdd97\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-688b-44d7-8081-1282028cdd97\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-688b-44d7-8081-1282028cdd97\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"41820b15-8dca-430f-b226-b3d26a3f80b5\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-04-24T18:28:31.0979781\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-688b-44d7-8081-1282028cdd97\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-688b-44d7-8081-1282028cdd97\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-688b-44d7-8081-1282028cdd97\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-688b-44d7-8081-1282028cdd97\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"41820b15-8dca-430f-b226-b3d26a3f80b5\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T18:28:31.1448558\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-688b-44d7-8081-1282028cdd97\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-3a6a-431c-8c4a-7c1f8b27f9f5\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-3a6a-431c-8c4a-7c1f8b27f9f5\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-3a6a-431c-8c4a-7c1f8b27f9f5\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"41820b15-8dca-430f-b226-b3d26a3f80b5\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-04-24T18:28:31.1762164\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-3a6a-431c-8c4a-7c1f8b27f9f5\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-3a6a-431c-8c4a-7c1f8b27f9f5\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-3a6a-431c-8c4a-7c1f8b27f9f5\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-3a6a-431c-8c4a-7c1f8b27f9f5\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"41820b15-8dca-430f-b226-b3d26a3f80b5\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T18:28:31.1762164\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-3a6a-431c-8c4a-7c1f8b27f9f5\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-688b-44d7-8081-1282028cdd97\",\"type\":\"Microsoft.Communication.DialogFailed\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-688b-44d7-8081-1282028cdd97\",\"resultInformation\":{\"code\":500,\"subCode\":8595,\"message\":\"Action failed, missing bot config or app id.\"},\"dialogInputType\":\"powerVirtualAgents\",\"dialogId\":\"92e08834-b6ee-4ede-8956-9fefa27a691c\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-688b-44d7-8081-1282028cdd97\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"41820b15-8dca-430f-b226-b3d26a3f80b5\",\"publicEventType\":\"Microsoft.Communication.DialogFailed\"},\"time\":\"2024-04-24T18:28:33.2388006\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-688b-44d7-8081-1282028cdd97\"}]"] \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/dtmfActionsInACallAutomatedTest.json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/dtmfActionsInACallAutomatedTest.json deleted file mode 100644 index 63208076fd7d..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/dtmfActionsInACallAutomatedTest.json +++ /dev/null @@ -1 +0,0 @@ -["[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-09a1-4ad4-9320-4f2d89459535\",\"type\":\"Microsoft.Communication.CallDisconnected\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-09a1-4ad4-9320-4f2d89459535\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-09a1-4ad4-9320-4f2d89459535\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"892264d7-e380-44f1-88fd-7764e019664b\",\"publicEventType\":\"Microsoft.Communication.CallDisconnected\"},\"time\":\"2024-04-24T18:29:05.7916051\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-09a1-4ad4-9320-4f2d89459535\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-567b-47c2-93a4-546fa6997899\",\"type\":\"Microsoft.Communication.CallDisconnected\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-567b-47c2-93a4-546fa6997899\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-567b-47c2-93a4-546fa6997899\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"63ad2792-7c3d-497d-bbae-aa384c7a8f03\",\"publicEventType\":\"Microsoft.Communication.CallDisconnected\"},\"time\":\"2024-04-24T18:29:06.0572971\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-567b-47c2-93a4-546fa6997899\"}]","{\"to\":{\"kind\":\"phoneNumber\",\"rawId\":\"REDACTED\",\"phoneNumber\":{\"value\":\"REDACTED\"}},\"from\":{\"kind\":\"phoneNumber\",\"rawId\":\"REDACTED\",\"phoneNumber\":{\"value\":\"REDACTED\"}},\"serverCallId\":\"REDACTED\",\"callerDisplayName\":\"\",\"incomingCallContext\":\"REDACTED\",\"correlationId\":\"1a14f457-e406-4aed-95b3-7e6259d23851\"}","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-476a-4aed-ae4b-fb8657609c2f\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-476a-4aed-ae4b-fb8657609c2f\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-476a-4aed-ae4b-fb8657609c2f\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"1a14f457-e406-4aed-95b3-7e6259d23851\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-04-24T19:16:50.3802422\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-476a-4aed-ae4b-fb8657609c2f\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-476a-4aed-ae4b-fb8657609c2f\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-476a-4aed-ae4b-fb8657609c2f\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"phoneNumber\",\"phoneNumber\":{\"value\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-476a-4aed-ae4b-fb8657609c2f\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"1a14f457-e406-4aed-95b3-7e6259d23851\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:50.5365\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-476a-4aed-ae4b-fb8657609c2f\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-e121-46d6-ab08-b468bd18edd5\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-e121-46d6-ab08-b468bd18edd5\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-e121-46d6-ab08-b468bd18edd5\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"d6d82270-ed3c-49b0-aeb9-2a157ca1af60\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-04-24T19:16:50.6345661\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-e121-46d6-ab08-b468bd18edd5\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-e121-46d6-ab08-b468bd18edd5\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-e121-46d6-ab08-b468bd18edd5\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"phoneNumber\",\"phoneNumber\":{\"value\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-e121-46d6-ab08-b468bd18edd5\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"d6d82270-ed3c-49b0-aeb9-2a157ca1af60\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:16:50.6345661\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-e121-46d6-ab08-b468bd18edd5\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-e121-46d6-ab08-b468bd18edd5\",\"type\":\"Microsoft.Communication.SendDtmfTonesCompleted\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-e121-46d6-ab08-b468bd18edd5\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-e121-46d6-ab08-b468bd18edd5\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"d6d82270-ed3c-49b0-aeb9-2a157ca1af60\",\"publicEventType\":\"Microsoft.Communication.SendDtmfTonesCompleted\"},\"time\":\"2024-04-24T19:16:55.6194105\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-e121-46d6-ab08-b468bd18edd5\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-e121-46d6-ab08-b468bd18edd5\",\"type\":\"Microsoft.Communication.ContinuousDtmfRecognitionStopped\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-e121-46d6-ab08-b468bd18edd5\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-e121-46d6-ab08-b468bd18edd5\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"d6d82270-ed3c-49b0-aeb9-2a157ca1af60\",\"publicEventType\":\"Microsoft.Communication.ContinuousDtmfRecognitionStopped\"},\"time\":\"2024-04-24T19:16:56.1352209\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-e121-46d6-ab08-b468bd18edd5\"}]"] \ No newline at end of file diff --git a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/playMediaInACallAutomatedTest.json b/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/playMediaInACallAutomatedTest.json deleted file mode 100644 index ef82e3d66c80..000000000000 --- a/sdk/communication/azure-communication-callautomation/src/test/resources/session-records/playMediaInACallAutomatedTest.json +++ /dev/null @@ -1 +0,0 @@ -["{\"to\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"from\":{\"kind\":\"communicationUser\",\"rawId\":\"REDACTED\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"serverCallId\":\"REDACTED\",\"callerDisplayName\":\"\",\"incomingCallContext\":\"REDACTED\",\"correlationId\":\"ef73aa27-a842-4fb1-bdaa-3a46db20014e\"}","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-b29e-4059-8f3c-f78434c99035\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-b29e-4059-8f3c-f78434c99035\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-b29e-4059-8f3c-f78434c99035\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"ef73aa27-a842-4fb1-bdaa-3a46db20014e\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-04-24T19:17:02.3387065\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-b29e-4059-8f3c-f78434c99035\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-5e6f-47d8-bc89-5489b351cd37\",\"type\":\"Microsoft.Communication.CallConnected\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-5e6f-47d8-bc89-5489b351cd37\",\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-5e6f-47d8-bc89-5489b351cd37\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"ef73aa27-a842-4fb1-bdaa-3a46db20014e\",\"publicEventType\":\"Microsoft.Communication.CallConnected\"},\"time\":\"2024-04-24T19:17:02.307396\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-5e6f-47d8-bc89-5489b351cd37\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-5e6f-47d8-bc89-5489b351cd37\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-5e6f-47d8-bc89-5489b351cd37\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-5e6f-47d8-bc89-5489b351cd37\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"ef73aa27-a842-4fb1-bdaa-3a46db20014e\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:17:02.3543277\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-5e6f-47d8-bc89-5489b351cd37\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-b29e-4059-8f3c-f78434c99035\",\"type\":\"Microsoft.Communication.ParticipantsUpdated\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-b29e-4059-8f3c-f78434c99035\",\"participants\":[{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false},{\"identifier\":{\"rawId\":\"REDACTED\",\"kind\":\"communicationUser\",\"communicationUser\":{\"id\":\"REDACTED\"}},\"isMuted\":false,\"isOnHold\":false}],\"sequenceNumber\":1,\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-b29e-4059-8f3c-f78434c99035\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"ef73aa27-a842-4fb1-bdaa-3a46db20014e\",\"publicEventType\":\"Microsoft.Communication.ParticipantsUpdated\"},\"time\":\"2024-04-24T19:17:02.3543277\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-b29e-4059-8f3c-f78434c99035\"}]","[{\"id\":\"REDACTED\",\"source\":\"calling/callConnections/451f3600-b29e-4059-8f3c-f78434c99035\",\"type\":\"Microsoft.Communication.PlayCompleted\",\"data\":{\"eventSource\":\"calling/callConnections/451f3600-b29e-4059-8f3c-f78434c99035\",\"resultInformation\":{\"code\":200,\"subCode\":0,\"message\":\"Action completed successfully.\"},\"version\":\"2023-10-03-preview\",\"callConnectionId\":\"451f3600-b29e-4059-8f3c-f78434c99035\",\"serverCallId\":\"REDACTED\",\"correlationId\":\"ef73aa27-a842-4fb1-bdaa-3a46db20014e\",\"publicEventType\":\"Microsoft.Communication.PlayCompleted\"},\"time\":\"2024-04-24T19:17:08.357708\\u002B00:00\",\"specversion\":\"1.0\",\"datacontenttype\":\"application/json\",\"subject\":\"calling/callConnections/451f3600-b29e-4059-8f3c-f78434c99035\"}]"] \ No newline at end of file diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallAutomationLiveTestBase.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallAutomationLiveTestBase.java index e5cf3dc2817e..fbfb3defe424 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallAutomationLiveTestBase.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/CallAutomationLiveTestBase.java @@ -13,6 +13,8 @@ import com.azure.core.test.TestMode; import com.azure.core.util.Configuration; import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.identity.DefaultAzureCredentialBuilder; import reactor.core.publisher.Mono; @@ -25,6 +27,8 @@ import java.util.regex.Pattern; public class CallAutomationLiveTestBase extends TestBase { + private static final ClientLogger LOGGER = new ClientLogger(CallAutomationLiveTestBase.class); + protected static final String CONNECTION_STRING = Configuration.getGlobalConfiguration() .get("COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING", "endpoint=https://REDACTED.communication.azure.com/;accesskey=QWNjZXNzS2V5"); @@ -109,7 +113,7 @@ protected Mono logHeaders(String testName, HttpPipelineNextPolicy final HttpResponse bufferedResponse = httpResponse.buffer(); /* Should sanitize printed response url */ - System.out.println("Chain-ID header for " + testName + " request " + LOGGER.log(LogLevel.VERBOSE, () -> "Chain-ID header for " + testName + " request " + bufferedResponse.getRequest().getUrl() + ": " + bufferedResponse.getHeaderValue("X-Microsoft-Skype-Chain-ID")); return Mono.just(bufferedResponse); diff --git a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/DownloadContentAsyncLiveTests.java b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/DownloadContentAsyncLiveTests.java index 4a397fa5a51f..732a8df93167 100644 --- a/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/DownloadContentAsyncLiveTests.java +++ b/sdk/communication/azure-communication-callingserver/src/test/java/com/azure/communication/callingserver/DownloadContentAsyncLiveTests.java @@ -8,6 +8,8 @@ import com.azure.communication.callingserver.models.ParallelDownloadOptions; import com.azure.core.http.HttpClient; import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -31,6 +33,7 @@ import static org.mockito.Mockito.times; public class DownloadContentAsyncLiveTests extends CallAutomationLiveTestBase { + private static final ClientLogger LOGGER = new ClientLogger(DownloadContentAsyncLiveTests.class); @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") @@ -61,7 +64,7 @@ private void downloadMetadata(CallAutomationAsyncClient conversationAsyncClient) try { validateMetadata(conversationAsyncClient.getCallRecordingAsync().downloadStream(METADATA_URL)); } catch (Exception e) { - System.out.println("Error: " + e.getMessage()); + LOGGER.log(LogLevel.VERBOSE, () -> "Error", e); throw e; } } @@ -79,7 +82,7 @@ public void downloadMetadataRetryingAsync(HttpClient httpClient) { try { validateMetadata(conversationAsyncClient.getCallRecordingAsync().downloadStream(METADATA_URL)); } catch (Exception e) { - System.out.println("Error: " + e.getMessage()); + LOGGER.log(LogLevel.VERBOSE, () -> "Error", e); throw e; } } @@ -104,7 +107,7 @@ public void downloadVideoAsync(HttpClient httpClient) { .verifyComplete()) .verifyComplete(); } catch (Exception e) { - System.out.println("Error: " + e.getMessage()); + LOGGER.log(LogLevel.VERBOSE, () -> "Error", e); throw e; } } diff --git a/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/ChatClientTest.java b/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/ChatClientTest.java index 89cd18a49ba8..4bdb19fff1e7 100644 --- a/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/ChatClientTest.java +++ b/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/ChatClientTest.java @@ -3,28 +3,30 @@ package com.azure.communication.chat; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - +import com.azure.communication.chat.implementation.ChatOptionsProvider; +import com.azure.communication.chat.models.ChatThreadItem; +import com.azure.communication.chat.models.CreateChatThreadOptions; +import com.azure.communication.chat.models.CreateChatThreadResult; +import com.azure.communication.chat.models.ListChatThreadsOptions; +import com.azure.communication.common.CommunicationUserIdentifier; import com.azure.communication.identity.CommunicationIdentityClient; import com.azure.communication.identity.models.CommunicationTokenScope; -import com.azure.communication.common.CommunicationUserIdentifier; -import com.azure.communication.chat.implementation.ChatOptionsProvider; -import com.azure.communication.chat.models.*; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + /** * Set the AZURE_TEST_MODE environment variable to either PLAYBACK or RECORD to determine if tests are playback or * live. By default, tests are run in playback mode. @@ -129,7 +131,7 @@ public void canDeleteChatThreadWithResponse(HttpClient httpClient) { @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void canListChatThreads(HttpClient httpClient) throws InterruptedException { + public void canListChatThreads(HttpClient httpClient) { // Arrange setupTest(httpClient, "canListChatThreadsSync"); CreateChatThreadOptions threadRequest1 = ChatOptionsProvider.createThreadOptions( @@ -139,7 +141,7 @@ public void canListChatThreads(HttpClient httpClient) throws InterruptedExceptio client.createChatThread(threadRequest1); client.createChatThread(threadRequest2); - Thread.sleep(500); + sleepIfRunningAgainstService(500); // Action & Assert PagedIterable threadsResponse = client.listChatThreads(); @@ -156,7 +158,7 @@ public void canListChatThreads(HttpClient httpClient) throws InterruptedExceptio @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") - public void canListChatThreadsWithMaxPageSize(HttpClient httpClient) throws InterruptedException { + public void canListChatThreadsWithMaxPageSize(HttpClient httpClient) { // Arrange setupTest(httpClient, "canListChatThreadsWithMaxPageSizeSync"); CreateChatThreadOptions threadRequest1 = ChatOptionsProvider.createThreadOptions( @@ -166,7 +168,7 @@ public void canListChatThreadsWithMaxPageSize(HttpClient httpClient) throws Inte client.createChatThread(threadRequest1); client.createChatThread(threadRequest2); - Thread.sleep(500); + sleepIfRunningAgainstService(500); ListChatThreadsOptions options = new ListChatThreadsOptions(); options.setMaxPageSize(10); diff --git a/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/CommunicationLoggerPolicy.java b/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/CommunicationLoggerPolicy.java index 362f2f720f74..74737342374d 100644 --- a/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/CommunicationLoggerPolicy.java +++ b/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/CommunicationLoggerPolicy.java @@ -9,6 +9,7 @@ import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import reactor.core.publisher.Mono; /** @@ -16,7 +17,7 @@ */ public class CommunicationLoggerPolicy implements HttpPipelinePolicy { - private final ClientLogger logger = new ClientLogger(CommunicationLoggerPolicy.class); + private static final ClientLogger LOGGER = new ClientLogger(CommunicationLoggerPolicy.class); private final String testName; /** @@ -34,7 +35,7 @@ public Mono process(HttpPipelineCallContext context, HttpPipelineN final HttpResponse bufferedResponse = httpResponse.buffer(); // Should sanitize printed reponse url - System.out.println("MS-CV header for " + testName + " request " + LOGGER.log(LogLevel.VERBOSE, () -> "MS-CV header for " + testName + " request " + bufferedResponse.getRequest().getUrl() + ": " + bufferedResponse.getHeaderValue("MS-CV")); return Mono.just(bufferedResponse); }); diff --git a/sdk/communication/azure-communication-identity/src/test/java/com/azure/communication/identity/CommunicationIdentityClientTestBase.java b/sdk/communication/azure-communication-identity/src/test/java/com/azure/communication/identity/CommunicationIdentityClientTestBase.java index 4a2be505d72a..0b183b1b4d6a 100644 --- a/sdk/communication/azure-communication-identity/src/test/java/com/azure/communication/identity/CommunicationIdentityClientTestBase.java +++ b/sdk/communication/azure-communication-identity/src/test/java/com/azure/communication/identity/CommunicationIdentityClientTestBase.java @@ -19,6 +19,8 @@ import com.azure.core.test.models.TestProxySanitizerType; import com.azure.core.test.utils.MockTokenCredential; import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.identity.DefaultAzureCredentialBuilder; import reactor.core.publisher.Mono; @@ -33,6 +35,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; public class CommunicationIdentityClientTestBase extends TestProxyTestBase { + private static final ClientLogger LOGGER = new ClientLogger(CommunicationIdentityClientTestBase.class); private static final String REDACTED = "REDACTED"; private static final String URI_IDENTITY_REPLACER_REGEX = "/identities/([^/?]+)"; @@ -159,7 +162,7 @@ private Mono logHeaders(String testName, HttpPipelineNextPolicy ne final HttpResponse bufferedResponse = httpResponse.buffer(); // Should sanitize printed reponse url - System.out.println("MS-CV header for " + testName + " request " + LOGGER.log(LogLevel.VERBOSE, () -> "MS-CV header for " + testName + " request " + bufferedResponse.getRequest().getUrl() + ": " + bufferedResponse.getHeaderValue("MS-CV")); return Mono.just(bufferedResponse); }); diff --git a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/ClassificationPolicyAsyncLiveTests.java b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/ClassificationPolicyAsyncLiveTests.java index b180abf99367..deac224f7551 100644 --- a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/ClassificationPolicyAsyncLiveTests.java +++ b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/ClassificationPolicyAsyncLiveTests.java @@ -26,7 +26,6 @@ import com.azure.communication.jobrouter.models.WorkerSelectorAttachment; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.Response; -import com.azure.core.test.TestMode; import com.azure.core.util.BinaryData; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -139,9 +138,7 @@ public void createClassificationPolicy(HttpClient httpClient) throws Interrupted } })).block(); - if (this.getTestMode() != TestMode.PLAYBACK) { - Thread.sleep(5000); - } + sleepIfRunningAgainstService(5000); // Verify assertEquals(classificationPolicyId, policy.getId()); diff --git a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/ClassificationPolicyLiveTests.java b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/ClassificationPolicyLiveTests.java index 5639631436e9..1da46b2b40da 100644 --- a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/ClassificationPolicyLiveTests.java +++ b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/ClassificationPolicyLiveTests.java @@ -24,7 +24,6 @@ import com.azure.communication.jobrouter.models.WorkerSelectorAttachment; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.Response; -import com.azure.core.test.TestMode; import com.azure.core.util.BinaryData; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -107,9 +106,7 @@ public void createClassificationPolicy(HttpClient httpClient) throws Interrupted RouterJob job = routerClient.createJobWithClassificationPolicy( new CreateJobWithClassificationPolicyOptions(jobId, channelId, classificationPolicyId)); - if (this.getTestMode() != TestMode.PLAYBACK) { - Thread.sleep(5000); - } + sleepIfRunningAgainstService(5000); // Verify assertEquals(classificationPolicyId, policy.getId()); diff --git a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterJobAsyncLiveTests.java b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterJobAsyncLiveTests.java index 92e21536b168..ccf6b55c2157 100644 --- a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterJobAsyncLiveTests.java +++ b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterJobAsyncLiveTests.java @@ -25,7 +25,6 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; -import com.azure.core.test.TestMode; import com.azure.core.util.BinaryData; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -150,9 +149,7 @@ public void unassignJob(HttpClient httpClient) throws InterruptedException { assertEquals(2, jobDeserialized.getRequestedWorkerSelectors().size()); assertEquals(Duration.ofSeconds(100), jobDeserialized.getRequestedWorkerSelectors().get(0).getExpiresAfter()); - if (this.getTestMode() != TestMode.PLAYBACK) { - Thread.sleep(2000); - } + sleepIfRunningAgainstService(2000); jobDeserialized.setPriority(10); RouterJob updatedJob = jobRouterAsyncClient.updateJob(jobId, jobDeserialized).block(); @@ -207,9 +204,7 @@ public void unassignJob(HttpClient httpClient) throws InterruptedException { // Verify assertTrue(unassignJobResult.getUnassignmentCount() > 0); - if (this.getTestMode() != TestMode.PLAYBACK) { - Thread.sleep(5000); - } + sleepIfRunningAgainstService(5000); RouterQueueStatistics queueStatistics = jobRouterAsyncClient.getQueueStatistics(queueId).block(); @@ -236,9 +231,7 @@ public void unassignJob(HttpClient httpClient) throws InterruptedException { jobRouterAsyncClient.cancelJob(jobId, requestOptions).block(); jobRouterAsyncClient.deleteJob(jobId).block(); jobRouterAsyncClient.deleteWorker(workerId).block(); - if (this.getTestMode() != TestMode.PLAYBACK) { - Thread.sleep(5000); - } + sleepIfRunningAgainstService(5000); administrationAsyncClient.deleteQueue(queueId).block(); administrationAsyncClient.deleteDistributionPolicy(distributionPolicyId).block(); } diff --git a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterJobLiveTests.java b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterJobLiveTests.java index 23447f8edab1..2363a4d1228a 100644 --- a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterJobLiveTests.java +++ b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterJobLiveTests.java @@ -25,7 +25,6 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; -import com.azure.core.test.TestMode; import com.azure.core.util.BinaryData; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -151,9 +150,7 @@ public void unassignJob(HttpClient httpClient) throws InterruptedException { assertEquals(2, jobDeserialized.getRequestedWorkerSelectors().size()); assertEquals(Duration.ofSeconds(100), jobDeserialized.getRequestedWorkerSelectors().get(0).getExpiresAfter()); - if (this.getTestMode() != TestMode.PLAYBACK) { - Thread.sleep(2000); - } + sleepIfRunningAgainstService(2000); jobDeserialized.setPriority(10); RouterJob updatedJob = jobRouterClient.updateJob(jobId, jobDeserialized); @@ -207,9 +204,7 @@ public void unassignJob(HttpClient httpClient) throws InterruptedException { // Verify assertTrue(unassignJobResult.getUnassignmentCount() > 0); - if (this.getTestMode() != TestMode.PLAYBACK) { - Thread.sleep(5000); - } + sleepIfRunningAgainstService(5000); RouterQueueStatistics queueStatistics = jobRouterClient.getQueueStatistics(queueId); @@ -235,9 +230,7 @@ public void unassignJob(HttpClient httpClient) throws InterruptedException { jobRouterClient.cancelJob(jobId, requestOptions); jobRouterClient.deleteJob(jobId); jobRouterClient.deleteWorker(workerId); - if (this.getTestMode() != TestMode.PLAYBACK) { - Thread.sleep(5000); - } + sleepIfRunningAgainstService(5000); routerAdminClient.deleteQueue(queueId); routerAdminClient.deleteDistributionPolicy(distributionPolicyId); } @@ -264,9 +257,7 @@ public void jobScheduling(HttpClient httpClient) throws InterruptedException { OffsetDateTime.of(2040, 1, 1, 1, 1, 1, 1, ZoneOffset.UTC)))); assertEquals(RouterJobStatus.PENDING_SCHEDULE, job.getStatus()); - if (this.getTestMode() != TestMode.PLAYBACK) { - Thread.sleep(2000); - } + sleepIfRunningAgainstService(2000); // Action job.setMatchingMode(new QueueAndMatchMode()); diff --git a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterWorkerAsyncLiveTests.java b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterWorkerAsyncLiveTests.java index 800d9d47d2f1..4cd77b5ce427 100644 --- a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterWorkerAsyncLiveTests.java +++ b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterWorkerAsyncLiveTests.java @@ -14,7 +14,6 @@ import com.azure.communication.jobrouter.models.RouterWorker; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.Response; -import com.azure.core.test.TestMode; import com.azure.core.util.BinaryData; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -132,9 +131,7 @@ public void createWorker(HttpClient httpClient) throws InterruptedException { assertEquals(channels.size(), deserialized.getChannels().size()); assertEquals(deserialized.getEtag(), result.getEtag()); - if (this.getTestMode() != TestMode.PLAYBACK) { - Thread.sleep(2000); - } + sleepIfRunningAgainstService(2000); deserialized.setAvailableForOffers(true); deserialized.setChannels(new ArrayList() { diff --git a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterWorkerLiveTests.java b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterWorkerLiveTests.java index 008f0b3a0eea..b4423b1403e9 100644 --- a/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterWorkerLiveTests.java +++ b/sdk/communication/azure-communication-jobrouter/src/test/java/com.azure.communication.jobrouter/RouterWorkerLiveTests.java @@ -11,7 +11,6 @@ import com.azure.communication.jobrouter.models.RouterWorker; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.Response; -import com.azure.core.test.TestMode; import com.azure.core.util.BinaryData; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -108,9 +107,7 @@ public void createWorker(HttpClient httpClient) throws InterruptedException { assertEquals(channels.size(), deserialized.getChannels().size()); assertEquals(deserialized.getEtag(), result.getEtag()); - if (this.getTestMode() != TestMode.PLAYBACK) { - Thread.sleep(2000); - } + sleepIfRunningAgainstService(2000); deserialized.setAvailableForOffers(true); deserialized.setChannels(new ArrayList() { diff --git a/sdk/communication/azure-communication-messages/src/test/java/com/azure/communication/messages/CommunicationMessagesTestBase.java b/sdk/communication/azure-communication-messages/src/test/java/com/azure/communication/messages/CommunicationMessagesTestBase.java index 34bfb174ebde..ebb1ceae3992 100644 --- a/sdk/communication/azure-communication-messages/src/test/java/com/azure/communication/messages/CommunicationMessagesTestBase.java +++ b/sdk/communication/azure-communication-messages/src/test/java/com/azure/communication/messages/CommunicationMessagesTestBase.java @@ -14,11 +14,14 @@ import com.azure.core.test.models.TestProxySanitizer; import com.azure.core.test.models.TestProxySanitizerType; import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import reactor.core.publisher.Mono; import java.util.Arrays; public class CommunicationMessagesTestBase extends TestProxyTestBase { + private static final ClientLogger LOGGER = new ClientLogger(CommunicationMessagesTestBase.class); protected static final String CONNECTION_STRING = Configuration.getGlobalConfiguration() .get("COMMUNICATION_CONNECTION_STRING_CPM", @@ -101,7 +104,7 @@ public Mono logHeaders(HttpPipelineNextPolicy next) { final HttpResponse bufferedResponse = httpResponse.buffer(); // Should sanitize printed reponse url - System.out.println("MS-CV header for request " + LOGGER.log(LogLevel.VERBOSE, () -> "MS-CV header for request " + bufferedResponse.getRequest().getUrl() + ": " + bufferedResponse.getHeaderValue("MS-CV")); return Mono.just(bufferedResponse); }); diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersIntegrationTestBase.java b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersIntegrationTestBase.java index 43789327783c..15d95cadd7c3 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersIntegrationTestBase.java +++ b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersIntegrationTestBase.java @@ -16,12 +16,16 @@ import com.azure.core.test.models.TestProxySanitizerType; import com.azure.core.test.utils.MockTokenCredential; import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.identity.DefaultAzureCredentialBuilder; import reactor.core.publisher.Mono; import java.util.Arrays; public class PhoneNumbersIntegrationTestBase extends TestProxyTestBase { + private static final ClientLogger LOGGER = new ClientLogger(PhoneNumbersIntegrationTestBase.class); + private static final String CONNECTION_STRING = Configuration.getGlobalConfiguration() .get("COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING", "endpoint=https://REDACTED.communication.azure.com/;accesskey=QWNjZXNzS2V5"); @@ -141,8 +145,8 @@ private Mono logHeaders(String testName, HttpPipelineNextPolicy ne final HttpResponse bufferedResponse = httpResponse.buffer(); // Should sanitize printed reponse url - System.out.println("MS-CV header for " + testName + " request " - + bufferedResponse.getRequest().getUrl() + ": " + bufferedResponse.getHeaderValue("MS-CV")); + LOGGER.log(LogLevel.VERBOSE, () -> "MS-CV header for " + testName + " request " + + bufferedResponse.getRequest().getUrl() + ": " + bufferedResponse.getHeaderValue("MS-CV")); return Mono.just(bufferedResponse); }); } diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/siprouting/SipRoutingIntegrationTestBase.java b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/siprouting/SipRoutingIntegrationTestBase.java index b74c96e53805..8d0b33036d34 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/siprouting/SipRoutingIntegrationTestBase.java +++ b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/siprouting/SipRoutingIntegrationTestBase.java @@ -19,16 +19,20 @@ import com.azure.core.test.models.TestProxySanitizerType; import com.azure.core.test.utils.MockTokenCredential; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.identity.DefaultAzureCredentialBuilder; import reactor.core.publisher.Mono; import java.util.Arrays; import java.util.List; -import java.util.UUID; import static java.util.Arrays.asList; public class SipRoutingIntegrationTestBase extends TestProxyTestBase { + private static final ClientLogger LOGGER = new ClientLogger(SipRoutingIntegrationTestBase.class); + private static final String CONNECTION_STRING = Configuration.getGlobalConfiguration() .get("COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING", "endpoint=https://REDACTED.communication.azure.com/;accesskey=QWNjZXNzS2V5"); private static final String AZURE_TEST_DOMAIN = Configuration.getGlobalConfiguration() @@ -192,7 +196,7 @@ private Mono logHeaders(String testName, HttpPipelineNextPolicy ne final HttpResponse bufferedResponse = httpResponse.buffer(); // Should sanitize printed reponse url - System.out.println("MS-CV header for " + testName + " request " + LOGGER.log(LogLevel.VERBOSE, () -> "MS-CV header for " + testName + " request " + bufferedResponse.getRequest().getUrl() + ": " + bufferedResponse.getHeaderValue("MS-CV")); return Mono.just(bufferedResponse); }); @@ -203,7 +207,7 @@ private static String getUniqueFqdn(String order) { return order + ".redacted" + "." + AZURE_TEST_DOMAIN; } - String unique = UUID.randomUUID().toString().replace("-", ""); + String unique = CoreUtils.randomUuid().toString().replace("-", ""); return order + "-" + unique + "." + AZURE_TEST_DOMAIN; } } diff --git a/sdk/communication/azure-communication-rooms/src/test/java/com/azure/communication/rooms/RoomsAsyncClientTests.java b/sdk/communication/azure-communication-rooms/src/test/java/com/azure/communication/rooms/RoomsAsyncClientTests.java index dc472774da6f..6fe6e520b73d 100644 --- a/sdk/communication/azure-communication-rooms/src/test/java/com/azure/communication/rooms/RoomsAsyncClientTests.java +++ b/sdk/communication/azure-communication-rooms/src/test/java/com/azure/communication/rooms/RoomsAsyncClientTests.java @@ -3,33 +3,42 @@ package com.azure.communication.rooms; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; - +import com.azure.communication.common.CommunicationIdentifier; +import com.azure.communication.common.CommunicationUserIdentifier; import com.azure.communication.identity.CommunicationIdentityClient; -import com.azure.communication.rooms.models.*; import com.azure.communication.rooms.implementation.models.CommunicationErrorResponseException; +import com.azure.communication.rooms.models.AddOrUpdateParticipantsResult; +import com.azure.communication.rooms.models.CommunicationRoom; +import com.azure.communication.rooms.models.CreateRoomOptions; +import com.azure.communication.rooms.models.ParticipantRole; +import com.azure.communication.rooms.models.RemoveParticipantsResult; +import com.azure.communication.rooms.models.RoomParticipant; +import com.azure.communication.rooms.models.UpdateRoomOptions; import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.Response; import com.azure.core.test.http.AssertingHttpClientBuilder; -import java.util.Arrays; -import java.util.List; - -import com.azure.communication.common.CommunicationIdentifier; -import com.azure.communication.common.CommunicationUserIdentifier; - +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; - import reactor.core.publisher.Mono; import reactor.test.StepVerifier; +import java.util.Arrays; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + public class RoomsAsyncClientTests extends RoomsTestBase { + private static final ClientLogger LOGGER = new ClientLogger(RoomsAsyncClientTests.class); + private RoomsAsyncClient roomsAsyncClient; private CommunicationIdentityClient communicationClient; private final String nonExistRoomId = "NotExistingRoomID"; @@ -78,7 +87,7 @@ public void createRoomFullCycleWithResponseStep(HttpClient httpClient) { Mono> response3 = roomsAsyncClient.updateRoomWithResponse(roomId, updateOptions); - System.out.println(VALID_FROM.plusMonths(3).getDayOfYear()); + LOGGER.log(LogLevel.VERBOSE, () -> String.valueOf(VALID_FROM.plusMonths(3).getDayOfYear())); StepVerifier.create(response3) .assertNext(roomResult -> { @@ -121,10 +130,10 @@ public void createRoomFullCycleWithOutResponseStep(HttpClient httpClient) { StepVerifier.create(response1) .assertNext(roomResult -> { - assertTrue(roomResult.getRoomId() != null); - assertTrue(roomResult.getCreatedAt() != null); - assertTrue(roomResult.getValidFrom() != null); - assertTrue(roomResult.getValidUntil() != null); + assertNotNull(roomResult.getRoomId()); + assertNotNull(roomResult.getCreatedAt()); + assertNotNull(roomResult.getValidFrom()); + assertNotNull(roomResult.getValidUntil()); assertTrue(roomResult.isPstnDialOutEnabled()); }).verifyComplete(); @@ -139,7 +148,7 @@ public void createRoomFullCycleWithOutResponseStep(HttpClient httpClient) { StepVerifier.create(response3) .assertNext(result3 -> { - assertEquals(true, result3.getValidUntil().toEpochSecond() > result3.getValidFrom().toEpochSecond()); + assertTrue(result3.getValidUntil().toEpochSecond() > result3.getValidFrom().toEpochSecond()); assertTrue(result3.isPstnDialOutEnabled()); }).verifyComplete(); @@ -168,10 +177,10 @@ public void createRoomWithNoAttributes(HttpClient httpClient) { StepVerifier.create(response1) .assertNext(roomResult -> { - assertTrue(roomResult.getRoomId() != null); - assertTrue(roomResult.getCreatedAt() != null); - assertTrue(roomResult.getValidFrom() != null); - assertTrue(roomResult.getValidUntil() != null); + assertNotNull(roomResult.getRoomId()); + assertNotNull(roomResult.getCreatedAt()); + assertNotNull(roomResult.getValidFrom()); + assertNotNull(roomResult.getValidUntil()); assertFalse(roomResult.isPstnDialOutEnabled()); }).verifyComplete(); @@ -210,10 +219,10 @@ public void createRoomWithOnlyParticipantAttributes(HttpClient httpClient) { StepVerifier.create(response1) .assertNext(roomResult -> { - assertTrue(roomResult.getRoomId() != null); - assertTrue(roomResult.getCreatedAt() != null); - assertTrue(roomResult.getValidFrom() != null); - assertTrue(roomResult.getValidUntil() != null); + assertNotNull(roomResult.getRoomId()); + assertNotNull(roomResult.getCreatedAt()); + assertNotNull(roomResult.getValidFrom()); + assertNotNull(roomResult.getValidUntil()); assertTrue(roomResult.isPstnDialOutEnabled()); }).verifyComplete(); @@ -241,10 +250,10 @@ public void createRoomWithOnlyPstnEnabledAttribute(HttpClient httpClient) { StepVerifier.create(response1) .assertNext(roomResult -> { - assertTrue(roomResult.getRoomId() != null); - assertTrue(roomResult.getCreatedAt() != null); - assertTrue(roomResult.getValidFrom() != null); - assertTrue(roomResult.getValidUntil() != null); + assertNotNull(roomResult.getRoomId()); + assertNotNull(roomResult.getCreatedAt()); + assertNotNull(roomResult.getValidFrom()); + assertNotNull(roomResult.getValidUntil()); assertTrue(roomResult.isPstnDialOutEnabled()); }).verifyComplete(); @@ -566,10 +575,10 @@ public void addUpdateAndRemoveParticipantsOperationsWithFullFlow(HttpClient http StepVerifier.create(createCommunicationRoom) .assertNext(roomResult -> { - assertTrue(roomResult.getRoomId() != null); - assertTrue(roomResult.getCreatedAt() != null); - assertTrue(roomResult.getValidFrom() != null); - assertTrue(roomResult.getValidUntil() != null); + assertNotNull(roomResult.getRoomId()); + assertNotNull(roomResult.getCreatedAt()); + assertNotNull(roomResult.getValidFrom()); + assertNotNull(roomResult.getValidUntil()); assertTrue(roomResult.isPstnDialOutEnabled()); }).verifyComplete(); @@ -627,7 +636,7 @@ public void addUpdateAndRemoveParticipantsOperationsWithFullFlow(HttpClient http StepVerifier.create(updateParticipantResponse) .assertNext(result -> { - assertEquals(true, result instanceof AddOrUpdateParticipantsResult); + assertInstanceOf(AddOrUpdateParticipantsResult.class, result); }) .verifyComplete(); @@ -680,7 +689,7 @@ public void addUpdateAndRemoveParticipantsOperationsWithFullFlow(HttpClient http StepVerifier.create(removeParticipantResponse2) .assertNext(result -> { - assertEquals(true, result instanceof RemoveParticipantsResult); + assertInstanceOf(RemoveParticipantsResult.class, result); }) .verifyComplete(); @@ -716,10 +725,10 @@ public void addParticipantsOperationWithOutResponse(HttpClient httpClient) { StepVerifier.create(createCommunicationRoom) .assertNext(roomResult -> { - assertTrue(roomResult.getRoomId() != null); - assertTrue(roomResult.getCreatedAt() != null); - assertTrue(roomResult.getValidFrom() != null); - assertTrue(roomResult.getValidUntil() != null); + assertNotNull(roomResult.getRoomId()); + assertNotNull(roomResult.getCreatedAt()); + assertNotNull(roomResult.getValidFrom()); + assertNotNull(roomResult.getValidUntil()); assertTrue(roomResult.isPstnDialOutEnabled()); }).verifyComplete(); @@ -772,10 +781,10 @@ public void addUpdateInvalidParticipants(HttpClient httpClient) { StepVerifier.create(createCommunicationRoom) .assertNext(roomResult -> { - assertEquals(true, roomResult.getRoomId() != null); - assertEquals(true, roomResult.getCreatedAt() != null); - assertEquals(true, roomResult.getValidFrom() != null); - assertEquals(true, roomResult.getValidUntil() != null); + assertNotNull(roomResult.getRoomId()); + assertNotNull(roomResult.getCreatedAt()); + assertNotNull(roomResult.getValidFrom()); + assertNotNull(roomResult.getValidUntil()); }).verifyComplete(); String roomId = createCommunicationRoom.block().getRoomId(); @@ -822,10 +831,10 @@ public void listRoomTestFirstRoomIsNotNullThenDeleteRoomWithOutResponse(HttpClie StepVerifier.create(createCommunicationRoom) .assertNext(roomResult -> { - assertEquals(true, roomResult.getRoomId() != null); - assertEquals(true, roomResult.getCreatedAt() != null); - assertEquals(true, roomResult.getValidFrom() != null); - assertEquals(true, roomResult.getValidUntil() != null); + assertNotNull(roomResult.getRoomId()); + assertNotNull(roomResult.getCreatedAt()); + assertNotNull(roomResult.getValidFrom()); + assertNotNull(roomResult.getValidUntil()); }).verifyComplete(); String roomId = createCommunicationRoom.block().getRoomId(); @@ -835,10 +844,10 @@ public void listRoomTestFirstRoomIsNotNullThenDeleteRoomWithOutResponse(HttpClie StepVerifier.create(listRoomResponse.take(1)) .assertNext(room -> { - assertEquals(true, room.getRoomId() != null); - assertEquals(true, room.getCreatedAt() != null); - assertEquals(true, room.getValidFrom() != null); - assertEquals(true, room.getValidUntil() != null); + assertNotNull(room.getRoomId()); + assertNotNull(room.getCreatedAt()); + assertNotNull(room.getValidFrom()); + assertNotNull(room.getValidUntil()); }) .expectComplete() .verify(); diff --git a/sdk/communication/azure-communication-rooms/src/test/java/com/azure/communication/rooms/RoomsTestBase.java b/sdk/communication/azure-communication-rooms/src/test/java/com/azure/communication/rooms/RoomsTestBase.java index c78a43f7207b..d845723cd19b 100644 --- a/sdk/communication/azure-communication-rooms/src/test/java/com/azure/communication/rooms/RoomsTestBase.java +++ b/sdk/communication/azure-communication-rooms/src/test/java/com/azure/communication/rooms/RoomsTestBase.java @@ -5,10 +5,14 @@ import com.azure.communication.common.implementation.CommunicationConnectionString; import com.azure.communication.identity.CommunicationIdentityClientBuilder; -import com.azure.communication.rooms.models.*; +import com.azure.communication.rooms.models.CommunicationRoom; +import com.azure.communication.rooms.models.RoomParticipant; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.credential.TokenCredential; import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipelineNextPolicy; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; import com.azure.core.test.models.BodilessMatcher; @@ -16,18 +20,17 @@ import com.azure.core.test.utils.MockTokenCredential; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; +import reactor.core.publisher.Mono; import java.time.OffsetDateTime; import java.util.Arrays; -import java.util.Locale; -import reactor.core.publisher.Mono; -import com.azure.core.http.HttpPipelineNextPolicy; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.Response; -import static org.junit.jupiter.api.Assertions.*; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; public class RoomsTestBase extends TestProxyTestBase { - protected static final TestMode TEST_MODE = initializeTestMode(); + private static final ClientLogger LOGGER = new ClientLogger(RoomsTestBase.class); protected static final String CONNECTION_STRING = Configuration.getGlobalConfiguration().get( "COMMUNICATION_CONNECTION_STRING_ROOMS", @@ -112,23 +115,6 @@ protected void configureTestMode(RoomsClientBuilder builder) { } } - private static TestMode initializeTestMode() { - ClientLogger logger = new ClientLogger(RoomsTestBase.class); - String azureTestMode = Configuration.getGlobalConfiguration().get("AZURE_TEST_MODE"); - if (azureTestMode != null) { - System.out.println("azureTestMode: " + azureTestMode); - try { - return TestMode.valueOf(azureTestMode.toUpperCase(Locale.US)); - } catch (IllegalArgumentException var3) { - logger.error("Could not parse '{}' into TestEnum. Using 'Playback' mode.", azureTestMode); - return TestMode.PLAYBACK; - } - } else { - logger.info("Environment variable '{}' has not been set yet. Using 'Playback' mode.", "AZURE_TEST_MODE"); - return TestMode.PLAYBACK; - } - } - protected RoomsClientBuilder addLoggingPolicy(RoomsClientBuilder builder, String testName) { return builder.addPolicy((context, next) -> logHeaders(testName, next)); } @@ -153,8 +139,8 @@ private Mono logHeaders(String testName, HttpPipelineNextPolicy ne final HttpResponse bufferedResponse = httpResponse.buffer(); // Should sanitize printed reponse url - System.out.println("MS-CV header for " + testName + " request " + bufferedResponse.getRequest().getUrl() - + ": " + bufferedResponse.getHeaderValue("MS-CV")); + LOGGER.log(LogLevel.VERBOSE, () -> "MS-CV header for " + testName + " request " + + bufferedResponse.getRequest().getUrl() + ": " + bufferedResponse.getHeaderValue("MS-CV")); return Mono.just(bufferedResponse); }); } diff --git a/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsTestBase.java b/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsTestBase.java index fdffac7a5479..bbfcda8cc29f 100644 --- a/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsTestBase.java +++ b/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsTestBase.java @@ -15,11 +15,15 @@ import com.azure.core.test.models.TestProxySanitizerType; import com.azure.core.test.utils.MockTokenCredential; import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import reactor.core.publisher.Mono; import java.util.Arrays; public class SmsTestBase extends TestProxyTestBase { + private static final ClientLogger LOGGER = new ClientLogger(SmsTestBase.class); + protected static final String CONNECTION_STRING = Configuration.getGlobalConfiguration() .get("COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING", "endpoint=https://REDACTED.communication.azure.com/;accesskey=QWNjZXNzS2V5"); @@ -95,8 +99,8 @@ private Mono logHeaders(String testName, HttpPipelineNextPolicy ne final HttpResponse bufferedResponse = httpResponse.buffer(); // Should sanitize printed reponse url - System.out.println("MS-CV header for " + testName + " request " - + bufferedResponse.getRequest().getUrl() + ": " + bufferedResponse.getHeaderValue("MS-CV")); + LOGGER.log(LogLevel.VERBOSE, () -> ("MS-CV header for " + testName + " request " + + bufferedResponse.getRequest().getUrl() + ": " + bufferedResponse.getHeaderValue("MS-CV"))); return Mono.just(bufferedResponse); }); } diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/ConfidentialLedgerClientTestBase.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/ConfidentialLedgerClientTestBase.java index c91b8d5c6cf1..d9c220dd946f 100644 --- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/ConfidentialLedgerClientTestBase.java +++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/ConfidentialLedgerClientTestBase.java @@ -18,6 +18,8 @@ import com.azure.core.test.models.TestProxySanitizer; import com.azure.core.test.models.TestProxySanitizerType; import com.azure.core.util.BinaryData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.security.confidentialledger.certificate.ConfidentialLedgerCertificateClient; import com.azure.security.confidentialledger.certificate.ConfidentialLedgerCertificateClientBuilder; @@ -39,6 +41,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; class ConfidentialLedgerClientTestBase extends TestProxyTestBase { + private static final ClientLogger LOGGER = new ClientLogger(ConfidentialLedgerClientTestBase.class); protected static final String TRANSACTION_ID = "transactionId"; protected static final String COLLECTION_ID = "collectionId"; @@ -82,7 +85,7 @@ protected void beforeTest() { try { jsonNode = mapper.readTree(identityResponse.toBytes()); } catch (IOException ex) { - System.out.println("Caught IO exception " + ex); + LOGGER.log(LogLevel.VERBOSE, () -> "Caught IO exception", ex); Assertions.fail(); } @@ -104,7 +107,7 @@ protected void beforeTest() { reactorClient = reactor.netty.http.client.HttpClient.create() .secure(sslContextSpec -> sslContextSpec.sslContext(sslContext)); } catch (SSLException ex) { - System.out.println("Caught SSL exception " + ex); + LOGGER.log(LogLevel.VERBOSE, () -> "Caught SSL exception", ex); Assertions.fail(); } diff --git a/sdk/containerregistry/azure-containers-containerregistry/src/test/java/com/azure/containers/containerregistry/TestUtils.java b/sdk/containerregistry/azure-containers-containerregistry/src/test/java/com/azure/containers/containerregistry/TestUtils.java index d844c0558d86..839f886a4b87 100644 --- a/sdk/containerregistry/azure-containers-containerregistry/src/test/java/com/azure/containers/containerregistry/TestUtils.java +++ b/sdk/containerregistry/azure-containers-containerregistry/src/test/java/com/azure/containers/containerregistry/TestUtils.java @@ -125,7 +125,6 @@ static TokenCredential getCredentialByAuthority(TestMode testMode, String author static void importImage(TestMode mode, String repository, List tags) { try { importImage(mode, REGISTRY_NAME, repository, tags, REGISTRY_ENDPOINT); - Thread.sleep(SLEEP_TIME_IN_MILLISECONDS); } catch (InterruptedException e) { e.printStackTrace(); } @@ -190,6 +189,8 @@ static void importImage(TestMode mode, String registryName, String repository, L Thread.sleep(SLEEP_TIME_IN_MILLISECONDS); } } while (++index < 3); + + Thread.sleep(SLEEP_TIME_IN_MILLISECONDS); } private static OciImageManifest createManifest() { diff --git a/sdk/core/azure-core-http-jdk-httpclient/src/main/java/com/azure/core/http/jdk/httpclient/implementation/JdkHttpUtils.java b/sdk/core/azure-core-http-jdk-httpclient/src/main/java/com/azure/core/http/jdk/httpclient/implementation/JdkHttpUtils.java index 85ae06b2f5a3..bc9a29d746c2 100644 --- a/sdk/core/azure-core-http-jdk-httpclient/src/main/java/com/azure/core/http/jdk/httpclient/implementation/JdkHttpUtils.java +++ b/sdk/core/azure-core-http-jdk-httpclient/src/main/java/com/azure/core/http/jdk/httpclient/implementation/JdkHttpUtils.java @@ -3,6 +3,7 @@ package com.azure.core.http.jdk.httpclient.implementation; import com.azure.core.http.HttpHeaders; +import com.azure.core.implementation.util.HttpHeadersAccessHelper; import com.azure.core.util.CoreUtils; import java.nio.ByteBuffer; @@ -25,13 +26,14 @@ public final class JdkHttpUtils { * @param headers the JDK Http headers * @return the azure-core Http headers */ - @SuppressWarnings("deprecation") public static HttpHeaders fromJdkHttpHeaders(java.net.http.HttpHeaders headers) { final HttpHeaders httpHeaders = new HttpHeaders((int) (headers.map().size() / 0.75F)); for (Map.Entry> kvp : headers.map().entrySet()) { if (!CoreUtils.isNullOrEmpty(kvp.getValue())) { - httpHeaders.set(kvp.getKey(), kvp.getValue()); + // JDK HttpClient parses headers to lower case, use the access helper to bypass lowercasing the header + // name (or in this case, just checking that the header name is lowercased). + HttpHeadersAccessHelper.setInternal(httpHeaders, kvp.getKey(), kvp.getKey(), kvp.getValue()); } } diff --git a/sdk/core/azure-core-http-netty/src/main/java/com/azure/core/http/netty/implementation/NettyAsyncHttpResponseBase.java b/sdk/core/azure-core-http-netty/src/main/java/com/azure/core/http/netty/implementation/NettyAsyncHttpResponseBase.java index 5346aeb2948a..6621a80eea46 100644 --- a/sdk/core/azure-core-http-netty/src/main/java/com/azure/core/http/netty/implementation/NettyAsyncHttpResponseBase.java +++ b/sdk/core/azure-core-http-netty/src/main/java/com/azure/core/http/netty/implementation/NettyAsyncHttpResponseBase.java @@ -7,10 +7,13 @@ import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpRequest; import com.azure.core.http.HttpResponse; +import com.azure.core.implementation.util.HttpHeadersAccessHelper; +import io.netty.util.AsciiString; import reactor.netty.http.client.HttpClientResponse; import java.util.Iterator; import java.util.Map; +import java.util.Objects; /** * Base response class for Reactor Netty with implementations for response metadata. @@ -40,8 +43,19 @@ public abstract class NettyAsyncHttpResponseBase extends HttpResponse { while (nettyHeadersIterator.hasNext()) { Map.Entry next = nettyHeadersIterator.next(); // Value may be null and that needs to be guarded but key should never be null. - CharSequence value = next.getValue(); - this.headers.add(next.getKey().toString(), (value == null) ? null : value.toString()); + String value = Objects.toString(next.getValue(), null); + CharSequence key = next.getKey(); + + // Check for the header name being a Netty AsciiString as it has optimizations around lowercasing. + if (key instanceof AsciiString) { + // Hook into optimizations exposed through shared implementation to speed up the conversion. + AsciiString asciiString = (AsciiString) key; + HttpHeadersAccessHelper.addInternal(headers, asciiString.toLowerCase().toString(), + asciiString.toString(), value); + } else { + // If it isn't an AsciiString, then fallback to the shared, albeit, slower path. + this.headers.add(key.toString(), value); + } } } else { this.headers = new NettyToAzureCoreHttpHeadersWrapper(nettyHeaders); diff --git a/sdk/core/azure-core-http-netty/src/main/java/com/azure/core/http/netty/implementation/Utility.java b/sdk/core/azure-core-http-netty/src/main/java/com/azure/core/http/netty/implementation/Utility.java index 33a18a4fe343..670e41710e34 100644 --- a/sdk/core/azure-core-http-netty/src/main/java/com/azure/core/http/netty/implementation/Utility.java +++ b/sdk/core/azure-core-http-netty/src/main/java/com/azure/core/http/netty/implementation/Utility.java @@ -51,10 +51,9 @@ public final class Utility { * @return A newly allocated {@link ByteBuffer} containing the copied bytes. */ public static ByteBuffer deepCopyBuffer(ByteBuf byteBuf) { - ByteBuffer buffer = ByteBuffer.allocate(byteBuf.readableBytes()); - byteBuf.readBytes(buffer); - buffer.rewind(); - return buffer; + byte[] bytes = new byte[byteBuf.readableBytes()]; + byteBuf.getBytes(byteBuf.readerIndex(), bytes); + return ByteBuffer.wrap(bytes); } /** diff --git a/sdk/core/azure-core-management/src/test/java/com/azure/core/management/implementation/polling/LROPollerTests.java b/sdk/core/azure-core-management/src/test/java/com/azure/core/management/implementation/polling/LROPollerTests.java index d20086bf9d0c..031ed96e6cd0 100644 --- a/sdk/core/azure-core-management/src/test/java/com/azure/core/management/implementation/polling/LROPollerTests.java +++ b/sdk/core/azure-core-management/src/test/java/com/azure/core/management/implementation/polling/LROPollerTests.java @@ -22,6 +22,8 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollerFlux; @@ -61,6 +63,7 @@ @SuppressWarnings("unchecked") public class LROPollerTests { + private static final ClientLogger LOGGER = new ClientLogger(LROPollerTests.class); private static final SerializerAdapter SERIALIZER = SerializerFactory.createDefaultManagementSerializerAdapter(); @@ -678,8 +681,12 @@ public void lroRetryAfter() { long nanoTime = System.nanoTime(); - FooWithProvisioningState result = lroFlux.doOnNext(response -> System.out.printf("[%s] status %s%n", - OffsetDateTime.now(), response.getStatus().toString())).blockLast().getFinalResult().block(); + FooWithProvisioningState result = lroFlux + .doOnNext(response -> LOGGER.log(LogLevel.VERBOSE, + () -> String.format("[%s] status %s%n", OffsetDateTime.now(), response.getStatus()))) + .blockLast() + .getFinalResult() + .block(); Assertions.assertNotNull(result); Duration pollingDuration = Duration.ofNanos(System.nanoTime() - nanoTime); @@ -879,7 +886,8 @@ public com.github.tomakehurst.wiremock.http.Response transform(Request request, .build(); } if (request.getMethod().isOneOf(RequestMethod.PUT)) { - System.out.printf("[%s] PUT status %s%n", OffsetDateTime.now(), "IN_PROGRESS"); + LOGGER.log(LogLevel.VERBOSE, + () -> String.format("[%s] PUT status %s%n", OffsetDateTime.now(), "IN_PROGRESS")); return new com.github.tomakehurst.wiremock.http.Response.Builder() .headers(serverConfigure.additionalHeaders) .body(toJson(new FooWithProvisioningState("IN_PROGRESS"))) @@ -888,13 +896,15 @@ public com.github.tomakehurst.wiremock.http.Response transform(Request request, if (request.getMethod().isOneOf(RequestMethod.GET)) { getCallCount[0]++; if (getCallCount[0] < serverConfigure.pollingCountTillSuccess) { - System.out.printf("[%s] GET status %s%n", OffsetDateTime.now(), "IN_PROGRESS"); + LOGGER.log(LogLevel.VERBOSE, + () -> String.format("[%s] GET status %s%n", OffsetDateTime.now(), "IN_PROGRESS")); return new com.github.tomakehurst.wiremock.http.Response.Builder() .headers(serverConfigure.additionalHeaders) .body(toJson(new FooWithProvisioningState("IN_PROGRESS"))) .build(); } else if (getCallCount[0] == serverConfigure.pollingCountTillSuccess) { - System.out.printf("[%s] GET status %s%n", OffsetDateTime.now(), "SUCCEEDED"); + LOGGER.log(LogLevel.VERBOSE, + () -> String.format("[%s] GET status %s%n", OffsetDateTime.now(), "SUCCEEDED")); return new com.github.tomakehurst.wiremock.http.Response.Builder() .body(toJson(new FooWithProvisioningState("SUCCEEDED", UUID.randomUUID().toString()))) .build(); diff --git a/sdk/core/azure-core/spotbugs-exclude.xml b/sdk/core/azure-core/spotbugs-exclude.xml index 4fd09a2c2551..2ffee6a08a69 100644 --- a/sdk/core/azure-core/spotbugs-exclude.xml +++ b/sdk/core/azure-core/spotbugs-exclude.xml @@ -449,4 +449,10 @@ + + + + + + diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/http/HttpHeaders.java b/sdk/core/azure-core/src/main/java/com/azure/core/http/HttpHeaders.java index b42992287c1a..c52fa19e5cbd 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/http/HttpHeaders.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/http/HttpHeaders.java @@ -33,7 +33,22 @@ public class HttpHeaders implements Iterable { private final Map headers; static { - HttpHeadersAccessHelper.setAccessor(headers -> headers.headers); + HttpHeadersAccessHelper.setAccessor(new HttpHeadersAccessHelper.HttpHeadersAccessor() { + @Override + public Map getRawHeaderMap(HttpHeaders headers) { + return headers.headers; + } + + @Override + public void addInternal(HttpHeaders headers, String formattedName, String name, String value) { + headers.addInternal(formattedName, name, value); + } + + @Override + public void setInternal(HttpHeaders headers, String formattedName, String name, List values) { + headers.setInternal(formattedName, name, values); + } + }); } /** diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/http/policy/BearerTokenAuthenticationPolicy.java b/sdk/core/azure-core/src/main/java/com/azure/core/http/policy/BearerTokenAuthenticationPolicy.java index 615f231971c3..b37eb2c46b7f 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/http/policy/BearerTokenAuthenticationPolicy.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/http/policy/BearerTokenAuthenticationPolicy.java @@ -123,16 +123,11 @@ public Mono process(HttpPipelineCallContext context, HttpPipelineN return authorizeRequest(context).then(Mono.defer(next::process)).flatMap(httpResponse -> { String authHeader = httpResponse.getHeaderValue(HttpHeaderName.WWW_AUTHENTICATE); if (httpResponse.getStatusCode() == 401 && authHeader != null) { - return authorizeRequestOnChallenge(context, httpResponse).flatMap(retry -> { - if (retry) { - // Both Netty and OkHttp expect the requestBody to be closed after the response has been read. - // Failure to do so results in memory leak. - // In case of StreamResponse (or other scenarios where we do not eagerly read the response) - // the response body may not be consumed. - // This can cause potential leaks in the scenarios like above, where the policy - // may intercept the response and it may never be read. - // Forcing the read here - so that the memory can be released. - return httpResponse.getBody().ignoreElements().then(nextPolicy.process()); + return authorizeRequestOnChallenge(context, httpResponse).flatMap(authorized -> { + if (authorized) { + // body needs to be closed or read to the end to release the connection + httpResponse.close(); + return nextPolicy.process(); } else { return Mono.just(httpResponse); } @@ -155,13 +150,8 @@ public HttpResponse processSync(HttpPipelineCallContext context, HttpPipelineNex String authHeader = httpResponse.getHeaderValue(HttpHeaderName.WWW_AUTHENTICATE); if (httpResponse.getStatusCode() == 401 && authHeader != null) { if (authorizeRequestOnChallengeSync(context, httpResponse)) { - // Both Netty and OkHttp expect the requestBody to be closed after the response has been read. - // Failure to do so results in memory leak. - // In case of StreamResponse (or other scenarios where we do not eagerly read the response) - // the response body may not be consumed. - // This can cause potential leaks in the scenarios like above, where the policy - // may intercept the response and it may never be read. - // Forcing the read here - so that the memory can be released. + // body needs to be closed or read to the end to release the connection + httpResponse.close(); return nextPolicy.processSync(); } else { return httpResponse; diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/http/policy/RedirectPolicy.java b/sdk/core/azure-core/src/main/java/com/azure/core/http/policy/RedirectPolicy.java index fcc969e5216f..d0758d6b7d5d 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/http/policy/RedirectPolicy.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/http/policy/RedirectPolicy.java @@ -89,7 +89,6 @@ private Mono attemptRedirect(final HttpPipelineCallContext context return next.clone().process().flatMap(httpResponse -> { if (redirectStrategy.shouldAttemptRedirect(context, httpResponse, redirectAttempt, attemptedRedirectUrls)) { - HttpRequest redirectRequestCopy = createRedirectRequest(httpResponse); return attemptRedirect(context, next, redirectRequestCopy, redirectAttempt + 1, attemptedRedirectUrls); } else { @@ -111,7 +110,6 @@ private HttpResponse attemptRedirectSync(final HttpPipelineCallContext context, HttpResponse httpResponse = next.clone().processSync(); if (redirectStrategy.shouldAttemptRedirect(context, httpResponse, redirectAttempt, attemptedRedirectUrls)) { - HttpRequest redirectRequestCopy = createRedirectRequest(httpResponse); return attemptRedirectSync(context, next, redirectRequestCopy, redirectAttempt + 1, attemptedRedirectUrls); } else { diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/http/rest/RestProxy.java b/sdk/core/azure-core/src/main/java/com/azure/core/http/rest/RestProxy.java index 6e3c8d9a611e..de36dac2045e 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/http/rest/RestProxy.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/http/rest/RestProxy.java @@ -82,8 +82,6 @@ public Mono send(HttpRequest request, Context contextData) { @Override public Object invoke(Object proxy, final Method method, Object[] args) { - RestProxyUtils.validateResumeOperationIsNotPresent(method); - // Note: request options need to be evaluated here, as it is a public class with package private methods. // Evaluating here allows the package private methods to be invoked here for downstream use. final SwaggerMethodParser methodParser = getMethodParser(method); diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/rest/AsyncRestProxy.java b/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/rest/AsyncRestProxy.java index a09db64f1d79..2548bec2a64f 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/rest/AsyncRestProxy.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/rest/AsyncRestProxy.java @@ -75,8 +75,6 @@ Mono send(HttpRequest request, Context contextData) { @SuppressWarnings({ "try", "unused" }) public Object invoke(Object proxy, Method method, RequestOptions options, EnumSet errorOptions, Consumer requestCallback, SwaggerMethodParser methodParser, HttpRequest request, Context context) { - RestProxyUtils.validateResumeOperationIsNotPresent(method); - context = startTracingSpan(methodParser, context); // If there is 'RequestOptions' apply its request callback operations before validating the body. diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/rest/RestProxyBase.java b/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/rest/RestProxyBase.java index af018bfc0d95..67f4ea40662e 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/rest/RestProxyBase.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/rest/RestProxyBase.java @@ -98,8 +98,6 @@ public RestProxyBase(HttpPipeline httpPipeline, SerializerAdapter serializer, */ public final Object invoke(Object proxy, Method method, RequestOptions options, EnumSet errorOptions, Consumer requestCallback, SwaggerMethodParser methodParser, boolean isAsync, Object[] args) { - RestProxyUtils.validateResumeOperationIsNotPresent(method); - try { HttpRequest request = createHttpRequest(methodParser, serializer, isAsync, args); diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/rest/SwaggerMethodParser.java b/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/rest/SwaggerMethodParser.java index 7401e138f985..94f1674f3348 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/rest/SwaggerMethodParser.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/rest/SwaggerMethodParser.java @@ -285,6 +285,8 @@ public SwaggerMethodParser(Method swaggerMethod) { this.responseEagerlyRead = isResponseEagerlyRead(unwrappedReturnType); this.ignoreResponseBody = isResponseBodyIgnored(unwrappedReturnType); this.spanName = interfaceParser.getServiceName() + "." + swaggerMethod.getName(); + + RestProxyUtils.validateResumeOperationIsNotPresent(swaggerMethod); } /** diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/implementation/util/HttpHeadersAccessHelper.java b/sdk/core/azure-core/src/main/java/com/azure/core/implementation/util/HttpHeadersAccessHelper.java index 304f082277fa..bbf6c87e2250 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/implementation/util/HttpHeadersAccessHelper.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/implementation/util/HttpHeadersAccessHelper.java @@ -5,6 +5,8 @@ import com.azure.core.http.HttpHeader; import com.azure.core.http.HttpHeaders; +import java.util.List; +import java.util.Locale; import java.util.Map; /** @@ -24,6 +26,34 @@ public interface HttpHeadersAccessor { * @return The raw header map. */ Map getRawHeaderMap(HttpHeaders headers); + + /** + * Adds a header value to the backing map in {@link HttpHeaders}. + *

+ * This bypasses using {@link HttpHeaders#add(String, String)} which uses {@link String#toLowerCase(Locale)}, + * which may be slower than options available by implementing HTTP stacks (such as Netty which has an ASCII + * string class which has optimizations around lowercasing due to ASCII constraints). + * + * @param headers The {@link HttpHeaders} to add the header to. + * @param formattedName The lower-cased header name. + * @param name The original header name. + * @param value The header value. + */ + void addInternal(HttpHeaders headers, String formattedName, String name, String value); + + /** + * Sets a header value to the backing map in {@link HttpHeaders}. + *

+ * This bypasses using {@link HttpHeaders#set(String, List)} which uses {@link String#toLowerCase(Locale)}, + * which may be slower than options available by implementing HTTP stacks (such as JDK HttpClient where all + * response header names are already lowercased). + * + * @param headers The {@link HttpHeaders} to set the header to. + * @param formattedName The lower-cased header name. + * @param name The original header name. + * @param values The header values. + */ + void setInternal(HttpHeaders headers, String formattedName, String name, List values); } /** @@ -36,6 +66,38 @@ public static Map getRawHeaderMap(HttpHeaders headers) { return accessor.getRawHeaderMap(headers); } + /** + * Adds a header value to the backing map in {@link HttpHeaders}. + *

+ * This bypasses using {@link HttpHeaders#add(String, String)} which uses {@link String#toLowerCase(Locale)}, + * which may be slower than options available by implementing HTTP stacks (such as Netty which has an ASCII + * string class which has optimizations around lowercasing due to ASCII constraints). + * + * @param headers The {@link HttpHeaders} to add the header to. + * @param formattedName The lower-cased header name. + * @param name The original header name. + * @param value The header value. + */ + public static void addInternal(HttpHeaders headers, String formattedName, String name, String value) { + accessor.addInternal(headers, formattedName, name, value); + } + + /** + * Sets a header value to the backing map in {@link HttpHeaders}. + *

+ * This bypasses using {@link HttpHeaders#set(String, List)} which uses {@link String#toLowerCase(Locale)}, + * which may be slower than options available by implementing HTTP stacks (such as JDK HttpClient where all + * response header names are already lowercased). + * + * @param headers The {@link HttpHeaders} to set the header to. + * @param formattedName The lower-cased header name. + * @param name The original header name. + * @param values The header values. + */ + public static void setInternal(HttpHeaders headers, String formattedName, String name, List values) { + accessor.setInternal(headers, formattedName, name, values); + } + /** * Sets the {@link HttpHeadersAccessor}. * diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/util/serializer/SerializerEncoding.java b/sdk/core/azure-core/src/main/java/com/azure/core/util/serializer/SerializerEncoding.java index 4d4bf4985d5f..c8207428a790 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/util/serializer/SerializerEncoding.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/util/serializer/SerializerEncoding.java @@ -9,9 +9,6 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.logging.LogLevel; -import java.util.Map; -import java.util.TreeMap; - /** * Supported serialization encoding formats. */ @@ -32,20 +29,6 @@ public enum SerializerEncoding { TEXT; private static final ClientLogger LOGGER = new ClientLogger(SerializerEncoding.class); - private static final Map SUPPORTED_MIME_TYPES; - - static { - // Encodings and suffixes from: https://tools.ietf.org/html/rfc6838 - SUPPORTED_MIME_TYPES = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); - SUPPORTED_MIME_TYPES.put("text/xml", XML); - SUPPORTED_MIME_TYPES.put("application/xml", XML); - SUPPORTED_MIME_TYPES.put("application/json", JSON); - SUPPORTED_MIME_TYPES.put("text/css", TEXT); - SUPPORTED_MIME_TYPES.put("text/csv", TEXT); - SUPPORTED_MIME_TYPES.put("text/html", TEXT); - SUPPORTED_MIME_TYPES.put("text/javascript", TEXT); - SUPPORTED_MIME_TYPES.put("text/plain", TEXT); - } /** * Determines the serializer encoding to use based on the Content-Type header. @@ -63,7 +46,7 @@ public static SerializerEncoding fromHeaders(HttpHeaders headers) { int contentTypeEnd = mimeContentType.indexOf(';'); String contentType = (contentTypeEnd == -1) ? mimeContentType : mimeContentType.substring(0, contentTypeEnd); - final SerializerEncoding encoding = SUPPORTED_MIME_TYPES.get(contentType); + SerializerEncoding encoding = checkForKnownEncoding(contentType); if (encoding != null) { return encoding; } @@ -97,4 +80,43 @@ public static SerializerEncoding fromHeaders(HttpHeaders headers) { return JSON; } + + /* + * There is a limited set of serialization encodings that are known ahead of time. Instead of using a TreeMap with + * a case-insensitive comparator, use an optimized search specifically for the known encodings. + */ + private static SerializerEncoding checkForKnownEncoding(String contentType) { + int length = contentType.length(); + + // Check the length of the content type first as it is a quick check. + if (length != 8 && length != 9 && length != 10 && length != 15 && length != 16) { + return null; + } + + if ("text/".regionMatches(true, 0, contentType, 0, 5)) { + if (length == 8) { + if ("xml".regionMatches(true, 0, contentType, 5, 3)) { + return XML; + } else if ("csv".regionMatches(true, 0, contentType, 5, 3)) { + return TEXT; + } else if ("css".regionMatches(true, 0, contentType, 5, 3)) { + return TEXT; + } + } else if (length == 9 && "html".regionMatches(true, 0, contentType, 5, 4)) { + return TEXT; + } else if (length == 10 && "plain".regionMatches(true, 0, contentType, 5, 5)) { + return TEXT; + } else if (length == 15 && "javascript".regionMatches(true, 0, contentType, 5, 10)) { + return TEXT; + } + } else if ("application/".regionMatches(true, 0, contentType, 0, 12)) { + if (length == 16 && "json".regionMatches(true, 0, contentType, 12, 4)) { + return JSON; + } else if (length == 15 && "xml".regionMatches(true, 0, contentType, 12, 3)) { + return XML; + } + } + + return null; + } } diff --git a/sdk/core/azure-core/src/test/java/com/azure/core/http/policy/PolicyConsumesResponseBodyTest.java b/sdk/core/azure-core/src/test/java/com/azure/core/http/policy/PolicyConsumesResponseBodyTest.java new file mode 100644 index 000000000000..06573971f1f9 --- /dev/null +++ b/sdk/core/azure-core/src/test/java/com/azure/core/http/policy/PolicyConsumesResponseBodyTest.java @@ -0,0 +1,430 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.core.http.policy; + +import com.azure.core.SyncAsyncExtension; +import com.azure.core.SyncAsyncTest; +import com.azure.core.credential.AccessToken; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.*; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.ByteBuffer; +import java.nio.channels.AsynchronousByteChannel; +import java.nio.channels.WritableByteChannel; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Function; + +import static com.azure.core.http.HttpHeaderName.*; +import static org.junit.jupiter.api.Assertions.*; + +public class PolicyConsumesResponseBodyTest { + + private static final TokenCredential NOOP_CREDENTIAL + = request -> Mono.just(new AccessToken("token", OffsetDateTime.MAX)); + + @ParameterizedTest + @ValueSource(booleans = { true, false }) + public void testResponseClosureOn401Sync(boolean authorizeOnChallenge) { + AtomicInteger tryCount = new AtomicInteger(0); + + AtomicReference response401 = new AtomicReference<>(); + HttpPipeline pipeline + = new HttpPipelineBuilder().policies(new BearerPolicyImpl(authorizeOnChallenge, NOOP_CREDENTIAL, "scope")) + .httpClient(new TestHttpClient(r -> { + if (tryCount.getAndIncrement() == 0) { + TestHttpResponse r401 = createWithSyncBody(r, 401, 424242); + r401.headers.set(WWW_AUTHENTICATE, "Bearer"); + response401.set(r401); + return r401; + } + return createWithSyncBody(r, 200, 42); + })) + .build(); + + HttpResponse response = pipeline.sendSync(new HttpRequest(HttpMethod.GET, "https://fake"), Context.NONE); + assertEquals(authorizeOnChallenge ? 200 : 401, response.getStatusCode()); + assertEquals(authorizeOnChallenge ? 2 : 1, tryCount.get()); + + if (authorizeOnChallenge) { + assertTrue(response401.get().isConsumedOrClosed()); + } + assertInstanceOf(TestHttpResponse.class, response); + assertFalse(((TestHttpResponse) response).isConsumedOrClosed()); + } + + @ParameterizedTest + @ValueSource(booleans = { true, false }) + public void testResponseClosureOn401Async(boolean authorizeOnChallenge) { + AtomicInteger tryCount = new AtomicInteger(0); + + AtomicReference response401 = new AtomicReference<>(); + HttpPipeline pipeline + = new HttpPipelineBuilder().policies(new BearerPolicyImpl(authorizeOnChallenge, NOOP_CREDENTIAL, "scope")) + .httpClient(new TestHttpClient(r -> { + if (tryCount.getAndIncrement() == 0) { + TestHttpResponse r401 = createWithAsyncBody(r, 401, 424242); + r401.headers.set(WWW_AUTHENTICATE, "Bearer"); + response401.set(r401); + return r401; + } + return createWithAsyncBody(r, 200, 42); + })) + .build(); + + HttpResponse response = pipeline.send(new HttpRequest(HttpMethod.GET, "https://fake")).block(); + assertEquals(authorizeOnChallenge ? 200 : 401, response.getStatusCode()); + assertEquals(authorizeOnChallenge ? 2 : 1, tryCount.get()); + + if (authorizeOnChallenge) { + assertTrue(response401.get().isConsumedOrClosed()); + } + + assertInstanceOf(TestHttpResponse.class, response); + assertFalse(((TestHttpResponse) response).isConsumedOrClosed()); + } + + @SyncAsyncTest + public void testResponseClosureOn401AndException() throws Exception { + AtomicInteger tryCount = new AtomicInteger(0); + + AtomicReference responseException = new AtomicReference<>(); + HttpPipeline pipeline = new HttpPipelineBuilder().policies(new BearerPolicyImpl(true, NOOP_CREDENTIAL, "scope")) + .httpClient(new TestHttpClient(r -> { + if (tryCount.getAndIncrement() == 0) { + TestHttpResponse r401 + = createWithAsyncBodyAndException(r, 401, 424242, new IOException("Fake exception")); + r401.headers.set(WWW_AUTHENTICATE, "Bearer"); + responseException.set(r401); + return r401; + } + return createWithSyncBody(r, 200, 42); + })) + .build(); + + HttpRequest request = new HttpRequest(HttpMethod.GET, "https://fake"); + HttpResponse response = SyncAsyncExtension.execute(() -> pipeline.sendSync(request, Context.NONE), + () -> pipeline.send(request).block()); + + assertEquals(200, response.getStatusCode()); + + assertEquals(2, tryCount.get()); + assertTrue(responseException.get().isConsumedOrClosed()); + assertInstanceOf(TestHttpResponse.class, response); + assertFalse(((TestHttpResponse) response).isConsumedOrClosed()); + } + + @SyncAsyncTest + public void testResponseClosureOn302() throws Exception { + AtomicInteger tryCount = new AtomicInteger(0); + + AtomicReference response302 = new AtomicReference<>(); + HttpPipeline pipeline + = new HttpPipelineBuilder().policies(new RedirectPolicy()).httpClient(new TestHttpClient(r -> { + if (tryCount.getAndIncrement() == 0) { + TestHttpResponse r302 = createWithAsyncBody(r, 302, 424242); + r302.headers.set(LOCATION, "https://fake"); + response302.set(r302); + return r302; + } + return createWithAsyncBody(r, 200, 42); + })).build(); + + HttpRequest request = new HttpRequest(HttpMethod.GET, "https://fake"); + HttpResponse response = SyncAsyncExtension.execute(() -> pipeline.sendSync(request, Context.NONE), + () -> pipeline.send(request).block()); + + assertEquals(200, response.getStatusCode()); + + assertEquals(2, tryCount.get()); + assertTrue(response302.get().isConsumedOrClosed()); + assertInstanceOf(TestHttpResponse.class, response); + assertFalse(((TestHttpResponse) response).isConsumedOrClosed()); + } + + @SyncAsyncTest + public void testResponseClosureOn302AndException() throws Exception { + AtomicInteger tryCount = new AtomicInteger(0); + + AtomicReference responseException = new AtomicReference<>(); + HttpPipeline pipeline + = new HttpPipelineBuilder().policies(new RedirectPolicy()).httpClient(new TestHttpClient(r -> { + if (tryCount.getAndIncrement() == 0) { + TestHttpResponse rEx + = createWithAsyncBodyAndException(r, 302, 424242, new IOException("Fake exception")); + rEx.headers.set(LOCATION, "https://fake"); + responseException.set(rEx); + return rEx; + } + return createWithSyncBody(r, 200, 42); + })).build(); + + HttpRequest request = new HttpRequest(HttpMethod.GET, "https://fake"); + HttpResponse response = SyncAsyncExtension.execute(() -> pipeline.sendSync(request, Context.NONE), + () -> pipeline.send(request).block()); + + assertEquals(200, response.getStatusCode()); + + assertEquals(2, tryCount.get()); + assertTrue(responseException.get().isConsumedOrClosed()); + assertInstanceOf(TestHttpResponse.class, response); + assertFalse(((TestHttpResponse) response).isConsumedOrClosed()); + } + + @SyncAsyncTest + public void testResponseClosureOn503() throws Exception { + AtomicInteger tryCount = new AtomicInteger(0); + + AtomicReference response503 = new AtomicReference<>(); + HttpPipeline pipeline + = new HttpPipelineBuilder().policies(new RetryPolicy()).httpClient(new TestHttpClient(r -> { + if (tryCount.getAndIncrement() == 0) { + response503.set(createWithSyncBody(r, 503, 424242)); + return response503.get(); + } + return createWithSyncBody(r, 200, 42); + })).build(); + + HttpRequest request = new HttpRequest(HttpMethod.GET, "https://fake"); + HttpResponse response = SyncAsyncExtension.execute(() -> pipeline.sendSync(request, Context.NONE), + () -> pipeline.send(request).block()); + + assertEquals(200, response.getStatusCode()); + + assertEquals(2, tryCount.get()); + assertTrue(response503.get().isConsumedOrClosed()); + assertInstanceOf(TestHttpResponse.class, response); + assertFalse(((TestHttpResponse) response).isConsumedOrClosed()); + } + + @SyncAsyncTest + public void testResponseClosureOn503AndException() throws Exception { + AtomicInteger tryCount = new AtomicInteger(0); + + AtomicReference responseException = new AtomicReference<>(); + HttpPipeline pipeline + = new HttpPipelineBuilder().policies(new RetryPolicy()).httpClient(new TestHttpClient(r -> { + if (tryCount.getAndIncrement() == 0) { + TestHttpResponse rEx + = createWithAsyncBodyAndException(r, 503, 424242, new IOException("Fake exception")); + responseException.set(rEx); + return rEx; + } + return createWithSyncBody(r, 200, 42); + })).build(); + + HttpRequest request = new HttpRequest(HttpMethod.GET, "https://fake"); + HttpResponse response = SyncAsyncExtension.execute(() -> pipeline.sendSync(request, Context.NONE), + () -> pipeline.send(request).block()); + + assertEquals(200, response.getStatusCode()); + + assertEquals(2, tryCount.get()); + assertTrue(responseException.get().isConsumedOrClosed()); + assertInstanceOf(TestHttpResponse.class, response); + assertFalse(((TestHttpResponse) response).isConsumedOrClosed()); + } + + private TestHttpResponse createWithSyncBody(HttpRequest request, int statusCode, int contentLength) { + HttpHeaders headers = new HttpHeaders().set(CONTENT_LENGTH, Integer.toString(contentLength)); + return new TestHttpResponse(request, statusCode, headers, new ByteArrayInputStream(new byte[contentLength])); + } + + private TestHttpResponse createWithAsyncBody(HttpRequest request, int statusCode, int contentLength) { + HttpHeaders headers = new HttpHeaders().set(CONTENT_LENGTH, Integer.toString(contentLength)); + return new TestHttpResponse(request, statusCode, headers, Flux.create(s -> { + for (int remaining = contentLength; remaining > 0; remaining -= 10) { + byte[] bytes = new byte[Math.min(10, remaining)]; + s.next(ByteBuffer.wrap(bytes)); + } + s.complete(); + })); + } + + private TestHttpResponse createWithAsyncBodyAndException(HttpRequest request, int statusCode, int contentLength, + Exception exception) { + HttpHeaders headers = new HttpHeaders().set(CONTENT_LENGTH, Integer.toString(contentLength)); + return new TestHttpResponse(request, statusCode, headers, Flux.create(s -> { + byte[] bytes = new byte[Math.min(10, contentLength)]; + s.next(ByteBuffer.wrap(bytes)); + s.error(exception); + })); + } + + private class BearerPolicyImpl extends BearerTokenAuthenticationPolicy { + private final boolean authorize; + + BearerPolicyImpl(boolean authorize, TokenCredential credential, String... scopes) { + super(credential, scopes); + this.authorize = authorize; + } + + @Override + public boolean authorizeRequestOnChallengeSync(HttpPipelineCallContext context, HttpResponse response) { + return authorize; + } + + @Override + public Mono authorizeRequestOnChallenge(HttpPipelineCallContext context, HttpResponse response) { + return Mono.just(authorize); + } + } + + private static class TestHttpClient implements HttpClient { + private final Function responseProvider; + + TestHttpClient(Function responseProvider) { + this.responseProvider = responseProvider; + } + + @Override + public Mono send(HttpRequest request) { + return Mono.just(responseProvider.apply(request)); + } + + @Override + public HttpResponse sendSync(HttpRequest request, Context context) { + return responseProvider.apply(request); + } + } + + public class TestHttpResponse extends HttpResponse { + + private final int statusCode; + + private final HttpHeaders headers; + + private final Flux bodyFlux; + private final ByteArrayInputStream bodyStream; + private boolean closed = false; + private boolean consumed = false; + + public TestHttpResponse(HttpRequest request, int statusCode, HttpHeaders headers, Flux body) { + super(request); + this.statusCode = statusCode; + this.headers = headers; + this.bodyFlux = body.doFinally(__ -> consumed = true); + this.bodyStream = null; + } + + public TestHttpResponse(HttpRequest request, int statusCode, HttpHeaders headers, ByteArrayInputStream body) { + super(request); + this.statusCode = statusCode; + this.headers = headers; + this.bodyStream = body; + this.bodyFlux = null; + } + + public boolean isConsumedOrClosed() { + return closed || (bodyStream != null ? bodyStream.available() == 0 : consumed); + } + + @Override + public int getStatusCode() { + return statusCode; + } + + @Override + @Deprecated + public String getHeaderValue(String name) { + return headers.getValue(name); + } + + @Override + public String getHeaderValue(HttpHeaderName headerName) { + return headers.getValue(headerName); + } + + @Override + public HttpHeaders getHeaders() { + return this.headers; + } + + @Override + public Mono getBodyAsByteArray() { + if (bodyStream != null) { + return Mono.just(BinaryData.fromStream(bodyStream).toBytes()); + } else { + return FluxUtil.collectBytesInByteBufferStream(bodyFlux); + } + } + + @Override + public Flux getBody() { + if (bodyStream != null) { + return FluxUtil.toFluxByteBuffer(bodyStream); + } else { + return bodyFlux; + } + } + + @Override + public Mono getBodyAsString() { + return getBodyAsString(StandardCharsets.UTF_8); + } + + @Override + public Mono getBodyAsString(Charset charset) { + return getBodyAsByteArray().map(bytes -> new String(bytes, charset)); + } + + @Override + public BinaryData getBodyAsBinaryData() { + if (bodyStream != null) { + return BinaryData.fromStream(bodyStream); + } else { + return BinaryData.fromFlux(bodyFlux).block(); + } + } + + @Override + public Mono getBodyAsInputStream() { + if (bodyStream != null) { + return Mono.just(bodyStream); + } else { + return getBodyAsByteArray().map(ByteArrayInputStream::new); + } + } + + @Override + public HttpResponse buffer() { + return new MockHttpResponse(getRequest(), getStatusCode(), getHeaders(), getBodyAsBinaryData().toBytes()); + } + + @Override + public Mono writeBodyToAsync(AsynchronousByteChannel channel) { + return FluxUtil.writeToAsynchronousByteChannel(getBody(), channel); + } + + @Override + public void writeBodyTo(WritableByteChannel channel) throws IOException { + FluxUtil.writeToWritableByteChannel(getBody(), channel).block(); + } + + @Override + public void close() { + this.closed = true; + if (bodyStream != null) { + try { + bodyStream.close(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + } + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/pom.xml b/sdk/cosmos/azure-cosmos-kafka-connect/pom.xml index ae5e2dfef8f8..627124a3d33d 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/pom.xml +++ b/sdk/cosmos/azure-cosmos-kafka-connect/pom.xml @@ -101,7 +101,7 @@ Licensed under the MIT License. com.azure azure-cosmos-test - 1.0.0-beta.7 + 1.0.0-beta.8 test diff --git a/sdk/cosmos/azure-cosmos-test/CHANGELOG.md b/sdk/cosmos/azure-cosmos-test/CHANGELOG.md index bb5bbe06a853..42e76a6c34c0 100644 --- a/sdk/cosmos/azure-cosmos-test/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos-test/CHANGELOG.md @@ -1,5 +1,14 @@ ## Release History +### 1.0.0-beta.8 (Unreleased) + +#### Features Added + +#### Breaking Changes + +#### Bugs Fixed +* Fixed an issue where `FaultInjectionRule` can not apply on partition level when using `Gateway` Mode and non-session consistency - See [40005](https://github.com/Azure/azure-sdk-for-java/pull/40005) + ### 1.0.0-beta.7 (2024-05-03) #### Bugs Fixed diff --git a/sdk/cosmos/azure-cosmos-test/pom.xml b/sdk/cosmos/azure-cosmos-test/pom.xml index cb2d32eb7ac6..7e5429c2cf40 100644 --- a/sdk/cosmos/azure-cosmos-test/pom.xml +++ b/sdk/cosmos/azure-cosmos-test/pom.xml @@ -13,7 +13,7 @@ Licensed under the MIT License. com.azure azure-cosmos-test - 1.0.0-beta.7 + 1.0.0-beta.8 Microsoft Azure Java Cosmos Test Library This package contains core fault injection types for Azure Java Cosmos client. jar diff --git a/sdk/cosmos/azure-cosmos-tests/pom.xml b/sdk/cosmos/azure-cosmos-tests/pom.xml index b55fefbf13ea..cecbe9dc1fd9 100644 --- a/sdk/cosmos/azure-cosmos-tests/pom.xml +++ b/sdk/cosmos/azure-cosmos-tests/pom.xml @@ -104,7 +104,7 @@ Licensed under the MIT License. com.azure azure-cosmos-test - 1.0.0-beta.7 + 1.0.0-beta.8 commons-io diff --git a/sdk/cosmos/azure-cosmos/CHANGELOG.md b/sdk/cosmos/azure-cosmos/CHANGELOG.md index 28c11dc76f12..686ee7b6b8e2 100644 --- a/sdk/cosmos/azure-cosmos/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos/CHANGELOG.md @@ -4,6 +4,8 @@ #### Features Added +* Added support for non-streaming OrderBy query and a query feature `NonStreamingOrderBy` to support Vector Search queries. - See [PR 39897](https://github.com/Azure/azure-sdk-for-java/pull/39897/) + #### Breaking Changes #### Bugs Fixed diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java index da368de5360d..c643379b2fe6 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java @@ -166,6 +166,13 @@ public class Configs { public static final String MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED = "COSMOS.MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED"; private static final int DEFAULT_MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED = 1; + private static final String MAX_ITEM_SIZE_FOR_VECTOR_SEARCH = "COSMOS.MAX_ITEM_SIZE_FOR_VECTOR_SEARCH"; + private static final int DEFAULT_MAX_ITEM_SIZE_FOR_VECTOR_SEARCH = 50000; + + private static final String MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED = "COSMOS.MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED"; + + private static final boolean DEFAULT_MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED = true; + public static final int MIN_MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED = 1; public static final String TCP_CONNECTION_ACQUISITION_TIMEOUT_IN_MS = "COSMOS.TCP_CONNECTION_ACQUISITION_TIMEOUT_IN_MS"; @@ -484,6 +491,14 @@ public static int getMaxRetriesInLocalRegionWhenRemoteRegionPreferred() { MIN_MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED); } + public static int getMaxItemSizeForVectorSearch() { + return getJVMConfigAsInt(MAX_ITEM_SIZE_FOR_VECTOR_SEARCH, DEFAULT_MAX_ITEM_SIZE_FOR_VECTOR_SEARCH); + } + + public static boolean getMaxItemSizeForVectorSearchEnabled() { + return getJVMConfigAsBoolean(MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED, DEFAULT_MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED); + } + public static Duration getMinRetryTimeInLocalRegionWhenRemoteRegionPreferred() { return Duration.ofMillis(Math.max( diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java index 4dc62089acc5..c70ded3a906f 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java @@ -25,6 +25,7 @@ public final class CosmosQueryRequestOptionsImpl extends CosmosQueryRequestOptio private boolean queryPlanRetrievalDisallowed; private boolean emptyPageDiagnosticsEnabled; private String queryName; + private Integer maxItemSizeForVectorSearch; private List cancelledRequestDiagnosticsTracker = new ArrayList<>(); /** @@ -62,6 +63,7 @@ public CosmosQueryRequestOptionsImpl(CosmosQueryRequestOptionsImpl options) { this.queryName = options.queryName; this.feedRange = options.feedRange; this.cancelledRequestDiagnosticsTracker = options.cancelledRequestDiagnosticsTracker; + this.maxItemSizeForVectorSearch = options.maxItemSizeForVectorSearch; } /** @@ -196,6 +198,26 @@ public CosmosQueryRequestOptionsImpl setMaxItemCount(Integer maxItemCount) { return this; } + /** + * Gets the maximum item size to fetch during non-streaming order by queries. + * + * @return the max number of items for vector search. + */ + public Integer getMaxItemSizeForVectorSearch() { + return maxItemSizeForVectorSearch; + } + + /** + * Sets the maximum item size to fetch during non-streaming order by queries. + * + * @param maxItemSizeForVectorSearch the max number of items for vector search. + * return the CosmosQueryRequestOptions. + */ + public CosmosQueryRequestOptionsImpl setMaxItemSizeForVectorSearch(Integer maxItemSizeForVectorSearch) { + this.maxItemSizeForVectorSearch = maxItemSizeForVectorSearch; + return this; + } + /** * Gets the request continuation token. * diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java index a13cfc65348d..7a530816856b 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java @@ -4,9 +4,11 @@ import com.azure.cosmos.BridgeInternal; import com.azure.cosmos.implementation.BadRequestException; +import com.azure.cosmos.implementation.Configs; import com.azure.cosmos.implementation.Constants; import com.azure.cosmos.implementation.DiagnosticsClientContext; import com.azure.cosmos.implementation.DocumentCollection; +import com.azure.cosmos.implementation.HttpConstants; import com.azure.cosmos.implementation.ImplementationBridgeHelpers; import com.azure.cosmos.implementation.OperationType; import com.azure.cosmos.implementation.PartitionKeyRange; @@ -239,7 +241,8 @@ private static boolean canCacheQuery(QueryInfo queryInfo) { && !queryInfo.hasTop() && !queryInfo.hasOffset() && !queryInfo.hasDCount() - && !queryInfo.hasOrderBy(); + && !queryInfo.hasOrderBy() + && !queryInfo.hasNonStreamingOrderBy(); } private static boolean isScopedToSinglePartition(CosmosQueryRequestOptions cosmosQueryRequestOptions) { @@ -358,6 +361,37 @@ public static Flux> createSpecia boolean getLazyFeedResponse = queryInfo.hasTop(); + // We need to compute the optimal initial age size for non-streaming order-by queries + if (queryInfo.hasNonStreamingOrderBy() && Configs.getMaxItemSizeForVectorSearchEnabled()) { + // Validate the TOP or LIMIT for non-streaming order-by queries + if (!queryInfo.hasTop() && !queryInfo.hasLimit() && queryInfo.getTop() < 0 && queryInfo.getLimit() < 0) { + throw new NonStreamingOrderByBadRequestException(HttpConstants.StatusCodes.BADREQUEST, + "Executing a vector search query without TOP or LIMIT can consume a large number of RUs" + + "very fast and have long runtimes. Please ensure you are using one of the above two filters" + + "with you vector search query."); + } + // Validate the size of TOP or LIMIT against MaxItemSizeForVectorSearch + int maxLimit = Math.max(queryInfo.hasTop() ? queryInfo.getTop() : 0, + queryInfo.hasLimit() ? queryInfo.getLimit() : 0); + int maxItemSizeForVectorSearch = Math.max(Configs.getMaxItemSizeForVectorSearch(), + ModelBridgeInternal.getMaxItemSizeForVectorSearchFromQueryRequestOptions(cosmosQueryRequestOptions)); + if (maxLimit > maxItemSizeForVectorSearch) { + throw new NonStreamingOrderByBadRequestException(HttpConstants.StatusCodes.BADREQUEST, + "Executing a vector search query with TOP or LIMIT larger than the maxItemSizeForVectorSearch " + + "is not allowed"); + } + // Set initialPageSize based on the smallest of TOP or LIMIT + if (queryInfo.hasTop() || queryInfo.hasLimit()) { + int pageSizeWithTopOrLimit = Math.min(queryInfo.hasTop() ? queryInfo.getTop() : Integer.MAX_VALUE, + queryInfo.hasLimit() ? queryInfo.getLimit() : Integer.MAX_VALUE); + if (initialPageSize > 0) { + initialPageSize = Math.min(pageSizeWithTopOrLimit, initialPageSize); + } else { + initialPageSize = pageSizeWithTopOrLimit; + } + } + } + // We need to compute the optimal initial page size for order-by queries if (queryInfo.hasOrderBy()) { int top; diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByBadRequestException.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByBadRequestException.java new file mode 100644 index 000000000000..4b3b41fbc675 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByBadRequestException.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.cosmos.implementation.query; + +import com.azure.cosmos.CosmosException; + +public class NonStreamingOrderByBadRequestException extends CosmosException { + + private static final long serialVersionUID = 1L; + + /** + * Creates a new instance of the NonStreamingOrderByBadRequestException class. + * + * @param statusCode the http status code of the response. + * @param errorMessage the error message. + */ + public NonStreamingOrderByBadRequestException(int statusCode, String errorMessage) { + super(statusCode, errorMessage); + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentProducer.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentProducer.java new file mode 100644 index 000000000000..c64ef5d1fbda --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentProducer.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.implementation.query; + +import com.azure.cosmos.implementation.Document; +import com.azure.cosmos.implementation.DocumentClientRetryPolicy; +import com.azure.cosmos.implementation.RxDocumentServiceRequest; +import com.azure.cosmos.implementation.feedranges.FeedRangeEpkImpl; +import com.azure.cosmos.implementation.query.orderbyquery.OrderbyRowComparer; +import com.azure.cosmos.models.CosmosQueryRequestOptions; +import com.azure.cosmos.models.FeedResponse; +import reactor.core.publisher.Mono; + +import java.util.UUID; +import java.util.function.Function; +import java.util.function.Supplier; + +public class NonStreamingOrderByDocumentProducer extends DocumentProducer { + private final OrderbyRowComparer consumeComparer; + + NonStreamingOrderByDocumentProducer( + OrderbyRowComparer consumeComparer, + IDocumentQueryClient client, + String collectionResourceId, + CosmosQueryRequestOptions cosmosQueryRequestOptions, + TriFunction createRequestFunc, + Function>> executeRequestFunc, + FeedRangeEpkImpl feedRange, + String collectionLink, + Supplier createRetryPolicyFunc, + Class resourceType, + UUID correlatedActivityId, + int initialPageSize, + String initialContinuationToken, + int top, + Supplier operationContextTextProvider) { + super(client, collectionResourceId, cosmosQueryRequestOptions, createRequestFunc, executeRequestFunc, + collectionLink, createRetryPolicyFunc, resourceType, correlatedActivityId, initialPageSize, + initialContinuationToken, top, feedRange, operationContextTextProvider); + this.consumeComparer = consumeComparer; + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java new file mode 100644 index 000000000000..89a8a3065443 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.implementation.query; + +import com.azure.cosmos.BridgeInternal; +import com.azure.cosmos.CosmosException; +import com.azure.cosmos.implementation.ClientSideRequestStatistics; +import com.azure.cosmos.implementation.DiagnosticsClientContext; +import com.azure.cosmos.implementation.Document; +import com.azure.cosmos.implementation.DocumentClientRetryPolicy; +import com.azure.cosmos.implementation.DocumentCollection; +import com.azure.cosmos.implementation.HttpConstants; +import com.azure.cosmos.implementation.ImplementationBridgeHelpers; +import com.azure.cosmos.implementation.QueryMetrics; +import com.azure.cosmos.implementation.RequestChargeTracker; +import com.azure.cosmos.implementation.ResourceType; +import com.azure.cosmos.implementation.RxDocumentServiceRequest; +import com.azure.cosmos.implementation.Utils; +import com.azure.cosmos.implementation.feedranges.FeedRangeEpkImpl; +import com.azure.cosmos.implementation.query.orderbyquery.OrderByRowResult; +import com.azure.cosmos.implementation.query.orderbyquery.OrderbyRowComparer; +import com.azure.cosmos.models.CosmosQueryRequestOptions; +import com.azure.cosmos.models.FeedResponse; +import com.azure.cosmos.models.ModelBridgeInternal; +import com.azure.cosmos.models.SqlQuerySpec; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +public class NonStreamingOrderByDocumentQueryExecutionContext + extends ParallelDocumentQueryExecutionContextBase { + + private final static + ImplementationBridgeHelpers.CosmosDiagnosticsHelper.CosmosDiagnosticsAccessor diagnosticsAccessor = + ImplementationBridgeHelpers.CosmosDiagnosticsHelper.getCosmosDiagnosticsAccessor(); + + private static final ImplementationBridgeHelpers.FeedResponseHelper.FeedResponseAccessor feedResponseAccessor = + ImplementationBridgeHelpers.FeedResponseHelper.getFeedResponseAccessor(); + + private final static String FormatPlaceHolder = "{documentdb-formattableorderbyquery-filter}"; + private final static String True = "true"; + + private final OrderbyRowComparer consumeComparer; + private final RequestChargeTracker tracker; + private final ConcurrentMap queryMetricMap; + private final Collection clientSideRequestStatistics; + private Flux> orderByObservable; + + private int maxPageSizePerPartition; + + public NonStreamingOrderByDocumentQueryExecutionContext( + DiagnosticsClientContext diagnosticsClientContext, + IDocumentQueryClient client, + ResourceType resourceTypeEnum, + SqlQuerySpec query, + CosmosQueryRequestOptions cosmosQueryRequestOptions, + String resourceLink, + String rewrittenQuery, + OrderbyRowComparer consumeComparer, + UUID correlatedActivityId, + boolean hasSelectValue, + final AtomicBoolean isQueryCancelledOnTimeout) { + super(diagnosticsClientContext, client, resourceTypeEnum, Document.class, query, cosmosQueryRequestOptions, + resourceLink, rewrittenQuery, correlatedActivityId, hasSelectValue, isQueryCancelledOnTimeout); + this.consumeComparer = consumeComparer; + this.tracker = new RequestChargeTracker(); + this.queryMetricMap = new ConcurrentHashMap<>(); + this.clientSideRequestStatistics = ConcurrentHashMap.newKeySet(); + } + + public static Flux> createAsync( + DiagnosticsClientContext diagnosticsClientContext, + IDocumentQueryClient client, + PipelinedDocumentQueryParams initParams, + DocumentCollection collection) { + + QueryInfo queryInfo = initParams.getQueryInfo(); + + NonStreamingOrderByDocumentQueryExecutionContext context = new NonStreamingOrderByDocumentQueryExecutionContext( + diagnosticsClientContext, + client, + initParams.getResourceTypeEnum(), + initParams.getQuery(), + initParams.getCosmosQueryRequestOptions(), + initParams.getResourceLink(), + initParams.getQueryInfo().getRewrittenQuery(), + new OrderbyRowComparer<>(queryInfo.getOrderBy()), + initParams.getCorrelatedActivityId(), + queryInfo.hasSelectValue(), + initParams.isQueryCancelledOnTimeout()); + + context.setTop(initParams.getTop()); + + try { + context.initialize( + initParams.getFeedRanges(), + initParams.getQueryInfo().getOrderBy(), + initParams.getQueryInfo().getOrderByExpressions(), + initParams.getInitialPageSize(), + collection); + + return Flux.just(context); + } catch (CosmosException dce) { + return Flux.error(dce); + } + } + + private void initialize( + List feedRanges, List sortOrders, + Collection orderByExpressions, + int initialPageSize, + DocumentCollection collection) throws CosmosException { + // Since the continuation token will always be null, + // we don't need to handle any initialization based on continuationToken. + // We can directly initialize without any consideration for continuationToken. + super.initialize(collection, + feedRanges.stream().collect(Collectors.toMap( + feedRangeEpk -> feedRangeEpk, + feedRangeEpk -> null)), + initialPageSize, + new SqlQuerySpec(querySpec.getQueryText().replace(FormatPlaceHolder, True), + querySpec.getParameters())); + + orderByObservable = NonStreamingOrderByUtils.nonStreamingOrderedMerge( + consumeComparer, + tracker, + documentProducers, + initialPageSize, + queryMetricMap, + clientSideRequestStatistics); + } + + @Override + protected NonStreamingOrderByDocumentProducer createDocumentProducer( + String collectionRid, + String continuationToken, + int initialPageSize, + CosmosQueryRequestOptions cosmosQueryRequestOptions, + SqlQuerySpec querySpecForInit, + Map commonRequestHeaders, + TriFunction createRequestFunc, + Function>> executeFunc, + Supplier createRetryPolicyFunc, + FeedRangeEpkImpl feedRange) { + return new NonStreamingOrderByDocumentProducer( + consumeComparer, + client, + collectionRid, + cosmosQueryRequestOptions, + createRequestFunc, + executeFunc, + feedRange, + collectionRid, + createRetryPolicyFunc, + Document.class, + correlatedActivityId, + maxPageSizePerPartition, + continuationToken, + top, + this.getOperationContextTextProvider()); + } + + @Override + public Flux> drainAsync(int maxPageSize) { + return this.orderByObservable.transformDeferred(new ItemToPageTransformer(tracker, + maxPageSize, + this.queryMetricMap, + this.clientSideRequestStatistics)); + } + + @Override + public Flux> executeAsync() { + return drainAsync(ModelBridgeInternal.getMaxItemCountFromQueryRequestOptions(cosmosQueryRequestOptions)); + } + + private static class ItemToPageTransformer implements + Function>, Flux>> { + private final static int DEFAULT_PAGE_SIZE = 100; + private final RequestChargeTracker tracker; + private final int maxPageSize; + private final ConcurrentMap queryMetricMap; + private final Collection clientSideRequestStatistics; + + public ItemToPageTransformer(RequestChargeTracker tracker, + int maxPageSize, + ConcurrentMap queryMetricsMap, + Collection clientSideRequestStatistics) { + this.tracker = tracker; + this.maxPageSize = maxPageSize > 0 ? maxPageSize : DEFAULT_PAGE_SIZE; + this.queryMetricMap = queryMetricsMap; + this.clientSideRequestStatistics = clientSideRequestStatistics; + } + + private static Map headerResponse(double requestCharge) { + return Utils.immutableMapOf(HttpConstants.HttpHeaders.REQUEST_CHARGE, String.valueOf(requestCharge)); + } + + @Override + public Flux> apply(Flux> source) { + return source + .window(maxPageSize).map(Flux::collectList) + .flatMap(resultListObs -> resultListObs, 1) + .map(orderByRowResults -> { + // construct a page from result with request charge + FeedResponse> feedResponse = feedResponseAccessor.createFeedResponse( + orderByRowResults, + headerResponse(tracker.getAndResetCharge()), + null); + if (!queryMetricMap.isEmpty()) { + for (Map.Entry entry : queryMetricMap.entrySet()) { + BridgeInternal.putQueryMetricsIntoMap(feedResponse, + entry.getKey(), + entry.getValue()); + } + } + return feedResponse; + }) + .concatWith(Flux.defer(() -> { + return Flux.just(feedResponseAccessor.createFeedResponse(Utils.immutableListOf(), + null, null)); + })) + .map(feedOfOrderByRowResults -> { + List unwrappedResults = new ArrayList<>(); + for (OrderByRowResult orderByRowResult : feedOfOrderByRowResults.getResults()) { + unwrappedResults.add(orderByRowResult.getPayload()); + } + FeedResponse feedResponse = BridgeInternal.createFeedResponseWithQueryMetrics(unwrappedResults, + feedOfOrderByRowResults.getResponseHeaders(), + BridgeInternal.queryMetricsFromFeedResponse(feedOfOrderByRowResults), + ModelBridgeInternal.getQueryPlanDiagnosticsContext(feedOfOrderByRowResults), + false, + false, feedOfOrderByRowResults.getCosmosDiagnostics()); + diagnosticsAccessor.addClientSideDiagnosticsToFeed( + feedResponse.getCosmosDiagnostics(), clientSideRequestStatistics); + return feedResponse; + }).switchIfEmpty(Flux.defer(() -> { + // create an empty page if there is no result + FeedResponse frp = BridgeInternal.createFeedResponseWithQueryMetrics(Utils.immutableListOf(), + headerResponse( + tracker.getAndResetCharge()), + queryMetricMap, + null, + false, + false, + null); + diagnosticsAccessor.addClientSideDiagnosticsToFeed( + frp.getCosmosDiagnostics(), clientSideRequestStatistics); + return Flux.just(frp); + })); + } + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java new file mode 100644 index 000000000000..1b4191e26413 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.cosmos.implementation.query; + +import com.azure.cosmos.BridgeInternal; +import com.azure.cosmos.implementation.ClientSideRequestStatistics; +import com.azure.cosmos.implementation.Configs; +import com.azure.cosmos.implementation.Document; +import com.azure.cosmos.implementation.ImplementationBridgeHelpers; +import com.azure.cosmos.implementation.QueryMetrics; +import com.azure.cosmos.implementation.RequestChargeTracker; +import com.azure.cosmos.implementation.Resource; +import com.azure.cosmos.implementation.query.orderbyquery.OrderByRowResult; +import com.azure.cosmos.implementation.query.orderbyquery.OrderbyRowComparer; +import reactor.core.publisher.Flux; + +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.concurrent.PriorityBlockingQueue; +import java.util.function.Function; + +public class NonStreamingOrderByUtils { + private final static + ImplementationBridgeHelpers.CosmosDiagnosticsHelper.CosmosDiagnosticsAccessor diagnosticsAccessor = + ImplementationBridgeHelpers.CosmosDiagnosticsHelper.getCosmosDiagnosticsAccessor(); + + public static Flux> nonStreamingOrderedMerge(OrderbyRowComparer consumeComparer, + RequestChargeTracker tracker, + List> documentProducers, + int initialPageSize, + Map queryMetricsMap, + Collection clientSideRequestStatistics) { + @SuppressWarnings("unchecked") + Flux>[] fluxes = documentProducers + .subList(0, documentProducers.size()) + .stream() + .map(producer -> + toNonStreamingOrderByQueryResultObservable(producer, tracker, queryMetricsMap, initialPageSize, + consumeComparer, clientSideRequestStatistics)) + .toArray(Flux[]::new); + return Flux.mergeComparingDelayError(1,consumeComparer, fluxes); + } + + private static Flux> toNonStreamingOrderByQueryResultObservable(DocumentProducer producer, + RequestChargeTracker tracker, + Map queryMetricsMap, + int initialPageSize, + OrderbyRowComparer consumeComparer, + Collection clientSideRequestStatisticsList) { + return producer + .produceAsync() + .transformDeferred(new NonStreamingOrderByUtils.PageToItemTransformer(tracker, queryMetricsMap, initialPageSize, + consumeComparer, clientSideRequestStatisticsList)); + } + + private static class PageToItemTransformer implements + Function.DocumentProducerFeedResponse>, Flux>> { + private final RequestChargeTracker tracker; + private final Map queryMetricsMap; + private final Integer initialPageSize; + private final OrderbyRowComparer consumeComparer; + private final Collection clientSideRequestStatistics; + + private PageToItemTransformer(RequestChargeTracker tracker, Map queryMetricsMap, + Integer initialPageSize, OrderbyRowComparer consumeComparer, + Collection clientSideRequestStatistics) { + this.tracker = tracker; + this.queryMetricsMap = queryMetricsMap; + this.initialPageSize = initialPageSize; + this.consumeComparer = consumeComparer; + this.clientSideRequestStatistics = clientSideRequestStatistics; + } + + @Override + public Flux> apply(Flux.DocumentProducerFeedResponse> source) { + PriorityBlockingQueue> priorityQueue = new PriorityBlockingQueue<>(initialPageSize, consumeComparer); + + return source.flatMap(documentProducerFeedResponse -> { + clientSideRequestStatistics.addAll( + diagnosticsAccessor.getClientSideRequestStatisticsForQueryPipelineAggregations(documentProducerFeedResponse + .pageResult.getCosmosDiagnostics())); + + QueryMetrics.mergeQueryMetricsMap(queryMetricsMap, + BridgeInternal.queryMetricsFromFeedResponse(documentProducerFeedResponse.pageResult)); + List results = documentProducerFeedResponse.pageResult.getResults(); + results.forEach(r -> { + OrderByRowResult orderByRowResult = new OrderByRowResult( + r.toJson(), + documentProducerFeedResponse.sourceFeedRange, + null); + if (Configs.getMaxItemSizeForVectorSearchEnabled()) { + if (priorityQueue.size() < initialPageSize) { + priorityQueue.add(orderByRowResult); + } else { + priorityQueue.add(orderByRowResult); + priorityQueue.poll(); + } + } else { + priorityQueue.add(orderByRowResult); + } + + }); + tracker.addCharge(documentProducerFeedResponse.pageResult.getRequestCharge()); + // Returning an empty Flux since we are only processing and managing state here + return Flux.empty(); + }, 1) + .thenMany(Flux.defer(() -> Flux.fromIterable(priorityQueue))); + } + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/ParallelDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/ParallelDocumentQueryExecutionContext.java index 020b8633d2be..6ed30d3a7fbe 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/ParallelDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/ParallelDocumentQueryExecutionContext.java @@ -106,7 +106,8 @@ public static Flux> createAsync( || queryInfo.hasAggregates() || queryInfo.hasGroupBy() || queryInfo.hasDCount() - || queryInfo.hasDistinct()), + || queryInfo.hasDistinct() + || queryInfo.hasNonStreamingOrderBy()), initParams.isQueryCancelledOnTimeout()); context.setTop(initParams.getTop()); diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java index 7b6104271762..a6ea9fc2d5f6 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java @@ -15,6 +15,8 @@ import java.util.function.BiFunction; +import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; + /** * While this class is public, but it is not part of our published public APIs. * This is meant to be internally used only by our sdk. @@ -53,12 +55,17 @@ private static BiFunction, Flux { CosmosQueryRequestOptions orderByCosmosQueryRequestOptions = qryOptAccessor.clone(requestOptions); - ModelBridgeInternal.setQueryRequestOptionsContinuationToken(orderByCosmosQueryRequestOptions, continuationToken); - qryOptAccessor.getImpl(orderByCosmosQueryRequestOptions).setCustomItemSerializer(null); - - documentQueryParams.setCosmosQueryRequestOptions(orderByCosmosQueryRequestOptions); - - return OrderByDocumentQueryExecutionContext.createAsync(diagnosticsClientContext, client, documentQueryParams, collection); + if (queryInfo.hasNonStreamingOrderBy()) { + checkNotNull(continuationToken, "Can not use a continuation token for a vector search query "); + qryOptAccessor.getImpl(orderByCosmosQueryRequestOptions).setCustomItemSerializer(null); + documentQueryParams.setCosmosQueryRequestOptions(orderByCosmosQueryRequestOptions); + return NonStreamingOrderByDocumentQueryExecutionContext.createAsync(diagnosticsClientContext, client, documentQueryParams, collection); + } else { + ModelBridgeInternal.setQueryRequestOptionsContinuationToken(orderByCosmosQueryRequestOptions, continuationToken); + qryOptAccessor.getImpl(orderByCosmosQueryRequestOptions).setCustomItemSerializer(null); + documentQueryParams.setCosmosQueryRequestOptions(orderByCosmosQueryRequestOptions); + return OrderByDocumentQueryExecutionContext.createAsync(diagnosticsClientContext, client, documentQueryParams, collection); + } }; } else { diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContext.java index c7f67711fabd..6c3fa2827216 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContext.java @@ -137,7 +137,7 @@ public Flux> executeAsync() { } private static QueryInfo validateQueryInfo(QueryInfo queryInfo) { - if (queryInfo.hasOrderBy() || queryInfo.hasAggregates() || queryInfo.hasGroupBy()) { + if (queryInfo.hasOrderBy() || queryInfo.hasAggregates() || queryInfo.hasGroupBy() || queryInfo.hasNonStreamingOrderBy()) { // Any query with order by, aggregates or group by needs to go through the Document query pipeline throw new IllegalStateException("This query must not use the simple query pipeline."); } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContextBase.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContextBase.java index 232f942b8590..39c6c27efad8 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContextBase.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContextBase.java @@ -63,7 +63,8 @@ public static Flux> createAsync( || queryInfo.hasAggregates() || queryInfo.hasGroupBy() || queryInfo.hasDCount() - || queryInfo.hasDistinct()) { + || queryInfo.hasDistinct() + || queryInfo.hasNonStreamingOrderBy()) { return PipelinedDocumentQueryExecutionContext.createAsyncCore( diagnosticsClientContext, diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryFeature.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryFeature.java index ce2b4865767c..1dd3e5928b92 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryFeature.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryFeature.java @@ -14,5 +14,6 @@ public enum QueryFeature { OrderBy, Top, NonValueAggregate, - DCount + DCount, + NonStreamingOrderBy } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryInfo.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryInfo.java index 65efb92c3325..48870a5ae52d 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryInfo.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryInfo.java @@ -36,6 +36,7 @@ public final class QueryInfo extends JsonSerializable { private DistinctQueryType distinctQueryType; private QueryPlanDiagnosticsContext queryPlanDiagnosticsContext; private DCountInfo dCountInfo; + private boolean nonStreamingOrderBy; public QueryInfo() { } @@ -160,6 +161,11 @@ public boolean hasGroupBy() { return groupByExpressions != null && !groupByExpressions.isEmpty(); } + public boolean hasNonStreamingOrderBy() { + this.nonStreamingOrderBy = Boolean.TRUE.equals(super.getBoolean("hasNonStreamingOrderBy")); + return this.nonStreamingOrderBy; + } + public Map getGroupByAliasToAggregateType(){ Map groupByAliasToAggregateMap; groupByAliasToAggregateMap = super.getMap("groupByAliasToAggregateType"); diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryPlanRetriever.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryPlanRetriever.java index ce91ff2029e9..83f82dbde363 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryPlanRetriever.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryPlanRetriever.java @@ -43,7 +43,8 @@ class QueryPlanRetriever { QueryFeature.GroupBy.name() + ", " + QueryFeature.Top.name() + ", " + QueryFeature.DCount.name() + ", " + - QueryFeature.NonValueAggregate.name(); + QueryFeature.NonValueAggregate.name() + ", " + + QueryFeature.NonStreamingOrderBy.name(); static Mono getQueryPlanThroughGatewayAsync(DiagnosticsClientContext diagnosticsClientContext, IDocumentQueryClient queryClient, diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java index c9bf3909fd5d..309fb87a8b22 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java @@ -256,6 +256,15 @@ CosmosQueryRequestOptions setMaxItemCount(Integer maxItemCount) { return this; } + /** + * Gets the maximum item size to fetch during non-streaming order by queries. + * + * @return the max number of items for vector search. + */ + public Integer getMaxItemSizeForVectorSearch() { + return this.actualRequestOptions.getMaxItemSizeForVectorSearch(); + } + /** * Gets the request continuation token. * diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java index 4931c9b3b1b0..e814cc16681b 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java @@ -544,6 +544,11 @@ public static Integer getMaxItemCountFromQueryRequestOptions(CosmosQueryRequestO return options.getMaxItemCount(); } + @Warning(value = INTERNAL_USE_ONLY_WARNING) + public static Integer getMaxItemSizeForVectorSearchFromQueryRequestOptions(CosmosQueryRequestOptions options) { + return options.getMaxItemSizeForVectorSearch(); + } + @Warning(value = INTERNAL_USE_ONLY_WARNING) public static String getRequestContinuationFromQueryRequestOptions(CosmosQueryRequestOptions options) { return options.getRequestContinuation(); diff --git a/sdk/digitaltwins/azure-digitaltwins-core/src/test/java/com/azure/digitaltwins/core/DigitalTwinsTestBase.java b/sdk/digitaltwins/azure-digitaltwins-core/src/test/java/com/azure/digitaltwins/core/DigitalTwinsTestBase.java index 3009b8a4fcbf..2cbbb0aad9f6 100644 --- a/sdk/digitaltwins/azure-digitaltwins-core/src/test/java/com/azure/digitaltwins/core/DigitalTwinsTestBase.java +++ b/sdk/digitaltwins/azure-digitaltwins-core/src/test/java/com/azure/digitaltwins/core/DigitalTwinsTestBase.java @@ -10,7 +10,6 @@ import com.azure.core.http.policy.HttpLogDetailLevel; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; import com.azure.core.test.models.CustomMatcher; import com.azure.core.util.Configuration; @@ -141,9 +140,7 @@ static T deserializeJsonString(String rawJsonString, Class clazz) throws } void waitIfLive(int waitTimeInSeconds) throws InterruptedException { - if (this.getTestMode() == TestMode.LIVE || this.getTestMode() == TestMode.RECORD) { - Thread.sleep(waitTimeInSeconds * 1000); - } + sleepIfRunningAgainstService(waitTimeInSeconds * 1000L); } void waitIfLive() throws InterruptedException { diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventDataAggregatorTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventDataAggregatorTest.java index c50f9d4b94a6..86101a67af93 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventDataAggregatorTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventDataAggregatorTest.java @@ -5,6 +5,8 @@ import com.azure.core.amqp.exception.AmqpErrorCondition; import com.azure.core.amqp.exception.AmqpException; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.messaging.eventhubs.EventHubBufferedProducerAsyncClient.BufferedProducerClientOptions; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -29,6 +31,8 @@ import static org.mockito.Mockito.when; public class EventDataAggregatorTest { + private static final ClientLogger LOGGER = new ClientLogger(EventDataAggregatorTest.class); + private static final String NAMESPACE = "test.namespace"; private static final String PARTITION_ID = "test-id"; @@ -175,7 +179,7 @@ public void pushesBatchAfterMaxTime() { case 1: return batch2; default: - System.out.println("Invoked get batch for the xth time:" + current); + LOGGER.log(LogLevel.VERBOSE, () -> "Invoked get batch for the xth time:" + current); return batch3; } }; diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubBufferedPartitionProducerTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubBufferedPartitionProducerTest.java index 5ea403598f74..f7714375106c 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubBufferedPartitionProducerTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubBufferedPartitionProducerTest.java @@ -5,6 +5,8 @@ import com.azure.core.amqp.AmqpRetryOptions; import com.azure.core.amqp.exception.AmqpException; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.messaging.eventhubs.EventHubBufferedProducerAsyncClient.BufferedProducerClientOptions; import com.azure.messaging.eventhubs.models.CreateBatchOptions; import com.azure.messaging.eventhubs.models.SendBatchFailedContext; @@ -49,6 +51,8 @@ */ @Isolated public class EventHubBufferedPartitionProducerTest { + private static final ClientLogger LOGGER = new ClientLogger(EventHubBufferedPartitionProducerTest.class); + private static final String PARTITION_ID = "10"; private static final String NAMESPACE = "test-eventhubs-namespace"; private static final String EVENT_HUB_NAME = "test-hub"; @@ -312,7 +316,7 @@ public void getBufferedEventCounts() throws InterruptedException { final BufferedProducerClientOptions options = new BufferedProducerClientOptions(); options.setMaxWaitTime(Duration.ofSeconds(5)); options.setSendSucceededContext(context -> { - System.out.println("Batch received."); + LOGGER.log(LogLevel.VERBOSE, () -> "Batch received."); holder.onSucceed(context); success.countDown(); }); diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubBufferedProducerAsyncClientIntegrationTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubBufferedProducerAsyncClientIntegrationTest.java index 33de24fb11ff..d117c200ee0d 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubBufferedProducerAsyncClientIntegrationTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubBufferedProducerAsyncClientIntegrationTest.java @@ -4,6 +4,7 @@ package com.azure.messaging.eventhubs; import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.messaging.eventhubs.models.SendBatchSucceededContext; import com.azure.messaging.eventhubs.models.SendOptions; import org.junit.jupiter.api.Tag; @@ -196,9 +197,9 @@ public void publishWithPartitionKeys() throws InterruptedException { }); return Mono.delay(Duration.ofSeconds(delay)).then(producer.enqueueEvent(eventData, sendOptions) - .doFinally(signal -> { - System.out.printf("\t[%s] %s Published event.%n", expectedPartitionId, formatter.format(Instant.now())); - })); + .doFinally(signal -> logger.log(LogLevel.VERBOSE, + () -> String.format("\t[%s] %s Published event.%n", expectedPartitionId, + formatter.format(Instant.now()))))); }).collect(Collectors.toList()); // Waiting for at least maxWaitTime because events will get published by then. diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubConsumerAsyncClientTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubConsumerAsyncClientTest.java index 8b9bdaa665eb..06a1e658e7e7 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubConsumerAsyncClientTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubConsumerAsyncClientTest.java @@ -24,6 +24,7 @@ import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.core.util.tracing.SpanKind; import com.azure.core.util.tracing.StartSpanOptions; import com.azure.core.util.tracing.Tracer; @@ -960,9 +961,9 @@ private void assertStartOptions(StartSpanOptions startOpts) { } private void assertPartition(String partitionId, PartitionEvent event) { - System.out.println("Event received: " + event.getPartitionContext().getPartitionId()); + LOGGER.log(LogLevel.VERBOSE, () -> "Event received: " + event.getPartitionContext().getPartitionId()); final Object value = event.getData().getProperties().get(PARTITION_ID_HEADER); - Assertions.assertTrue(value instanceof String); + Assertions.assertInstanceOf(String.class, value); Assertions.assertEquals(partitionId, value); Assertions.assertEquals(partitionId, event.getPartitionContext().getPartitionId()); diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubConsumerClientTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubConsumerClientTest.java index 2843c5f92bd9..214592630966 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubConsumerClientTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubConsumerClientTest.java @@ -15,6 +15,8 @@ import com.azure.core.util.ClientOptions; import com.azure.core.util.Configuration; import com.azure.core.util.IterableStream; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.messaging.eventhubs.implementation.ClientConstants; import com.azure.messaging.eventhubs.implementation.EventHubAmqpConnection; import com.azure.messaging.eventhubs.implementation.EventHubConnectionProcessor; @@ -64,6 +66,8 @@ import static org.mockito.Mockito.when; public class EventHubConsumerClientTest { + private static final ClientLogger LOGGER = new ClientLogger(EventHubConsumerClientTest.class); + private static final ClientOptions CLIENT_OPTIONS = new ClientOptions(); private static final String PAYLOAD = "hello"; private static final byte[] PAYLOAD_BYTES = PAYLOAD.getBytes(UTF_8); @@ -131,10 +135,10 @@ AmqpTransportType.AMQP_WEB_SOCKETS, new AmqpRetryOptions(), ProxyOptions.SYSTEM_ when(connection.createReceiveLink(any(), argThat(name -> name.endsWith(PARTITION_ID)), any(EventPosition.class), any(ReceiveOptions.class), anyString())).thenReturn( Mono.fromCallable(() -> { - System.out.println("Returning first link"); + LOGGER.log(LogLevel.VERBOSE, () -> "Returning first link"); return amqpReceiveLink; }), Mono.fromCallable(() -> { - System.out.println("Returning second link"); + LOGGER.log(LogLevel.VERBOSE, () -> "Returning second link"); return amqpReceiveLink2; })); @@ -291,11 +295,11 @@ public void receivesMultipleTimes() { final IterableStream receive2 = consumer.receiveFromPartition(PARTITION_ID, secondReceive, EventPosition.earliest()); // Assert - System.out.println("First receive."); + LOGGER.log(LogLevel.VERBOSE, () -> "First receive."); final Map firstActual = receive.stream() .collect(Collectors.toMap(EventHubConsumerClientTest::getPositionId, Function.identity())); - System.out.println("Second receive."); + LOGGER.log(LogLevel.VERBOSE, () -> "Second receive."); final Map secondActual = receive2.stream() .collect(Collectors.toMap(EventHubConsumerClientTest::getPositionId, Function.identity())); diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventPositionIntegrationTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventPositionIntegrationTest.java index bc8d559f26c5..8943cbb8204a 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventPositionIntegrationTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventPositionIntegrationTest.java @@ -5,6 +5,7 @@ import com.azure.core.util.IterableStream; import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.messaging.eventhubs.models.EventPosition; import com.azure.messaging.eventhubs.models.PartitionEvent; import com.azure.messaging.eventhubs.models.SendOptions; @@ -59,7 +60,7 @@ protected void beforeTest() { for (Map.Entry entry : integrationTestData.entrySet()) { testData = entry.getValue(); - System.out.printf("Getting entry for: %s%n", testData.getPartitionId()); + logger.log(LogLevel.VERBOSE, () -> "Getting entry for: " + testData.getPartitionId()); break; } diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventProcessorClientBuilderTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventProcessorClientBuilderTest.java index 6399a399f8e3..467b2a27e703 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventProcessorClientBuilderTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventProcessorClientBuilderTest.java @@ -8,6 +8,8 @@ import com.azure.core.util.ClientOptions; import com.azure.core.util.Configuration; import com.azure.core.util.TracingOptions; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.messaging.eventhubs.implementation.ClientConstants; import com.azure.messaging.eventhubs.models.CloseContext; import com.azure.messaging.eventhubs.models.ErrorContext; @@ -35,6 +37,7 @@ * Unit tests for {@link EventProcessorClientBuilder}. */ public class EventProcessorClientBuilderTest { + private static final ClientLogger LOGGER = new ClientLogger(EventProcessorClientBuilderTest.class); private static final String NAMESPACE_NAME = "dummyNamespaceName"; private static final String DEFAULT_DOMAIN_NAME = Configuration.getGlobalConfiguration() @@ -68,13 +71,14 @@ public void testEventProcessorBuilderMissingProperties() { EventProcessorClient eventProcessorClient = new EventProcessorClientBuilder() .checkpointStore(new SampleCheckpointStore()) .processEvent(eventContext -> { - System.out.println("Partition id = " + eventContext.getPartitionContext().getPartitionId() + " and " - + "sequence number of event = " + eventContext.getEventData().getSequenceNumber()); + LOGGER.log(LogLevel.VERBOSE, () -> "Partition id = " + + eventContext.getPartitionContext().getPartitionId() + " and sequence number of event = " + + eventContext.getEventData().getSequenceNumber()); }) .processError(errorContext -> { - System.out.printf("Error occurred in partition processor for partition %s, %s%n", - errorContext.getPartitionContext().getPartitionId(), - errorContext.getThrowable()); + LOGGER.log(LogLevel.VERBOSE, () -> String.format( + "Error occurred in partition processor for partition %s, %s%n", + errorContext.getPartitionContext().getPartitionId(), errorContext.getThrowable())); }) .buildEventProcessorClient(); }); @@ -86,13 +90,14 @@ public void testEventProcessorBuilderWithProcessEvent() { .connectionString(CORRECT_CONNECTION_STRING) .consumerGroup("consumer-group") .processEvent(eventContext -> { - System.out.println("Partition id = " + eventContext.getPartitionContext().getPartitionId() + " and " - + "sequence number of event = " + eventContext.getEventData().getSequenceNumber()); + LOGGER.log(LogLevel.VERBOSE, () -> "Partition id = " + + eventContext.getPartitionContext().getPartitionId() + " and sequence number of event = " + + eventContext.getEventData().getSequenceNumber()); }) .processError(errorContext -> { - System.out.printf("Error occurred in partition processor for partition %s, %s%n", - errorContext.getPartitionContext().getPartitionId(), - errorContext.getThrowable()); + LOGGER.log(LogLevel.VERBOSE, () -> String.format( + "Error occurred in partition processor for partition %s, %s%n", + errorContext.getPartitionContext().getPartitionId(), errorContext.getThrowable())); }) .checkpointStore(new SampleCheckpointStore()) .buildEventProcessorClient(); @@ -107,21 +112,21 @@ public void testEventProcessorBuilderWithBothSingleAndBatchConsumers() { .checkpointStore(new SampleCheckpointStore()) .consumerGroup("consumer-group") .processEvent(eventContext -> { - System.out.println("Partition id = " + eventContext.getPartitionContext().getPartitionId() + " and " - + "sequence number of event = " + eventContext.getEventData().getSequenceNumber()); + LOGGER.log(LogLevel.VERBOSE, () -> ("Partition id = " + + eventContext.getPartitionContext().getPartitionId() + " and sequence number of event = " + + eventContext.getEventData().getSequenceNumber())); }) .processEventBatch(eventBatchContext -> { eventBatchContext.getEvents().forEach(event -> { - System.out - .println( - "Partition id = " + eventBatchContext.getPartitionContext().getPartitionId() + " and " - + "sequence number of event = " + event.getSequenceNumber()); + LOGGER.log(LogLevel.VERBOSE, () -> "Partition id = " + + eventBatchContext.getPartitionContext().getPartitionId() + + " and sequence number of event = " + event.getSequenceNumber()); }); }, 5, Duration.ofSeconds(1)) .processError(errorContext -> { - System.out.printf("Error occurred in partition processor for partition %s, %s%n", - errorContext.getPartitionContext().getPartitionId(), - errorContext.getThrowable()); + LOGGER.log(LogLevel.VERBOSE, () -> String.format( + "Error occurred in partition processor for partition %s, %s%n", + errorContext.getPartitionContext().getPartitionId(), errorContext.getThrowable())); }) .buildEventProcessorClient(); }); @@ -134,9 +139,9 @@ public void testEventProcessorBuilderWithNoProcessEventConsumer() { .checkpointStore(new SampleCheckpointStore()) .consumerGroup("consumer-group") .processError(errorContext -> { - System.out.printf("Error occurred in partition processor for partition %s, %s%n", - errorContext.getPartitionContext().getPartitionId(), - errorContext.getThrowable()); + LOGGER.log(LogLevel.VERBOSE, () -> String.format( + "Error occurred in partition processor for partition %s, %s%n", + errorContext.getPartitionContext().getPartitionId(), errorContext.getThrowable())); }) .buildEventProcessorClient(); }); @@ -149,15 +154,15 @@ public void testEventProcessorBuilderWithProcessEventBatch() { .consumerGroup("consumer-group") .processEventBatch(eventBatchContext -> { eventBatchContext.getEvents().forEach(event -> { - System.out - .println("Partition id = " + eventBatchContext.getPartitionContext().getPartitionId() + " and " - + "sequence number of event = " + event.getSequenceNumber()); + LOGGER.log(LogLevel.VERBOSE, () -> ("Partition id = " + + eventBatchContext.getPartitionContext().getPartitionId() + " and sequence number of event = " + + event.getSequenceNumber())); }); }, 5, Duration.ofSeconds(1)) .processError(errorContext -> { - System.out.printf("Error occurred in partition processor for partition %s, %s%n", - errorContext.getPartitionContext().getPartitionId(), - errorContext.getThrowable()); + LOGGER.log(LogLevel.VERBOSE, () -> String.format( + "Error occurred in partition processor for partition %s, %s%n", + errorContext.getPartitionContext().getPartitionId(), errorContext.getThrowable())); }) .checkpointStore(new SampleCheckpointStore()) .buildEventProcessorClient(); @@ -174,15 +179,15 @@ public void initialOffsetProviderSetMoreThanOne() { .consumerGroup("consumer-group") .processEventBatch(eventBatchContext -> { eventBatchContext.getEvents().forEach(event -> { - System.out - .println("Partition id = " + eventBatchContext.getPartitionContext().getPartitionId() + " and " - + "sequence number of event = " + event.getSequenceNumber()); + LOGGER.log(LogLevel.VERBOSE, () -> "Partition id = " + + eventBatchContext.getPartitionContext().getPartitionId() + " and sequence number of event = " + + event.getSequenceNumber()); }); }, 5, Duration.ofSeconds(1)) .processError(errorContext -> { - System.out.printf("Error occurred in partition processor for partition %s, %s%n", - errorContext.getPartitionContext().getPartitionId(), - errorContext.getThrowable()); + LOGGER.log(LogLevel.VERBOSE, () -> String.format( + "Error occurred in partition processor for partition %s, %s%n", + errorContext.getPartitionContext().getPartitionId(), errorContext.getThrowable())); }) .checkpointStore(new SampleCheckpointStore()); @@ -215,15 +220,15 @@ public void initialEventPositionProvider() { .consumerGroup("consumer-group") .processEventBatch(eventBatchContext -> { eventBatchContext.getEvents().forEach(event -> { - System.out - .println("Partition id = " + eventBatchContext.getPartitionContext().getPartitionId() + " and " - + "sequence number of event = " + event.getSequenceNumber()); + LOGGER.log(LogLevel.VERBOSE, () -> "Partition id = " + + eventBatchContext.getPartitionContext().getPartitionId() + " and sequence number of event = " + + event.getSequenceNumber()); }); }, 5, Duration.ofSeconds(1)) .processError(errorContext -> { - System.out.printf("Error occurred in partition processor for partition %s, %s%n", - errorContext.getPartitionContext().getPartitionId(), - errorContext.getThrowable()); + LOGGER.log(LogLevel.VERBOSE, () -> String.format( + "Error occurred in partition processor for partition %s, %s%n", + errorContext.getPartitionContext().getPartitionId(), errorContext.getThrowable())); }) .checkpointStore(new SampleCheckpointStore()) .initialPartitionEventPosition(eventPositionFunction) @@ -257,15 +262,15 @@ public void initialEventPositionMap() { .consumerGroup("consumer-group") .processEventBatch(eventBatchContext -> { eventBatchContext.getEvents().forEach(event -> { - System.out - .println("Partition id = " + eventBatchContext.getPartitionContext().getPartitionId() + " and " - + "sequence number of event = " + event.getSequenceNumber()); + LOGGER.log(LogLevel.VERBOSE, () -> "Partition id = " + + eventBatchContext.getPartitionContext().getPartitionId() + " and sequence number of event = " + + event.getSequenceNumber()); }); }, 5, Duration.ofSeconds(1)) .processError(errorContext -> { - System.out.printf("Error occurred in partition processor for partition %s, %s%n", - errorContext.getPartitionContext().getPartitionId(), - errorContext.getThrowable()); + LOGGER.log(LogLevel.VERBOSE, () -> String.format( + "Error occurred in partition processor for partition %s, %s%n", + errorContext.getPartitionContext().getPartitionId(), errorContext.getThrowable())); }) .checkpointStore(new SampleCheckpointStore()) .initialPartitionEventPosition(eventPositionMap) diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/IntegrationTestBase.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/IntegrationTestBase.java index ed526061a5a0..40acadca38c1 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/IntegrationTestBase.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/IntegrationTestBase.java @@ -16,6 +16,7 @@ import com.azure.core.util.Configuration; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.identity.ClientSecretCredential; import com.azure.identity.ClientSecretCredentialBuilder; import com.azure.messaging.eventhubs.models.SendOptions; @@ -59,6 +60,8 @@ * Test base for running integration tests. */ public abstract class IntegrationTestBase extends TestBase { + private static final ClientLogger LOGGER = new ClientLogger(IntegrationTestBase.class); + // The number of partitions we create in test-resources.json. // Partitions 0 and 1 are used for consume-only operations. 2, 3, and 4 are used to publish or consume events. protected static final int NUMBER_OF_PARTITIONS = 5; @@ -193,7 +196,7 @@ static String getConnectionString(boolean withSas) { } return String.format(connectionStringWithSasAndEntityFormat, endpoint, signatureValue, entityPath); } catch (Exception e) { - e.printStackTrace(); + LOGGER.log(LogLevel.VERBOSE, () -> "Error while getting connection string", e); } } return connectionString; diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/LongRunningTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/LongRunningTest.java index 79e8dc03672c..d1b6c899d297 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/LongRunningTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/LongRunningTest.java @@ -4,6 +4,7 @@ package com.azure.messaging.eventhubs; import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.messaging.eventhubs.models.CreateBatchOptions; import com.azure.messaging.eventhubs.models.EventPosition; import org.junit.jupiter.api.Disabled; @@ -70,17 +71,12 @@ void twoConsumersAndSender() throws InterruptedException { return producer.send(batch).thenReturn(Instant.now()); })) - .subscribe(instant -> { - System.out.println("Sent batch at: " + instant); - }, error -> { - logger.error("Error sending batch: ", error); - }, () -> { - logger.info("Complete."); - })); + .subscribe(instant -> logger.log(LogLevel.VERBOSE, () -> "Sent batch at: " + instant), + error -> logger.error("Error sending batch: ", error), () -> logger.info("Complete."))); - System.out.println("Sleeping while performing work."); + logger.log(LogLevel.VERBOSE, () -> "Sleeping while performing work."); TimeUnit.MINUTES.sleep(duration.toMinutes()); - System.out.println("Complete."); + logger.log(LogLevel.VERBOSE, () -> "Complete."); } @Disabled("Testing idle clients. Connections are timed out at 30 mins.") @@ -90,7 +86,7 @@ void idleConnection() throws InterruptedException { .connectionString(getConnectionString()) .buildAsyncProducerClient()) { for (int i = 0; i < 4; i++) { - System.out.println("Iteration: " + i); + logger.verbose("Iteration: " + i); toClose(idleProducer.createBatch().flatMap(batch -> { IntStream.range(0, 3).mapToObj(number -> new EventData("Number : " + number)) @@ -102,17 +98,12 @@ void idleConnection() throws InterruptedException { }); return idleProducer.send(batch).thenReturn(Instant.now()); - }).subscribe(instant -> { - System.out.println("Sent batch at: " + instant); - }, error -> { - logger.error("Error sending batch: ", error); - }, () -> { - logger.info("Complete."); - })); - - System.out.println("Sleeping 40 mins."); + }).subscribe(instant -> logger.log(LogLevel.VERBOSE, () -> "Sent batch at: " + instant), + error -> logger.error("Error sending batch: ", error), () -> logger.info("Complete."))); + + logger.log(LogLevel.VERBOSE, () -> "Sleeping 40 mins."); TimeUnit.MINUTES.sleep(40); - System.out.println("Complete."); + logger.log(LogLevel.VERBOSE, () -> "Complete."); } } } @@ -125,14 +116,14 @@ void idleSendLinks() throws InterruptedException { .buildAsyncProducerClient()) { for (int i = 0; i < 4; i++) { - System.out.println("Iteration: " + i); + logger.verbose("Iteration: " + i); toClose(idleProducer.getEventHubProperties().subscribe(properties -> { - System.out.printf("[%s]: ids[%s]. Received: %s%n", + logger.log(LogLevel.VERBOSE, () -> String.format("[%s]: ids[%s]. Received: %s%n", properties.getName(), String.join(",", properties.getPartitionIds()), - Instant.now()); - }, error -> System.err.println("Error receiving ids: " + error))); + Instant.now())); + }, error -> logger.log(LogLevel.VERBOSE, () -> "Error receiving ids", error))); toClose(idleProducer.createBatch().flatMap(batch -> { IntStream.range(0, 3).mapToObj(number -> new EventData("Number : " + number)) @@ -144,13 +135,12 @@ void idleSendLinks() throws InterruptedException { }); return idleProducer.send(batch).thenReturn(Instant.now()); - }).subscribe(instant -> { - System.out.println("Sent batch at: " + instant); - }, error -> System.err.println("Error sending batch: " + error))); + }).subscribe(instant -> logger.log(LogLevel.VERBOSE, () -> "Sent batch at: " + instant), + error -> logger.log(LogLevel.VERBOSE, () -> "Error sending batch", error))); - System.out.println("Sleeping 15 mins."); + logger.log(LogLevel.VERBOSE, () -> "Sleeping 15 mins."); TimeUnit.MINUTES.sleep(15); - System.out.println("Completed sleep."); + logger.log(LogLevel.VERBOSE, () -> "Completed sleep."); } } } @@ -173,12 +163,9 @@ void worksAfterReconnection() throws InterruptedException { toClose(Flux.interval(Duration.ofSeconds(1)) .flatMap(position -> client.getPartitionIds().collectList()) .subscribe(partitionIds -> { - System.out.printf("Ids %s: {%s}%n", Instant.now(), String.join(",", partitionIds)); - }, error -> { - logger.error("Error fetching info.", error); - }, () -> { - logger.info("Complete."); - })); + logger.log(LogLevel.VERBOSE, + () -> String.format("Ids %s: {%s}%n", Instant.now(), String.join(",", partitionIds))); + }, error -> logger.error("Error fetching info.", error), () -> logger.info("Complete."))); toClose(Flux.interval(Duration.ofSeconds(5)) .flatMap(position -> producer.createBatch(options).flatMap(batch -> { IntStream.range(0, 3).mapToObj(number -> new EventData("Position" + position + ": " + number)) @@ -191,16 +178,11 @@ void worksAfterReconnection() throws InterruptedException { return producer.send(batch).thenReturn(Instant.now()); })) - .subscribe(instant -> { - System.out.println("---- Sent batch at: " + instant); - }, error -> { - logger.error("---- Error sending batch: ", error); - }, () -> { - logger.info("---- Complete."); - })); + .subscribe(instant -> logger.log(LogLevel.VERBOSE, () -> "---- Sent batch at: " + instant), + error -> logger.error("---- Error sending batch: ", error), () -> logger.info("---- Complete."))); - System.out.println("Sleeping while performing work."); + logger.log(LogLevel.VERBOSE, () -> "Sleeping while performing work."); TimeUnit.MINUTES.sleep(30); - System.out.println("Complete."); + logger.log(LogLevel.VERBOSE, () -> "Complete."); } } diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/PartitionBasedLoadBalancerTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/PartitionBasedLoadBalancerTest.java index 1fa96bf7fdc9..5d277e366132 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/PartitionBasedLoadBalancerTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/PartitionBasedLoadBalancerTest.java @@ -4,6 +4,7 @@ package com.azure.messaging.eventhubs; import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.messaging.eventhubs.implementation.PartitionProcessor; import com.azure.messaging.eventhubs.implementation.instrumentation.EventHubsTracer; import com.azure.messaging.eventhubs.models.ErrorContext; @@ -17,7 +18,6 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestInfo; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; @@ -109,8 +109,7 @@ public class PartitionBasedLoadBalancerTest { private final EventProcessorClientOptions processorOptions = new EventProcessorClientOptions(); @BeforeEach - public void setup(TestInfo testInfo) { - System.out.println("Running " + testInfo.getDisplayName()); + public void setup() { toClose = new ArrayList<>(); mockCloseable = MockitoAnnotations.openMocks(this); @@ -142,7 +141,7 @@ public void teardown() throws Exception { try { closeable.close(); } catch (IOException error) { - error.printStackTrace(); + LOGGER.log(LogLevel.VERBOSE, () -> "Error closing resource.", error); } } diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/ProxySelectorTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/ProxySelectorTest.java index 9562eac39f4e..c43bebc11c50 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/ProxySelectorTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/ProxySelectorTest.java @@ -6,6 +6,7 @@ import com.azure.core.amqp.AmqpRetryOptions; import com.azure.core.amqp.AmqpTransportType; import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.messaging.eventhubs.models.EventPosition; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; @@ -27,6 +28,8 @@ @Tag(TestUtils.INTEGRATION) class ProxySelectorTest extends IntegrationTestBase { + private static final ClientLogger LOGGER = new ClientLogger(ProxySelectorTest.class); + private static final int PROXY_PORT = 8899; private static final InetSocketAddress SIMPLE_PROXY_ADDRESS = new InetSocketAddress("localhost", PROXY_PORT); private ProxySelector defaultProxySelector; @@ -73,7 +76,7 @@ public void connectFailed(URI uri, SocketAddress sa, IOException ioe) { .expectErrorSatisfies(error -> { // The message can vary because it is returned from proton-j, so we don't want to compare against that. // This is a transient error from ExceptionUtil.java: line 67. - System.out.println("Error: " + error); + LOGGER.log(LogLevel.VERBOSE, () -> "Error", error); }) .verify(TIMEOUT); diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/implementation/AmqpReceiveLinkProcessorTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/implementation/AmqpReceiveLinkProcessorTest.java index c731b8bea014..b7acff2826e5 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/implementation/AmqpReceiveLinkProcessorTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/implementation/AmqpReceiveLinkProcessorTest.java @@ -10,6 +10,8 @@ import com.azure.core.amqp.exception.AmqpErrorContext; import com.azure.core.amqp.exception.AmqpException; import com.azure.core.amqp.implementation.AmqpReceiveLink; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.messaging.eventhubs.implementation.instrumentation.EventHubsConsumerInstrumentation; import org.apache.qpid.proton.message.Message; import org.junit.jupiter.api.AfterEach; @@ -49,6 +51,8 @@ import static org.mockito.Mockito.when; class AmqpReceiveLinkProcessorTest { + private static final ClientLogger LOGGER = new ClientLogger(AmqpReceiveLinkProcessorTest.class); + private static final int PREFETCH = 5; private static final EventHubsConsumerInstrumentation DEFAULT_INSTRUMENTATION = new EventHubsConsumerInstrumentation(null, null, "hostname", "hubname", "$Default", false); @@ -190,9 +194,9 @@ void respectsBackpressureLessThanMinimum() { // Act processor.subscribe( - e -> System.out.println("message: " + e), + e -> LOGGER.log(LogLevel.VERBOSE, () -> "message: " + e), Assertions::fail, - () -> System.out.println("Complete."), + () -> LOGGER.log(LogLevel.VERBOSE, () -> "Complete."), s -> s.request(backpressure)); // Assert @@ -554,7 +558,7 @@ void onlyRequestsWhenCreditsLessThanPrefetch() { assertNotNull(integerSupplier); // Invoking this once. Should return a value and notify that there are no credits left on the link. final int messages = integerSupplier.get(); - System.out.println("Messages: " + messages); + LOGGER.log(LogLevel.VERBOSE, () -> "Messages: " + messages); }) .expectNoEvent(Duration.ofSeconds(1)) .thenRequest(nextRequest) diff --git a/sdk/healthinsights/azure-health-insights-radiologyinsights/README.md b/sdk/healthinsights/azure-health-insights-radiologyinsights/README.md index 13782c80c116..bb5249bfbb72 100644 --- a/sdk/healthinsights/azure-health-insights-radiologyinsights/README.md +++ b/sdk/healthinsights/azure-health-insights-radiologyinsights/README.md @@ -121,7 +121,7 @@ private static List createPatientRecords() { // Use LocalDate to set Date patientDetails.setBirthDate(LocalDate.of(1959, 11, 11)); - + patientRecord.setInfo(patientDetails); Encounter encounter = new Encounter("encounterid1"); @@ -151,7 +151,7 @@ private static List createPatientRecords() { patientDocument.setSpecialtyType(SpecialtyType.RADIOLOGY); DocumentAdministrativeMetadata adminMetadata = new DocumentAdministrativeMetadata(); - FhirR4Extendible orderedProcedure = new FhirR4Extendible(); + OrderedProcedure orderedProcedure = new OrderedProcedure(); FhirR4CodeableConcept procedureCode = new FhirR4CodeableConcept(); FhirR4Coding procedureCoding = new FhirR4Coding(); @@ -240,8 +240,8 @@ Display critical result inferences from the example request results. ```java com.azure.health.insights.radiologyinsights.displayresults List patientResults = radiologyInsightsResult.getPatientResults(); for (RadiologyInsightsPatientResult patientResult : patientResults) { - List inferences = patientResult.getInferences(); - for (FhirR4Extendible1 inference : inferences) { + List inferences = patientResult.getInferences(); + for (RadiologyInsightsInference inference : inferences) { if (inference instanceof CriticalResultInference) { CriticalResultInference criticalResultInference = (CriticalResultInference) inference; String description = criticalResultInference.getResult().getDescription(); diff --git a/sdk/keyvault/azure-security-keyvault-certificates/src/test/java/com/azure/security/keyvault/certificates/CertificateClientTest.java b/sdk/keyvault/azure-security-keyvault-certificates/src/test/java/com/azure/security/keyvault/certificates/CertificateClientTest.java index 176841ed1efa..393a22f5e03f 100644 --- a/sdk/keyvault/azure-security-keyvault-certificates/src/test/java/com/azure/security/keyvault/certificates/CertificateClientTest.java +++ b/sdk/keyvault/azure-security-keyvault-certificates/src/test/java/com/azure/security/keyvault/certificates/CertificateClientTest.java @@ -9,6 +9,8 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.test.http.AssertingHttpClientBuilder; import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollResponse; import com.azure.core.util.polling.SyncPoller; @@ -68,6 +70,8 @@ import static org.junit.jupiter.api.Assertions.fail; public class CertificateClientTest extends CertificateClientTestBase { + private static final ClientLogger LOGGER = new ClientLogger(CertificateClientTest.class); + private CertificateClient certificateClient; @Override @@ -975,7 +979,7 @@ private void pollOnCertificatePurge(String certificateName) { } } - System.err.printf("Deleted Key %s was not purged \n", certificateName); + LOGGER.log(LogLevel.VERBOSE, () -> "Deleted Certificate " + certificateName + " was not purged"); } } diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/KeyAsyncClientTest.java b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/KeyAsyncClientTest.java index 3012b65ad5d2..3cb7feb45efa 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/KeyAsyncClientTest.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/KeyAsyncClientTest.java @@ -7,6 +7,8 @@ import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpClient; import com.azure.core.test.TestMode; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.PollerFlux; import com.azure.security.keyvault.keys.cryptography.CryptographyAsyncClient; @@ -41,6 +43,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public class KeyAsyncClientTest extends KeyClientTestBase { + private static final ClientLogger LOGGER = new ClientLogger(KeyAsyncClientTest.class); protected KeyAsyncClient keyAsyncClient; @Override @@ -838,7 +841,7 @@ private void pollOnKeyPurge(String keyName) { } } - System.err.printf("Deleted Key %s was not purged \n", keyName); + LOGGER.log(LogLevel.VERBOSE, () -> "Deleted Key " + keyName + " was not purged"); } } diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/KeyClientTest.java b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/KeyClientTest.java index 10ace970322b..ae77209705b3 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/KeyClientTest.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/KeyClientTest.java @@ -7,6 +7,8 @@ import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpClient; import com.azure.core.test.TestMode; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.core.util.polling.SyncPoller; import com.azure.security.keyvault.keys.cryptography.CryptographyClient; import com.azure.security.keyvault.keys.cryptography.models.EncryptionAlgorithm; @@ -40,6 +42,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public class KeyClientTest extends KeyClientTestBase { + private static final ClientLogger LOGGER = new ClientLogger(KeyClientTest.class); + protected KeyClient keyClient; @Override @@ -751,6 +755,6 @@ private void pollOnKeyPurge(String keyName) { } } - System.err.printf("Deleted Key %s was not purged \n", keyName); + LOGGER.log(LogLevel.VERBOSE, () -> "Deleted Key " + keyName + " was not purged"); } } diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientTest.java b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientTest.java index 419c079e7854..01e37bb6cdac 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientTest.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientTest.java @@ -4,6 +4,8 @@ package com.azure.security.keyvault.keys.cryptography; import com.azure.core.http.HttpClient; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.security.keyvault.keys.KeyClient; import com.azure.security.keyvault.keys.cryptography.models.EncryptParameters; import com.azure.security.keyvault.keys.cryptography.models.EncryptionAlgorithm; @@ -40,6 +42,8 @@ import static org.junit.jupiter.api.Assertions.fail; public class CryptographyClientTest extends CryptographyClientTestBase { + private static final ClientLogger LOGGER = new ClientLogger(CryptographyClientTest.class); + private KeyClient client; @Override @@ -349,7 +353,7 @@ public void signDataVerifyEcLocal() { } catch (InvalidAlgorithmParameterException | NoSuchAlgorithmException e) { // Could not generate a KeyPair from the given JsonWebKey. // It's likely this happened for key curve secp256k1, which is not supported on Java 16+. - e.printStackTrace(); + LOGGER.log(LogLevel.VERBOSE, () -> "Failed to generate key pair from JsonWebKey.", e); return; } diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientTestBase.java b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientTestBase.java index 91e7ed3f2276..3aecf85da493 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientTestBase.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/test/java/com/azure/security/keyvault/keys/cryptography/CryptographyClientTestBase.java @@ -15,6 +15,7 @@ import com.azure.core.test.utils.MockTokenCredential; import com.azure.core.util.Configuration; import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; import com.azure.identity.ClientSecretCredentialBuilder; import com.azure.security.keyvault.keys.KeyClientBuilder; import com.azure.security.keyvault.keys.KeyServiceVersion; @@ -52,6 +53,8 @@ import static org.junit.jupiter.api.Assertions.assertArrayEquals; public abstract class CryptographyClientTestBase extends TestProxyTestBase { + private static final ClientLogger LOGGER = new ClientLogger(CryptographyClientTestBase.class); + protected boolean isHsmEnabled = false; protected boolean runManagedHsmTest = false; @@ -338,10 +341,6 @@ public String getEndpoint() { } public void sleep(long millis) { - try { - Thread.sleep(millis); - } catch (InterruptedException e) { - e.printStackTrace(); - } + sleepIfRunningAgainstService(millis); } } diff --git a/sdk/keyvault/azure-security-keyvault-secrets/src/test/java/com/azure/security/keyvault/secrets/SecretAsyncClientTest.java b/sdk/keyvault/azure-security-keyvault-secrets/src/test/java/com/azure/security/keyvault/secrets/SecretAsyncClientTest.java index 155f022e979a..63fffc5dffbe 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/src/test/java/com/azure/security/keyvault/secrets/SecretAsyncClientTest.java +++ b/sdk/keyvault/azure-security-keyvault-secrets/src/test/java/com/azure/security/keyvault/secrets/SecretAsyncClientTest.java @@ -7,6 +7,8 @@ import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpClient; import com.azure.core.test.http.AssertingHttpClientBuilder; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.PollerFlux; import com.azure.security.keyvault.secrets.implementation.KeyVaultCredentialPolicy; @@ -29,6 +31,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public class SecretAsyncClientTest extends SecretClientTestBase { + private static final ClientLogger LOGGER = new ClientLogger(SecretAsyncClientTest.class); + private SecretAsyncClient secretAsyncClient; @Override @@ -574,6 +578,6 @@ private void pollOnSecretPurge(String secretName) { } } - System.err.printf("Deleted Secret %s was not purged \n", secretName); + LOGGER.log(LogLevel.VERBOSE, () -> "Deleted Secret " + secretName + " was not purged"); } } diff --git a/sdk/keyvault/azure-security-keyvault-secrets/src/test/java/com/azure/security/keyvault/secrets/SecretClientTest.java b/sdk/keyvault/azure-security-keyvault-secrets/src/test/java/com/azure/security/keyvault/secrets/SecretClientTest.java index 0e8309f0b9ce..4e43e1a38cb8 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/src/test/java/com/azure/security/keyvault/secrets/SecretClientTest.java +++ b/sdk/keyvault/azure-security-keyvault-secrets/src/test/java/com/azure/security/keyvault/secrets/SecretClientTest.java @@ -7,6 +7,8 @@ import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpClient; import com.azure.core.test.http.AssertingHttpClientBuilder; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.core.util.polling.SyncPoller; import com.azure.security.keyvault.secrets.implementation.KeyVaultCredentialPolicy; import com.azure.security.keyvault.secrets.implementation.models.KeyVaultErrorException; @@ -27,6 +29,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public class SecretClientTest extends SecretClientTestBase { + private static final ClientLogger LOGGER = new ClientLogger(SecretClientTest.class); + private SecretClient secretClient; @Override @@ -494,6 +498,6 @@ private void pollOnSecretPurge(String secretName) { } } - System.err.printf("Deleted Secret %s was not purged \n", secretName); + LOGGER.log(LogLevel.VERBOSE, () -> "Deleted Secret " + secretName + " was not purged"); } } diff --git a/sdk/keyvault/test-resources.json b/sdk/keyvault/test-resources.json index dff6a0b2c37d..3b0edf0a9a2b 100644 --- a/sdk/keyvault/test-resources.json +++ b/sdk/keyvault/test-resources.json @@ -171,7 +171,7 @@ "type": "string", "defaultValue": "core.windows.net", "metadata": { - "description": "The url suffix to use when accessing the storage data plane." + "description": "The url suffix to use when accessing the storage data plane." } } }, @@ -486,45 +486,11 @@ "azPowerShellVersion": "5.0", "timeout": "PT30M", "arguments": "[format(' -vaultName {0} -certificateName {1} -subjectName {2}', variables('kvName'), parameters('certificateName'), parameters('subjectName'))]", - "scriptContent": " - param( - [string] [Parameter(Mandatory=$true)] $vaultName, - [string] [Parameter(Mandatory=$true)] $certificateName, - [string] [Parameter(Mandatory=$true)] $subjectName - ) - - $ErrorActionPreference = 'Stop' - $DeploymentScriptOutputs = @{} - - $policy = New-AzKeyVaultCertificatePolicy -SubjectName $subjectName -IssuerName Self -ValidityInMonths 12 -Verbose - - Add-AzKeyVaultCertificate -VaultName $vaultName -Name $certificateName -CertificatePolicy $policy -Verbose - - $newCert = Get-AzKeyVaultCertificate -VaultName $vaultName -Name $certificateName - - $tries = 0 - do { - Write-Host 'Waiting for certificate creation completion...' - Start-Sleep -Seconds 10 - $operation = Get-AzKeyVaultCertificateOperation -VaultName $vaultName -Name $certificateName - $tries++ - - if ($operation.Status -eq 'failed') { - throw 'Creating certificate $certificateName in vault $vaultName failed with error $($operation.ErrorMessage)' + "scriptContent": "param([string] [Parameter(Mandatory=$true)] $vaultName, [string] [Parameter(Mandatory=$true)] $certificateName, [string] [Parameter(Mandatory=$true)] $subjectName)\n\n$ErrorActionPreference = 'Stop'\n$DeploymentScriptOutputs = @{}\n$policy = New-AzKeyVaultCertificatePolicy -SubjectName $subjectName -IssuerName Self -ValidityInMonths 12 -Verbose\n\nAdd-AzKeyVaultCertificate -VaultName $vaultName -Name $certificateName -CertificatePolicy $policy -Verbose\n\n$newCert = Get-AzKeyVaultCertificate -VaultName $vaultName -Name $certificateName\n$tries = 0\n\ndo {\n Write-Host 'Waiting for certificate creation completion...'\n Start-Sleep -Seconds 10\n $operation = Get-AzKeyVaultCertificateOperation -VaultName $vaultName -Name $certificateName\n $tries++\n\n if ($operation.Status -eq 'failed') {\n throw 'Creating certificate $certificateName in vault $vaultName failed with error $($operation.ErrorMessage)'\n }\n\n if ($tries -gt 120) {\n throw 'Timed out waiting for creation of certificate $certificateName in vault $vaultName'\n }\n} while ($operation.Status -ne 'completed')\n\n$DeploymentScriptOutputs['certThumbprint'] = $newCert.Thumbprint\n$newCert | Out-String\n", + "cleanupPreference": "OnSuccess", + "retentionInterval": "P1D" } - - if ($tries -gt 120) { - throw 'Timed out waiting for creation of certificate $certificateName in vault $vaultName' - } - } while ($operation.Status -ne 'completed') - - $DeploymentScriptOutputs['certThumbprint'] = $newCert.Thumbprint - $newCert | Out-String - ", - "cleanupPreference": "OnSuccess", - "retentionInterval": "P1D" } - } ], "outputs": { "AZURE_KEYVAULT_ENDPOINT": { @@ -565,8 +531,8 @@ "value": "[parameters('testApplicationOid')]" }, "KEYVAULT_STORAGE_ENDPOINT_SUFFIX": { - "type": "string", - "value": "[parameters('storageEndpointSuffix')]" + "type": "string", + "value": "[parameters('storageEndpointSuffix')]" }, "BLOB_STORAGE_ACCOUNT_NAME": { "type": "string", diff --git a/sdk/monitor/azure-monitor-ingestion/src/test/java/com/azure/monitor/ingestion/LogsIngestionTestBase.java b/sdk/monitor/azure-monitor-ingestion/src/test/java/com/azure/monitor/ingestion/LogsIngestionTestBase.java index eda79ce1ec45..fca9777060ae 100644 --- a/sdk/monitor/azure-monitor-ingestion/src/test/java/com/azure/monitor/ingestion/LogsIngestionTestBase.java +++ b/sdk/monitor/azure-monitor-ingestion/src/test/java/com/azure/monitor/ingestion/LogsIngestionTestBase.java @@ -19,6 +19,8 @@ import com.azure.core.test.utils.MockTokenCredential; import com.azure.core.util.BinaryData; import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.core.util.serializer.JsonSerializerProviders; import com.azure.core.util.serializer.TypeReference; import com.azure.identity.DefaultAzureCredentialBuilder; @@ -43,6 +45,8 @@ * Base test class for logs ingestion client tests. */ public abstract class LogsIngestionTestBase extends TestProxyTestBase { + private static final ClientLogger LOGGER = new ClientLogger(LogsIngestionTestBase.class); + protected LogsIngestionClientBuilder clientBuilder; protected String dataCollectionEndpoint; protected String dataCollectionRuleId; @@ -210,7 +214,7 @@ private static byte[] unzipRequestBody(BinaryData bodyAsBinaryData) { outputStream.close(); return outputStream.toByteArray(); } catch (IOException exception) { - System.out.println("Failed to unzip data"); + LOGGER.log(LogLevel.VERBOSE, () -> "Failed to unzip data"); } return null; } diff --git a/sdk/monitor/azure-monitor-ingestion/src/test/java/com/azure/monitor/ingestion/implementation/UtilsTest.java b/sdk/monitor/azure-monitor-ingestion/src/test/java/com/azure/monitor/ingestion/implementation/UtilsTest.java index db75340d1d7a..afc99a8bb5ab 100644 --- a/sdk/monitor/azure-monitor-ingestion/src/test/java/com/azure/monitor/ingestion/implementation/UtilsTest.java +++ b/sdk/monitor/azure-monitor-ingestion/src/test/java/com/azure/monitor/ingestion/implementation/UtilsTest.java @@ -5,7 +5,6 @@ import org.junit.jupiter.api.Test; -import java.time.Instant; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; @@ -17,7 +16,6 @@ import java.util.stream.Stream; import static org.junit.jupiter.api.Assertions.assertArrayEquals; -import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -31,13 +29,11 @@ public void shutdownHookTerminatesPool() throws InterruptedException, ExecutionE Stream stream = IntStream.of(100, 4000) .boxed() .parallel() - .map(i -> task(i)); + .map(this::task); Future> tasks = threadPool.submit(() -> stream.collect(Collectors.toList())); - long start = Instant.now().toEpochMilli(); hook.run(); - assertEquals(timeoutSec * 1000, Instant.now().toEpochMilli() - start, 1000); assertTrue(threadPool.isShutdown()); assertTrue(threadPool.isTerminated()); diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/MetricDataMapper.java b/sdk/monitor/azure-monitor-opentelemetry-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/MetricDataMapper.java index 42bcfafe9f1a..b69e5f9dd886 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/MetricDataMapper.java +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/MetricDataMapper.java @@ -45,22 +45,22 @@ public class MetricDataMapper { private static final ClientLogger logger = new ClientLogger(MetricDataMapper.class); + private static final Set OTEL_UNSTABLE_METRICS_TO_EXCLUDE = new HashSet<>(); + private static final String OTEL_INSTRUMENTATION_NAME_PREFIX = "io.opentelemetry"; private static final Set OTEL_PRE_AGGREGATED_STANDARD_METRIC_NAMES = new HashSet<>(4); - private static final List EXCLUDED_METRIC_NAMES = new ArrayList<>(); public static final AttributeKey APPLICATIONINSIGHTS_INTERNAL_METRIC_NAME = AttributeKey.stringKey("applicationinsights.internal.metric_name"); private final BiConsumer telemetryInitializer; private final boolean captureHttpServer4xxAsError; static { - EXCLUDED_METRIC_NAMES.add("http.server.active_requests"); // Servlet - EXCLUDED_METRIC_NAMES.add("http.server.response.size"); - EXCLUDED_METRIC_NAMES.add("http.client.response.size"); + // HTTP unstable metrics to be excluded via Otel auto instrumentation + OTEL_UNSTABLE_METRICS_TO_EXCLUDE.add("rpc.client.duration"); + OTEL_UNSTABLE_METRICS_TO_EXCLUDE.add("rpc.server.duration"); + // Application Insights pre-aggregated standard metrics OTEL_PRE_AGGREGATED_STANDARD_METRIC_NAMES.add("http.server.request.duration"); OTEL_PRE_AGGREGATED_STANDARD_METRIC_NAMES.add("http.client.request.duration"); - OTEL_PRE_AGGREGATED_STANDARD_METRIC_NAMES.add("http.server.duration"); // pre-stable HTTP semconv - OTEL_PRE_AGGREGATED_STANDARD_METRIC_NAMES.add("http.client.duration"); // pre-stable HTTP semconv OTEL_PRE_AGGREGATED_STANDARD_METRIC_NAMES.add("rpc.client.duration"); OTEL_PRE_AGGREGATED_STANDARD_METRIC_NAMES.add("rpc.server.duration"); } @@ -73,10 +73,6 @@ public MetricDataMapper( } public void map(MetricData metricData, Consumer consumer) { - if (EXCLUDED_METRIC_NAMES.contains(metricData.getName())) { - return; - } - MetricDataType type = metricData.getType(); if (type == DOUBLE_SUM || type == DOUBLE_GAUGE @@ -85,11 +81,20 @@ public void map(MetricData metricData, Consumer consumer) { || type == HISTOGRAM) { boolean isPreAggregatedStandardMetric = OTEL_PRE_AGGREGATED_STANDARD_METRIC_NAMES.contains(metricData.getName()); - List telemetryItemList = - convertOtelMetricToAzureMonitorMetric(metricData, isPreAggregatedStandardMetric); - for (TelemetryItem telemetryItem : telemetryItemList) { - consumer.accept(telemetryItem); + if (isPreAggregatedStandardMetric) { + List preAggregatedStandardMetrics = + convertOtelMetricToAzureMonitorMetric(metricData, true); + preAggregatedStandardMetrics.forEach(consumer::accept); + } + + // DO NOT emit unstable metrics from the OpenTelemetry auto instrumentation libraries + // custom metrics are always emitted + if (OTEL_UNSTABLE_METRICS_TO_EXCLUDE.contains(metricData.getName()) + && metricData.getInstrumentationScopeInfo().getName().startsWith(OTEL_INSTRUMENTATION_NAME_PREFIX)) { + return; } + List stableOtelMetrics = convertOtelMetricToAzureMonitorMetric(metricData, false); + stableOtelMetrics.forEach(consumer::accept); } else { logger.warning("metric data type {} is not supported yet.", metricData.getType()); } diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/heartbeat/DefaultHeartBeatPropertyProvider.java b/sdk/monitor/azure-monitor-opentelemetry-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/heartbeat/DefaultHeartBeatPropertyProvider.java index 2a0c259da7fc..8d3c424251c7 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/heartbeat/DefaultHeartBeatPropertyProvider.java +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/heartbeat/DefaultHeartBeatPropertyProvider.java @@ -23,7 +23,7 @@ public class DefaultHeartBeatPropertyProvider implements HeartBeatPayloadProvide /** * Collection holding default properties for this default provider. */ - private final Set defaultFields; + final Set defaultFields; /** * Random GUID that would help in analysis when app has stopped and restarted. Each restart will diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/src/test/java/com/azure/monitor/opentelemetry/exporter/implementation/heartbeat/HeartbeatTests.java b/sdk/monitor/azure-monitor-opentelemetry-exporter/src/test/java/com/azure/monitor/opentelemetry/exporter/implementation/heartbeat/HeartbeatTests.java index a08c30811c66..45d3676a11fd 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/src/test/java/com/azure/monitor/opentelemetry/exporter/implementation/heartbeat/HeartbeatTests.java +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/src/test/java/com/azure/monitor/opentelemetry/exporter/implementation/heartbeat/HeartbeatTests.java @@ -6,13 +6,8 @@ import com.azure.monitor.opentelemetry.exporter.implementation.models.MetricsData; import com.azure.monitor.opentelemetry.exporter.implementation.models.TelemetryItem; import org.junit.jupiter.api.Test; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.stubbing.Answer; -import java.lang.reflect.Field; import java.util.List; -import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.function.Consumer; @@ -20,9 +15,8 @@ import static org.assertj.core.api.Assertions.assertThat; class HeartbeatTests { - - @Mock - private Consumer> telemetryItemsConsumer; + // Dummy consumer that does nothing. + private final Consumer> telemetryItemsConsumer = ignored -> {}; @Test void heartBeatPayloadContainsDataByDefault() throws InterruptedException { @@ -80,30 +74,24 @@ void heartbeatMetricCountsForAllFailures() { } @Test - void sentHeartbeatContainsExpectedDefaultFields() throws Exception { - HeartbeatExporter mockProvider = Mockito.mock(HeartbeatExporter.class); + void sentHeartbeatContainsExpectedDefaultFields() { ConcurrentMap props = new ConcurrentHashMap<>(); - Mockito.when( - mockProvider.addHeartBeatProperty( - Mockito.anyString(), Mockito.anyString(), Mockito.anyBoolean())) - .then( - (Answer) - invocation -> { - props.put( - invocation.getArgument(0, String.class), - invocation.getArgument(1, String.class)); - return true; - }); + + HeartbeatExporter mockProvider = new HeartbeatExporter(60, (b, r) -> { + }, telemetryItemsConsumer) { + @Override + public boolean addHeartBeatProperty(String propertyName, String propertyValue, boolean isHealthy) { + props.put(propertyName, propertyValue); + return true; + } + }; + DefaultHeartBeatPropertyProvider defaultProvider = new DefaultHeartBeatPropertyProvider(); HeartbeatDefaultPayload.populateDefaultPayload(mockProvider).run(); - Field field = defaultProvider.getClass().getDeclaredField("defaultFields"); - field.setAccessible(true); - @SuppressWarnings("unchecked") - Set defaultFields = (Set) field.get(defaultProvider); - for (String fieldName : defaultFields) { + for (String fieldName : defaultProvider.defaultFields) { assertThat(props.containsKey(fieldName)).isTrue(); - assertThat(props.get(fieldName).length() > 0).isTrue(); + assertThat(!props.get(fieldName).isEmpty()).isTrue(); } } @@ -119,15 +107,11 @@ void heartBeatProviderDoesNotAllowDuplicateProperties() { } @Test - void cannotAddUnknownDefaultProperty() throws Exception { + void cannotAddUnknownDefaultProperty() { DefaultHeartBeatPropertyProvider base = new DefaultHeartBeatPropertyProvider(); String testKey = "testKey"; - Field field = base.getClass().getDeclaredField("defaultFields"); - field.setAccessible(true); - @SuppressWarnings("unchecked") - Set defaultFields = (Set) field.get(base); - defaultFields.add(testKey); + base.defaultFields.add(testKey); HeartbeatExporter provider = new HeartbeatExporter(60, (b, r) -> { }, telemetryItemsConsumer); diff --git a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureFunctionsSyncTests.java b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureFunctionsSyncTests.java index 993a2317dab3..d13c415ca607 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureFunctionsSyncTests.java +++ b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureFunctionsSyncTests.java @@ -52,11 +52,7 @@ public void parallelFunctionCallTest(HttpClient httpClient, AssistantsServiceVer // Poll the run do { - try { - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + sleepIfRunningAgainstService(500); run = client.getRun(assistantThread.getId(), run.getId()); } while (run.getStatus() == RunStatus.QUEUED || run.getStatus() == RunStatus.IN_PROGRESS); diff --git a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureRetrievalSyncTest.java b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureRetrievalSyncTest.java index 372aef1d8711..e0b8132b6ee1 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureRetrievalSyncTest.java +++ b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureRetrievalSyncTest.java @@ -58,11 +58,7 @@ public void basicRetrieval(HttpClient httpClient, AssistantsServiceVersion servi ThreadRun run = client.createRun(thread, assistant); do { - try { - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + sleepIfRunningAgainstService(500); run = client.getRun(thread.getId(), run.getId()); } while (run.getStatus() == RunStatus.IN_PROGRESS || run.getStatus() == RunStatus.QUEUED); diff --git a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureRunThreadAsyncTest.java b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureRunThreadAsyncTest.java index c303e758c988..0c41110a5607 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureRunThreadAsyncTest.java +++ b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureRunThreadAsyncTest.java @@ -69,11 +69,7 @@ public void submitMessageAndRun(HttpClient httpClient, AssistantsServiceVersion .verifyComplete(); run = runReference.get(); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + sleepIfRunningAgainstService(500); } while (run.getStatus() == RunStatus.IN_PROGRESS || run.getStatus() == RunStatus.QUEUED); assertSame(RunStatus.COMPLETED, run.getStatus()); @@ -136,11 +132,7 @@ public void submitMessageAndRunWithResponse(HttpClient httpClient, AssistantsSer .verifyComplete(); run = runReference.get(); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + sleepIfRunningAgainstService(500); } while (run.getStatus() == RunStatus.IN_PROGRESS || run.getStatus() == RunStatus.QUEUED); assertSame(RunStatus.COMPLETED, run.getStatus()); @@ -196,11 +188,7 @@ public void createThreadAndRun(HttpClient httpClient, AssistantsServiceVersion s .verifyComplete(); run = runReference.get(); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + sleepIfRunningAgainstService(500); } while (run.getStatus() == RunStatus.IN_PROGRESS || run.getStatus() == RunStatus.QUEUED); assertSame(RunStatus.COMPLETED, run.getStatus()); @@ -261,11 +249,7 @@ public void createThreadAndRunWithResponse(HttpClient httpClient, AssistantsServ .verifyComplete(); run = runReference.get(); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + sleepIfRunningAgainstService(500); } while (run.getStatus() == RunStatus.IN_PROGRESS || run.getStatus() == RunStatus.QUEUED); assertSame(RunStatus.COMPLETED, run.getStatus()); @@ -394,11 +378,7 @@ public void listAndGetRunSteps(HttpClient httpClient, AssistantsServiceVersion s runReference.set(threadRun); }) .verifyComplete(); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + sleepIfRunningAgainstService(500); run = runReference.get(); } while (run.getStatus() == RunStatus.IN_PROGRESS || run.getStatus() == RunStatus.QUEUED); assertSame(RunStatus.COMPLETED, run.getStatus()); diff --git a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureRunThreadSyncTest.java b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureRunThreadSyncTest.java index ce08fa777d93..5ea7a4570741 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureRunThreadSyncTest.java +++ b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/AzureRunThreadSyncTest.java @@ -50,11 +50,7 @@ public void submitMessageAndRun(HttpClient httpClient, AssistantsServiceVersion // Wait on Run and poll the Run in a loop do { run = client.getRun(run.getThreadId(), run.getId()); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + sleepIfRunningAgainstService(500); } while (run.getStatus() == RunStatus.IN_PROGRESS || run.getStatus() == RunStatus.QUEUED); assertSame(RunStatus.COMPLETED, run.getStatus()); @@ -94,11 +90,7 @@ public void submitMessageAndRunWithResponse(HttpClient httpClient, AssistantsSer // Wait on Run and poll the Run in a loop do { run = client.getRun(run.getThreadId(), run.getId()); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + sleepIfRunningAgainstService(500); } while (run.getStatus() == RunStatus.IN_PROGRESS || run.getStatus() == RunStatus.QUEUED); assertSame(RunStatus.COMPLETED, run.getStatus()); @@ -134,11 +126,7 @@ public void createThreadAndRun(HttpClient httpClient, AssistantsServiceVersion s // Wait on Run and poll the Run in a loop do { run = client.getRun(run.getThreadId(), run.getId()); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + sleepIfRunningAgainstService(500); } while (run.getStatus() == RunStatus.IN_PROGRESS || run.getStatus() == RunStatus.QUEUED); assertSame(RunStatus.COMPLETED, run.getStatus()); @@ -176,11 +164,7 @@ public void createThreadAndRunWithResponse(HttpClient httpClient, AssistantsServ // Wait on Run and poll the Run in a loop do { run = client.getRun(run.getThreadId(), run.getId()); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + sleepIfRunningAgainstService(500); } while (run.getStatus() == RunStatus.IN_PROGRESS || run.getStatus() == RunStatus.QUEUED); assertSame(RunStatus.COMPLETED, run.getStatus()); @@ -283,11 +267,7 @@ public void listAndGetRunSteps(HttpClient httpClient, AssistantsServiceVersion s // Wait on Run and poll the Run in a loop do { run = client.getRun(run.getThreadId(), run.getId()); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + sleepIfRunningAgainstService(500); } while (run.getStatus() == RunStatus.IN_PROGRESS || run.getStatus() == RunStatus.QUEUED); assertSame(RunStatus.COMPLETED, run.getStatus()); diff --git a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/FunctionsSyncTests.java b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/FunctionsSyncTests.java index 50182c461a08..231da68f7344 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/FunctionsSyncTests.java +++ b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/FunctionsSyncTests.java @@ -52,11 +52,7 @@ public void parallelFunctionCallTest(HttpClient httpClient, AssistantsServiceVer // Poll the run do { - try { - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + sleepIfRunningAgainstService(500); run = client.getRun(assistantThread.getId(), run.getId()); } while (run.getStatus() == RunStatus.QUEUED || run.getStatus() == RunStatus.IN_PROGRESS); diff --git a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/RetrievalSyncTest.java b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/RetrievalSyncTest.java index e9ad5a5fd64f..3ab9b625ba3e 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/RetrievalSyncTest.java +++ b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/RetrievalSyncTest.java @@ -56,11 +56,7 @@ public void basicRetrieval(HttpClient httpClient, AssistantsServiceVersion servi ThreadRun run = client.createRun(thread, assistant); do { - try { - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + sleepIfRunningAgainstService(500); run = client.getRun(thread.getId(), run.getId()); } while (run.getStatus() == RunStatus.IN_PROGRESS || run.getStatus() == RunStatus.QUEUED); diff --git a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/RunThreadAsyncTest.java b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/RunThreadAsyncTest.java index 035e80e9a8ff..fc56f839db04 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/RunThreadAsyncTest.java +++ b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/RunThreadAsyncTest.java @@ -69,11 +69,7 @@ public void submitMessageAndRun(HttpClient httpClient, AssistantsServiceVersion .verifyComplete(); run = runReference.get(); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + sleepIfRunningAgainstService(500); } while (run.getStatus() == RunStatus.IN_PROGRESS || run.getStatus() == RunStatus.QUEUED); assertSame(RunStatus.COMPLETED, run.getStatus()); @@ -138,11 +134,7 @@ public void submitMessageAndRunWithResponse(HttpClient httpClient, AssistantsSer .verifyComplete(); run = runReference.get(); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + sleepIfRunningAgainstService(500); } while (run.getStatus() == RunStatus.IN_PROGRESS || run.getStatus() == RunStatus.QUEUED); assertSame(RunStatus.COMPLETED, run.getStatus()); @@ -198,11 +190,7 @@ public void createThreadAndRun(HttpClient httpClient, AssistantsServiceVersion s .verifyComplete(); run = runReference.get(); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + sleepIfRunningAgainstService(500); } while (run.getStatus() == RunStatus.IN_PROGRESS || run.getStatus() == RunStatus.QUEUED); assertSame(RunStatus.COMPLETED, run.getStatus()); @@ -263,11 +251,7 @@ public void createThreadAndRunWithResponse(HttpClient httpClient, AssistantsServ .verifyComplete(); run = runReference.get(); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + sleepIfRunningAgainstService(500); } while (run.getStatus() == RunStatus.IN_PROGRESS || run.getStatus() == RunStatus.QUEUED); assertSame(RunStatus.COMPLETED, run.getStatus()); @@ -396,11 +380,7 @@ public void listAndGetRunSteps(HttpClient httpClient, AssistantsServiceVersion s runReference.set(threadRun); }) .verifyComplete(); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + sleepIfRunningAgainstService(500); run = runReference.get(); } while (run.getStatus() == RunStatus.IN_PROGRESS || run.getStatus() == RunStatus.QUEUED); assertSame(RunStatus.COMPLETED, run.getStatus()); diff --git a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/RunThreadSyncTest.java b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/RunThreadSyncTest.java index 294165e1d156..1cf4ddf547b3 100644 --- a/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/RunThreadSyncTest.java +++ b/sdk/openai/azure-ai-openai-assistants/src/test/java/com/azure/ai/openai/assistants/RunThreadSyncTest.java @@ -50,11 +50,7 @@ public void submitMessageAndRun(HttpClient httpClient, AssistantsServiceVersion // Wait on Run and poll the Run in a loop do { run = client.getRun(run.getThreadId(), run.getId()); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + sleepIfRunningAgainstService(500); } while (run.getStatus() == RunStatus.IN_PROGRESS || run.getStatus() == RunStatus.QUEUED); assertSame(RunStatus.COMPLETED, run.getStatus()); @@ -94,11 +90,7 @@ public void submitMessageAndRunWithResponse(HttpClient httpClient, AssistantsSer // Wait on Run and poll the Run in a loop do { run = client.getRun(run.getThreadId(), run.getId()); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + sleepIfRunningAgainstService(500); } while (run.getStatus() == RunStatus.IN_PROGRESS || run.getStatus() == RunStatus.QUEUED); assertSame(RunStatus.COMPLETED, run.getStatus()); @@ -133,11 +125,7 @@ public void createThreadAndRun(HttpClient httpClient, AssistantsServiceVersion s // Wait on Run and poll the Run in a loop do { run = client.getRun(run.getThreadId(), run.getId()); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + sleepIfRunningAgainstService(500); } while (run.getStatus() == RunStatus.IN_PROGRESS || run.getStatus() == RunStatus.QUEUED); assertSame(RunStatus.COMPLETED, run.getStatus()); @@ -175,11 +163,7 @@ public void createThreadAndRunWithResponse(HttpClient httpClient, AssistantsServ // Wait on Run and poll the Run in a loop do { run = client.getRun(run.getThreadId(), run.getId()); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + sleepIfRunningAgainstService(500); } while (run.getStatus() == RunStatus.IN_PROGRESS || run.getStatus() == RunStatus.QUEUED); assertSame(RunStatus.COMPLETED, run.getStatus()); @@ -281,11 +265,7 @@ public void listAndGetRunSteps(HttpClient httpClient, AssistantsServiceVersion s // Wait on Run and poll the Run in a loop do { run = client.getRun(run.getThreadId(), run.getId()); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } + sleepIfRunningAgainstService(500); } while (run.getStatus() == RunStatus.IN_PROGRESS || run.getStatus() == RunStatus.QUEUED); assertSame(RunStatus.COMPLETED, run.getStatus()); diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/FunctionCallPreset.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/FunctionCallPreset.java index f2ca84984c34..0cb1ab118f36 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/FunctionCallPreset.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/FunctionCallPreset.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - package com.azure.ai.openai.implementation.models; import com.azure.core.annotation.Generated; @@ -13,6 +12,7 @@ * operation. */ public final class FunctionCallPreset extends ExpandableStringEnum { + /** * Specifies that the model may either use any of the functions provided in this chat completions request or * instead return a standard chat completions response as if no functions were provided. @@ -29,7 +29,7 @@ public final class FunctionCallPreset extends ExpandableStringEnum "Subscription id: " + getSubscriptionId()); + LOGGER.log(LogLevel.VERBOSE, () -> "Resource group: " + getResourceGroup()); + LOGGER.log(LogLevel.VERBOSE, () -> "Workspace: " + getWorkspaceName()); + LOGGER.log(LogLevel.VERBOSE, () -> "Location: " + getLocation()); + LOGGER.log(LogLevel.VERBOSE, () -> "Endpoint: " + getEndpoint()); + LOGGER.log(LogLevel.VERBOSE, () -> "Test mode: " + getTestMode()); QuantumClientBuilder builder = new QuantumClientBuilder(); diff --git a/sdk/resourcemanager/azure-resourcemanager-appplatform/src/test/java/com/azure/resourcemanager/appplatform/AppPlatformTest.java b/sdk/resourcemanager/azure-resourcemanager-appplatform/src/test/java/com/azure/resourcemanager/appplatform/AppPlatformTest.java index e296384651bd..812417c877c2 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appplatform/src/test/java/com/azure/resourcemanager/appplatform/AppPlatformTest.java +++ b/sdk/resourcemanager/azure-resourcemanager-appplatform/src/test/java/com/azure/resourcemanager/appplatform/AppPlatformTest.java @@ -10,6 +10,8 @@ import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.appservice.AppServiceManager; import com.azure.resourcemanager.dns.DnsZoneManager; import com.azure.resourcemanager.keyvault.KeyVaultManager; @@ -33,6 +35,8 @@ import java.util.List; public class AppPlatformTest extends ResourceManagerTestProxyTestBase { + private static final ClientLogger LOGGER = new ClientLogger(AppPlatformTest.class); + protected AppPlatformManager appPlatformManager; protected AppServiceManager appServiceManager; protected DnsZoneManager dnsZoneManager; @@ -85,10 +89,10 @@ protected boolean checkRedirect(String url) throws IOException { if (connection.getResponseCode() / 100 == 3) { return true; } - System.out.printf("Do request to %s with response code %d%n", url, connection.getResponseCode()); + LOGGER.verbose("Do request to {} with response code {}", url, connection.getResponseCode()); } } catch (Exception e) { - System.err.printf("Do request to %s with error %s%n", url, e.getMessage()); + LOGGER.log(LogLevel.VERBOSE, () -> "Do request to " + url + " with error", e); } finally { connection.disconnect(); } @@ -103,13 +107,13 @@ protected boolean requestSuccess(String url) throws Exception { try { connection.connect(); if (connection.getResponseCode() == 200) { - System.out.printf("Request to %s succeeded%n", url); + LOGGER.log(LogLevel.VERBOSE, () -> "Request to " + url + " succeeded"); connection.getInputStream().close(); return true; } - System.out.printf("Do request to %s with response code %d%n", url, connection.getResponseCode()); + LOGGER.verbose("Do request to {} with response code {}", url, connection.getResponseCode()); } catch (Exception e) { - System.err.printf("Do request to %s with error %s%n", url, e.getMessage()); + LOGGER.log(LogLevel.VERBOSE, () -> "Do request to " + url + " with error", e); } finally { connection.disconnect(); } diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/OneDeployTests.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/OneDeployTests.java index 1d86fb736472..066f8aaf5346 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/OneDeployTests.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/OneDeployTests.java @@ -96,7 +96,7 @@ public void canPushDeployJar() throws Exception { Assertions.assertNotNull(deploymentId); // stream logs - webApp1.streamApplicationLogsAsync().subscribeOn(Schedulers.single()).subscribe(System.out::println); + webApp1.streamApplicationLogsAsync().subscribeOn(Schedulers.single()).subscribe(LOGGER::verbose); waitForRuntimeSuccess(webApp1, deploymentId); diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/implementation/RetryTests.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/implementation/RetryTests.java index fdb1ce8debff..3e50a823425b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/implementation/RetryTests.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/test/java/com/azure/resourcemanager/authorization/implementation/RetryTests.java @@ -6,6 +6,8 @@ import com.azure.core.http.HttpResponse; import com.azure.core.management.exception.ManagementError; import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; import com.azure.resourcemanager.test.utils.TestDelayProvider; import org.junit.jupiter.api.Assertions; @@ -19,6 +21,7 @@ import java.util.concurrent.atomic.AtomicInteger; public class RetryTests { + private static final ClientLogger LOGGER = new ClientLogger(RetryTests.class); @Test public void testRetryForGraph() { @@ -33,9 +36,8 @@ public void testRetryForGraph() { RetryBackoffSpec retry = RetryUtils.backoffRetryFor404ResourceNotFound(); AtomicInteger retryCount = new AtomicInteger(0); - retry = retry.doAfterRetry(ignored -> { - System.out.println("retry " + retryCount.incrementAndGet() + ", at " + OffsetDateTime.now()); - }); + retry = retry.doAfterRetry(ignored -> LOGGER.log(LogLevel.VERBOSE, + () -> "retry " + retryCount.incrementAndGet() + ", at " + OffsetDateTime.now())); // pass without retry Mono monoSuccess = Mono.just("foo"); @@ -106,9 +108,8 @@ public void testRetryForAuthorization() { RetryBackoffSpec retry = RetryUtils.backoffRetryFor400PrincipalNotFound(); AtomicInteger retryCount = new AtomicInteger(0); - retry = retry.doAfterRetry(ignored -> { - System.out.println("retry " + retryCount.incrementAndGet() + ", at " + OffsetDateTime.now()); - }); + retry = retry.doAfterRetry(ignored -> LOGGER.log(LogLevel.VERBOSE, + () -> "retry " + retryCount.incrementAndGet() + ", at " + OffsetDateTime.now())); // 400 with PrincipalNotFound, retry till pass AtomicInteger errorCount = new AtomicInteger(0); diff --git a/sdk/resourcemanager/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineImageOperationsTests.java b/sdk/resourcemanager/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineImageOperationsTests.java index 770a9dbbf94c..c6cead94f558 100644 --- a/sdk/resourcemanager/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineImageOperationsTests.java +++ b/sdk/resourcemanager/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineImageOperationsTests.java @@ -4,6 +4,8 @@ package com.azure.resourcemanager.compute; import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.compute.models.DataDiskImage; import com.azure.resourcemanager.compute.models.VirtualMachineImage; import com.azure.resourcemanager.compute.models.VirtualMachineOffer; @@ -14,6 +16,8 @@ import org.junit.jupiter.api.Test; public class VirtualMachineImageOperationsTests extends ComputeManagementTest { + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineImageOperationsTests.class); + @Test public void canListVirtualMachineImages() throws Exception { /* @@ -37,7 +41,7 @@ public void canListVirtualMachineImages() throws Exception { for (VirtualMachineOffer offer : canonicalPublisher.offers().list()) { for (VirtualMachineSku sku : offer.skus().list()) { for (VirtualMachineImage image : sku.images().list()) { - System.out.println(image.version()); + LOGGER.log(LogLevel.VERBOSE, image::version); firstVMImage = image; break; } diff --git a/sdk/resourcemanager/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineManagedDiskOperationsTests.java b/sdk/resourcemanager/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineManagedDiskOperationsTests.java index e514f890fea4..d8e3d7ae823a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineManagedDiskOperationsTests.java +++ b/sdk/resourcemanager/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineManagedDiskOperationsTests.java @@ -4,6 +4,8 @@ package com.azure.resourcemanager.compute; import com.azure.core.http.HttpPipeline; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.compute.models.AvailabilitySet; import com.azure.resourcemanager.compute.models.AvailabilitySetSkuTypes; import com.azure.resourcemanager.compute.models.CachingTypes; @@ -28,6 +30,8 @@ import org.junit.jupiter.api.Test; public class VirtualMachineManagedDiskOperationsTests extends ComputeManagementTest { + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineManagedDiskOperationsTests.class); + private String rgName = ""; private Region region = Region.US_EAST; private KnownLinuxVirtualMachineImage linuxImage = KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS; @@ -314,7 +318,7 @@ public void canCreateVirtualMachineFromCustomImageWithManagedDisks() { .withSize(VirtualMachineSizeTypes.fromString("Standard_D4a_v4")) .withOSDiskCaching(CachingTypes.READ_WRITE) .create(); - System.out.println("Waiting for some time before de-provision"); + LOGGER.log(LogLevel.VERBOSE, () -> "Waiting for some time before de-provision"); sleep(60 * 1000); // Wait for some time to ensure vm is publicly accessible deprovisionAgentInLinuxVM(virtualMachine1); diff --git a/sdk/resourcemanager/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineOperationsTests.java b/sdk/resourcemanager/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineOperationsTests.java index f6acacb5f6b4..6dbbc6ab4f03 100644 --- a/sdk/resourcemanager/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineOperationsTests.java +++ b/sdk/resourcemanager/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineOperationsTests.java @@ -13,6 +13,8 @@ import com.azure.core.test.annotation.DoNotRecord; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollResponse; import com.azure.resourcemanager.compute.fluent.models.VirtualMachineInner; @@ -82,6 +84,8 @@ import java.util.concurrent.atomic.AtomicInteger; public class VirtualMachineOperationsTests extends ComputeManagementTest { + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineOperationsTests.class); + private String rgName = ""; private String rgName2 = ""; private final Region region = Region.US_EAST; @@ -731,7 +735,7 @@ public void canStreamParallelCreatedVirtualMachinesAndRelatedResources() throws createdResource -> { if (createdResource instanceof Resource) { Resource resource = (Resource) createdResource; - System.out.println("Created: " + resource.id()); + LOGGER.log(LogLevel.VERBOSE, () -> "Created: " + resource.id()); if (resource instanceof VirtualMachine) { VirtualMachine virtualMachine = (VirtualMachine) resource; Assertions.assertTrue(virtualMachineNames.contains(virtualMachine.name())); diff --git a/sdk/resourcemanager/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineRelatedResourcesDeletionTests.java b/sdk/resourcemanager/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineRelatedResourcesDeletionTests.java index aaf5daeb295a..0f72c477a604 100644 --- a/sdk/resourcemanager/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineRelatedResourcesDeletionTests.java +++ b/sdk/resourcemanager/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineRelatedResourcesDeletionTests.java @@ -6,6 +6,8 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.exception.ManagementException; import com.azure.core.test.annotation.DoNotRecord; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.compute.models.AvailabilitySet; import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; import com.azure.resourcemanager.compute.models.VirtualMachine; @@ -31,6 +33,7 @@ import reactor.core.publisher.Mono; public class VirtualMachineRelatedResourcesDeletionTests extends ComputeManagementTest { + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineRelatedResourcesDeletionTests.class); private String rgName = ""; @@ -166,7 +169,7 @@ public void canDeleteRelatedResourcesFromFailedParallelVMCreations() { createdResource -> { if (createdResource instanceof Resource) { Resource resource = (Resource) createdResource; - System.out.println("Created: " + resource.id()); + LOGGER.log(LogLevel.VERBOSE, () -> "Created: " + resource.id()); if (resource instanceof VirtualMachine) { VirtualMachine virtualMachine = (VirtualMachine) resource; @@ -220,22 +223,23 @@ public void canDeleteRelatedResourcesFromFailedParallelVMCreations() { // Show any errors for (Throwable error : errors) { - System.out.println("\n### ERROR ###\n"); + LOGGER.log(LogLevel.VERBOSE, () -> "\n### ERROR ###\n"); if (error instanceof ManagementException) { ManagementException ce = (ManagementException) error; - System.out.println("CLOUD EXCEPTION: " + ce.getMessage()); + LOGGER.log(LogLevel.VERBOSE, () -> "CLOUD EXCEPTION: " + ce.getMessage()); } else { - error.printStackTrace(); + LOGGER.log(LogLevel.VERBOSE, () -> "Only expected ManagementExceptions", error); } } - System.out.println("Number of failed/cleaned up VM creations: " + vmNonNicResourceDefinitions.size()); + LOGGER.log(LogLevel.VERBOSE, + () -> "Number of failed/cleaned up VM creations: " + vmNonNicResourceDefinitions.size()); // Verifications final int successfulVMCount = desiredVMCount - vmNonNicResourceDefinitions.size(); final int actualVMCount = TestUtilities.getSize(computeManager.virtualMachines().listByResourceGroup(resourceGroupName)); - System.out.println("Number of actual successful VMs: " + actualVMCount); + LOGGER.log(LogLevel.VERBOSE, () -> "Number of actual successful VMs: " + actualVMCount); Assertions.assertEquals(successfulVMCount, actualVMCount); final int actualNicCount = diff --git a/sdk/resourcemanager/azure-resourcemanager-containerservice/src/test/java/com/azure/resourcemanager/containerservice/KubernetesClustersTests.java b/sdk/resourcemanager/azure-resourcemanager-containerservice/src/test/java/com/azure/resourcemanager/containerservice/KubernetesClustersTests.java index f7a3930a4ef3..66b802421cb9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-containerservice/src/test/java/com/azure/resourcemanager/containerservice/KubernetesClustersTests.java +++ b/sdk/resourcemanager/azure-resourcemanager-containerservice/src/test/java/com/azure/resourcemanager/containerservice/KubernetesClustersTests.java @@ -7,6 +7,8 @@ import com.azure.core.http.policy.AddHeadersFromContextPolicy; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.containerservice.models.AgentPool; import com.azure.resourcemanager.containerservice.models.AgentPoolData; import com.azure.resourcemanager.containerservice.models.AgentPoolMode; @@ -48,6 +50,8 @@ import java.util.stream.Collectors; public class KubernetesClustersTests extends ContainerServiceManagementTest { + private static final ClientLogger LOGGER = new ClientLogger(KubernetesClustersTests.class); + private static final String SSH_KEY = sshPublicKey(); @Test @@ -256,7 +260,8 @@ public void canAutoScaleKubernetesCluster() { .create(); // print config - System.out.println(new String(kubernetesCluster.adminKubeConfigContent(), StandardCharsets.UTF_8)); + LOGGER.log(LogLevel.VERBOSE, + () -> new String(kubernetesCluster.adminKubeConfigContent(), StandardCharsets.UTF_8)); Assertions.assertEquals(Code.RUNNING, kubernetesCluster.powerState().code()); @@ -335,7 +340,8 @@ public void canCreateClusterWithSpotVM() { .create(); // print config - System.out.println(new String(kubernetesCluster.adminKubeConfigContent(), StandardCharsets.UTF_8)); + LOGGER.log(LogLevel.VERBOSE, + () -> new String(kubernetesCluster.adminKubeConfigContent(), StandardCharsets.UTF_8)); KubernetesClusterAgentPool agentPoolProfile = kubernetesCluster.agentPools().get(agentPoolName); Assertions.assertTrue(agentPoolProfile.virtualMachinePriority() == null || agentPoolProfile.virtualMachinePriority() == ScaleSetPriority.REGULAR); diff --git a/sdk/resourcemanager/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/MonitorActivityAndMetricsTests.java b/sdk/resourcemanager/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/MonitorActivityAndMetricsTests.java index 83d9d1561a15..dee1fa063b69 100644 --- a/sdk/resourcemanager/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/MonitorActivityAndMetricsTests.java +++ b/sdk/resourcemanager/azure-resourcemanager-monitor/src/test/java/com/azure/resourcemanager/monitor/MonitorActivityAndMetricsTests.java @@ -9,6 +9,8 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.management.profile.AzureProfile; import com.azure.core.test.annotation.DoNotRecord; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.compute.models.VirtualMachine; import com.azure.resourcemanager.monitor.models.EventData; import com.azure.resourcemanager.monitor.models.EventDataPropertyName; @@ -24,6 +26,8 @@ import java.time.OffsetDateTime; public class MonitorActivityAndMetricsTests extends MonitorManagementTest { + private static final ClientLogger LOGGER = new ClientLogger(MonitorActivityAndMetricsTests.class); + private String rgName = ""; @Override protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) { @@ -49,7 +53,7 @@ public void canListEventsAndMetrics() { "10.0.0.0/28"); OffsetDateTime now = OffsetDateTime.now(); - System.out.println("record timestamp: " + now); + LOGGER.log(LogLevel.VERBOSE, () -> "record timestamp: " + now); OffsetDateTime recordDateTime = now.minusDays(40); @@ -143,7 +147,7 @@ public void canListEventsAndMetricsWithWhiteSpaceInResourceId() { SqlElasticPool pool = ensureElasticPoolWithWhiteSpace(region, rgName); OffsetDateTime now = OffsetDateTime.now(); - System.out.println("record timestamp: " + now); + LOGGER.log(LogLevel.VERBOSE, () -> "record timestamp: " + now); OffsetDateTime recordDateTime = now.minusDays(40); diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/DeploymentsTests.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/DeploymentsTests.java index d81b0ab2e248..a4c355636f15 100644 --- a/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/DeploymentsTests.java +++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/DeploymentsTests.java @@ -10,6 +10,8 @@ import com.azure.core.management.exception.ManagementError; import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollResponse; import com.azure.resourcemanager.test.utils.TestUtilities; @@ -38,6 +40,8 @@ import java.util.stream.Collectors; public class DeploymentsTests extends ResourceManagementTest { + private static final ClientLogger LOGGER = new ClientLogger(DeploymentsTests.class); + private ResourceGroups resourceGroups; private ResourceGroup resourceGroup; @@ -446,7 +450,7 @@ public void canDeployVirtualNetworkWithContext() { try { String correlationRequestId = generateRandomUuid(); - System.out.println("x-ms-correlation-request-id: " + correlationRequestId); + LOGGER.log(LogLevel.VERBOSE, () -> "x-ms-correlation-request-id: " + correlationRequestId); Context context = new Context( AddHeadersFromContextPolicy.AZURE_REQUEST_HTTP_HEADERS_KEY, new HttpHeaders().set("x-ms-correlation-request-id", correlationRequestId)); diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/BreadSliceImpl.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/BreadSliceImpl.java index 4ce5407d2550..e2d2e643964b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/BreadSliceImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/BreadSliceImpl.java @@ -3,6 +3,8 @@ package com.azure.resourcemanager.resources.fluentcore.dag; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.resources.fluentcore.model.Creatable; import com.azure.resourcemanager.resources.fluentcore.model.Executable; import com.azure.resourcemanager.resources.fluentcore.model.implementation.ExecutableImpl; @@ -14,6 +16,8 @@ * Implementation for IBreadSlice. */ public class BreadSliceImpl extends ExecutableImpl implements IBreadSlice { + private static final ClientLogger LOGGER = new ClientLogger(BreadSliceImpl.class); + private final String name; public BreadSliceImpl(String name) { @@ -23,7 +27,7 @@ public BreadSliceImpl(String name) { @Override public Mono executeWorkAsync() { - System.out.println("Bread(" + this.name + ")::executeWorkAsync() [Getting slice from store]"); + LOGGER.log(LogLevel.VERBOSE, () -> "Bread(" + this.name + ")::executeWorkAsync() [Getting slice from store]"); return Mono.just(this) .delayElement(Duration.ofMillis(250)) .map(breadSlice -> breadSlice); diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGErrorTests.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGErrorTests.java index 6d8b11398cb9..4df71ac7a2c5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGErrorTests.java +++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGErrorTests.java @@ -3,6 +3,8 @@ package com.azure.resourcemanager.resources.fluentcore.dag; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -14,6 +16,8 @@ import java.util.TreeSet; public class DAGErrorTests { + private static final ClientLogger LOGGER = new ClientLogger(DAGErrorTests.class); + @Test public void testTerminateOnInProgressTaskCompletion() { // Terminate on error strategy used in this task group is @@ -107,20 +111,19 @@ public void testTerminateOnInProgressTaskCompletion() { .withTerminateOnErrorStrategy(TaskGroupTerminateOnErrorStrategy.TERMINATE_ON_IN_PROGRESS_TASKS_COMPLETION); IPancake rootPancake = pancakeFtg.invokeAsync(context).map(indexable -> { IPancake pancake = (IPancake) indexable; - System.out.println("map.onNext: " + pancake.name()); + LOGGER.log(LogLevel.VERBOSE, () -> "map.onNext: " + pancake.name()); seen.add(pancake.name()); return pancake; - }) - .onErrorResume(throwable -> { - System.out.println("map.onErrorResumeNext: " + throwable); - exceptions.add(throwable); - return Mono.empty(); - }).blockLast(); + }).onErrorResume(throwable -> { + LOGGER.log(LogLevel.VERBOSE, () -> "map.onErrorResumeNext: ", throwable); + exceptions.add(throwable); + return Mono.empty(); + }).blockLast(); expectedToSee.removeAll(seen); Assertions.assertTrue(expectedToSee.isEmpty()); Assertions.assertEquals(exceptions.size(), 1); - Assertions.assertTrue(exceptions.get(0) instanceof RuntimeException); + Assertions.assertInstanceOf(RuntimeException.class, exceptions.get(0)); RuntimeException runtimeException = (RuntimeException) exceptions.get(0); Assertions.assertTrue(runtimeException.getMessage().equalsIgnoreCase("B")); } @@ -227,20 +230,19 @@ public void testTerminateOnHittingLcaTask() { IPasta rootPasta = pastaFtg.invokeAsync(context).map(indexable -> { IPasta pasta = (IPasta) indexable; - System.out.println("map.onNext: " + pasta.name()); + LOGGER.log(LogLevel.VERBOSE, () -> "map.onNext: " + pasta.name()); seen.add(pasta.name()); return pasta; - }) - .onErrorResume(throwable -> { - System.out.println("map.onErrorResumeNext: " + throwable); - exceptions.add(throwable); - return Mono.empty(); - }).blockLast(); + }).onErrorResume(throwable -> { + LOGGER.log(LogLevel.VERBOSE, () -> "map.onErrorResumeNext: ", throwable); + exceptions.add(throwable); + return Mono.empty(); + }).blockLast(); expectedToSee.removeAll(seen); Assertions.assertTrue(expectedToSee.isEmpty()); Assertions.assertEquals(exceptions.size(), 1); - Assertions.assertTrue(exceptions.get(0) instanceof RuntimeException); + Assertions.assertInstanceOf(RuntimeException.class, exceptions.get(0)); RuntimeException runtimeException = (RuntimeException) exceptions.get(0); Assertions.assertTrue(runtimeException.getMessage().equalsIgnoreCase("B")); } @@ -344,11 +346,11 @@ public void testCompositeError() { IPancake rootPancake = pancakeFtg.invokeAsync(context).map(indexable -> { IPancake pancake = (IPancake) indexable; String name = pancake.name(); - System.out.println("map.onNext:" + name); + LOGGER.log(LogLevel.VERBOSE, () -> "map.onNext:" + name); seen.add(name); return pancake; }).onErrorResume(throwable -> { - System.out.println("map.onErrorResumeNext:" + throwable); + LOGGER.log(LogLevel.VERBOSE, () -> "map.onErrorResumeNext:", throwable); exceptions.add(throwable); return Mono.empty(); }).blockLast(); @@ -356,7 +358,7 @@ public void testCompositeError() { expectedToSee.removeAll(seen); Assertions.assertTrue(expectedToSee.isEmpty()); Assertions.assertEquals(exceptions.size(), 1); - Assertions.assertTrue(exceptions.get(0) instanceof RuntimeException); + Assertions.assertInstanceOf(RuntimeException.class, exceptions.get(0)); RuntimeException compositeException = (RuntimeException) exceptions.get(0); Assertions.assertEquals(compositeException.getSuppressed().length, 2); for (Throwable throwable : compositeException.getSuppressed()) { @@ -462,10 +464,10 @@ public void testErrorOnRoot() { IPancake rootPancake = pancakeFtg.invokeAsync(context).map(indexable -> { IPancake pancake = (IPancake) indexable; seen.add(pancake.name()); - System.out.println("map.onNext:" + pancake.name()); + LOGGER.log(LogLevel.VERBOSE, () -> "map.onNext:" + pancake.name()); return pancake; }).onErrorResume(throwable -> { - System.out.println("map.onErrorResumeNext:" + throwable); + LOGGER.log(LogLevel.VERBOSE, () -> "map.onErrorResumeNext:", throwable); exceptions.add(throwable); return Mono.empty(); }).blockLast(); @@ -473,7 +475,7 @@ public void testErrorOnRoot() { expectedToSee.removeAll(seen); Assertions.assertTrue(expectedToSee.isEmpty()); Assertions.assertEquals(exceptions.size(), 1); - Assertions.assertTrue(exceptions.get(0) instanceof RuntimeException); + Assertions.assertInstanceOf(RuntimeException.class, exceptions.get(0)); RuntimeException runtimeException = (RuntimeException) exceptions.get(0); Assertions.assertTrue(runtimeException.getMessage().equalsIgnoreCase("F")); } diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGraphTests.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGraphTests.java index f2a9814a8c92..ba6710befa36 100644 --- a/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGraphTests.java +++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/DAGraphTests.java @@ -15,7 +15,7 @@ public class DAGraphTests { @Test public void testDAGraphGetNext() { - /** + /* * |-------->[D]------>[B]-----------[A] * | ^ ^ * | | | @@ -85,7 +85,7 @@ public void testDAGraphGetNext() { @Test public void testGraphDependency() { - /** + /* * |-------->[D]------>[B]---------->[A] * | ^ ^ * | | | @@ -148,7 +148,7 @@ public void testGraphDeadLockDetection() { boolean dlDetected; // ---------------------------------------------------- - /** + /* * [A] <-----------> [A] */ dlDetected = false; @@ -161,7 +161,7 @@ public void testGraphDeadLockDetection() { Assertions.assertTrue(dlDetected, "Expected exception is not thrown"); // ---------------------------------------------------- - /** + /* * [A] -----------> [B] * ^ ^ * | | @@ -184,7 +184,7 @@ public void testGraphDeadLockDetection() { Assertions.assertTrue(dlDetected, "Expected exception is not thrown"); // ---------------------------------------------------- - /** + /* * [2] ------------> [1] * ^ | * ----------------| | @@ -211,7 +211,7 @@ public void testGraphNodeTableBubblingUp() { // ---------------------------------------------------- // Graph-1 - /** + /* * [B] -----------> [A] * ^ ^ * | | @@ -232,7 +232,7 @@ public void testGraphNodeTableBubblingUp() { // ---------------------------------------------------- // Graph-2 - /** + /* * [E] ---> [D] ---> G * ^ * | @@ -252,7 +252,7 @@ public void testGraphNodeTableBubblingUp() { // ---------------------------------------------------- // Graph-3 - /** + /* * [J] ---> [H] ---> I */ @@ -276,7 +276,7 @@ public void testGraphNodeTableBubblingUp() { DAGraph graph4Root1 = graph2Root; // graphF DAGraph graph4Root2 = graph3Root; // graphJ - /** + /* * [B] -----------> [A] * ^ ^ * | | @@ -373,7 +373,7 @@ public void testGraphNodeTableBubblingUp() { // ---------------------------------------------------- // Graph-1 - /** + /* * [L] -----------> [K] * ^ ^ * | | @@ -395,7 +395,7 @@ public void testGraphNodeTableBubblingUp() { // graphA.addDependencyGraph(graphL); - /** + /* * |---------> [L] -----------> [K] * | ^ ^ * | | | @@ -462,17 +462,15 @@ public void testGraphNodeTableBubblingUp() { private DAGraph createGraph(String resourceName) { ItemHolder node = new ItemHolder(resourceName, "data" + resourceName); - DAGraph graph = new DAGraph<>(node); - return graph; + return new DAGraph<>(node); } private void assertExactMatch(Set set, String[] values) { - HashSet s = new HashSet<>(); - s.addAll(set); + HashSet s = new HashSet<>(set); - s.removeAll(Arrays.asList(values)); - if (s.size() != 0) { - Assertions.assertTrue(false, "Content of set " + set + " does not match with provided array " + Arrays.asList(values)); + Arrays.asList(values).forEach(s::remove); + if (!s.isEmpty()) { + Assertions.fail("Content of set " + set + " does not match with provided array " + Arrays.asList(values)); } } } diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/OrderImpl.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/OrderImpl.java index 81f498b22ec2..d4ac227fff7c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/OrderImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/OrderImpl.java @@ -3,6 +3,8 @@ package com.azure.resourcemanager.resources.fluentcore.dag; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; import reactor.core.publisher.Mono; @@ -14,6 +16,8 @@ public class OrderImpl extends CreatableUpdatableImpl implements IOrder { + private static final ClientLogger LOGGER = new ClientLogger(OrderImpl.class); + /** * Creates SandwichImpl. * @@ -26,7 +30,7 @@ protected OrderImpl(String name, OrderInner innerObject) { @Override public Mono createResourceAsync() { - System.out.println("Order(" + this.name() + ")::createResourceAsync() [Creating order]"); + LOGGER.log(LogLevel.VERBOSE, () -> "Order(" + this.name() + ")::createResourceAsync() [Creating order]"); return Mono.just(this) .delayElement(Duration.ofMillis(250)) .map(sandwich -> sandwich); diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PanCakeImpl.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PanCakeImpl.java index c1c13ddb0f92..743ff9dac62b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PanCakeImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PanCakeImpl.java @@ -3,6 +3,8 @@ package com.azure.resourcemanager.resources.fluentcore.dag; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.resources.fluentcore.model.Creatable; import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreateUpdateTask; @@ -19,6 +21,8 @@ class PancakeImpl extends CreatableUpdatableImpl implements IPancake { + private static final ClientLogger LOGGER = new ClientLogger(PancakeImpl.class); + final List> delayedPancakes; final long eventDelayInMilliseconds; final Throwable errorToThrow; @@ -73,19 +77,19 @@ public void beforeGroupCreateOrUpdate() { this.addDependency(pancake); } int newCount = this.taskGroup().getNode(this.key()).dependencyKeys().size(); - System.out.println("Pancake(" + this.name() + ")::beforeGroupCreateOrUpdate() 'delayedSize':" + this.delayedPancakes.size() - + " 'dependency count [old, new]': [" + oldCount + "," + newCount + "]"); + LOGGER.log(LogLevel.VERBOSE, () -> "Pancake(" + this.name() + ")::beforeGroupCreateOrUpdate() 'delayedSize':" + + this.delayedPancakes.size() + " 'dependency count [old, new]': [" + oldCount + "," + newCount + "]"); } @Override public Mono createResourceAsync() { if (this.errorToThrow == null) { - System.out.println("Pancake(" + this.name() + ")::createResourceAsync() 'onNext()'"); + LOGGER.log(LogLevel.VERBOSE, () -> "Pancake(" + this.name() + ")::createResourceAsync() 'onNext()'"); return Mono.just(this) .delayElement(Duration.ofMillis(this.eventDelayInMilliseconds)) .map(pancake -> pancake); } else { - System.out.println("Pancake(" + this.name() + ")::createResourceAsync() 'onError()'"); + LOGGER.log(LogLevel.VERBOSE, () -> "Pancake(" + this.name() + ")::createResourceAsync() 'onError()'"); return Mono.just(this) .delayElement(Duration.ofMillis(this.eventDelayInMilliseconds)) .flatMap(pancake -> toErrorMono(errorToThrow)); diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PastaImpl.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PastaImpl.java index 92c73ad79bd6..f38f7f9ebd70 100644 --- a/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PastaImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PastaImpl.java @@ -3,6 +3,8 @@ package com.azure.resourcemanager.resources.fluentcore.dag; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.resources.fluentcore.model.Creatable; import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreateUpdateTask; @@ -19,6 +21,8 @@ class PastaImpl extends CreatableUpdatableImpl implements IPasta { + private static final ClientLogger LOGGER = new ClientLogger(PastaImpl.class); + final List> delayedPastas; final long eventDelayInMilliseconds; final Throwable errorToThrow; @@ -74,19 +78,19 @@ public void beforeGroupCreateOrUpdate() { this.addDependency(pancake); } int newCount = this.taskGroup().getNode(this.key()).dependencyKeys().size(); - System.out.println("Pasta(" + this.name() + ")::beforeGroupCreateOrUpdate() 'delayedSize':" + this.delayedPastas.size() - + " 'dependency count [old, new]': [" + oldCount + "," + newCount + "]"); + LOGGER.log(LogLevel.VERBOSE, () -> "Pasta(" + this.name() + ")::beforeGroupCreateOrUpdate() 'delayedSize':" + + this.delayedPastas.size() + " 'dependency count [old, new]': [" + oldCount + "," + newCount + "]"); } @Override public Mono createResourceAsync() { if (this.errorToThrow == null) { - System.out.println("Pasta(" + this.name() + ")::createResourceAsync() 'onNext()'"); + LOGGER.log(LogLevel.VERBOSE, () -> "Pasta(" + this.name() + ")::createResourceAsync() 'onNext()'"); return Mono.just(this) .delayElement(Duration.ofMillis(this.eventDelayInMilliseconds)) .map(pasta -> pasta); } else { - System.out.println("Pasta(" + this.name() + ")::createResourceAsync() 'onError()'"); + LOGGER.log(LogLevel.VERBOSE, () -> "Pasta(" + this.name() + ")::createResourceAsync() 'onError()'"); return Mono.just(this) .delayElement(Duration.ofMillis(this.eventDelayInMilliseconds)) .flatMap(pasta -> toErrorObservable(errorToThrow)); diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PizzaImpl.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PizzaImpl.java index 761d0b600040..dc72b43c093f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PizzaImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/PizzaImpl.java @@ -3,6 +3,8 @@ package com.azure.resourcemanager.resources.fluentcore.dag; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.resources.fluentcore.model.Creatable; import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreateUpdateTask; @@ -19,6 +21,8 @@ class PizzaImpl extends CreatableUpdatableImpl implements IPizza { + private static final ClientLogger LOGGER = new ClientLogger(PizzaImpl.class); + final List> delayedPizzas; boolean prepareCalled = false; @@ -61,13 +65,13 @@ public void beforeGroupCreateOrUpdate() { this.addDependency(pizza); } int newCount = this.taskGroup().getNode(this.key()).dependencyKeys().size(); - System.out.println("Pizza(" + this.name() + ")::beforeGroupCreateOrUpdate() 'delayedSize':" + this.delayedPizzas.size() - + " 'dependency count [old, new]': [" + oldCount + "," + newCount + "]"); + LOGGER.log(LogLevel.VERBOSE, () -> "Pizza(" + this.name() + ")::beforeGroupCreateOrUpdate() 'delayedSize':" + + this.delayedPizzas.size() + " 'dependency count [old, new]': [" + oldCount + "," + newCount + "]"); } @Override public Mono createResourceAsync() { - System.out.println("Pizza(" + this.name() + ")::createResourceAsync()"); + LOGGER.log(LogLevel.VERBOSE, () -> "Pizza(" + this.name() + ")::createResourceAsync()"); return Mono.just(this) .delayElement(Duration.ofMillis(250)) .map(pizza -> pizza); diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/ProxyTaskGroupTests.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/ProxyTaskGroupTests.java index c55b04569380..58fd15b5786e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/ProxyTaskGroupTests.java +++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/ProxyTaskGroupTests.java @@ -3,6 +3,8 @@ package com.azure.resourcemanager.resources.fluentcore.dag; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.resources.fluentcore.model.Indexable; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -19,6 +21,7 @@ import java.util.concurrent.CountDownLatch; public class ProxyTaskGroupTests { + private static final ClientLogger LOGGER = new ClientLogger(ProxyTaskGroupTests.class); @Test public void testSampleTaskGroupSanity() { @@ -539,7 +542,7 @@ public void testTaskGroupInvocationShouldInvokePostRunDependentTaskGroup() { group1.invokeAsync(group1.newInvocationContext()) - .subscribe(indexable -> System.out.println(indexable.key())); + .subscribe(indexable -> LOGGER.log(LogLevel.VERBOSE, indexable::key)); } @Test diff --git a/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/SandwichImpl.java b/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/SandwichImpl.java index 3b6a26bf6a3a..419086bfe47c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/SandwichImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/fluentcore/dag/SandwichImpl.java @@ -3,6 +3,8 @@ package com.azure.resourcemanager.resources.fluentcore.dag; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.resources.fluentcore.model.Executable; import com.azure.resourcemanager.resources.fluentcore.model.implementation.CreatableUpdatableImpl; import reactor.core.publisher.Mono; @@ -15,6 +17,8 @@ public class SandwichImpl extends CreatableUpdatableImpl implements ISandwich { + private static final ClientLogger LOGGER = new ClientLogger(SandwichImpl.class); + /** * Creates SandwichImpl. * @@ -34,7 +38,7 @@ public ISandwich withBreadSliceFromStore(Executable breadFetcher) { @Override public Mono createResourceAsync() { - System.out.println("Sandwich(" + this.name() + ")::createResourceAsync() [Creating sandwich]"); + LOGGER.log(LogLevel.VERBOSE, () -> "Sandwich(" + this.name() + ")::createResourceAsync() [Creating sandwich]"); return Mono.just(this) .delayElement(Duration.ofMillis(250)) .map(sandwich -> sandwich); diff --git a/sdk/resourcemanager/azure-resourcemanager-samples/pom.xml b/sdk/resourcemanager/azure-resourcemanager-samples/pom.xml index 708b387ded37..bcfbeb0aaa34 100644 --- a/sdk/resourcemanager/azure-resourcemanager-samples/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-samples/pom.xml @@ -124,12 +124,12 @@ com.azure azure-messaging-servicebus - 7.16.0 + 7.17.0 io.fabric8 kubernetes-client - 5.12.3 + 6.12.1 com.microsoft.sqlserver @@ -195,7 +195,7 @@ org.apache.httpcomponents:httpclient:[4.5.14] - io.fabric8:kubernetes-client:[5.12.3] + io.fabric8:kubernetes-client:[6.12.1] com.jcraft:jsch:[0.1.55] org.slf4j:slf4j-simple:[1.7.36] com.google.guava:guava:[33.1.0-jre] diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/ApplicationGatewayTests.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/ApplicationGatewayTests.java index f47cf9a846e4..b481cdee7727 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/ApplicationGatewayTests.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/ApplicationGatewayTests.java @@ -9,6 +9,8 @@ import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; import com.azure.resourcemanager.compute.models.VirtualMachine; import com.azure.resourcemanager.network.models.ApplicationGateway; @@ -46,6 +48,8 @@ import org.junit.jupiter.api.Test; public class ApplicationGatewayTests extends ResourceManagerTestProxyTestBase { + private static final ClientLogger LOGGER = new ClientLogger(ApplicationGatewayTests.class); + private AzureResourceManager azureResourceManager; @Override @@ -228,7 +232,7 @@ public void testAppGatewayBackendHealthCheck() throws Exception { } } } - System.out.println(info.toString()); + LOGGER.log(LogLevel.VERBOSE, () -> info.toString()); // Verify app gateway Assertions.assertEquals(2, appGateway.backends().size()); @@ -247,8 +251,8 @@ public void testAppGatewayBackendHealthCheck() throws Exception { ApplicationGatewayBackendHealth backendHealth1 = backendHealths.get(backend1.name()); Assertions.assertNotNull(backendHealth1); Assertions.assertNotNull(backendHealth1.backend()); - for (int i = 0; i < ipAddresses.length; i++) { - Assertions.assertTrue(backend1.containsIPAddress(ipAddresses[i])); + for (String ipAddress : ipAddresses) { + Assertions.assertTrue(backend1.containsIPAddress(ipAddress)); } // Verify second backend (NIC based) diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/AzureResourceManagerTests.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/AzureResourceManagerTests.java index 6f128a12344d..dcab933c7130 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/AzureResourceManagerTests.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/AzureResourceManagerTests.java @@ -9,10 +9,14 @@ import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.Region; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.profile.AzureProfile; import com.azure.core.test.annotation.DoNotRecord; import com.azure.core.test.models.TestProxySanitizer; import com.azure.core.test.models.TestProxySanitizerType; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.authorization.models.BuiltInRole; import com.azure.resourcemanager.compute.models.CachingTypes; import com.azure.resourcemanager.compute.models.Disk; @@ -49,27 +53,33 @@ import com.azure.resourcemanager.network.models.Subnet; import com.azure.resourcemanager.network.models.Topology; import com.azure.resourcemanager.network.models.VerificationIPFlow; -import com.azure.resourcemanager.resources.fluentcore.model.CreatedResources; -import com.azure.resourcemanager.resources.models.LockLevel; -import com.azure.resourcemanager.resources.models.ManagementLock; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import com.azure.resourcemanager.storage.models.StorageAccountSkuType; -import com.azure.resourcemanager.test.utils.TestUtilities; import com.azure.resourcemanager.resources.fluentcore.arm.CountryIsoCode; -import com.azure.core.management.Region; import com.azure.resourcemanager.resources.fluentcore.model.Creatable; -import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.resources.fluentcore.model.CreatedResources; import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; import com.azure.resourcemanager.resources.models.Deployment; import com.azure.resourcemanager.resources.models.DeploymentMode; import com.azure.resourcemanager.resources.models.GenericResource; import com.azure.resourcemanager.resources.models.Location; +import com.azure.resourcemanager.resources.models.LockLevel; +import com.azure.resourcemanager.resources.models.ManagementLock; import com.azure.resourcemanager.resources.models.RegionCategory; import com.azure.resourcemanager.resources.models.RegionType; +import com.azure.resourcemanager.resources.models.ResourceGroup; import com.azure.resourcemanager.resources.models.Subscription; import com.azure.resourcemanager.storage.models.StorageAccount; -import java.io.IOException; +import com.azure.resourcemanager.storage.models.StorageAccountSkuType; +import com.azure.resourcemanager.test.ResourceManagerTestProxyTestBase; +import com.azure.resourcemanager.test.utils.TestDelayProvider; +import com.azure.resourcemanager.test.utils.TestIdentifierProvider; +import com.azure.resourcemanager.test.utils.TestUtilities; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Flux; +import reactor.core.scheduler.Schedulers; + import java.text.MessageFormat; import java.time.Duration; import java.time.temporal.ChronoUnit; @@ -84,16 +94,9 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; -import com.azure.resourcemanager.test.ResourceManagerTestProxyTestBase; -import com.azure.resourcemanager.test.utils.TestDelayProvider; -import com.azure.resourcemanager.test.utils.TestIdentifierProvider; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Flux; -import reactor.core.scheduler.Schedulers; - public class AzureResourceManagerTests extends ResourceManagerTestProxyTestBase { + private static final ClientLogger LOGGER = new ClientLogger(AzureResourceManagerTests.class); + private AzureResourceManager azureResourceManager; public AzureResourceManagerTests() { @@ -138,7 +141,6 @@ protected void cleanUpResources() { /** * Stress-tests the resilience of ExpandableEnum to multi-threaded access * - * @throws Exception */ @Test public void testExpandableEnum() throws Exception { @@ -223,17 +225,17 @@ public void run() { // Verify country ISO codes Collection countryIsoCodes = CountryIsoCode.values(); - System.out.println("\n## Country ISO codes: " + countryIsoCodes.size()); + LOGGER.log(LogLevel.VERBOSE, () -> "\n## Country ISO codes: " + countryIsoCodes.size()); for (CountryIsoCode value : countryIsoCodes) { - System.out.println(value.toString()); + LOGGER.log(LogLevel.VERBOSE, value::toString); } Assertions.assertEquals(257, countryIsoCodes.size()); // Verify power states Collection powerStates = PowerState.values(); - System.out.println("\n## Power states: " + powerStates.size()); + LOGGER.log(LogLevel.VERBOSE, () -> "\n## Power states: " + powerStates.size()); for (PowerState value : powerStates) { - System.out.println(value.toString()); + LOGGER.log(LogLevel.VERBOSE, value::toString); } Assertions.assertEquals(27, powerStates.size()); } @@ -245,15 +247,13 @@ public void run() { /** * Tests ARM template deployments. * - * @throws IOException - * @throws ManagementException */ @DoNotRecord(skipInPlayback = true) // response contains token in hostpoolToken @Test - public void testDeployments() throws Exception { + public void testDeployments() { String testId = azureResourceManager.deployments().manager().resourceManager().internalContext().randomResourceName("", 8); PagedIterable deployments = azureResourceManager.deployments().list(); - System.out.println("Deployments: " + TestUtilities.getSize(deployments)); + LOGGER.log(LogLevel.VERBOSE, () -> "Deployments: " + TestUtilities.getSize(deployments)); Deployment deployment = azureResourceManager .deployments() @@ -263,7 +263,7 @@ public void testDeployments() throws Exception { .withParametersLink(PARAMETERS_URI, CONTENT_VERSION) .withMode(DeploymentMode.COMPLETE) .create(); - System.out.println("Created deployment: " + deployment.correlationId()); + LOGGER.log(LogLevel.VERBOSE, () -> "Created deployment: " + deployment.correlationId()); azureResourceManager.resourceGroups().beginDeleteByName("rg" + testId); } @@ -271,10 +271,9 @@ public void testDeployments() throws Exception { /** * Tests basic generic resources retrieval. * - * @throws Exception */ @Test - public void testGenericResources() throws Exception { + public void testGenericResources() { // Create some resources NetworkSecurityGroup nsg = azureResourceManager @@ -312,10 +311,9 @@ public void testGenericResources() throws Exception { * Tests management locks. * NOTE: This requires the service principal to have an Owner role on the subscription * - * @throws Exception */ @Test - public void testManagementLocks() throws Exception { + public void testManagementLocks() { // Prepare a VM final String password = ResourceManagerTestProxyTestBase.password(); final String rgName = generateRandomResourceName("rg", 15); @@ -487,14 +485,14 @@ public void testManagementLocks() throws Exception { Assertions.assertNotNull(locksGroup); int locksAllCount = TestUtilities.getSize(locksSubscription); - System.out.println("All locks: " + locksAllCount); + LOGGER.log(LogLevel.VERBOSE, () -> "All locks: " + locksAllCount); Assertions.assertTrue(6 <= locksAllCount); int locksGroupCount = TestUtilities.getSize(locksGroup); - System.out.println("Group locks: " + locksGroupCount); + LOGGER.log(LogLevel.VERBOSE, () -> "Group locks: " + locksGroupCount); Assertions.assertEquals(6, locksGroupCount); } catch (Exception ex) { - ex.printStackTrace(System.out); + LOGGER.log(LogLevel.VERBOSE, () -> "Error occurred", ex); } finally { if (resourceGroup != null) { if (lockGroup != null) { @@ -524,21 +522,19 @@ public void testManagementLocks() throws Exception { /** * Tests VM images. * - * @throws IOException - * @throws ManagementException */ @DoNotRecord(skipInPlayback = true) @Test - public void testVMImages() throws ManagementException, IOException { + public void testVMImages() throws ManagementException { PagedIterable publishers = azureResourceManager.virtualMachineImages().publishers().listByRegion(Region.US_WEST); Assertions.assertTrue(TestUtilities.getSize(publishers) > 0); for (VirtualMachinePublisher p : publishers.stream().limit(5).toArray(VirtualMachinePublisher[]::new)) { - System.out.println(String.format("Publisher name: %s, region: %s", p.name(), p.region())); + LOGGER.log(LogLevel.VERBOSE, () -> "Publisher name: " + p.name() + ", region: " + p.region()); for (VirtualMachineOffer o : p.offers().list().stream().limit(5).toArray(VirtualMachineOffer[]::new)) { - System.out.println(String.format("\tOffer name: %s", o.name())); + LOGGER.log(LogLevel.VERBOSE, () -> "\tOffer name: " + o.name()); for (VirtualMachineSku s : o.skus().list().stream().limit(5).toArray(VirtualMachineSku[]::new)) { - System.out.println(String.format("\t\tSku name: %s", s.name())); + LOGGER.log(LogLevel.VERBOSE, () -> "\t\tSku name: " + s.name()); } } } @@ -552,7 +548,6 @@ public void testVMImages() throws ManagementException, IOException { /** * Tests the network security group implementation. * - * @throws Exception */ @Test public void testNetworkSecurityGroups() throws Exception { @@ -562,7 +557,6 @@ public void testNetworkSecurityGroups() throws Exception { /** * Tests the inbound NAT rule support in load balancers. * - * @throws Exception */ @DoNotRecord(skipInPlayback = true) // TODO(weidxu) @Test @@ -574,7 +568,6 @@ public void testLoadBalancersNatRules() throws Exception { /** * Tests the inbound NAT pool support in load balancers. * - * @throws Exception */ @DoNotRecord(skipInPlayback = true) // TODO(weidxu) @Test @@ -586,7 +579,6 @@ public void testLoadBalancersNatPools() throws Exception { /** * Tests the minimum Internet-facing load balancer with a load balancing rule only * - * @throws Exception */ @Test public void testLoadBalancersInternetMinimum() throws Exception { @@ -597,7 +589,6 @@ public void testLoadBalancersInternetMinimum() throws Exception { /** * Tests the minimum Internet-facing load balancer with a NAT rule only * - * @throws Exception */ @Test public void testLoadBalancersNatOnly() throws Exception { @@ -608,7 +599,6 @@ public void testLoadBalancersNatOnly() throws Exception { /** * Tests the minimum internal load balancer. * - * @throws Exception */ @Test public void testLoadBalancersInternalMinimum() throws Exception { @@ -619,7 +609,6 @@ public void testLoadBalancersInternalMinimum() throws Exception { /** * Tests the internal load balancer with availability zone. * - * @throws Exception */ @Test @Disabled("Though valid scenario, NRP is failing") @@ -629,7 +618,7 @@ public void testLoadBalancersInternalWithAvailabilityZone() throws Exception { } @Test - public void testManagedDiskVMUpdate() throws Exception { + public void testManagedDiskVMUpdate() { ResourceManagerUtils.InternalRuntimeContext context = azureResourceManager.disks().manager().resourceManager().internalContext(); final String rgName = context.randomResourceName("rg", 13); final String linuxVM2Name = context.randomResourceName("vm" + "-", 10); @@ -661,7 +650,6 @@ public void testManagedDiskVMUpdate() throws Exception { /** * Tests the public IP address implementation. * - * @throws Exception */ @Test public void testPublicIPAddresses() throws Exception { @@ -671,7 +659,6 @@ public void testPublicIPAddresses() throws Exception { /** * Tests the public IP address implementation. * - * @throws Exception */ @Test public void testPublicIPPrefixes() throws Exception { @@ -681,7 +668,6 @@ public void testPublicIPPrefixes() throws Exception { /** * Tests the availability set implementation. * - * @throws Exception */ @Test public void testAvailabilitySets() throws Exception { @@ -691,7 +677,6 @@ public void testAvailabilitySets() throws Exception { /** * Tests the virtual network implementation. * - * @throws Exception */ @Test public void testNetworks() throws Exception { @@ -701,7 +686,6 @@ public void testNetworks() throws Exception { /** * Tests virtual network peering * - * @throws Exception */ @Test public void testNetworkWithAccessFromServiceToSubnet() throws Exception { @@ -711,7 +695,6 @@ public void testNetworkWithAccessFromServiceToSubnet() throws Exception { /** * Tests virtual network peering * - * @throws Exception */ @Test public void testNetworkPeerings() throws Exception { @@ -721,7 +704,6 @@ public void testNetworkPeerings() throws Exception { /** * Tests virtual network with DDoS protection plan * - * @throws Exception */ @Test public void testDdosAndVmProtection() throws Exception { @@ -731,7 +713,6 @@ public void testDdosAndVmProtection() throws Exception { /** * Tests updateTags for virtual network. * - * @throws Exception */ @Test public void testNetworkUpdateTags() throws Exception { @@ -741,7 +722,6 @@ public void testNetworkUpdateTags() throws Exception { /** * Tests route tables. * - * @throws Exception */ @Test public void testRouteTables() throws Exception { @@ -752,16 +732,16 @@ public void testRouteTables() throws Exception { @Test public void testRegions() { // Show built-in regions - System.out.println("Built-in regions list:"); + LOGGER.log(LogLevel.VERBOSE, () -> "Built-in regions list:"); int regionsCount = Region.values().size(); for (Region region : Region.values()) { - System.out.println("Name: " + region.name() + ", Label: " + region.label()); + LOGGER.log(LogLevel.VERBOSE, () -> "Name: " + region.name() + ", Label: " + region.label()); } // Look up built-in region Region region = Region.fromName("westus"); - Assertions.assertTrue(region == Region.US_WEST); + Assertions.assertSame(region, Region.US_WEST); // Add a region Region region2 = Region.fromName("madeUpRegion"); @@ -775,7 +755,6 @@ public void testRegions() { /** * Tests the network interface implementation. * - * @throws Exception */ @Test public void testNetworkInterfaces() throws Exception { @@ -785,7 +764,6 @@ public void testNetworkInterfaces() throws Exception { /** * Tests the network watcher implementation. * - * @throws Exception */ @Test public void testNetworkWatchers() throws Exception { @@ -859,7 +837,7 @@ public void testNetworkWatcherFunctions() throws Exception { .withRetentionPolicyDays(5) .withRetentionPolicyEnabled() .apply(); - Assertions.assertEquals(true, flowLogSettings.enabled()); + Assertions.assertTrue(flowLogSettings.enabled()); Assertions.assertEquals(5, flowLogSettings.retentionDays()); Assertions.assertEquals(storageAccount.id(), flowLogSettings.storageId()); @@ -945,7 +923,6 @@ public void testNetworkWatcherFunctions() throws Exception { /** * Tests the local network gateway implementation. * - * @throws Exception */ @DoNotRecord(skipInPlayback = true) // TODO(weidxu) @Test @@ -956,7 +933,6 @@ public void testLocalNetworkGateways() throws Exception { /** * Tests the express route circuit implementation. * - * @throws Exception */ @Test @Disabled("Failed to provision ExpressRoute circuit as the service provider does not have sufficient capacity at this location.") @@ -967,7 +943,6 @@ public void testExpressRouteCircuits() throws Exception { /** * Tests the express route circuit peerings implementation. * - * @throws Exception */ @Test @Disabled("Failed to provision ExpressRoute circuit as the service provider does not have sufficient capacity at this location.") @@ -979,7 +954,6 @@ public void testExpressRouteCircuitPeering() throws Exception { /** * Tests virtual machines. * - * @throws Exception */ @Test @Disabled("osDiskSize is returned as 127 instead of 128 - known service bug") @@ -992,7 +966,6 @@ public void testVirtualMachines() throws Exception { /** * Tests the virtual machine data disk implementation. * - * @throws Exception */ @Test public void testVirtualMachineDataDisk() throws Exception { @@ -1002,7 +975,6 @@ public void testVirtualMachineDataDisk() throws Exception { /** * Tests the virtual machine network interface implementation. * - * @throws Exception */ @Test public void testVirtualMachineNics() throws Exception { @@ -1012,7 +984,6 @@ public void testVirtualMachineNics() throws Exception { /** * Tests virtual machine support for SSH. * - * @throws Exception */ @Test public void testVirtualMachineSSh() throws Exception { @@ -1022,7 +993,6 @@ public void testVirtualMachineSSh() throws Exception { /** * Tests virtual machine sizes. * - * @throws Exception */ @Test public void testVirtualMachineSizes() throws Exception { @@ -1049,10 +1019,9 @@ public void testVirtualMachineSyncPoller() throws Exception { /** * Tests subscription listing. * - * @throws Exception */ @Test - public void listSubscriptions() throws Exception { + public void listSubscriptions() { Assertions.assertTrue(0 < TestUtilities.getSize(azureResourceManager.subscriptions().list())); Subscription subscription = azureResourceManager.getCurrentSubscription(); Assertions.assertNotNull(subscription); @@ -1064,10 +1033,9 @@ public void listSubscriptions() throws Exception { /** * Tests location listing. * - * @throws Exception */ @Test - public void listLocations() throws Exception { + public void listLocations() { Subscription subscription = azureResourceManager.getCurrentSubscription(); Assertions.assertNotNull(subscription); for (Location location : subscription.listLocations()) { @@ -1085,27 +1053,25 @@ public void listLocations() throws Exception { /** * Tests resource group listing. * - * @throws Exception */ @Test - public void listResourceGroups() throws Exception { + public void listResourceGroups() { int groupCount = TestUtilities.getSize(azureResourceManager.resourceGroups().list()); - System.out.println(String.format("Group count: %s", groupCount)); + LOGGER.log(LogLevel.VERBOSE, () -> "Group count: " + groupCount); Assertions.assertTrue(0 < groupCount); } /** * Tests storage account listing. * - * @throws Exception */ @Test - public void listStorageAccounts() throws Exception { + public void listStorageAccounts() { Assertions.assertTrue(0 < TestUtilities.getSize(azureResourceManager.storageAccounts().list())); } @Test - public void createStorageAccount() throws Exception { + public void createStorageAccount() { String storageAccountName = generateRandomResourceName("testsa", 12); StorageAccount storageAccount = azureResourceManager @@ -1175,7 +1141,7 @@ public void testContainerInstanceWithPublicIpAddressWithSystemAssignedMsi() thro } @Test - public void testContainerInstanceWithPublicIpAddressWithUserAssignedMsi() throws Exception { + public void testContainerInstanceWithPublicIpAddressWithUserAssignedMsi() { final String cgName = generateRandomResourceName("aci", 10); final String rgName = generateRandomResourceName("rgaci", 10); String identityName1 = generateRandomResourceName("msi-id", 15); @@ -1198,7 +1164,7 @@ public void testContainerInstanceWithPublicIpAddressWithUserAssignedMsi() throws .withExistingResourceGroup(rgName) .withAccessToCurrentResourceGroup(BuiltInRole.CONTRIBUTOR); - List dnsServers = new ArrayList(); + List dnsServers = new ArrayList<>(); dnsServers.add("dnsServer1"); ContainerGroup containerGroup = azureResourceManager @@ -1283,14 +1249,14 @@ public void testContainerInstanceWithPublicIpAddressWithUserAssignedMsi() throws List containerGroupList = azureResourceManager.containerGroups().listByResourceGroup(rgName).stream().collect(Collectors.toList()); - Assertions.assertTrue(containerGroupList.size() > 0); + Assertions.assertFalse(containerGroupList.isEmpty()); containerGroup.refresh(); Set containerGroupOperations = azureResourceManager.containerGroups().listOperations().stream().collect(Collectors.toSet()); // Number of supported operation can change hence don't assert with a predefined number. - Assertions.assertTrue(containerGroupOperations.size() > 0); + Assertions.assertFalse(containerGroupOperations.isEmpty()); } @Test @@ -1386,7 +1352,7 @@ public void generateMissingRegion() { } } - Assertions.assertTrue(sb.length() == 0, sb.toString()); + Assertions.assertEquals(0, sb.length(), sb.toString()); } private static Region findByLabelOrName(String labelOrName) { diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/PrivateLinkTests.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/PrivateLinkTests.java index 882ce2ab1b5f..a5f66e2472fe 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/PrivateLinkTests.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/PrivateLinkTests.java @@ -12,8 +12,8 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.Region; import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.serializer.JacksonAdapter; -import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.appservice.models.PricingTier; import com.azure.resourcemanager.appservice.models.RuntimeStack; import com.azure.resourcemanager.appservice.models.WebApp; @@ -50,17 +50,14 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; -import java.io.File; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.stream.Collectors; public class PrivateLinkTests extends ResourceManagerTestProxyTestBase { + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkTests.class); private AzureResourceManager azureResourceManager; private String rgName; @@ -122,7 +119,7 @@ public void testPrivateEndpoint() { // String pecName2 = generateRandomResourceName("pec", 10); String saDomainName = saName + ".blob.core.windows.net"; - System.out.println("storage account domain name: " + saDomainName); + LOGGER.log(LogLevel.VERBOSE, () -> "storage account domain name: " + saDomainName); StorageAccount storageAccount = azureResourceManager.storageAccounts().define(saName) .withRegion(region) @@ -228,7 +225,7 @@ public void testPrivateEndpoint() { Assertions.assertEquals("Approved", privateEndpoint.privateLinkServiceConnections().get(pecName).state().status()); String saPrivateIp = privateEndpoint.customDnsConfigurations().get(0).ipAddresses().get(0); - System.out.println("storage account private ip: " + saPrivateIp); + LOGGER.log(LogLevel.VERBOSE, () -> "storage account private ip: " + saPrivateIp); // verify list List privateEndpoints = azureResourceManager.privateEndpoints().listByResourceGroup(rgName).stream().collect(Collectors.toList()); @@ -248,7 +245,7 @@ public void testPrivateEndpointE2E() { String vmName = generateRandomResourceName("vm", 10); String saDomainName = saName + ".blob.core.windows.net"; - System.out.println("storage account domain name: " + saDomainName); + LOGGER.log(LogLevel.VERBOSE, () -> "storage account domain name: " + saDomainName); StorageAccount storageAccount = azureResourceManager.storageAccounts().define(saName) .withRegion(region) @@ -289,7 +286,7 @@ public void testPrivateEndpointE2E() { Assertions.assertEquals("Approved", privateEndpoint.privateLinkServiceConnections().get(pecName).state().status()); String saPrivateIp = privateEndpoint.customDnsConfigurations().get(0).ipAddresses().get(0); - System.out.println("storage account private ip: " + saPrivateIp); + LOGGER.log(LogLevel.VERBOSE, () -> "storage account private ip: " + saPrivateIp); VirtualMachine virtualMachine = null; if (validateOnVirtualMachine) { @@ -310,7 +307,7 @@ public void testPrivateEndpointE2E() { // verify private endpoint not yet works RunCommandResult commandResult = virtualMachine.runShellScript(Collections.singletonList("nslookup " + saDomainName), null); for (InstanceViewStatus status : commandResult.value()) { - System.out.println(status.message()); + LOGGER.log(LogLevel.VERBOSE, () -> status.message()); } Assertions.assertFalse(commandResult.value().stream().anyMatch(status -> status.message().contains(saPrivateIp))); } @@ -335,7 +332,7 @@ public void testPrivateEndpointE2E() { // verify private endpoint works RunCommandResult commandResult = virtualMachine.runShellScript(Collections.singletonList("nslookup " + saDomainName), null); for (InstanceViewStatus status : commandResult.value()) { - System.out.println(status.message()); + LOGGER.log(LogLevel.VERBOSE, () -> status.message()); } Assertions.assertTrue(commandResult.value().stream().anyMatch(status -> status.message().contains(saPrivateIp))); } @@ -560,11 +557,4 @@ private parseAuthFile(String authFilename) throws Exception { - String content = new String(Files.readAllBytes(new File(authFilename).toPath()), StandardCharsets.UTF_8).trim(); - HashMap auth = new HashMap<>(); - auth = new JacksonAdapter().deserialize(content, auth.getClass(), SerializerEncoding.JSON); - return auth; - } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestApplicationGateway.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestApplicationGateway.java index 7bc709c81960..190280a546eb 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestApplicationGateway.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestApplicationGateway.java @@ -2,6 +2,8 @@ // Licensed under the MIT License. package com.azure.resourcemanager; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.network.models.ApplicationGateway; import com.azure.resourcemanager.network.models.ApplicationGatewayAuthenticationCertificate; import com.azure.resourcemanager.network.models.ApplicationGatewayBackend; @@ -39,6 +41,8 @@ /** Test of application gateway management. */ public class TestApplicationGateway { + private static final ClientLogger LOGGER = new ClientLogger(TestApplicationGateway.class); + String testId = ""; static final Region REGION = Region.US_WEST; String groupName = ""; @@ -381,9 +385,8 @@ public class PrivateComplex extends TestTemplate "Uncaught exception", ex); } }; @@ -519,7 +522,7 @@ public void run() { .withInstanceCount(2) .create(); } catch (IOException e) { - e.printStackTrace(); + LOGGER.log(LogLevel.VERBOSE, () -> "Error creating application gateway", e); } } }); @@ -843,9 +846,8 @@ public class PublicComplex extends TestTemplate "Uncaught exception", ex); } }; @@ -962,7 +964,7 @@ public void run() { .withHttp2() .create(); } catch (IOException e) { - e.printStackTrace(); + LOGGER.log(LogLevel.VERBOSE, () -> "Uncaught exception", e); } } }); @@ -978,7 +980,7 @@ public void run() { ApplicationGateway appGateway = resources.getById(resourceId); Assertions.assertNotNull(appGateway); Assertions.assertTrue(appGateway.isPublic()); - Assertions.assertTrue(!appGateway.isPrivate()); + Assertions.assertFalse(appGateway.isPrivate()); Assertions.assertEquals(ApplicationGatewayTier.STANDARD, appGateway.tier()); Assertions.assertEquals(ApplicationGatewaySkuName.STANDARD_MEDIUM, appGateway.size()); Assertions.assertEquals(2, appGateway.instanceCount()); @@ -997,7 +999,7 @@ public void run() { Assertions.assertEquals(0, appGateway.privateFrontends().size()); ApplicationGatewayFrontend frontend = appGateway.publicFrontends().values().iterator().next(); Assertions.assertTrue(frontend.isPublic()); - Assertions.assertTrue(!frontend.isPrivate()); + Assertions.assertFalse(frontend.isPrivate()); // Verify listeners Assertions.assertEquals(3, appGateway.listeners().size()); @@ -1099,7 +1101,7 @@ public void run() { Assertions.assertEquals(2, appGateway.disabledSslProtocols().size()); Assertions.assertTrue(appGateway.disabledSslProtocols().contains(ApplicationGatewaySslProtocol.TLSV1_0)); Assertions.assertTrue(appGateway.disabledSslProtocols().contains(ApplicationGatewaySslProtocol.TLSV1_1)); - Assertions.assertTrue(!appGateway.disabledSslProtocols().contains(ApplicationGatewaySslProtocol.TLSV1_2)); + Assertions.assertFalse(appGateway.disabledSslProtocols().contains(ApplicationGatewaySslProtocol.TLSV1_2)); return appGateway; } @@ -1148,8 +1150,8 @@ public ApplicationGateway updateResource(final ApplicationGateway resource) thro // Get the resource created so far Assertions.assertTrue(resource.tags().containsKey("tag1")); - Assertions.assertTrue(resource.size().equals(ApplicationGatewaySkuName.STANDARD_SMALL)); - Assertions.assertTrue(resource.instanceCount() == 1); + Assertions.assertEquals(resource.size(), ApplicationGatewaySkuName.STANDARD_SMALL); + Assertions.assertEquals(1, resource.instanceCount()); Assertions.assertFalse(resource.isHttp2Enabled()); // Verify listeners @@ -1157,10 +1159,10 @@ public ApplicationGateway updateResource(final ApplicationGateway resource) thro Assertions.assertTrue("www.contoso.com".equalsIgnoreCase(listener.hostname())); // Verify request routing rules - Assertions.assertTrue(resource.requestRoutingRules().size() == rulesCount - 1); - Assertions.assertTrue(!resource.requestRoutingRules().containsKey("rule9000")); + Assertions.assertEquals(resource.requestRoutingRules().size(), rulesCount - 1); + Assertions.assertFalse(resource.requestRoutingRules().containsKey("rule9000")); ApplicationGatewayRequestRoutingRule rule = resource.requestRoutingRules().get("rule443"); - Assertions.assertTrue(rule != null); + Assertions.assertNotNull(rule); Assertions.assertTrue("listener1".equalsIgnoreCase(rule.listener().name())); // Verify probes @@ -1233,7 +1235,7 @@ public void run() { .attach() .create(); } catch (IOException e) { - e.printStackTrace(); + LOGGER.log(LogLevel.VERBOSE, () -> "Error occurred", e); } } }); @@ -1246,48 +1248,48 @@ public void run() { // Get the resource as created so far String resourceId = createResourceId(resources.manager().subscriptionId()); ApplicationGateway appGateway = resources.manager().applicationGateways().getById(resourceId); - Assertions.assertTrue(appGateway != null); - Assertions.assertTrue(ApplicationGatewayTier.STANDARD.equals(appGateway.tier())); - Assertions.assertTrue(ApplicationGatewaySkuName.STANDARD_SMALL.equals(appGateway.size())); - Assertions.assertTrue(appGateway.instanceCount() == 1); + Assertions.assertNotNull(appGateway); + Assertions.assertEquals(ApplicationGatewayTier.STANDARD, appGateway.tier()); + Assertions.assertEquals(ApplicationGatewaySkuName.STANDARD_SMALL, appGateway.size()); + Assertions.assertEquals(1, appGateway.instanceCount()); // Verify frontend ports - Assertions.assertTrue(appGateway.frontendPorts().size() == 1); - Assertions.assertTrue(appGateway.frontendPortNameFromNumber(443) != null); + Assertions.assertEquals(1, appGateway.frontendPorts().size()); + Assertions.assertNotNull(appGateway.frontendPortNameFromNumber(443)); // Verify frontends - Assertions.assertTrue(!appGateway.isPrivate()); + Assertions.assertFalse(appGateway.isPrivate()); Assertions.assertTrue(appGateway.isPublic()); - Assertions.assertTrue(appGateway.frontends().size() == 1); + Assertions.assertEquals(1, appGateway.frontends().size()); // Verify listeners - Assertions.assertTrue(appGateway.listeners().size() == 1); - Assertions.assertTrue(appGateway.listenerByPortNumber(443) != null); + Assertions.assertEquals(1, appGateway.listeners().size()); + Assertions.assertNotNull(appGateway.listenerByPortNumber(443)); // Verify backends - Assertions.assertTrue(appGateway.backends().size() == 1); + Assertions.assertEquals(1, appGateway.backends().size()); // Verify backend HTTP configs - Assertions.assertTrue(appGateway.backendHttpConfigurations().size() == 1); + Assertions.assertEquals(1, appGateway.backendHttpConfigurations().size()); // Verify rules - Assertions.assertTrue(appGateway.requestRoutingRules().size() == 1); + Assertions.assertEquals(1, appGateway.requestRoutingRules().size()); ApplicationGatewayRequestRoutingRule rule = appGateway.requestRoutingRules().get("rule1"); - Assertions.assertTrue(rule != null); - Assertions.assertTrue(rule.frontendPort() == 443); - Assertions.assertTrue(ApplicationGatewayProtocol.HTTPS.equals(rule.frontendProtocol())); - Assertions.assertTrue(rule.listener() != null); - Assertions.assertTrue(rule.listener().frontend() != null); + Assertions.assertNotNull(rule); + Assertions.assertEquals(443, rule.frontendPort()); + Assertions.assertEquals(ApplicationGatewayProtocol.HTTPS, rule.frontendProtocol()); + Assertions.assertNotNull(rule.listener()); + Assertions.assertNotNull(rule.listener().frontend()); Assertions.assertTrue(rule.listener().frontend().isPublic()); - Assertions.assertTrue(!rule.listener().frontend().isPrivate()); - Assertions.assertTrue(rule.backendPort() == 8080); - Assertions.assertTrue(rule.sslCertificate() != null); - Assertions.assertTrue(rule.backendAddresses().size() == 2); + Assertions.assertFalse(rule.listener().frontend().isPrivate()); + Assertions.assertEquals(8080, rule.backendPort()); + Assertions.assertNotNull(rule.sslCertificate()); + Assertions.assertEquals(2, rule.backendAddresses().size()); Assertions.assertTrue(rule.backend().containsIPAddress("11.1.1.1")); Assertions.assertTrue(rule.backend().containsIPAddress("11.1.1.2")); // Verify certificates - Assertions.assertTrue(appGateway.sslCertificates().size() == 1); + Assertions.assertEquals(1, appGateway.sslCertificates().size()); return appGateway; } @@ -1324,47 +1326,47 @@ public ApplicationGateway updateResource(final ApplicationGateway resource) thro Assertions.assertTrue(resource.tags().containsKey("tag1")); Assertions.assertTrue(resource.tags().containsKey("tag2")); - Assertions.assertTrue(ApplicationGatewaySkuName.STANDARD_MEDIUM.equals(resource.size())); - Assertions.assertTrue(resource.instanceCount() == 2); + Assertions.assertEquals(ApplicationGatewaySkuName.STANDARD_MEDIUM, resource.size()); + Assertions.assertEquals(2, resource.instanceCount()); // Verify frontend ports - Assertions.assertTrue(resource.frontendPorts().size() == 2); - Assertions.assertTrue(resource.frontendPortNameFromNumber(80) != null); + Assertions.assertEquals(2, resource.frontendPorts().size()); + Assertions.assertNotNull(resource.frontendPortNameFromNumber(80)); // Verify listeners - Assertions.assertTrue(resource.listeners().size() == 2); + Assertions.assertEquals(2, resource.listeners().size()); ApplicationGatewayListener listener = resource.listeners().get("listener2"); - Assertions.assertTrue(listener != null); - Assertions.assertTrue(!listener.frontend().isPrivate()); + Assertions.assertNotNull(listener); + Assertions.assertFalse(listener.frontend().isPrivate()); Assertions.assertTrue(listener.frontend().isPublic()); - Assertions.assertTrue(listener.frontendPortNumber() == 80); - Assertions.assertTrue(ApplicationGatewayProtocol.HTTP.equals(listener.protocol())); - Assertions.assertTrue(listener.sslCertificate() == null); + Assertions.assertEquals(80, listener.frontendPortNumber()); + Assertions.assertEquals(ApplicationGatewayProtocol.HTTP, listener.protocol()); + Assertions.assertNull(listener.sslCertificate()); // Verify backends - Assertions.assertTrue(resource.backends().size() == 2); + Assertions.assertEquals(2, resource.backends().size()); ApplicationGatewayBackend backend = resource.backends().get("backend2"); - Assertions.assertTrue(backend != null); - Assertions.assertTrue(backend.addresses().size() == 1); + Assertions.assertNotNull(backend); + Assertions.assertEquals(1, backend.addresses().size()); Assertions.assertTrue(backend.containsIPAddress("11.1.1.3")); // Verify HTTP configs - Assertions.assertTrue(resource.backendHttpConfigurations().size() == 2); + Assertions.assertEquals(2, resource.backendHttpConfigurations().size()); ApplicationGatewayBackendHttpConfiguration config = resource.backendHttpConfigurations().get("config2"); - Assertions.assertTrue(config != null); + Assertions.assertNotNull(config); Assertions.assertTrue(config.cookieBasedAffinity()); - Assertions.assertTrue(config.port() == 8081); - Assertions.assertTrue(config.requestTimeout() == 33); + Assertions.assertEquals(8081, config.port()); + Assertions.assertEquals(33, config.requestTimeout()); // Verify request routing rules - Assertions.assertTrue(resource.requestRoutingRules().size() == 2); + Assertions.assertEquals(2, resource.requestRoutingRules().size()); ApplicationGatewayRequestRoutingRule rule = resource.requestRoutingRules().get("rule2"); - Assertions.assertTrue(rule != null); - Assertions.assertTrue(rule.listener() != null); - Assertions.assertTrue("listener2".equals(rule.listener().name())); - Assertions.assertTrue(rule.backendHttpConfiguration() != null); + Assertions.assertNotNull(rule); + Assertions.assertNotNull(rule.listener()); + Assertions.assertEquals("listener2", rule.listener().name()); + Assertions.assertNotNull(rule.backendHttpConfiguration()); Assertions.assertTrue("config2".equalsIgnoreCase(rule.backendHttpConfiguration().name())); - Assertions.assertTrue(rule.backend() != null); + Assertions.assertNotNull(rule.backend()); Assertions.assertTrue("backend2".equalsIgnoreCase(rule.backend().name())); return resource; @@ -1372,10 +1374,10 @@ public ApplicationGateway updateResource(final ApplicationGateway resource) thro } // Create VNet for the app gateway - private Map ensurePIPs(PublicIpAddresses pips) throws Exception { + private Map ensurePIPs(PublicIpAddresses pips) { List> creatablePips = new ArrayList<>(); - for (int i = 0; i < pipNames.length; i++) { - creatablePips.add(pips.define(pipNames[i]).withRegion(REGION).withNewResourceGroup(groupName)); + for (String pipName : pipNames) { + creatablePips.add(pips.define(pipName).withRegion(REGION).withNewResourceGroup(groupName)); } return pips.create(creatablePips); @@ -1497,7 +1499,7 @@ static void printAppGateway(ApplicationGateway resource) { .append(httpConfig.path()); if (httpConfig.probe() != null) { - info.append("\n\t\t\tProbe: " + httpConfig.probe().name()); + info.append("\n\t\t\tProbe: ").append(httpConfig.probe().name()); } info.append("\n\t\tIs probe enabled? ").append(httpConfig.isProbeEnabled()); } @@ -1653,6 +1655,6 @@ static void printAppGateway(ApplicationGateway resource) { info.append(listener.name()); } } - System.out.println(info.toString()); + LOGGER.log(LogLevel.VERBOSE, () -> info.toString()); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestCdn.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestCdn.java index 79d98ea846f2..e896eea3d65c 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestCdn.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestCdn.java @@ -4,6 +4,8 @@ package com.azure.resourcemanager; import com.azure.core.management.Region; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.cdn.models.CdnEndpoint; import com.azure.resourcemanager.cdn.models.CdnProfile; import com.azure.resourcemanager.cdn.models.CdnProfiles; @@ -24,6 +26,8 @@ * Test of CDN management. */ public class TestCdn extends TestTemplate { + private static final ClientLogger LOGGER = new ClientLogger(TestCdn.class); + @Override public CdnProfile createResource(CdnProfiles profiles) throws Exception { final Region region = Region.US_EAST; @@ -50,7 +54,7 @@ public CdnProfile createResource(CdnProfiles profiles) throws Exception { .attach() .create(); - Assertions.assertTrue(cdnProfile.sku().name().equals(SkuName.STANDARD_VERIZON)); + Assertions.assertEquals(cdnProfile.sku().name(), SkuName.STANDARD_VERIZON); Assertions.assertNotNull(cdnProfile.endpoints()); Assertions.assertEquals(1, cdnProfile.endpoints().size()); CdnEndpoint endpoint = cdnProfile.endpoints().get(cdnEndpointName); @@ -165,6 +169,6 @@ public void print(CdnProfile profile) { } } } - System.out.println(info.toString()); + LOGGER.log(LogLevel.VERBOSE, info::toString); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestContainerInstanceWithPublicIpAddressWithSystemAssignedMSI.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestContainerInstanceWithPublicIpAddressWithSystemAssignedMSI.java index 435a4212f531..f5349b048003 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestContainerInstanceWithPublicIpAddressWithSystemAssignedMSI.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestContainerInstanceWithPublicIpAddressWithSystemAssignedMSI.java @@ -3,6 +3,8 @@ package com.azure.resourcemanager; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.authorization.models.BuiltInRole; import com.azure.resourcemanager.containerinstance.models.Container; import com.azure.resourcemanager.containerinstance.models.ContainerGroup; @@ -24,6 +26,8 @@ public class TestContainerInstanceWithPublicIpAddressWithSystemAssignedMSI extends TestTemplate { + private static final ClientLogger LOGGER + = new ClientLogger(TestContainerInstanceWithPublicIpAddressWithSystemAssignedMSI.class); @Override public ContainerGroup createResource(ContainerGroups containerGroups) throws Exception { @@ -104,13 +108,13 @@ public ContainerGroup createResource(ContainerGroups containerGroups) throws Exc List containerGroupList = containerGroups.listByResourceGroup(rgName).stream().collect(Collectors.toList()); - Assertions.assertTrue(containerGroupList.size() > 0); + Assertions.assertFalse(containerGroupList.isEmpty()); containerGroup.refresh(); Set containerGroupOperations = containerGroups.listOperations().stream().collect(Collectors.toSet()); // Number of supported operation can change hence don't assert with a predefined number. - Assertions.assertTrue(containerGroupOperations.size() > 0); + Assertions.assertFalse(containerGroupOperations.isEmpty()); return containerGroup; } @@ -211,6 +215,6 @@ public void print(ContainerGroup resource) { } } - System.out.println(info.toString()); + LOGGER.log(LogLevel.VERBOSE, info::toString); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestDns.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestDns.java index 21b959dda73b..e6ea71a52362 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestDns.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestDns.java @@ -3,6 +3,8 @@ package com.azure.resourcemanager; import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.dns.models.ARecordSet; import com.azure.resourcemanager.dns.models.AaaaRecordSet; import com.azure.resourcemanager.dns.models.CnameRecordSet; @@ -34,6 +36,8 @@ import static com.azure.resourcemanager.dns.models.RecordType.TXT; public class TestDns extends TestTemplate { + private static final ClientLogger LOGGER = new ClientLogger(TestDns.class); + @Override public DnsZone createResource(DnsZones dnsZones) throws Exception { final Region region = Region.US_EAST; @@ -92,8 +96,8 @@ public DnsZone createResource(DnsZones dnsZones) throws Exception { // Check Dns zone properties Assertions.assertTrue(dnsZone.name().startsWith(topLevelDomain)); - Assertions.assertTrue(dnsZone.nameServers().size() > 0); // Default '@' name servers - Assertions.assertTrue(dnsZone.tags().size() == 2); + Assertions.assertFalse(dnsZone.nameServers().isEmpty()); // Default '@' name servers + Assertions.assertEquals(2, dnsZone.tags().size()); // Check SOA record - external child resource (created by default) SoaRecordSet soaRecordSet = dnsZone.getSoaRecordSet(); @@ -106,23 +110,23 @@ public DnsZone createResource(DnsZones dnsZones) throws Exception { // Check A records PagedIterable aRecordSets = dnsZone.aRecordSets().list(); - Assertions.assertTrue(aRecordSets.stream().count() == 1); - Assertions.assertTrue(aRecordSets.iterator().next().timeToLive() == 7200); + Assertions.assertEquals(1, aRecordSets.stream().count()); + Assertions.assertEquals(7200, aRecordSets.iterator().next().timeToLive()); // Check AAAA records PagedIterable aaaaRecordSets = dnsZone.aaaaRecordSets().list(); - Assertions.assertTrue(aaaaRecordSets.stream().count() == 1); + Assertions.assertEquals(1, aaaaRecordSets.stream().count()); Assertions.assertTrue(aaaaRecordSets.iterator().next().name().startsWith("www")); - Assertions.assertTrue(aaaaRecordSets.iterator().next().ipv6Addresses().size() == 2); + Assertions.assertEquals(2, aaaaRecordSets.iterator().next().ipv6Addresses().size()); // Check MX records PagedIterable mxRecordSets = dnsZone.mxRecordSets().list(); - Assertions.assertTrue(mxRecordSets.stream().count() == 1); + Assertions.assertEquals(1, mxRecordSets.stream().count()); MxRecordSet mxRecordSet = mxRecordSets.iterator().next(); Assertions.assertNotNull(mxRecordSet); Assertions.assertTrue(mxRecordSet.name().startsWith("email")); - Assertions.assertTrue(mxRecordSet.metadata().size() == 2); - Assertions.assertTrue(mxRecordSet.records().size() == 2); + Assertions.assertEquals(2, mxRecordSet.metadata().size()); + Assertions.assertEquals(2, mxRecordSet.records().size()); for (MxRecord mxRecord : mxRecordSet.records()) { Assertions.assertTrue(mxRecord.exchange().startsWith("mail.contoso-mail-exchange1.com") || mxRecord.exchange().startsWith("mail.contoso-mail-exchange2.com")); @@ -132,23 +136,23 @@ public DnsZone createResource(DnsZones dnsZones) throws Exception { // Check NS records PagedIterable nsRecordSets = dnsZone.nsRecordSets().list(); - Assertions.assertTrue(nsRecordSets.stream().count() == 2); // One created above with name 'partners' + the default '@' + Assertions.assertEquals(2, nsRecordSets.stream().count()); // One created above with name 'partners' + the default '@' // Check TXT records PagedIterable txtRecordSets = dnsZone.txtRecordSets().list(); - Assertions.assertTrue(txtRecordSets.stream().count() == 2); + Assertions.assertEquals(2, txtRecordSets.stream().count()); // Check SRV records PagedIterable srvRecordSets = dnsZone.srvRecordSets().list(); - Assertions.assertTrue(srvRecordSets.stream().count() == 1); + Assertions.assertEquals(1, srvRecordSets.stream().count()); // Check PTR records PagedIterable ptrRecordSets = dnsZone.ptrRecordSets().list(); - Assertions.assertTrue(ptrRecordSets.stream().count() == 2); + Assertions.assertEquals(2, ptrRecordSets.stream().count()); // Check CNAME records PagedIterable cnameRecordSets = dnsZone.cNameRecordSets().list(); - Assertions.assertTrue(cnameRecordSets.stream().count() == 2); + Assertions.assertEquals(2, cnameRecordSets.stream().count()); // Check Generic record set listing PagedIterable recordSets = dnsZone.listRecordSets(); @@ -214,15 +218,15 @@ public DnsZone createResource(DnsZones dnsZones) throws Exception { Assertions.assertNotNull(recordSet); } } - Assertions.assertTrue(typeToCount.get(SOA) == 1); - Assertions.assertTrue(typeToCount.get(RecordType.A) == 1); - Assertions.assertTrue(typeToCount.get(AAAA) == 1); - Assertions.assertTrue(typeToCount.get(MX) == 1); - Assertions.assertTrue(typeToCount.get(NS) == 2); - Assertions.assertTrue(typeToCount.get(TXT) == 2); - Assertions.assertTrue(typeToCount.get(SRV) == 1); - Assertions.assertTrue(typeToCount.get(PTR) == 2); - Assertions.assertTrue(typeToCount.get(RecordType.CNAME) == 2); + Assertions.assertEquals(1, (int) typeToCount.get(SOA)); + Assertions.assertEquals(1, (int) typeToCount.get(RecordType.A)); + Assertions.assertEquals(1, (int) typeToCount.get(AAAA)); + Assertions.assertEquals(1, (int) typeToCount.get(MX)); + Assertions.assertEquals(2, (int) typeToCount.get(NS)); + Assertions.assertEquals(2, (int) typeToCount.get(TXT)); + Assertions.assertEquals(1, (int) typeToCount.get(SRV)); + Assertions.assertEquals(2, (int) typeToCount.get(PTR)); + Assertions.assertEquals(2, (int) typeToCount.get(RecordType.CNAME)); return dnsZone; } @@ -269,7 +273,7 @@ public DnsZone updateResource(DnsZone dnsZone) throws Exception { // Check NS records PagedIterable nsRecordSets = dnsZone.nsRecordSets().list(); - Assertions.assertTrue(nsRecordSets.stream().count() == 2); // One created above with name 'partners' + the default '@' + Assertions.assertEquals(2, nsRecordSets.stream().count()); // One created above with name 'partners' + the default '@' for (NsRecordSet nsRecordSet : nsRecordSets) { Assertions.assertTrue(nsRecordSet.name().startsWith("partners") || nsRecordSet.name().startsWith("@")); if (nsRecordSet.name().startsWith("partners")) { @@ -291,9 +295,9 @@ public DnsZone updateResource(DnsZone dnsZone) throws Exception { // Check SRV records PagedIterable srvRecordSets = dnsZone.srvRecordSets().list(); - Assertions.assertTrue(srvRecordSets.stream().count() == 1); + Assertions.assertEquals(1, srvRecordSets.stream().count()); SrvRecordSet srvRecordSet = srvRecordSets.iterator().next(); - Assertions.assertTrue(srvRecordSet.records().size() == 4); + Assertions.assertEquals(4, srvRecordSet.records().size()); for (SrvRecord srvRecord : srvRecordSet.records()) { Assertions.assertFalse(srvRecord.target().startsWith("bigbox.contoso-service.com")); } @@ -304,11 +308,11 @@ public DnsZone updateResource(DnsZone dnsZone) throws Exception { SoaRecord soaRecord = soaRecordSet.record(); Assertions.assertNotNull(soaRecord); Assertions.assertEquals(soaRecord.minimumTtl(), Long.valueOf(600)); - Assertions.assertTrue(soaRecordSet.timeToLive() == 7200); + Assertions.assertEquals(7200, soaRecordSet.timeToLive()); // Check MX records PagedIterable mxRecordSets = dnsZone.mxRecordSets().list(); - Assertions.assertTrue(mxRecordSets.stream().count() == 2); + Assertions.assertEquals(2, mxRecordSets.stream().count()); dnsZone.update() .updateMXRecordSet("email") @@ -320,11 +324,11 @@ public DnsZone updateResource(DnsZone dnsZone) throws Exception { .withTag("d", "dd") .apply(); - Assertions.assertTrue(dnsZone.tags().size() == 3); + Assertions.assertEquals(3, dnsZone.tags().size()); // Check "mail" MX record MxRecordSet mxRecordSet = dnsZone.mxRecordSets().getByName("email"); - Assertions.assertTrue(mxRecordSet.records().size() == 1); - Assertions.assertTrue(mxRecordSet.metadata().size() == 3); + Assertions.assertEquals(1, mxRecordSet.records().size()); + Assertions.assertEquals(3, mxRecordSet.metadata().size()); Assertions.assertTrue(mxRecordSet.records().get(0).exchange().startsWith("mail.contoso-mail-exchange1.com")); return dnsZone; @@ -452,11 +456,11 @@ public void print(DnsZone dnsZone) { .append("\n\t\tTTL (seconds): ").append(txtRecordSet.timeToLive()) .append("\n\t\tRecords: "); for (TxtRecord txtRecord : txtRecordSet.records()) { - if (txtRecord.value().size() > 0) { + if (!txtRecord.value().isEmpty()) { info.append("\n\t\t\tValue: ").append(txtRecord.value().get(0)); } } } - System.out.println(info.toString()); + LOGGER.log(LogLevel.VERBOSE, () -> info.toString()); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestExpressRouteCircuit.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestExpressRouteCircuit.java index 8226a805d24f..6c0edc1c2499 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestExpressRouteCircuit.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestExpressRouteCircuit.java @@ -3,6 +3,8 @@ package com.azure.resourcemanager; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.network.models.ExpressRouteCircuit; import com.azure.resourcemanager.network.models.ExpressRouteCircuitSkuType; import com.azure.resourcemanager.network.models.ExpressRouteCircuits; @@ -13,6 +15,8 @@ /** Tests Express Route Circuit. */ public class TestExpressRouteCircuit { + private static final ClientLogger LOGGER = new ClientLogger(TestExpressRouteCircuit.class); + private String testId = ""; private static final Region REGION = Region.ASIA_SOUTHEAST; private String circuitName; @@ -54,7 +58,7 @@ public ExpressRouteCircuit updateResource(ExpressRouteCircuit resource) throws E .apply(); resource.refresh(); Assertions.assertTrue(resource.tags().containsKey("tag2")); - Assertions.assertTrue(!resource.tags().containsKey("tag1")); + Assertions.assertFalse(resource.tags().containsKey("tag1")); Assertions.assertEquals(Integer.valueOf(200), resource.serviceProviderProperties().bandwidthInMbps()); Assertions.assertEquals(ExpressRouteCircuitSkuType.PREMIUM_UNLIMITEDDATA, resource.sku()); @@ -131,18 +135,8 @@ public void print(ExpressRouteCircuit resource) { } private static void printExpressRouteCircuit(ExpressRouteCircuit resource) { - StringBuilder info = new StringBuilder(); - info - .append("Express Route Circuit: ") - .append(resource.id()) - .append("\n\tName: ") - .append(resource.name()) - .append("\n\tResource group: ") - .append(resource.resourceGroupName()) - .append("\n\tRegion: ") - .append(resource.regionName()) - .append("\n\tTags: ") - .append(resource.tags()); - System.out.println(info.toString()); + LOGGER.log(LogLevel.VERBOSE, () -> "Express Route Circuit: " + resource.id() + "\n\tName: " + resource.name() + + "\n\tResource group: " + resource.resourceGroupName() + "\n\tRegion: " + resource.regionName() + + "\n\tTags: " + resource.tags()); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestLoadBalancer.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestLoadBalancer.java index 867de9bf56c5..5683b621229c 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestLoadBalancer.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestLoadBalancer.java @@ -2,6 +2,8 @@ // Licensed under the MIT License. package com.azure.resourcemanager; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.compute.models.AvailabilitySet; import com.azure.resourcemanager.compute.models.AvailabilitySetSkuTypes; import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; @@ -45,6 +47,8 @@ /** Test of load balancer management. */ public class TestLoadBalancer { + private static final ClientLogger LOGGER = new ClientLogger(TestLoadBalancer.class); + String testId = ""; Region region = Region.US_WEST; String groupName = ""; @@ -367,10 +371,10 @@ public LoadBalancer updateResource(LoadBalancer resource) throws Exception { // Remove the NIC associations nic1.update().withoutLoadBalancerBackends().withoutLoadBalancerInboundNatRules().apply(); - Assertions.assertTrue(nic1.primaryIPConfiguration().listAssociatedLoadBalancerBackends().size() == 0); + Assertions.assertEquals(0, nic1.primaryIPConfiguration().listAssociatedLoadBalancerBackends().size()); nic2.update().withoutLoadBalancerBackends().withoutLoadBalancerInboundNatRules().apply(); - Assertions.assertTrue(nic2.primaryIPConfiguration().listAssociatedLoadBalancerBackends().size() == 0); + Assertions.assertEquals(0, nic2.primaryIPConfiguration().listAssociatedLoadBalancerBackends().size()); // Update the load balancer ensurePIPs(resource.manager().publicIpAddresses()); @@ -542,7 +546,7 @@ public LoadBalancer updateResource(LoadBalancer resource) throws Exception { // Verify backends Assertions.assertTrue(resource.backends().containsKey("backend2")); - Assertions.assertTrue(!resource.backends().containsKey(backend.name())); + Assertions.assertFalse(resource.backends().containsKey(backend.name())); // Verify NAT rules Assertions.assertTrue(resource.inboundNatRules().isEmpty()); @@ -705,7 +709,7 @@ public LoadBalancer updateResource(LoadBalancer resource) throws Exception { // Verify backends Assertions.assertEquals(1, resource.backends().size()); Assertions.assertTrue(resource.backends().containsKey("backend2")); - Assertions.assertTrue(!resource.backends().containsKey(backend.name())); + Assertions.assertFalse(resource.backends().containsKey(backend.name())); // Verify load balancing rules lbRule = resource.loadBalancingRules().get("lbrule1"); @@ -1023,23 +1027,18 @@ public LoadBalancer updateResource(LoadBalancer resource) throws Exception { } // Create VNet for the LB - private Map ensurePIPs(PublicIpAddresses pips) throws Exception { + private Map ensurePIPs(PublicIpAddresses pips) { List> creatablePips = new ArrayList<>(); - for (int i = 0; i < pipNames.length; i++) { - creatablePips - .add( - pips - .define(pipNames[i]) - .withRegion(region) - .withNewResourceGroup(groupName) - .withLeafDomainLabel(pipNames[i])); + for (String pipName : pipNames) { + creatablePips.add( + pips.define(pipName).withRegion(region).withNewResourceGroup(groupName).withLeafDomainLabel(pipName)); } return pips.create(creatablePips); } // Ensure VMs for the LB - private VirtualMachine[] ensureVMs(Networks networks, ComputeManager computeManager, int count) throws Exception { + private VirtualMachine[] ensureVMs(Networks networks, ComputeManager computeManager, int count) { // Create a network for the VMs Network network = networks @@ -1311,9 +1310,9 @@ static void printLB(LoadBalancer resource) { // Show assigned load balancing rules info .append("\n\t\t\tReferenced load balancing rules: ") - .append(new ArrayList(backend.loadBalancingRules().keySet())); + .append(new ArrayList<>(backend.loadBalancingRules().keySet())); } - System.out.println(info.toString()); + LOGGER.log(LogLevel.VERBOSE, info::toString); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestLocalNetworkGateway.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestLocalNetworkGateway.java index c8bf6a47f705..952f5b94bd8a 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestLocalNetworkGateway.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestLocalNetworkGateway.java @@ -2,6 +2,8 @@ // Licensed under the MIT License. package com.azure.resourcemanager; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.network.models.LocalNetworkGateway; import com.azure.resourcemanager.network.models.LocalNetworkGateways; import com.azure.core.management.Region; @@ -10,6 +12,8 @@ /** Tests Local Network Gateway. */ public class TestLocalNetworkGateway extends TestTemplate { + private static final ClientLogger LOGGER = new ClientLogger(TestLocalNetworkGateway.class); + private String testId = ""; private static final Region REGION = Region.US_NORTH_CENTRAL; private String groupName; @@ -51,7 +55,7 @@ public LocalNetworkGateway updateResource(LocalNetworkGateway gateway) throws Ex Assertions.assertFalse(gateway.addressSpaces().contains("192.168.3.0/24")); Assertions.assertEquals("40.71.184.216", gateway.ipAddress()); Assertions.assertTrue(gateway.tags().containsKey("tag2")); - Assertions.assertTrue(!gateway.tags().containsKey("tag1")); + Assertions.assertFalse(gateway.tags().containsKey("tag1")); gateway.updateTags().withoutTag("tag2").withTag("tag3", "value3").applyTags(); Assertions.assertFalse(gateway.tags().containsKey("tag2")); Assertions.assertEquals("value3", gateway.tags().get("tag3")); @@ -75,10 +79,10 @@ public void print(LocalNetworkGateway gateway) { if (!gateway.addressSpaces().isEmpty()) { info.append("\n\tAddress spaces:"); for (String addressSpace : gateway.addressSpaces()) { - info.append("\n\t\t" + addressSpace); + info.append("\n\t\t").append(addressSpace); } } info.append("\n\tTags: ").append(gateway.tags()); - System.out.println(info.toString()); + LOGGER.log(LogLevel.VERBOSE, info::toString); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNSG.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNSG.java index 912d39298b15..233d88f9c0ac 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNSG.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNSG.java @@ -2,6 +2,8 @@ // Licensed under the MIT License. package com.azure.resourcemanager; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.network.models.ApplicationSecurityGroup; import com.azure.resourcemanager.network.models.NetworkInterface; import com.azure.resourcemanager.network.models.NetworkSecurityGroup; @@ -17,6 +19,8 @@ /** Test for network security group CRUD. */ public class TestNSG extends TestTemplate { + private static final ClientLogger LOGGER = new ClientLogger(TestNSG.class); + @Override public NetworkSecurityGroup createResource(NetworkSecurityGroups nsgs) throws Exception { String postFix = nsgs.manager().resourceManager().internalContext().randomResourceName("", 8); @@ -61,7 +65,7 @@ public NetworkSecurityGroup createResource(NetworkSecurityGroups nsgs) throws Ex .createAsync(); resourceStream - .doOnSuccess((_ignore) -> System.out.print("completed")); + .doOnSuccess((_ignore) -> LOGGER.log(LogLevel.VERBOSE, () -> "completed")); NetworkSecurityGroup nsg = resourceStream.block(); @@ -80,8 +84,8 @@ public NetworkSecurityGroup createResource(NetworkSecurityGroups nsgs) throws Ex nsg.refresh(); // Verify - Assertions.assertTrue(nsg.region().equals(region)); - Assertions.assertTrue(nsg.securityRules().size() == 2); + Assertions.assertEquals(nsg.region(), region); + Assertions.assertEquals(2, nsg.securityRules().size()); // Confirm NIC association Assertions.assertEquals(1, nsg.networkInterfaceIds().size()); @@ -191,7 +195,7 @@ public static void printNSG(NetworkSecurityGroup resource) { // Output associated subnets info.append("\n\tAssociated subnets: "); List subnets = resource.listAssociatedSubnets(); - if (subnets == null || subnets.size() == 0) { + if (subnets == null || subnets.isEmpty()) { info.append("(None)"); } else { for (Subnet subnet : subnets) { @@ -203,7 +207,7 @@ public static void printNSG(NetworkSecurityGroup resource) { } } - System.out.println(info.toString()); + LOGGER.log(LogLevel.VERBOSE, info::toString); } @Override diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNetwork.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNetwork.java index 9cba6692de9f..61e2ca7f1120 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNetwork.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNetwork.java @@ -2,6 +2,8 @@ // Licensed under the MIT License. package com.azure.resourcemanager; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.network.models.Network; import com.azure.resourcemanager.network.models.NetworkPeering; import com.azure.resourcemanager.network.models.NetworkPeeringGatewayUse; @@ -23,6 +25,8 @@ /** Test of virtual network management. */ public class TestNetwork { + private static final ClientLogger LOGGER = new ClientLogger(TestNetwork.class); + /** Test of network with subnets. */ public class WithSubnets extends TestTemplate { @Override @@ -484,13 +488,13 @@ public static void printNetwork(Network resource) { // Output services with access Map> services = subnet.servicesWithAccess(); - if (services.size() > 0) { + if (!services.isEmpty()) { info.append("\n\tServices with access"); for (Map.Entry> service : services.entrySet()) { - info - .append("\n\t\tService: ") + info.append("\n\t\tService: ") .append(service.getKey()) - .append(" Regions: " + service.getValue() + ""); + .append(" Regions: ") + .append(service.getValue()); } } } @@ -512,6 +516,6 @@ public static void printNetwork(Network resource) { .append(peering.gatewayUse()); } - System.out.println(info.toString()); + LOGGER.log(LogLevel.VERBOSE, info::toString); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNetworkInterface.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNetworkInterface.java index e06d10395e17..49a9451b3333 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNetworkInterface.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNetworkInterface.java @@ -2,6 +2,8 @@ // Licensed under the MIT License. package com.azure.resourcemanager; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.network.models.LoadBalancerBackend; import com.azure.resourcemanager.network.models.LoadBalancerInboundNatRule; import com.azure.resourcemanager.network.models.Network; @@ -15,6 +17,8 @@ import org.junit.jupiter.api.Assertions; public class TestNetworkInterface extends TestTemplate { + private static final ClientLogger LOGGER = new ClientLogger(TestNetworkInterface.class); + @Override public NetworkInterface createResource(NetworkInterfaces networkInterfaces) throws Exception { @@ -199,7 +203,7 @@ public static void printNic(NetworkInterface resource) { } } - System.out.println(info.toString()); + LOGGER.log(LogLevel.VERBOSE, info::toString); } @Override diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNetworkWatcher.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNetworkWatcher.java index 1897af7112fa..27fe629849b1 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNetworkWatcher.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestNetworkWatcher.java @@ -3,6 +3,8 @@ package com.azure.resourcemanager; import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.compute.models.KnownLinuxVirtualMachineImage; import com.azure.resourcemanager.compute.models.VirtualMachine; import com.azure.resourcemanager.compute.models.VirtualMachineSizeTypes; @@ -28,6 +30,8 @@ /** Tests Network Watcher. */ public class TestNetworkWatcher extends TestTemplate { + private static final ClientLogger LOGGER = new ClientLogger(TestNetworkWatcher.class); + private String testId = ""; private static final Region REGION = Region.EUROPE_NORTH; private String groupName; @@ -169,19 +173,9 @@ StorageAccount ensureStorageAccount(StorageAccounts storageAccounts) { @Override public void print(NetworkWatcher nw) { - StringBuilder info = new StringBuilder(); - info - .append("Network Watcher: ") - .append(nw.id()) - .append("\n\tName: ") - .append(nw.name()) - .append("\n\tResource group: ") - .append(nw.resourceGroupName()) - .append("\n\tRegion: ") - .append(nw.regionName()) - .append("\n\tTags: ") - .append(nw.tags()); - System.out.println(info.toString()); + LOGGER.log(LogLevel.VERBOSE, () -> "Network Watcher: " + nw.id() + "\n\tName: " + nw.name() + + "\n\tResource group: " + nw.resourceGroupName() + "\n\tRegion: " + nw.regionName() + "\n\tTags: " + + nw.tags()); } public String groupName() { diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestPrivateDns.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestPrivateDns.java index c31fdd62a87e..01ae80cd352f 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestPrivateDns.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestPrivateDns.java @@ -3,6 +3,8 @@ package com.azure.resourcemanager; import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.privatedns.models.ARecordSet; import com.azure.resourcemanager.privatedns.models.AaaaRecordSet; import com.azure.resourcemanager.privatedns.models.CnameRecordSet; @@ -32,6 +34,8 @@ import static com.azure.resourcemanager.privatedns.models.RecordType.TXT; public class TestPrivateDns extends TestTemplate { + private static final ClientLogger LOGGER = new ClientLogger(TestPrivateDns.class); + @Override public PrivateDnsZone createResource(PrivateDnsZones resources) throws Exception { final Region region = Region.US_EAST; @@ -84,7 +88,7 @@ public PrivateDnsZone createResource(PrivateDnsZones resources) throws Exception // Check Dns zone properties Assertions.assertTrue(resource.name().startsWith(topLevelDomain)); - Assertions.assertTrue(resource.tags().size() == 2); + Assertions.assertEquals(2, resource.tags().size()); // Check SOA record - external child resource (created by default) SoaRecordSet soaRecordSet = resource.getSoaRecordSet(); @@ -97,23 +101,23 @@ public PrivateDnsZone createResource(PrivateDnsZones resources) throws Exception // Check A records PagedIterable aRecordSets = resource.aRecordSets().list(); - Assertions.assertTrue(aRecordSets.stream().count() == 1); - Assertions.assertTrue(aRecordSets.iterator().next().timeToLive() == 7200); + Assertions.assertEquals(1, aRecordSets.stream().count()); + Assertions.assertEquals(7200, aRecordSets.iterator().next().timeToLive()); // Check AAAA records PagedIterable aaaaRecordSets = resource.aaaaRecordSets().list(); - Assertions.assertTrue(aaaaRecordSets.stream().count() == 1); + Assertions.assertEquals(1, aaaaRecordSets.stream().count()); Assertions.assertTrue(aaaaRecordSets.iterator().next().name().startsWith("www")); - Assertions.assertTrue(aaaaRecordSets.iterator().next().ipv6Addresses().size() == 2); + Assertions.assertEquals(2, aaaaRecordSets.iterator().next().ipv6Addresses().size()); // Check MX records PagedIterable mxRecordSets = resource.mxRecordSets().list(); - Assertions.assertTrue(mxRecordSets.stream().count() == 1); + Assertions.assertEquals(1, mxRecordSets.stream().count()); MxRecordSet mxRecordSet = mxRecordSets.iterator().next(); Assertions.assertNotNull(mxRecordSet); Assertions.assertTrue(mxRecordSet.name().startsWith("email")); - Assertions.assertTrue(mxRecordSet.metadata().size() == 2); - Assertions.assertTrue(mxRecordSet.records().size() == 2); + Assertions.assertEquals(2, mxRecordSet.metadata().size()); + Assertions.assertEquals(2, mxRecordSet.records().size()); for (MxRecord mxRecord : mxRecordSet.records()) { Assertions.assertTrue(mxRecord.exchange().startsWith("mail.contoso-mail-exchange1.com") || mxRecord.exchange().startsWith("mail.contoso-mail-exchange2.com")); @@ -123,19 +127,19 @@ public PrivateDnsZone createResource(PrivateDnsZones resources) throws Exception // Check TXT records PagedIterable txtRecordSets = resource.txtRecordSets().list(); - Assertions.assertTrue(txtRecordSets.stream().count() == 2); + Assertions.assertEquals(2, txtRecordSets.stream().count()); // Check SRV records PagedIterable srvRecordSets = resource.srvRecordSets().list(); - Assertions.assertTrue(srvRecordSets.stream().count() == 1); + Assertions.assertEquals(1, srvRecordSets.stream().count()); // Check PTR records PagedIterable ptrRecordSets = resource.ptrRecordSets().list(); - Assertions.assertTrue(ptrRecordSets.stream().count() == 2); + Assertions.assertEquals(2, ptrRecordSets.stream().count()); // Check CNAME records PagedIterable cnameRecordSets = resource.cnameRecordSets().list(); - Assertions.assertTrue(cnameRecordSets.stream().count() == 2); + Assertions.assertEquals(2, cnameRecordSets.stream().count()); // Check Generic record set listing PagedIterable recordSets = resource.listRecordSets(); @@ -195,14 +199,14 @@ public PrivateDnsZone createResource(PrivateDnsZones resources) throws Exception Assertions.assertNotNull(recordSet); } } - Assertions.assertTrue(typeToCount.get(SOA) == 1); - Assertions.assertTrue(typeToCount.get(RecordType.A) == 1); - Assertions.assertTrue(typeToCount.get(AAAA) == 1); - Assertions.assertTrue(typeToCount.get(MX) == 1); - Assertions.assertTrue(typeToCount.get(TXT) == 2); - Assertions.assertTrue(typeToCount.get(SRV) == 1); - Assertions.assertTrue(typeToCount.get(PTR) == 2); - Assertions.assertTrue(typeToCount.get(RecordType.CNAME) == 2); + Assertions.assertEquals(1, (int) typeToCount.get(SOA)); + Assertions.assertEquals(1, (int) typeToCount.get(RecordType.A)); + Assertions.assertEquals(1, (int) typeToCount.get(AAAA)); + Assertions.assertEquals(1, (int) typeToCount.get(MX)); + Assertions.assertEquals(2, (int) typeToCount.get(TXT)); + Assertions.assertEquals(1, (int) typeToCount.get(SRV)); + Assertions.assertEquals(2, (int) typeToCount.get(PTR)); + Assertions.assertEquals(2, (int) typeToCount.get(RecordType.CNAME)); return resource; } @@ -254,9 +258,9 @@ public PrivateDnsZone updateResource(PrivateDnsZone resource) throws Exception { // Check SRV records PagedIterable srvRecordSets = resource.srvRecordSets().list(); - Assertions.assertTrue(srvRecordSets.stream().count() == 1); + Assertions.assertEquals(1, srvRecordSets.stream().count()); SrvRecordSet srvRecordSet = srvRecordSets.iterator().next(); - Assertions.assertTrue(srvRecordSet.records().size() == 4); + Assertions.assertEquals(4, srvRecordSet.records().size()); for (SrvRecord srvRecord : srvRecordSet.records()) { Assertions.assertFalse(srvRecord.target().startsWith("bigbox.contoso-service.com")); } @@ -267,11 +271,11 @@ public PrivateDnsZone updateResource(PrivateDnsZone resource) throws Exception { SoaRecord soaRecord = soaRecordSet.record(); Assertions.assertNotNull(soaRecord); Assertions.assertEquals(soaRecord.minimumTtl(), Long.valueOf(600)); - Assertions.assertTrue(soaRecordSet.timeToLive() == 7200); + Assertions.assertEquals(7200, soaRecordSet.timeToLive()); // Check MX records PagedIterable mxRecordSets = resource.mxRecordSets().list(); - Assertions.assertTrue(mxRecordSets.stream().count() == 2); + Assertions.assertEquals(2, mxRecordSets.stream().count()); resource.update() .updateMxRecordSet("email") @@ -283,11 +287,11 @@ public PrivateDnsZone updateResource(PrivateDnsZone resource) throws Exception { .withTag("d", "dd") .apply(); - Assertions.assertTrue(resource.tags().size() == 3); + Assertions.assertEquals(3, resource.tags().size()); // Check "mail" MX record MxRecordSet mxRecordSet = resource.mxRecordSets().getByName("email"); - Assertions.assertTrue(mxRecordSet.records().size() == 1); - Assertions.assertTrue(mxRecordSet.metadata().size() == 3); + Assertions.assertEquals(1, mxRecordSet.records().size()); + Assertions.assertEquals(3, mxRecordSet.metadata().size()); Assertions.assertTrue(mxRecordSet.records().get(0).exchange().startsWith("mail.contoso-mail-exchange1.com")); return resource; @@ -399,11 +403,11 @@ public void print(PrivateDnsZone resource) { .append("\n\t\tTTL (seconds): ").append(txtRecordSet.timeToLive()) .append("\n\t\tRecords: "); for (TxtRecord txtRecord : txtRecordSet.records()) { - if (txtRecord.value().size() > 0) { + if (!txtRecord.value().isEmpty()) { info.append("\n\t\t\tValue: ").append(txtRecord.value().get(0)); } } } - System.out.println(info.toString()); + LOGGER.log(LogLevel.VERBOSE, info::toString); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestPublicIPAddress.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestPublicIPAddress.java index 0d0b58b9436d..bcea20410bed 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestPublicIPAddress.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestPublicIPAddress.java @@ -2,6 +2,8 @@ // Licensed under the MIT License. package com.azure.resourcemanager; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.network.models.LoadBalancer; import com.azure.resourcemanager.network.models.LoadBalancerPublicFrontend; import com.azure.resourcemanager.network.models.NetworkInterface; @@ -13,6 +15,8 @@ /** Tests public IPs. */ public class TestPublicIPAddress extends TestTemplate { + private static final ClientLogger LOGGER = new ClientLogger(TestPublicIPAddress.class); + @Override public PublicIpAddress createResource(PublicIpAddresses pips) throws Exception { final String newPipName = pips.manager().resourceManager().internalContext().randomResourceName("pip", 10); @@ -44,7 +48,7 @@ public PublicIpAddress updateResource(PublicIpAddress resource) throws Exception .withTag("tag2", "value2") .apply(); Assertions.assertTrue(resource.leafDomainLabel().equalsIgnoreCase(updatedDnsName)); - Assertions.assertTrue(resource.idleTimeoutInMinutes() == updatedIdleTimeout); + Assertions.assertEquals(updatedIdleTimeout, resource.idleTimeoutInMinutes()); Assertions.assertEquals("value2", resource.tags().get("tag2")); resource.updateTags().withoutTag("tag1").withTag("tag3", "value3").applyTags(); @@ -114,6 +118,6 @@ public static void printPIP(PublicIpAddress resource) { info.append("(None)"); } - System.out.println(info.toString()); + LOGGER.log(LogLevel.VERBOSE, info::toString); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestPublicIPPrefix.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestPublicIPPrefix.java index 645230b91671..c0d30fe6f0bb 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestPublicIPPrefix.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestPublicIPPrefix.java @@ -3,6 +3,8 @@ package com.azure.resourcemanager; import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.network.models.IpVersion; import com.azure.resourcemanager.network.models.PublicIpPrefix; import com.azure.resourcemanager.network.models.PublicIpPrefixSku; @@ -13,6 +15,8 @@ /** Tests public Prefixes. */ public class TestPublicIPPrefix extends TestTemplate { + private static final ClientLogger LOGGER = new ClientLogger(TestPublicIPPrefix.class); + @Override public PublicIpPrefix createResource(PublicIpPrefixes pips) throws Exception { final String newPipName = pips.manager().resourceManager().internalContext().randomResourceName("pip", 10); @@ -26,7 +30,7 @@ public PublicIpPrefix createResource(PublicIpPrefixes pips) throws Exception { Assertions.assertEquals(pip.prefixLength(), (Integer) 28); Assertions.assertEquals(pip.sku().name().toString(), "Standard"); - Assertions.assertTrue(pip.publicIpAddressVersion() == IpVersion.IPV4); + Assertions.assertSame(pip.publicIpAddressVersion(), IpVersion.IPV4); return pip; } @@ -67,6 +71,6 @@ public static void printPIP(PublicIpPrefix resource) { info.append("(None)"); } - System.out.println(info.toString()); + LOGGER.log(LogLevel.VERBOSE, info::toString); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestRedis.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestRedis.java index 6bdc52bdad11..e2030b9d1324 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestRedis.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestRedis.java @@ -3,6 +3,8 @@ package com.azure.resourcemanager; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.redis.models.RedisCache; import com.azure.resourcemanager.redis.models.RedisCaches; import com.azure.core.management.Region; @@ -10,6 +12,8 @@ import reactor.core.publisher.Mono; public class TestRedis extends TestTemplate { + private static final ClientLogger LOGGER = new ClientLogger(TestRedis.class); + @Override public RedisCache createResource(RedisCaches resources) throws Exception { final String redisName = resources.manager().resourceManager().internalContext().randomResourceName("redis", 10); @@ -43,6 +47,6 @@ public RedisCache updateResource(RedisCache resource) throws Exception { @Override public void print(RedisCache resource) { - System.out.println("Redis Cache: " + resource.id() + ", Name: " + resource.name()); + LOGGER.log(LogLevel.VERBOSE, () -> "Redis Cache: " + resource.id() + ", Name: " + resource.name()); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestRouteTables.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestRouteTables.java index 551f63d06731..1ea70731a0ea 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestRouteTables.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestRouteTables.java @@ -2,6 +2,8 @@ // Licensed under the MIT License. package com.azure.resourcemanager; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.network.models.Route; import com.azure.resourcemanager.network.models.RouteNextHopType; import com.azure.resourcemanager.network.models.RouteTable; @@ -15,6 +17,8 @@ /** Test of virtual network management. */ public class TestRouteTables { + private static final ClientLogger LOGGER = new ClientLogger(TestRouteTables.class); + private String route1Name = "route1"; private String route2Name = "route2"; private String routeAddedName = "route3"; @@ -58,13 +62,13 @@ public RouteTable createResource(RouteTables routeTables) throws Exception { Route route1 = routeTable.routes().get(route1Name); Assertions.assertTrue(route1.destinationAddressPrefix().equalsIgnoreCase(route1AddressPrefix)); Assertions.assertTrue(route1.nextHopIpAddress().equalsIgnoreCase(virtualApplianceIp)); - Assertions.assertTrue(route1.nextHopType().equals(RouteNextHopType.VIRTUAL_APPLIANCE)); + Assertions.assertEquals(route1.nextHopType(), RouteNextHopType.VIRTUAL_APPLIANCE); Assertions.assertTrue(routeTable.routes().containsKey(route2Name)); Route route2 = routeTable.routes().get(route2Name); Assertions.assertTrue(route2.destinationAddressPrefix().equalsIgnoreCase(route2AddressPrefix)); - Assertions.assertTrue(route2.nextHopIpAddress() == null); - Assertions.assertTrue(route2.nextHopType().equals(hopType)); + Assertions.assertNull(route2.nextHopIpAddress()); + Assertions.assertEquals(route2.nextHopType(), hopType); Assertions.assertTrue(routeTable.isBgpRoutePropagationDisabled()); @@ -83,7 +87,7 @@ public RouteTable createResource(RouteTables routeTables) throws Exception { .create(); List subnets = routeTable.refresh().listAssociatedSubnets(); - Assertions.assertTrue(subnets.size() == 1); + Assertions.assertEquals(1, subnets.size()); Assertions.assertTrue(subnets.get(0).routeTableId().equalsIgnoreCase(routeTable.id())); return routeTable; } @@ -110,7 +114,7 @@ public RouteTable updateResource(RouteTable routeTable) throws Exception { Assertions.assertTrue(routeTable.tags().containsKey("tag1")); Assertions.assertTrue(routeTable.tags().containsKey("tag2")); - Assertions.assertTrue(!routeTable.routes().containsKey(route1Name)); + Assertions.assertFalse(routeTable.routes().containsKey(route1Name)); Assertions.assertTrue(routeTable.routes().containsKey(route2Name)); Assertions.assertTrue(routeTable.routes().containsKey(routeAddedName)); Assertions.assertFalse(routeTable.isBgpRoutePropagationDisabled()); @@ -126,7 +130,7 @@ public RouteTable updateResource(RouteTable routeTable) throws Exception { .apply(); List subnets = routeTable.refresh().listAssociatedSubnets(); - Assertions.assertTrue(subnets.size() == 0); + Assertions.assertEquals(0, subnets.size()); routeTable.updateTags().withoutTag("tag1").withTag("tag3", "value3").applyTags(); Assertions.assertFalse(routeTable.tags().containsKey("tag1")); @@ -189,6 +193,6 @@ public static void printRouteTable(RouteTable resource) { .append(subnet.routeTableId()); } info.append("\n\tDisable BGP route propagation: ").append(resource.isBgpRoutePropagationDisabled()); - System.out.println(info.toString()); + LOGGER.log(LogLevel.VERBOSE, info::toString); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestSearchService.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestSearchService.java index d7cda788cbb8..ef6b4a52d942 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestSearchService.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestSearchService.java @@ -5,6 +5,8 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.Region; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.search.models.AdminKeyKind; import com.azure.resourcemanager.search.models.AdminKeys; import com.azure.resourcemanager.search.models.QueryKey; @@ -15,6 +17,7 @@ import org.junit.jupiter.api.Assertions; public class TestSearchService { + private static final ClientLogger LOGGER = new ClientLogger(TestSearchService.class); /** * Search service test. @@ -61,7 +64,7 @@ public SearchService updateResource(SearchService resource) throws Exception { .withPartitionCount(1) .apply(); Assertions.assertTrue(resource.tags().containsKey("tag2")); - Assertions.assertTrue(!resource.tags().containsKey("tag1")); + Assertions.assertFalse(resource.tags().containsKey("tag1")); Assertions.assertEquals(1, resource.replicaCount()); Assertions.assertEquals(1, resource.partitionCount()); Assertions.assertEquals(2, TestUtilities.getSize(resource.listQueryKeys())); @@ -117,7 +120,7 @@ public SearchService updateResource(SearchService resource) throws Exception { .withoutTag("tag1") .apply(); Assertions.assertTrue(resource.tags().containsKey("tag2")); - Assertions.assertTrue(!resource.tags().containsKey("tag1")); + Assertions.assertFalse(resource.tags().containsKey("tag1")); return resource; } @@ -158,7 +161,7 @@ public SearchService updateResource(SearchService resource) throws Exception { .withoutTag("tag1") .apply(); Assertions.assertTrue(resource.tags().containsKey("tag2")); - Assertions.assertTrue(!resource.tags().containsKey("tag1")); + Assertions.assertFalse(resource.tags().containsKey("tag1")); return resource; } @@ -202,7 +205,7 @@ public SearchService updateResource(SearchService resource) throws Exception { .withoutTag("tag1") .apply(); Assertions.assertTrue(resource.tags().containsKey("tag2")); - Assertions.assertTrue(!resource.tags().containsKey("tag1")); + Assertions.assertFalse(resource.tags().containsKey("tag1")); Assertions.assertEquals(SkuName.STANDARD, resource.sku().name()); Assertions.assertEquals(1, resource.replicaCount()); Assertions.assertEquals(1, resource.partitionCount()); @@ -247,7 +250,7 @@ public static void print(SearchService resource, String header) { stringBuilder.append("\n\t Key value: ").append(queryKey.key()); } - System.out.println(stringBuilder); + LOGGER.log(LogLevel.VERBOSE, stringBuilder::toString); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestTemplate.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestTemplate.java index bb847d6b08d6..0f0035d66adc 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestTemplate.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestTemplate.java @@ -4,6 +4,8 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.resources.fluentcore.arm.Manager; import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; @@ -23,12 +25,13 @@ * @param Top level resource type * @param Type representing the collection of the top level resources */ -public abstract class TestTemplate< - ResourceT extends GroupableResource, ?>, +public abstract class TestTemplate, ?>, CollectionT extends SupportsListing & SupportsGettingByResourceGroup & SupportsDeletingById & SupportsGettingById & HasManager> { + private static final ClientLogger LOGGER = new ClientLogger(TestTemplate.class); + private ResourceT resource; private CollectionT collection; private ResourceGroups resourceGroups; @@ -64,7 +67,7 @@ protected TestTemplate() { public int verifyListing() throws ManagementException, IOException { PagedIterable resources = this.collection.list(); for (ResourceT r : resources) { - System.out.println("resource id: " + r.id()); + LOGGER.log(LogLevel.VERBOSE, () -> "resource id: " + r.id()); } return TestUtilities.getSize(resources); } @@ -118,7 +121,7 @@ public void runTest(CollectionT collection, ResourceGroups resourceGroups) throw // Verify creation this.resource = createResource(collection); - System.out.println("\n------------\nAfter creation:\n"); + LOGGER.log(LogLevel.VERBOSE, () -> "\n------------\nAfter creation:\n"); print(this.resource); // Verify listing @@ -127,7 +130,7 @@ public void runTest(CollectionT collection, ResourceGroups resourceGroups) throw // Verify getting this.resource = verifyGetting(); Assertions.assertNotNull(this.resource); - System.out.println("\n------------\nRetrieved resource:\n"); + LOGGER.log(LogLevel.VERBOSE, () -> "\n------------\nRetrieved resource:\n"); print(this.resource); boolean failedUpdate = false; @@ -136,11 +139,11 @@ public void runTest(CollectionT collection, ResourceGroups resourceGroups) throw try { this.resource = updateResource(this.resource); Assertions.assertNotNull(this.resource); - System.out.println("\n------------\nUpdated resource:\n"); + LOGGER.log(LogLevel.VERBOSE, () -> "\n------------\nUpdated resource:\n"); message = "Print failed"; print(this.resource); } catch (Exception e) { - e.printStackTrace(); + LOGGER.log(LogLevel.VERBOSE, () -> "Update failed", e); failedUpdate = true; } @@ -150,7 +153,7 @@ public void runTest(CollectionT collection, ResourceGroups resourceGroups) throw message = "Delete failed"; verifyDeleting(); } catch (Exception e) { - e.printStackTrace(); + LOGGER.log(LogLevel.VERBOSE, () -> "Delete failed", e); failedDelete = true; } Assertions.assertFalse(failedUpdate, message); diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestTrafficManager.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestTrafficManager.java index f0d9816d8828..71dc35953141 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestTrafficManager.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestTrafficManager.java @@ -3,6 +3,8 @@ package com.azure.resourcemanager; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.network.models.PublicIpAddress; import com.azure.resourcemanager.network.models.PublicIpAddresses; import com.azure.core.management.Region; @@ -19,6 +21,7 @@ /** Test of traffic manager management. */ public class TestTrafficManager extends TestTemplate { + private static final ClientLogger LOGGER = new ClientLogger(TestTrafficManager.class); private final PublicIpAddresses publicIpAddresses; @@ -405,6 +408,6 @@ public void print(TrafficManagerProfile profile) { .append(endpoint.routingWeight()); } } - System.out.println(info.toString()); + LOGGER.log(LogLevel.VERBOSE, info::toString); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestUtils.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestUtils.java index 85091cc9ec6b..d9a0908fb063 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestUtils.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestUtils.java @@ -4,12 +4,16 @@ package com.azure.resourcemanager; import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.compute.models.DataDisk; import com.azure.resourcemanager.compute.models.VirtualMachine; import com.azure.resourcemanager.resources.models.ManagementLock; /** Test utilities. */ public final class TestUtils { + private static final ClientLogger LOGGER = new ClientLogger(TestUtils.class); + private TestUtils() { } @@ -22,11 +26,11 @@ public static boolean isRecordMode() { } public static void print(ManagementLock lock) { - StringBuffer info = new StringBuffer(); + StringBuilder info = new StringBuilder(); info.append("\nLock ID: ").append(lock.id()) .append("\nLocked resource ID: ").append(lock.lockedResourceId()) .append("\nLevel: ").append(lock.level()); - System.out.println(info.toString()); + LOGGER.log(LogLevel.VERBOSE, info::toString); } /** @@ -120,26 +124,9 @@ public static void print(VirtualMachine resource) { networkProfile.append("\n\t\tId:").append(networkInterfaceId); } - System - .out - .println( - new StringBuilder() - .append("Virtual Machine: ") - .append(resource.id()) - .append("Name: ") - .append(resource.name()) - .append("\n\tResource group: ") - .append(resource.resourceGroupName()) - .append("\n\tRegion: ") - .append(resource.region()) - .append("\n\tTags: ") - .append(resource.tags()) - .append("\n\tHardwareProfile: ") - .append("\n\t\tSize: ") - .append(resource.size()) - .append(storageProfile) - .append(osProfile) - .append(networkProfile) - .toString()); + LOGGER.log(LogLevel.VERBOSE, () -> "Virtual Machine: " + resource.id() + "Name: " + resource.name() + + "\n\tResource group: " + resource.resourceGroupName() + "\n\tRegion: " + resource.region() + "\n\tTags: " + + resource.tags() + "\n\tHardwareProfile: " + "\n\t\tSize: " + resource.size() + storageProfile + osProfile + + networkProfile); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualNetworkGateway.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualNetworkGateway.java index b2f9099c59d8..68448d74db77 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualNetworkGateway.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/TestVirtualNetworkGateway.java @@ -3,6 +3,8 @@ package com.azure.resourcemanager; import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.resourcemanager.network.NetworkManager; import com.azure.resourcemanager.network.models.LocalNetworkGateway; import com.azure.resourcemanager.network.models.Network; @@ -27,6 +29,8 @@ /** Tests Virtual Network Gateway. */ public class TestVirtualNetworkGateway { + private static final ClientLogger LOGGER = new ClientLogger(TestVirtualNetworkGateway.class); + private String testId = ""; private Region region = Region.US_NORTH_CENTRAL; private String groupName; @@ -324,7 +328,7 @@ certificateName, new File(getClass().getClassLoader().getResource(certificateNam // contains credential in the profile string String profile = vngw1.generateVpnProfile(); - System.out.println(profile); + LOGGER.log(LogLevel.VERBOSE, () -> profile); return vngw1; } @@ -359,6 +363,6 @@ static void printVirtualNetworkGateway(VirtualNetworkGateway gateway) { .append(gateway.regionName()) .append("\n\tTags: ") .append(gateway.tags()); - System.out.println(info.toString()); + LOGGER.log(LogLevel.VERBOSE, info::toString); } } diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index 6eb9e26cea40..c48fcced8334 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 11.7.0-beta.3 (Unreleased) +## 11.7.0-beta.4 (Unreleased) ### Features Added @@ -10,6 +10,27 @@ ### Other Changes +## 11.7.0-beta.3 (2024-05-07) + +### Features Added + +- Added support for `Byte[]` and `List` in `FieldBuilder` +- Added support for `HybridSearch` +- Index models added: `AIServicesVisionParameters`, `AIServicesVisionVectorizer`, `AIStudioModelCatalogName`, + `AzureMachineLearningParameters`, `AzureMachineLearningVectorizer`, `AzureOpenAIModelName`, `VectorEncodingFormat`, + `VisionVectorizeSkill` +- Search models added: `HybridCountAndFacetMode`, `HybridSearch`, `SearchScoreThreshold`, `VectorSimilarityThreshold`, + `VectorThreshold`, `VectorThresholdKind`, `VectorizableImageBinaryQuery`, `VectorizableImageUrlQuery` + +### Other Changes + +- Sample added for creating a vector fields index with reduced dimensions. + +#### Dependency Updates + +- Upgraded `azure-core` from `1.48.0` to version `1.49.0`. +- Upgraded `azure-core-http-netty` from `1.14.2` to version `1.15.0`. +- Upgraded `azure-core-serializer-json-jackson` from `1.4.11` to version `1.4.12`. ## 11.6.4 (2024-04-23) diff --git a/sdk/search/azure-search-documents/README.md b/sdk/search/azure-search-documents/README.md index be283cdbff32..c54420328ded 100644 --- a/sdk/search/azure-search-documents/README.md +++ b/sdk/search/azure-search-documents/README.md @@ -75,7 +75,7 @@ add the direct dependency to your project as follows. com.azure azure-search-documents - 11.7.0-beta.2 + 11.7.0-beta.3 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/search/azure-search-documents/pom.xml b/sdk/search/azure-search-documents/pom.xml index 974db62b9f51..55d68a917965 100644 --- a/sdk/search/azure-search-documents/pom.xml +++ b/sdk/search/azure-search-documents/pom.xml @@ -16,7 +16,7 @@ com.azure azure-search-documents - 11.7.0-beta.3 + 11.7.0-beta.4 jar @@ -103,6 +103,11 @@ 1.12.1 test + + com.azure + azure-ai-openai + 1.0.0-beta.8 + org.junit.jupiter junit-jupiter-api diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/FieldBuilder.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/FieldBuilder.java index 47680fb5bf86..27b62030f428 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/FieldBuilder.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/FieldBuilder.java @@ -54,6 +54,7 @@ public final class FieldBuilder { private static final int MAX_DEPTH = 10000; private static final Map SUPPORTED_NONE_PARAMETERIZED_TYPE = new HashMap<>(); private static final Set UNSUPPORTED_TYPES = new HashSet<>(); + private static final Set UNSUPPORTED_SERVICE_TYPES = new HashSet<>(); private static final SearchFieldDataType COLLECTION_STRING = SearchFieldDataType.collection(SearchFieldDataType.STRING); @@ -83,6 +84,7 @@ public final class FieldBuilder { SUPPORTED_NONE_PARAMETERIZED_TYPE.put(Byte.class, SearchFieldDataType.SBYTE); SUPPORTED_NONE_PARAMETERIZED_TYPE.put(short.class, SearchFieldDataType.INT16); SUPPORTED_NONE_PARAMETERIZED_TYPE.put(Short.class, SearchFieldDataType.INT16); + UNSUPPORTED_SERVICE_TYPES.add(SearchFieldDataType.BYTE); } /** diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AMLParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningParameters.java similarity index 79% rename from sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AMLParameters.java rename to sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningParameters.java index bce09e0d1505..a27e14a17c3f 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AMLParameters.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningParameters.java @@ -19,7 +19,7 @@ * Specifies the properties for connecting to an AML vectorizer. */ @Fluent -public final class AMLParameters implements JsonSerializable { +public final class AzureMachineLearningParameters implements JsonSerializable { /* * (Required for no authentication or key authentication) The scoring URI of the AML service to which the JSON * payload will be sent. Only the https URI scheme is allowed. @@ -55,11 +55,11 @@ public final class AMLParameters implements JsonSerializable { private AIStudioModelCatalogName modelName; /** - * Creates an instance of AMLParameters class. + * Creates an instance of AzureMachineLearningParameters class. * * @param scoringUri the scoringUri value to set. */ - public AMLParameters(String scoringUri) { + public AzureMachineLearningParameters(String scoringUri) { this.scoringUri = scoringUri; } @@ -86,9 +86,9 @@ public String getAuthenticationKey() { * Set the authenticationKey property: (Required for key authentication) The key for the AML service. * * @param authenticationKey the authenticationKey value to set. - * @return the AMLParameters object itself. + * @return the AzureMachineLearningParameters object itself. */ - public AMLParameters setAuthenticationKey(String authenticationKey) { + public AzureMachineLearningParameters setAuthenticationKey(String authenticationKey) { this.authenticationKey = authenticationKey; return this; } @@ -110,9 +110,9 @@ public String getResourceId() { * subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.MachineLearningServices/workspaces/{workspace-name}/services/{service_name}. * * @param resourceId the resourceId value to set. - * @return the AMLParameters object itself. + * @return the AzureMachineLearningParameters object itself. */ - public AMLParameters setResourceId(String resourceId) { + public AzureMachineLearningParameters setResourceId(String resourceId) { this.resourceId = resourceId; return this; } @@ -132,9 +132,9 @@ public Duration getTimeout() { * call. * * @param timeout the timeout value to set. - * @return the AMLParameters object itself. + * @return the AzureMachineLearningParameters object itself. */ - public AMLParameters setTimeout(Duration timeout) { + public AzureMachineLearningParameters setTimeout(Duration timeout) { this.timeout = timeout; return this; } @@ -152,9 +152,9 @@ public String getRegion() { * Set the region property: (Optional for token authentication). The region the AML service is deployed in. * * @param region the region value to set. - * @return the AMLParameters object itself. + * @return the AzureMachineLearningParameters object itself. */ - public AMLParameters setRegion(String region) { + public AzureMachineLearningParameters setRegion(String region) { this.region = region; return this; } @@ -174,9 +174,9 @@ public AIStudioModelCatalogName getModelName() { * the provided endpoint. * * @param modelName the modelName value to set. - * @return the AMLParameters object itself. + * @return the AzureMachineLearningParameters object itself. */ - public AMLParameters setModelName(AIStudioModelCatalogName modelName) { + public AzureMachineLearningParameters setModelName(AIStudioModelCatalogName modelName) { this.modelName = modelName; return this; } @@ -194,15 +194,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of AMLParameters from the JsonReader. + * Reads an instance of AzureMachineLearningParameters from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of AMLParameters if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. + * @return An instance of AzureMachineLearningParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AMLParameters. + * @throws IOException If an error occurs while reading the AzureMachineLearningParameters. */ - public static AMLParameters fromJson(JsonReader jsonReader) throws IOException { + public static AzureMachineLearningParameters fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { boolean scoringUriFound = false; String scoringUri = null; @@ -233,14 +233,15 @@ public static AMLParameters fromJson(JsonReader jsonReader) throws IOException { } } if (scoringUriFound) { - AMLParameters deserializedAMLParameters = new AMLParameters(scoringUri); - deserializedAMLParameters.authenticationKey = authenticationKey; - deserializedAMLParameters.resourceId = resourceId; - deserializedAMLParameters.timeout = timeout; - deserializedAMLParameters.region = region; - deserializedAMLParameters.modelName = modelName; - - return deserializedAMLParameters; + AzureMachineLearningParameters deserializedAzureMachineLearningParameters + = new AzureMachineLearningParameters(scoringUri); + deserializedAzureMachineLearningParameters.authenticationKey = authenticationKey; + deserializedAzureMachineLearningParameters.resourceId = resourceId; + deserializedAzureMachineLearningParameters.timeout = timeout; + deserializedAzureMachineLearningParameters.region = region; + deserializedAzureMachineLearningParameters.modelName = modelName; + + return deserializedAzureMachineLearningParameters; } throw new IllegalStateException("Missing required property: uri"); }); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AMLVectorizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningVectorizer.java similarity index 69% rename from sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AMLVectorizer.java rename to sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningVectorizer.java index 505a34a8d926..301ad886d438 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AMLVectorizer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningVectorizer.java @@ -17,18 +17,18 @@ * vector embedding of a query string. */ @Fluent -public final class AMLVectorizer extends VectorSearchVectorizer { +public final class AzureMachineLearningVectorizer extends VectorSearchVectorizer { /* * Specifies the properties of the AML vectorizer. */ - private AMLParameters aMLParameters; + private AzureMachineLearningParameters aMLParameters; /** - * Creates an instance of AMLVectorizer class. + * Creates an instance of AzureMachineLearningVectorizer class. * * @param name the name value to set. */ - public AMLVectorizer(String name) { + public AzureMachineLearningVectorizer(String name) { super(name); } @@ -37,7 +37,7 @@ public AMLVectorizer(String name) { * * @return the aMLParameters value. */ - public AMLParameters getAMLParameters() { + public AzureMachineLearningParameters getAMLParameters() { return this.aMLParameters; } @@ -45,9 +45,9 @@ public AMLParameters getAMLParameters() { * Set the aMLParameters property: Specifies the properties of the AML vectorizer. * * @param aMLParameters the aMLParameters value to set. - * @return the AMLVectorizer object itself. + * @return the AzureMachineLearningVectorizer object itself. */ - public AMLVectorizer setAMLParameters(AMLParameters aMLParameters) { + public AzureMachineLearningVectorizer setAMLParameters(AzureMachineLearningParameters aMLParameters) { this.aMLParameters = aMLParameters; return this; } @@ -63,20 +63,20 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of AMLVectorizer from the JsonReader. + * Reads an instance of AzureMachineLearningVectorizer from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of AMLVectorizer if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. + * @return An instance of AzureMachineLearningVectorizer if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. * @throws IllegalStateException If the deserialized JSON object was missing any required properties or the * polymorphic discriminator. - * @throws IOException If an error occurs while reading the AMLVectorizer. + * @throws IOException If an error occurs while reading the AzureMachineLearningVectorizer. */ - public static AMLVectorizer fromJson(JsonReader jsonReader) throws IOException { + public static AzureMachineLearningVectorizer fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { boolean nameFound = false; String name = null; - AMLParameters aMLParameters = null; + AzureMachineLearningParameters aMLParameters = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -92,16 +92,17 @@ public static AMLVectorizer fromJson(JsonReader jsonReader) throws IOException { name = reader.getString(); nameFound = true; } else if ("amlParameters".equals(fieldName)) { - aMLParameters = AMLParameters.fromJson(reader); + aMLParameters = AzureMachineLearningParameters.fromJson(reader); } else { reader.skipChildren(); } } if (nameFound) { - AMLVectorizer deserializedAMLVectorizer = new AMLVectorizer(name); - deserializedAMLVectorizer.aMLParameters = aMLParameters; + AzureMachineLearningVectorizer deserializedAzureMachineLearningVectorizer + = new AzureMachineLearningVectorizer(name); + deserializedAzureMachineLearningVectorizer.aMLParameters = aMLParameters; - return deserializedAMLVectorizer; + return deserializedAzureMachineLearningVectorizer; } throw new IllegalStateException("Missing required property: name"); }); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchServiceLimits.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchServiceLimits.java index 1a7bd1686be1..dd77354f1469 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchServiceLimits.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchServiceLimits.java @@ -52,7 +52,7 @@ public SearchServiceLimits() { /** * Get the maxFieldsPerIndex property: The maximum allowed fields per index. - * + * * @return the maxFieldsPerIndex value. */ public Integer getMaxFieldsPerIndex() { @@ -61,7 +61,7 @@ public Integer getMaxFieldsPerIndex() { /** * Set the maxFieldsPerIndex property: The maximum allowed fields per index. - * + * * @param maxFieldsPerIndex the maxFieldsPerIndex value to set. * @return the SearchServiceLimits object itself. */ @@ -73,7 +73,7 @@ public SearchServiceLimits setMaxFieldsPerIndex(Integer maxFieldsPerIndex) { /** * Get the maxFieldNestingDepthPerIndex property: The maximum depth which you can nest sub-fields in an index, * including the top-level complex field. For example, a/b/c has a nesting depth of 3. - * + * * @return the maxFieldNestingDepthPerIndex value. */ public Integer getMaxFieldNestingDepthPerIndex() { @@ -83,7 +83,7 @@ public Integer getMaxFieldNestingDepthPerIndex() { /** * Set the maxFieldNestingDepthPerIndex property: The maximum depth which you can nest sub-fields in an index, * including the top-level complex field. For example, a/b/c has a nesting depth of 3. - * + * * @param maxFieldNestingDepthPerIndex the maxFieldNestingDepthPerIndex value to set. * @return the SearchServiceLimits object itself. */ @@ -95,7 +95,7 @@ public SearchServiceLimits setMaxFieldNestingDepthPerIndex(Integer maxFieldNesti /** * Get the maxComplexCollectionFieldsPerIndex property: The maximum number of fields of type * Collection(Edm.ComplexType) allowed in an index. - * + * * @return the maxComplexCollectionFieldsPerIndex value. */ public Integer getMaxComplexCollectionFieldsPerIndex() { @@ -105,7 +105,7 @@ public Integer getMaxComplexCollectionFieldsPerIndex() { /** * Set the maxComplexCollectionFieldsPerIndex property: The maximum number of fields of type * Collection(Edm.ComplexType) allowed in an index. - * + * * @param maxComplexCollectionFieldsPerIndex the maxComplexCollectionFieldsPerIndex value to set. * @return the SearchServiceLimits object itself. */ @@ -117,7 +117,7 @@ public SearchServiceLimits setMaxComplexCollectionFieldsPerIndex(Integer maxComp /** * Get the maxComplexObjectsInCollectionsPerDocument property: The maximum number of objects in complex collections * allowed per document. - * + * * @return the maxComplexObjectsInCollectionsPerDocument value. */ public Integer getMaxComplexObjectsInCollectionsPerDocument() { @@ -127,7 +127,7 @@ public Integer getMaxComplexObjectsInCollectionsPerDocument() { /** * Set the maxComplexObjectsInCollectionsPerDocument property: The maximum number of objects in complex collections * allowed per document. - * + * * @param maxComplexObjectsInCollectionsPerDocument the maxComplexObjectsInCollectionsPerDocument value to set. * @return the SearchServiceLimits object itself. */ @@ -139,7 +139,7 @@ public Integer getMaxComplexObjectsInCollectionsPerDocument() { /** * Get the maxStoragePerIndexInBytes property: The maximum amount of storage in bytes allowed per index. - * + * * @return the maxStoragePerIndexInBytes value. */ public Long getMaxStoragePerIndexInBytes() { @@ -148,7 +148,7 @@ public Long getMaxStoragePerIndexInBytes() { /** * Set the maxStoragePerIndexInBytes property: The maximum amount of storage in bytes allowed per index. - * + * * @param maxStoragePerIndexInBytes the maxStoragePerIndexInBytes value to set. * @return the SearchServiceLimits object itself. */ @@ -165,13 +165,13 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeNumberField("maxComplexCollectionFieldsPerIndex", this.maxComplexCollectionFieldsPerIndex); jsonWriter.writeNumberField("maxComplexObjectsInCollectionsPerDocument", this.maxComplexObjectsInCollectionsPerDocument); - jsonWriter.writeNumberField("maxStoragePerIndexInBytes", this.maxStoragePerIndexInBytes); + jsonWriter.writeNumberField("maxStoragePerIndex", this.maxStoragePerIndexInBytes); return jsonWriter.writeEndObject(); } /** * Reads an instance of SearchServiceLimits from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of SearchServiceLimits if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. @@ -195,7 +195,7 @@ public static SearchServiceLimits fromJson(JsonReader jsonReader) throws IOExcep } else if ("maxComplexObjectsInCollectionsPerDocument".equals(fieldName)) { deserializedSearchServiceLimits.maxComplexObjectsInCollectionsPerDocument = reader.getNullable(JsonReader::getInt); - } else if ("maxStoragePerIndexInBytes".equals(fieldName)) { + } else if ("maxStoragePerIndex".equals(fieldName)) { deserializedSearchServiceLimits.maxStoragePerIndexInBytes = reader.getNullable(JsonReader::getLong); } else { reader.skipChildren(); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizer.java index 092234212721..a7b7fd0717e3 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizer.java @@ -25,7 +25,7 @@ public class VectorSearchVectorizer implements JsonSerializable com.azure azure-search-documents - 11.7.0-beta.2 + 11.7.0-beta.3 ``` [//]: # ({x-version-update-end}) @@ -97,6 +97,7 @@ The following sections provide several code snippets covering some of the most c - [Setting customer x-ms-client-request-id per API call](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/PerCallRequestIdExample.java) - [Index vector fields and perform vector search](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/VectorSearchExample.java). - [Rewrite Request URL to replace OData URL syntax with standard syntax](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SearchRequestUrlRewriterPolicy.java) +- [Vector search using reduced embeddings](https://github.com/Azure/azure-sdk-for-java/blob/40261403b3a75aa56a3eeaf18c2ba0fd071c87a6/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/VectorSearchReducedEmbeddings.java) ## Troubleshooting Troubleshooting steps can be found [here][SDK_README_TROUBLESHOOTING]. diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/VectorSearchReducedEmbeddings.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/VectorSearchReducedEmbeddings.java new file mode 100644 index 000000000000..e48b5cbf382c --- /dev/null +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/VectorSearchReducedEmbeddings.java @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.search.documents; + +import com.azure.ai.openai.OpenAIClient; +import com.azure.ai.openai.OpenAIClientBuilder; +import com.azure.ai.openai.models.Embeddings; +import com.azure.ai.openai.models.EmbeddingsOptions; +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.credential.KeyCredential; +import com.azure.core.util.Configuration; +import com.azure.core.util.Context; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.search.documents.indexes.SearchIndexClient; +import com.azure.search.documents.indexes.SearchIndexClientBuilder; +import com.azure.search.documents.indexes.SearchableField; +import com.azure.search.documents.indexes.SimpleField; +import com.azure.search.documents.indexes.models.AzureOpenAIModelName; +import com.azure.search.documents.indexes.models.AzureOpenAIParameters; +import com.azure.search.documents.indexes.models.AzureOpenAIVectorizer; +import com.azure.search.documents.indexes.models.HnswAlgorithmConfiguration; +import com.azure.search.documents.indexes.models.IndexDocumentsBatch; +import com.azure.search.documents.indexes.models.SearchField; +import com.azure.search.documents.indexes.models.SearchFieldDataType; +import com.azure.search.documents.indexes.models.SearchIndex; +import com.azure.search.documents.indexes.models.VectorSearch; +import com.azure.search.documents.indexes.models.VectorSearchProfile; +import com.azure.search.documents.models.SearchOptions; +import com.azure.search.documents.models.SearchResult; +import com.azure.search.documents.models.VectorSearchOptions; +import com.azure.search.documents.models.VectorizableTextQuery; +import com.azure.search.documents.util.SearchPagedIterable; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +/** + * This sample demonstrates how to create a vector fields index with reduced dimensions, upload reduced embeddings into + * the index, and query the documents. To accomplish this, you can utilize Azure OpenAI embedding models: a smaller and + * highly efficient {@code text-embedding-3-small} model or a larger and more powerful {@code text-embedding-3-large} + * model. These models are significantly more efficient and require less storage space. + */ +public class VectorSearchReducedEmbeddings { + public static void main(String[] args) { + SearchIndex vectorIndex = defineVectorIndex(); + + // After creating an instance of the 'SearchIndex',we need to instantiate the 'SearchIndexClient' and call the + // 'createIndex' method to create the search index. + createVectorIndex(vectorIndex); + + // Now, we can instantiate the 'SearchClient' and upload the documents to the 'Hotel' index we created earlier. + SearchClient searchClient = new SearchClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("SEARCH_ENDPOINT")) + .indexName("hotel") + .credential(new AzureKeyCredential(Configuration.getGlobalConfiguration().get("SEARCH_API_KEY"))) + .buildClient(); + + // Next, we will create sample hotel documents. The vector field requires submitting text input to an embedding + // model that converts human-readable text into a vector representation. To convert a text query string provided + // by a user into a vector representation, your application should utilize an embedding library that offers this + // functionality. + indexDocuments(searchClient, getHotelDocuments()); + + // When using 'VectorizableTextQuery', the query for a vector field should be the text that will be vectorized + // based on the 'Vectorizer' configuration in order to perform a vector search. + // + // Let's query the index and make sure everything works as implemented. You can also refer to + // https://learn.microsoft.com/azure/search/vector-search-how-to-query for more information on querying vector + // data. + } + + /** + * Let's consider the example of a 'Hotel'. First, we need to create an index for storing hotel information. In this + * index, we will define vector fields called 'DescriptionVector' and 'CategoryVector'. To configure the vector + * field, you need to provide the model dimensions, which indicate the size of the embeddings generated for this + * field. You can pass reduced dimensions and the name of the vector search profile that specifies the algorithm + * configuration, along with 'Vectorizer'. + *

+ * In order to get the reduced embeddings using either the {@code text-embedding-3-small} or + * {@code text-embedding-3-large} models, it is necessary to include the 'Dimensions' parameter. This parameter + * configures the desired number of dimensions for the output vector. Therefore, for {@link AzureOpenAIVectorizer}, + * we will retrieve the 'VectorSearchDimensions' that is already specified in the corresponding index field + * definition. However, to ensure that dimensions are only passed along in the vectorizer for a model that supports + * it, we need to pass a required property named 'ModelName'. This property enables the service to determine which + * model we are using, and dimensions will only be passed along when it is for a known supported model name. + *

+ * We will create an instace of {@code SearchIndex} and define 'Hotel' fields. + */ + public static SearchIndex defineVectorIndex() { + String vectorSearchProfileName = "my-vector-profile"; + String vectorSearchHnswConfig = "my-hnsw-vector-config"; + String deploymentId = "my-text-embedding-3-small"; + int modelDimensions = 256; // Here's the reduced model dimensions + String indexName = "hotel"; + return new SearchIndex(indexName).setFields(new SearchField("HotelId", SearchFieldDataType.STRING).setKey(true) + .setFilterable(true) + .setSortable(true) + .setFacetable(true), new SearchField("HotelName", SearchFieldDataType.STRING).setSearchable(true) + .setFilterable(true) + .setSortable(true), + new SearchField("Description", SearchFieldDataType.STRING).setSearchable(true).setFilterable(true), + new SearchField("DescriptionVector", + SearchFieldDataType.collection(SearchFieldDataType.SINGLE)).setSearchable(true) + .setFilterable(true) + .setVectorSearchDimensions(modelDimensions) + .setVectorSearchProfileName(vectorSearchProfileName), + new SearchField("Category", SearchFieldDataType.STRING).setSearchable(true) + .setFilterable(true) + .setSortable(true) + .setFacetable(true), + new SearchField("CategoryVector", SearchFieldDataType.collection(SearchFieldDataType.SINGLE)).setSearchable( + true) + .setFilterable(true) + .setVectorSearchDimensions(modelDimensions) + .setVectorSearchProfileName(vectorSearchProfileName)) + .setVectorSearch(new VectorSearch().setProfiles( + new VectorSearchProfile(vectorSearchProfileName, vectorSearchHnswConfig).setVectorizer("openai")) + .setAlgorithms(new HnswAlgorithmConfiguration(vectorSearchHnswConfig)) + .setVectorizers(Collections.singletonList(new AzureOpenAIVectorizer("openai").setAzureOpenAIParameters( + new AzureOpenAIParameters().setResourceUri( + Configuration.getGlobalConfiguration().get("OPENAI_ENDPOINT")) + .setApiKey(Configuration.getGlobalConfiguration().get("OPENAI_KEY")) + .setDeploymentId(deploymentId) + .setModelName(AzureOpenAIModelName.TEXT_EMBEDDING3LARGE))))); + } + + public static void createVectorIndex(SearchIndex vectorIndex) { + // Instantiate the 'SearchIndexClient' and call the 'createIndex' method to create the search index. + String endpoint = Configuration.getGlobalConfiguration().get("SEARCH_ENDPOINT"); + String key = Configuration.getGlobalConfiguration().get("SEARCH_API_KEY"); + AzureKeyCredential credential = new AzureKeyCredential(key); + + SearchIndexClient indexClient = new SearchIndexClientBuilder().endpoint(endpoint) + .credential(credential) + .buildClient(); + + indexClient.createIndex(vectorIndex); + } + + // Simple model type for Hotel + + /** + * Hotel model with an additional field for the vector description. + */ + public static final class VectorHotel implements JsonSerializable { + @SimpleField(isKey = true) + private String hotelId; + @SearchableField(isFilterable = true, isSortable = true, analyzerName = "en.lucene") + private String hotelName; + @SearchableField(analyzerName = "en.lucene") + private String description; + @SearchableField(vectorSearchDimensions = 256, vectorSearchProfileName = "my-vector-profile") + private List descriptionVector; + @SearchableField(isFilterable = true, isFacetable = true, isSortable = true) + private String category; + @SearchableField(vectorSearchDimensions = 256, vectorSearchProfileName = "my-vector-profile") + private List categoryVector; + + public VectorHotel() { + } + + public String getHotelId() { + return hotelId; + } + + public VectorHotel setHotelId(String hotelId) { + this.hotelId = hotelId; + return this; + } + + public String getHotelName() { + return hotelName; + } + + public VectorHotel setHotelName(String hotelName) { + this.hotelName = hotelName; + return this; + } + + public String getDescription() { + return description; + } + + public VectorHotel setDescription(String description) { + this.description = description; + return this; + } + + public List getDescriptionVector() { + return descriptionVector == null ? null : Collections.unmodifiableList(descriptionVector); + } + + public VectorHotel setDescriptionVector(List descriptionVector) { + this.descriptionVector = descriptionVector == null ? null : new ArrayList<>(descriptionVector); + return this; + } + + public String getCategory() { + return category; + } + + public VectorHotel setCategory(String category) { + this.category = category; + return this; + } + + public List getCategoryVector() { + return categoryVector == null ? null : Collections.unmodifiableList(categoryVector); + } + + public VectorHotel setCategoryVector(List categoryVector) { + this.categoryVector = categoryVector == null ? null : new ArrayList<>(categoryVector); + return this; + } + + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + return jsonWriter.writeStartObject() + .writeStringField("HotelId", hotelId) + .writeStringField("HotelName", hotelName) + .writeStringField("Description", description) + .writeArrayField("DescriptionVector", descriptionVector, JsonWriter::writeFloat) + .writeStringField("Category", category) + .writeArrayField("DescriptionVector", categoryVector, JsonWriter::writeFloat) + .writeEndObject(); + } + + public static VectorHotel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VectorHotel vectorHotel = new VectorHotel(); + + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("HotelId".equals(fieldName)) { + vectorHotel.hotelId = reader.getString(); + } else if ("HotelName".equals(fieldName)) { + vectorHotel.hotelName = reader.getString(); + } else if ("Description".equals(fieldName)) { + vectorHotel.description = reader.getString(); + } else if ("DescriptionVector".equals(fieldName)) { + vectorHotel.descriptionVector = reader.readArray(JsonReader::getFloat); + } else if ("Category".equals(fieldName)) { + vectorHotel.category = reader.getString(); + } else if ("CategoryVector".equals(fieldName)) { + vectorHotel.categoryVector = reader.readArray(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return vectorHotel; + }); + } + } + + /** + * Get Embeddings using {@code azure-ai-openai} library. + *

+ * You can use Azure OpenAI embedding models, {@code text-embedding-3-small} or {@code text-embedding-3-large}, to + * get the reduced embeddings. With these models, you can specify the desired number of dimensions for the output + * vector by passing the 'Dimensions' property. This enables you to customize the output according to your needs. + *

+ * For more details about how to generate embeddings, refer to the + * documentation. + * Here's an example of how you can get embeddings using + * azure-ai-openai + * library. + */ + public static List getEmbeddings(String input) { + // Get embeddings using Azure OpenAI + String endpoint = Configuration.getGlobalConfiguration().get("OPENAI_ENDPOINT"); + String key = Configuration.getGlobalConfiguration().get("OPENAI_API_KEY"); + KeyCredential credential = new KeyCredential(key); + + OpenAIClient openAIClient = new OpenAIClientBuilder() + .endpoint(endpoint) + .credential(credential) + .buildClient(); + EmbeddingsOptions embeddingsOptions = new EmbeddingsOptions(Collections.singletonList(input)) + .setModel("my-text-embedding-3-small") + .setDimensions(256); + + Embeddings embeddings = openAIClient.getEmbeddings("my-text-embedding-3-small", embeddingsOptions); + return embeddings.getData().get(0).getEmbedding(); + } + + public static List getHotelDocuments() { + // In the sample code below, we are using 'getEmbeddings' method mentioned above to get embeddings for the + // vector fields named 'DescriptionVector' and 'CategoryVector'. + return Arrays.asList( + new VectorHotel().setHotelId("1") + .setHotelName("Fancy Stay") + .setDescription("Best hotel in town if you like luxury hotels. They have an amazing infinity pool, a " + + "spa, and a really helpful concierge. The location is perfect -- right downtown, close to " + + "all the tourist attractions. We highly recommend this hotel.") + .setDescriptionVector(getEmbeddings( + "Best hotel in town if you like luxury hotels. They have an amazing infinity pool, a spa, " + + "and a really helpful concierge. The location is perfect -- right downtown, close to all " + + "the tourist attractions. We highly recommend this hotel.")) + .setCategory("Luxury") + .setCategoryVector(getEmbeddings("Luxury")), + new VectorHotel().setHotelId("2") + .setHotelName("Roach Motel") + .setDescription("Cheapest hotel in town. Infact, a motel.") + .setDescriptionVector(getEmbeddings("Cheapest hotel in town. Infact, a motel.")) + .setCategory("Budget") + .setCategoryVector(getEmbeddings("Budget")) + // Add more hotel documents here... + ); + } + + public static void indexDocuments(SearchClient searchClient, List hotelDocuments) { + searchClient.indexDocuments(new IndexDocumentsBatch().addUploadActions(hotelDocuments)); + } + + /** + * In this vector query, the 'VectorQueries' contains the vectorizable text of the query input. The 'Fields' + * property specifies which vector fields are searched. The 'KNearestNeighborsCount' property specifies the number + * of nearest neighbors to return as top hits. + */ + public static void vectorSearch(SearchClient searchClient) { + SearchPagedIterable response = searchClient.search(null, new SearchOptions() + .setVectorSearchOptions(new VectorSearchOptions() + .setQueries(new VectorizableTextQuery("Luxury hotels in town") + .setKNearestNeighborsCount(3) + .setFields("DescriptionVector"))), Context.NONE); + + int count = 0; + System.out.println("Vector Search Results:"); + + for (SearchResult result : response) { + count++; + VectorHotel doc = result.getDocument(VectorHotel.class); + System.out.println(doc.getHotelId() + ": " + doc.getHotelName()); + } + + System.out.println("Total number of search results: " + count); + } +} diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/FieldBuilderTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/FieldBuilderTests.java index 7aad823cce5f..f01ddf6a69b6 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/FieldBuilderTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/FieldBuilderTests.java @@ -126,7 +126,7 @@ public void ignoredPropertyName() { public void supportedFields() { List fields = SearchIndexClient.buildSearchFields(AllSupportedFields.class, null); - assertEquals(23, fields.size()); + assertEquals(25, fields.size()); Map fieldToDataType = fields.stream() .collect(Collectors.toMap(SearchField::getName, SearchField::getType)); @@ -154,6 +154,9 @@ public void supportedFields() { assertEquals(SearchFieldDataType.INT16, fieldToDataType.get("primitiveShort")); assertEquals(SearchFieldDataType.SBYTE, fieldToDataType.get("nullableByte")); assertEquals(SearchFieldDataType.SBYTE, fieldToDataType.get("primitiveByte")); + assertEquals(SearchFieldDataType.collection(SearchFieldDataType.SBYTE), fieldToDataType.get("byteArray")); + assertEquals(SearchFieldDataType.collection(SearchFieldDataType.SBYTE), fieldToDataType.get("byteList")); + } @SuppressWarnings({"unused", "UseOfObsoleteDateTimeApi"}) @@ -296,6 +299,18 @@ public byte getPrimitiveByte() { public Byte getNullableByte() { return nullableByte; } + + // 24. name = 'byteArray', OData type = COMPLEX + private byte[] byteArray; + public byte[] getByteArray() { + return byteArray; + } + + // 25. name = 'byteList', OData type = COMPLEX + private List byteList; + public List getByteList() { + return byteList; + } } @Test public void validNormalizerField() { diff --git a/sdk/search/azure-search-documents/swagger/README.md b/sdk/search/azure-search-documents/swagger/README.md index 9be65913d502..243c95197879 100644 --- a/sdk/search/azure-search-documents/swagger/README.md +++ b/sdk/search/azure-search-documents/swagger/README.md @@ -216,17 +216,6 @@ directive: return $; ``` -### Rename `maxStoragePerIndex` property to `maxStoragePerIndexInBytes` in ServiceLimits - -``` yaml $(tag) == 'searchservice' -directive: - - from: swagger-document - where: $.definitions.ServiceLimits.properties - transform: > - $.maxStoragePerIndexInBytes = $.maxStoragePerIndex; - delete $.maxStoragePerIndex; -``` - ### Set `hybridSearch` property to be type `HybridSearch` in SearchRequest ``` yaml $(tag) == 'searchindex' @@ -264,6 +253,7 @@ directive: transform: > $.ServiceCounters["x-ms-client-name"] = "SearchServiceCounters"; $.ServiceLimits["x-ms-client-name"] = "SearchServiceLimits"; + $.ServiceLimits.properties.maxStoragePerIndex["x-ms-client-name"] = "maxStoragePerIndexInBytes"; $.ServiceStatistics["x-ms-client-name"] = "SearchServiceStatistics"; ``` @@ -438,3 +428,21 @@ directive: where: $.definitions.VectorQuery.properties.k transform: $["x-ms-client-name"] = "KNearestNeighborsCount"; ``` + +### Rename `AMLVectorizer` to `AzureMachineLearningVectorizer` + +```yaml $(tag) == 'searchservice' +directive: +- from: swagger-document + where: $.definitions.AMLVectorizer + transform: $["x-ms-client-name"] = "AzureMachineLearningVectorizer"; +``` + +### Rename `AMLParameters` to `AzureMachineLearningParameters` + +```yaml $(tag) == 'searchservice' +directive: +- from: swagger-document + where: $.definitions.AMLParameters + transform: $["x-ms-client-name"] = "AzureMachineLearningParameters"; +``` diff --git a/sdk/search/azure-search-perf/pom.xml b/sdk/search/azure-search-perf/pom.xml index 99c82327d705..89de330df1ed 100644 --- a/sdk/search/azure-search-perf/pom.xml +++ b/sdk/search/azure-search-perf/pom.xml @@ -29,7 +29,7 @@ com.azure azure-search-documents - 11.7.0-beta.3 + 11.7.0-beta.4 diff --git a/sdk/servicebus/azure-messaging-servicebus-stress/pom.xml b/sdk/servicebus/azure-messaging-servicebus-stress/pom.xml index 863ce3a617b8..209473483a77 100644 --- a/sdk/servicebus/azure-messaging-servicebus-stress/pom.xml +++ b/sdk/servicebus/azure-messaging-servicebus-stress/pom.xml @@ -45,7 +45,7 @@ com.azure azure-messaging-servicebus - 7.17.0-beta.1 + 7.18.0-beta.1 diff --git a/sdk/servicebus/azure-messaging-servicebus-track2-perf/pom.xml b/sdk/servicebus/azure-messaging-servicebus-track2-perf/pom.xml index ddeb33bf3870..d6ac324a524b 100644 --- a/sdk/servicebus/azure-messaging-servicebus-track2-perf/pom.xml +++ b/sdk/servicebus/azure-messaging-servicebus-track2-perf/pom.xml @@ -23,7 +23,7 @@ com.azure azure-messaging-servicebus - 7.17.0-beta.1 + 7.18.0-beta.1 com.azure diff --git a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md index 62e74ebff15c..34f6139030e7 100644 --- a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md @@ -1,18 +1,24 @@ # Release History -## 7.17.0-beta.1 (Unreleased) +## 7.18.0-beta.1 (Unreleased) ### Features Added ### Breaking Changes ### Bugs Fixed - - Fixes the session message disposition to use management node as fall back. ([#39913](https://github.com/Azure/azure-sdk-for-java/issues/ 39913)) - Fixes the session processor idle timeout to fall back to RetryOptions::tryTimeout. ([#39993](https://github.com/Azure/azure-sdk-for-java/issues/39993)) ### Other Changes +## 7.17.0 (2024-05-06) + +### Bugs Fixed + +- Fixes the session message disposition to use management node as fall back. ([#39913](https://github.com/Azure/azure-sdk-for-java/issues/39913)) +- Fixes the session processor idle timeout to fall back to RetryOptions::tryTimeout. ([#39993](https://github.com/Azure/azure-sdk-for-java/issues/39993)) + ## 7.16.0 (2024-04-22) ### Features Added diff --git a/sdk/servicebus/azure-messaging-servicebus/README.md b/sdk/servicebus/azure-messaging-servicebus/README.md index 4cd5ddc50248..227abebb2b8d 100644 --- a/sdk/servicebus/azure-messaging-servicebus/README.md +++ b/sdk/servicebus/azure-messaging-servicebus/README.md @@ -69,7 +69,7 @@ add the direct dependency to your project as follows. com.azure azure-messaging-servicebus - 7.16.0 + 7.17.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/servicebus/azure-messaging-servicebus/docs/pom.xml b/sdk/servicebus/azure-messaging-servicebus/docs/pom.xml index 8940a0bd44d0..1a3222098498 100644 --- a/sdk/servicebus/azure-messaging-servicebus/docs/pom.xml +++ b/sdk/servicebus/azure-messaging-servicebus/docs/pom.xml @@ -20,7 +20,7 @@ com.azure azure-messaging-servicebus - 7.17.0-beta.1 + 7.18.0-beta.1 diff --git a/sdk/servicebus/azure-messaging-servicebus/pom.xml b/sdk/servicebus/azure-messaging-servicebus/pom.xml index e0687d632fa7..d316d54174b6 100644 --- a/sdk/servicebus/azure-messaging-servicebus/pom.xml +++ b/sdk/servicebus/azure-messaging-servicebus/pom.xml @@ -14,7 +14,7 @@ com.azure azure-messaging-servicebus - 7.17.0-beta.1 + 7.18.0-beta.1 Microsoft Azure client library for Service Bus This package contains the Microsoft Azure Service Bus client library https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/FluxTrace.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/FluxTrace.java index 8649598d6f23..a6908ec0f5ec 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/FluxTrace.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/FluxTrace.java @@ -60,7 +60,10 @@ protected void hookOnNext(ServiceBusMessageContext message) { return; } - Context span = instrumentation.startProcessInstrumentation("ServiceBus.process", message.getMessage(), Context.NONE); + Context span = instrumentation.startProcessInstrumentation("ServiceBus.process", + message.getMessage().getApplicationProperties(), + message.getMessage().getEnqueuedTime(), + Context.NONE); message.getMessage().setContext(span); AutoCloseable scope = tracer.makeSpanCurrent(span); try { diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/FluxTraceV2.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/FluxTraceV2.java deleted file mode 100644 index 33c9b3021780..000000000000 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/FluxTraceV2.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.messaging.servicebus; - -import com.azure.messaging.servicebus.implementation.instrumentation.ReceiverKind; -import com.azure.messaging.servicebus.implementation.instrumentation.ServiceBusReceiverInstrumentation; -import org.reactivestreams.Subscription; -import reactor.core.CoreSubscriber; -import reactor.core.publisher.BaseSubscriber; -import reactor.core.publisher.Flux; -import reactor.core.publisher.FluxOperator; - -import java.util.Objects; - -/** - * Flux operator that traces receive and process calls - */ -final class FluxTraceV2 extends FluxOperator { - private final ServiceBusReceiverInstrumentation instrumentation; - - FluxTraceV2(Flux upstream, ServiceBusReceiverInstrumentation instrumentation) { - super(upstream); - this.instrumentation = instrumentation; - } - - @Override - public void subscribe(CoreSubscriber coreSubscriber) { - Objects.requireNonNull(coreSubscriber, "'coreSubscriber' cannot be null."); - - source.subscribe(new TracingSubscriber(coreSubscriber, instrumentation)); - } - - private static class TracingSubscriber extends BaseSubscriber { - - private final CoreSubscriber downstream; - private final ServiceBusReceiverInstrumentation instrumentation; - TracingSubscriber(CoreSubscriber downstream, ServiceBusReceiverInstrumentation instrumentation) { - this.downstream = downstream; - this.instrumentation = instrumentation; - } - - @Override - public reactor.util.context.Context currentContext() { - return downstream.currentContext(); - } - - @Override - protected void hookOnSubscribe(Subscription subscription) { - downstream.onSubscribe(this); - } - - @Override - protected void hookOnNext(ServiceBusReceivedMessage message) { - instrumentation.instrumentProcess(message, ReceiverKind.ASYNC_RECEIVER, msg -> { - downstream.onNext(msg); - return null; - }); - } - - @Override - protected void hookOnError(Throwable throwable) { - downstream.onError(throwable); - } - - @Override - protected void hookOnComplete() { - downstream.onComplete(); - } - } -} diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumer.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumer.java index 280490f15070..fcddd200a436 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumer.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumer.java @@ -49,19 +49,10 @@ class ServiceBusAsyncConsumer implements AutoCloseable { this.linkProcessor = null; this.messageSerializer = messageSerializer; - final boolean useFluxTrace = instrumentation.isEnabled() && instrumentation.isAsyncReceiverInstrumentation(); - if (useFluxTrace) { - // This ServiceBusAsyncConsumer is backing ServiceBusReceiverAsyncClient instance (client has instrumentation is enabled). - final Flux deserialize = messageFlux - .map(message -> this.messageSerializer.deserialize(message, ServiceBusReceivedMessage.class)); - this.processor = new FluxTraceV2(deserialize, instrumentation); - } else { - // This ServiceBusAsyncConsumer is backing either - // 1. a ServiceBusReceiverAsyncClient instance (client has no instrumentation enabled) - // 2. Or a ServiceBusProcessorClient instance (processor client internally deal with instrumentation). - this.processor = messageFlux - .map(message -> this.messageSerializer.deserialize(message, ServiceBusReceivedMessage.class)); - } + // This ServiceBusAsyncConsumer is backing ServiceBusReceiverAsyncClient instance (client has instrumentation is enabled). + final Flux deserialize = messageFlux + .map(message -> this.messageSerializer.deserialize(message, ServiceBusReceivedMessage.class)); + this.processor = TracingFluxOperator.create(deserialize, instrumentation); } /** diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverAsyncClient.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverAsyncClient.java index 9cb63ce4a85f..0e7c2205227a 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverAsyncClient.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionReceiverAsyncClient.java @@ -274,7 +274,7 @@ private Mono acquireSpecificOrNextSession(String session, null, receiverOptions.getMaxLockRenewDuration()); final ServiceBusSingleSessionManager sessionManager = new ServiceBusSingleSessionManager(LOGGER, identifier, - sessionReceiver, receiverOptions.getPrefetchCount(), messageSerializer, connectionCacheWrapper.getRetryOptions()); + sessionReceiver, receiverOptions.getPrefetchCount(), messageSerializer, connectionCacheWrapper.getRetryOptions(), instrumentation); final ReceiverOptions newReceiverOptions = createNamedSessionOptions(receiverOptions.getReceiveMode(), receiverOptions.getPrefetchCount(), receiverOptions.getMaxLockRenewDuration(), diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSingleSessionManager.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSingleSessionManager.java index 702ac378cc5d..cccad6ed8d4d 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSingleSessionManager.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSingleSessionManager.java @@ -11,7 +11,9 @@ import com.azure.core.util.logging.LoggingEventBuilder; import com.azure.messaging.servicebus.implementation.DispositionStatus; import com.azure.messaging.servicebus.implementation.MessageUtils; +import com.azure.messaging.servicebus.implementation.instrumentation.ServiceBusReceiverInstrumentation; import org.apache.qpid.proton.amqp.transport.DeliveryState; +import org.apache.qpid.proton.message.Message; import reactor.core.publisher.Flux; import reactor.core.publisher.FluxSink; import reactor.core.publisher.Mono; @@ -34,11 +36,12 @@ final class ServiceBusSingleSessionManager implements IServiceBusSessionManager private final MessageSerializer serializer; private final Duration operationTimeout; private final ServiceBusSessionReactorReceiver sessionReceiver; - private final MessageFlux messageFlux; + private final Flux messageFlux; + private final ServiceBusReceiverInstrumentation instrumentation; ServiceBusSingleSessionManager(ClientLogger logger, String identifier, ServiceBusSessionReactorReceiver sessionReceiver, int prefetch, - MessageSerializer serializer, AmqpRetryOptions retryOptions) { + MessageSerializer serializer, AmqpRetryOptions retryOptions, ServiceBusReceiverInstrumentation instrumentation) { this.logger = Objects.requireNonNull(logger, "logger cannot be null."); this.identifier = identifier; this.sessionReceiver = Objects.requireNonNull(sessionReceiver, "sessionReceiver cannot be null."); @@ -46,7 +49,10 @@ final class ServiceBusSingleSessionManager implements IServiceBusSessionManager Objects.requireNonNull(retryOptions, "retryOptions cannot be null."); this.operationTimeout = retryOptions.getTryTimeout(); final Flux messageFluxUpstream = new SessionReceiverStream(sessionReceiver).flux(); - this.messageFlux = new MessageFlux(messageFluxUpstream, prefetch, CreditFlowMode.RequestDriven, NULL_RETRY_POLICY); + this.instrumentation = Objects.requireNonNull(instrumentation, "instrumentation cannot be null"); + MessageFlux messageFluxLocal = new MessageFlux(messageFluxUpstream, prefetch, CreditFlowMode.RequestDriven, + NULL_RETRY_POLICY); + this.messageFlux = TracingFluxOperator.create(messageFluxLocal, instrumentation); } @Override diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/SessionsMessagePump.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/SessionsMessagePump.java index 2afe6d63cedc..fb3bb5d6e403 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/SessionsMessagePump.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/SessionsMessagePump.java @@ -177,7 +177,7 @@ final class SessionsMessagePump { this.processMessage = Objects.requireNonNull(processMessage, "'processMessage' cannot be null."); this.processError = Objects.requireNonNull(processError, "'processError' cannot be null."); this.onTerminate = Objects.requireNonNull(onTerminate, "'onTerminate' cannot be null."); - this.receiversTracker = new SessionReceiversTracker(logger, maxConcurrentSessions, fullyQualifiedNamespace, entityPath, receiveMode); + this.receiversTracker = new SessionReceiversTracker(logger, maxConcurrentSessions, fullyQualifiedNamespace, entityPath, receiveMode, instrumentation); this.nextSession = new NextSession(pumpId, fullyQualifiedNamespace, entityPath, sessionAcquirer).mono(); } @@ -645,14 +645,16 @@ static final class SessionReceiversTracker { private final String entityPath; private final ServiceBusReceiveMode receiveMode; private final ConcurrentHashMap receivers; + private final ServiceBusReceiverInstrumentation instrumentation; private SessionReceiversTracker(ClientLogger logger, int size, String fullyQualifiedNamespace, String entityPath, - ServiceBusReceiveMode receiveMode) { + ServiceBusReceiveMode receiveMode, ServiceBusReceiverInstrumentation instrumentation) { this.logger = logger; this.fullyQualifiedNamespace = fullyQualifiedNamespace; this.entityPath = entityPath; this.receiveMode = receiveMode; this.receivers = new ConcurrentHashMap<>(size); + this.instrumentation = instrumentation; } private void track(ServiceBusSessionReactorReceiver receiver) { @@ -749,11 +751,14 @@ private Mono updateDisposition(ServiceBusReceivedMessage message, Disposit final ServiceBusSessionReactorReceiver receiver = receivers.get(sessionId); final DeliveryState deliveryState = MessageUtils.getDeliveryState(dispositionStatus, deadLetterReason, deadLetterDescription, propertiesToModify, transactionContext); + + Mono updateDispositionMono; if (receiver != null) { - return receiver.updateDisposition(message.getLockToken(), deliveryState); + updateDispositionMono = receiver.updateDisposition(message.getLockToken(), deliveryState); } else { - return Mono.error(DeliveryNotOnLinkException.noMatchingDelivery(message.getLockToken(), deliveryState)); + updateDispositionMono = Mono.error(DeliveryNotOnLinkException.noMatchingDelivery(message.getLockToken(), deliveryState)); } + return instrumentation.instrumentSettlement(updateDispositionMono, message, message.getContext(), dispositionStatus); } private Mono checkNull(Object options, ServiceBusTransactionContext transactionContext) { diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/TracingFluxOperator.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/TracingFluxOperator.java new file mode 100644 index 000000000000..830f52086389 --- /dev/null +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/TracingFluxOperator.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.messaging.servicebus; + +import com.azure.messaging.servicebus.implementation.instrumentation.ReceiverKind; +import com.azure.messaging.servicebus.implementation.instrumentation.ServiceBusReceiverInstrumentation; +import org.apache.qpid.proton.message.Message; +import org.reactivestreams.Subscription; +import reactor.core.CoreSubscriber; +import reactor.core.publisher.BaseSubscriber; +import reactor.core.publisher.Flux; +import reactor.core.publisher.FluxOperator; + +import java.util.Objects; +import java.util.function.BiConsumer; +import java.util.function.Function; + +/** + * Flux operator that traces receive and process calls + */ +final class TracingFluxOperator extends BaseSubscriber { + + public static Flux create(Flux upstream, ServiceBusReceiverInstrumentation instrumentation) { + if (!instrumentation.isEnabled() && instrumentation.isAsyncReceiverInstrumentation()) { + return upstream; + } + + return new FluxOperator(upstream) { + @SuppressWarnings("unchecked") + @Override + public void subscribe(CoreSubscriber actual) { + Objects.requireNonNull(actual, "'actual' cannot be null."); + source.subscribe(new TracingFluxOperator(actual, (msg, handler) -> { + if (msg instanceof Message) { + instrumentation.instrumentProcess((Message) msg, ReceiverKind.ASYNC_RECEIVER, + (Function) handler); + } else if (msg instanceof ServiceBusReceivedMessage) { + instrumentation.instrumentProcess((ServiceBusReceivedMessage) msg, ReceiverKind.ASYNC_RECEIVER, + (Function) handler); + } + })); + } + }; + } + + private final CoreSubscriber downstream; + private final BiConsumer> instrumentation; + private TracingFluxOperator(CoreSubscriber downstream, BiConsumer> instrumentation) { + this.downstream = downstream; + this.instrumentation = instrumentation; + } + + @Override + public reactor.util.context.Context currentContext() { + return downstream.currentContext(); + } + + @Override + protected void hookOnSubscribe(Subscription subscription) { + downstream.onSubscribe(this); + } + + @Override + protected void hookOnNext(T message) { + instrumentation.accept(message, msg -> { + downstream.onNext(msg); + return null; + }); + } + + @Override + protected void hookOnError(Throwable throwable) { + downstream.onError(throwable); + } + + @Override + protected void hookOnComplete() { + downstream.onComplete(); + } +} + diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/instrumentation/ServiceBusReceiverInstrumentation.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/instrumentation/ServiceBusReceiverInstrumentation.java index 5cb4616c97bd..cb54adcb41a2 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/instrumentation/ServiceBusReceiverInstrumentation.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/instrumentation/ServiceBusReceiverInstrumentation.java @@ -8,16 +8,25 @@ import com.azure.core.util.tracing.Tracer; import com.azure.messaging.servicebus.ServiceBusReceivedMessage; import com.azure.messaging.servicebus.implementation.DispositionStatus; +import org.apache.qpid.proton.amqp.Symbol; +import org.apache.qpid.proton.message.Message; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.util.Date; +import java.util.Map; import java.util.function.Function; +import static com.azure.core.amqp.AmqpMessageConstant.ENQUEUED_TIME_UTC_ANNOTATION_NAME; + /** * Contains convenience methods to instrument specific calls with traces and metrics. */ public final class ServiceBusReceiverInstrumentation { + private static final Symbol ENQUEUED_TIME_SYMBOL = Symbol.getSymbol(ENQUEUED_TIME_UTC_ANNOTATION_NAME.getValue()); private final ServiceBusMeter meter; private final ServiceBusTracer tracer; private final ReceiverKind receiverKind; @@ -67,37 +76,44 @@ public boolean isAsyncReceiverInstrumentation() { * for sync receiver. * Reports consumer lag metric. */ - public Context startProcessInstrumentation(String name, ServiceBusReceivedMessage message, Context parent) { - if (message == null || (!tracer.isEnabled() && !meter.isConsumerLagEnabled())) { + public Context startProcessInstrumentation(String name, Map applicationProperties, + OffsetDateTime enqueuedTime, Context parent) { + if (applicationProperties == null || (!tracer.isEnabled() && !meter.isConsumerLagEnabled())) { return parent; } - Context span = (tracer.isEnabled() && receiverKind != ReceiverKind.SYNC_RECEIVER) ? tracer.startProcessSpan(name, message, parent) : parent; + Context span = (tracer.isEnabled() && receiverKind != ReceiverKind.SYNC_RECEIVER) + ? tracer.startProcessSpan(name, applicationProperties, enqueuedTime, parent) + : parent; // important to record metric after span is started - meter.reportConsumerLag(message.getEnqueuedTime(), span); + meter.reportConsumerLag(enqueuedTime, span); return span; } public void instrumentProcess(ServiceBusReceivedMessage message, ReceiverKind caller, Function handleMessage) { - if (receiverKind != caller) { + if (receiverKind != caller || message == null) { handleMessage.apply(message); return; } - Context span = startProcessInstrumentation("ServiceBus.process", message, Context.NONE); + Context span = startProcessInstrumentation("ServiceBus.process", message.getApplicationProperties(), + message.getEnqueuedTime(), Context.NONE); ContextAccessor.setContext(message, span); - AutoCloseable scope = tracer.makeSpanCurrent(span); - Throwable error = null; - try { - error = handleMessage.apply(message); - } catch (Throwable t) { - error = t; - throw t; - } finally { - tracer.endSpan(error, span, scope); + wrap(span, message, handleMessage); + } + + public void instrumentProcess(Message message, ReceiverKind caller, Function handleMessage) { + if (receiverKind != caller || message == null || message.getApplicationProperties() == null) { + handleMessage.apply(message); + return; } + + Context span = startProcessInstrumentation("ServiceBus.process", message.getApplicationProperties().getValue(), + getEnqueuedTime(message), Context.NONE); + //ContextAccessor.setContext(message, span); + wrap(span, message, handleMessage); } /** @@ -145,4 +161,30 @@ private static String getSettlementSpanName(DispositionStatus status) { return "ServiceBus.unknown"; } } + + private void wrap(Context span, T message, Function handleMessage) { + AutoCloseable scope = tracer.makeSpanCurrent(span); + Throwable error = null; + try { + error = handleMessage.apply(message); + } catch (Throwable t) { + error = t; + throw t; + } finally { + tracer.endSpan(error, span, scope); + } + } + + private OffsetDateTime getEnqueuedTime(Message message) { + if (message.getMessageAnnotations() == null || message.getMessageAnnotations().getValue() == null) { + return null; + } + + Object date = message.getMessageAnnotations().getValue().get(ENQUEUED_TIME_SYMBOL); + if (date instanceof Date) { + return ((Date) date).toInstant().atOffset(ZoneOffset.UTC); + } + + return null; + } } diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/instrumentation/ServiceBusTracer.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/instrumentation/ServiceBusTracer.java index 4f24630ec75f..532a71a249f0 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/instrumentation/ServiceBusTracer.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/instrumentation/ServiceBusTracer.java @@ -285,13 +285,13 @@ Context startSpanWithLink(String spanName, OperationName operationName, ServiceB /** * Starts span. Used by ServiceBus*Instrumentations. */ - Context startProcessSpan(String spanName, ServiceBusReceivedMessage message, Context parent) { - if (isEnabled() && message != null) { + Context startProcessSpan(String spanName, Map applicationProperties, OffsetDateTime enqueuedTime, Context parent) { + if (isEnabled() && applicationProperties != null) { StartSpanOptions startOptions = createStartOption(SpanKind.CONSUMER, OperationName.PROCESS) - .setRemoteParent(extractContext(message.getApplicationProperties())); + .setRemoteParent(extractContext(applicationProperties)); - if (message.getEnqueuedTime() != null) { - startOptions.setAttribute(MESSAGE_ENQUEUED_TIME_ATTRIBUTE_NAME, message.getEnqueuedTime().toEpochSecond()); + if (enqueuedTime != null) { + startOptions.setAttribute(MESSAGE_ENQUEUED_TIME_ATTRIBUTE_NAME, enqueuedTime.toEpochSecond()); } return tracer.start(spanName, startOptions, parent); diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ProxySelectorTest.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ProxySelectorTest.java index 7047f8138369..1dff7bec6184 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ProxySelectorTest.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ProxySelectorTest.java @@ -7,6 +7,7 @@ import com.azure.core.amqp.AmqpTransportType; import com.azure.core.util.BinaryData; import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -25,6 +26,8 @@ import java.util.concurrent.TimeUnit; public class ProxySelectorTest extends IntegrationTestBase { + private static final ClientLogger LOGGER = new ClientLogger(ProxySelectorTest.class); + private static final int PROXY_PORT = 9002; private static final InetSocketAddress SIMPLE_PROXY_ADDRESS = new InetSocketAddress("localhost", PROXY_PORT); private ProxySelector defaultProxySelector; @@ -78,7 +81,7 @@ public void connectFailed(URI uri, SocketAddress sa, IOException ioe) { .expectErrorSatisfies(error -> { // The message can vary because it is returned from proton-j, so we don't want to compare against that. // This is a transient error from ExceptionUtil.java: line 67. - System.out.println("Error: " + error); + LOGGER.log(LogLevel.VERBOSE, () -> "Error", error); }) .verify(TIMEOUT); diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ReceiveLinkTest.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ReceiveLinkTest.java index 033b74509fed..98b6c3f71787 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ReceiveLinkTest.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ReceiveLinkTest.java @@ -4,6 +4,8 @@ import com.azure.core.amqp.AmqpEndpointState; import com.azure.core.amqp.implementation.AmqpReceiveLink; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import org.junit.jupiter.api.AfterEach; import org.mockito.Mockito; import reactor.core.publisher.Flux; @@ -21,6 +23,8 @@ import static org.mockito.Mockito.when; public class ReceiveLinkTest { + private static final ClientLogger LOGGER = new ClientLogger(ReceiveLinkTest.class); + private final AtomicInteger counter = new AtomicInteger(); private final AmqpReceiveLink[] allLinks = new AmqpReceiveLink[4]; @@ -47,7 +51,7 @@ public void verifyCreation() { when(link2.getLinkName()).thenReturn("link2-name"); when(link2.getEndpointStates()).thenAnswer(invocation -> { - System.out.println("link2-name endpoints"); + LOGGER.log(LogLevel.VERBOSE, () -> "link2-name endpoints"); return Flux.create(sink -> { sink.onRequest(r -> sink.next(AmqpEndpointState.UNINITIALIZED)); @@ -56,7 +60,7 @@ public void verifyCreation() { when(link3.getLinkName()).thenReturn("link3-name"); when(link3.getEndpointStates()).thenAnswer(invocation -> { - System.out.println("link3-name endpoints"); + LOGGER.log(LogLevel.VERBOSE, () -> "link3-name endpoints"); return Flux.create(sink -> { // Emit uninitialized first. After 3 seconds, emit ACTIVE. sink.onRequest(r -> { @@ -88,7 +92,7 @@ private Mono getActiveLink() { }) .retryWhen(Retry.from(retrySignals -> retrySignals.flatMap(signal -> { final Throwable failure = signal.failure(); - System.err.printf(" Retry: %s. Error occurred while waiting: %s%n", signal.totalRetriesInARow(), failure); + LOGGER.verbose(" Retry: {}. Error occurred while waiting: {}", signal.totalRetriesInARow(), failure); if (failure instanceof TimeoutException) { return Mono.delay(Duration.ofSeconds(4)); } else { @@ -100,7 +104,7 @@ private Mono getActiveLink() { private Mono createReceiveLink() { int index = counter.getAndIncrement(); - System.out.println("Index: " + index); + LOGGER.log(LogLevel.VERBOSE, () -> "Index: " + index); if (index < allLinks.length) { return Mono.just(allLinks[index]); } else { diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusMixClientIntegrationTest.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusMixClientIntegrationTest.java index 0b46e7fb5473..9709bc8f7726 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusMixClientIntegrationTest.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusMixClientIntegrationTest.java @@ -4,6 +4,7 @@ package com.azure.messaging.servicebus; import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.messaging.servicebus.implementation.MessagingEntityType; import com.azure.messaging.servicebus.models.CompleteOptions; import com.azure.messaging.servicebus.models.ServiceBusReceiveMode; @@ -28,6 +29,8 @@ * Test where various clients are involved for example Sender, Receiver and Processor client. */ public class ServiceBusMixClientIntegrationTest extends IntegrationTestBase { + private static final ClientLogger LOGGER = new ClientLogger(ServiceBusMixClientIntegrationTest.class); + private ServiceBusSenderAsyncClient sender; private ServiceBusReceiverAsyncClient receiver; private final AtomicInteger messagesPending = new AtomicInteger(); @@ -106,7 +109,7 @@ void crossEntityQueueTransaction(boolean isSessionEnabled) throws InterruptedExc receivedMessages.incrementAndGet(); messagesPending.incrementAndGet(); ServiceBusReceivedMessage myMessage = context.getMessage(); - System.out.printf("Processing message. MessageId: %s, Sequence #: %s. Contents: %s %n", myMessage.getMessageId(), + LOGGER.verbose("Processing message. MessageId: {}, Sequence #: {}. Contents: {}", myMessage.getMessageId(), myMessage.getSequenceNumber(), myMessage.getBody()); if (receivedMessages.get() == 1) { @@ -122,12 +125,12 @@ void crossEntityQueueTransaction(boolean isSessionEnabled) throws InterruptedExc }; Consumer processError = context -> { - System.out.printf("Error when receiving messages from namespace: '%s'. Entity: '%s'. Error Source: '%s' %n", + LOGGER.verbose("Error when receiving messages from namespace: '{}'. Entity: '{}'. Error Source: '{}'", context.getFullyQualifiedNamespace(), context.getEntityPath(), context.getErrorSource()); Assertions.fail("Failed processing of message.", context.getException()); if (!(context.getException() instanceof ServiceBusException)) { - System.out.printf("Non-ServiceBusException occurred: %s%n", context.getException()); + LOGGER.log(LogLevel.VERBOSE, () -> "Non-ServiceBusException occurred: " + context.getException()); } }; @@ -150,17 +153,17 @@ void crossEntityQueueTransaction(boolean isSessionEnabled) throws InterruptedExc // Create an instance of the processor through the ServiceBusClientBuilder // Act - System.out.println("Starting the processor"); + LOGGER.log(LogLevel.VERBOSE, () -> "Starting the processor"); processorA.start(); toClose((AutoCloseable) () -> processorA.stop()); // Assert - System.out.println("Listening for 10 seconds..."); + LOGGER.log(LogLevel.VERBOSE, () -> "Listening for 10 seconds..."); if (countdownLatch.await(10, TimeUnit.SECONDS)) { - System.out.println("Completed processing successfully."); + LOGGER.log(LogLevel.VERBOSE, () -> "Completed processing successfully."); Assertions.assertTrue(transactionComplete.get()); } else { - System.out.println("Closing processor."); + LOGGER.log(LogLevel.VERBOSE, () -> "Closing processor."); Assertions.fail("Failed to process message."); } @@ -216,7 +219,7 @@ void crossEntitySubscriptionTransaction(boolean isSessionEnabled) throws Interru receivedMessages.incrementAndGet(); messagesPending.incrementAndGet(); ServiceBusReceivedMessage myMessage = context.getMessage(); - System.out.printf("Processing message. MessageId: %s, Sequence #: %s. Contents: %s %n", myMessage.getMessageId(), + LOGGER.verbose("Processing message. MessageId: {}, Sequence #: {}. Contents: {}", myMessage.getMessageId(), myMessage.getSequenceNumber(), myMessage.getBody()); if (receivedMessages.get() == 1) { @@ -232,12 +235,12 @@ void crossEntitySubscriptionTransaction(boolean isSessionEnabled) throws Interru }; Consumer processError = context -> { - System.out.printf("Error when receiving messages from namespace: '%s'. Entity: '%s'. Error Source: '%s' %n", + LOGGER.verbose("Error when receiving messages from namespace: '{}'. Entity: '{}'. Error Source: '{}'", context.getFullyQualifiedNamespace(), context.getEntityPath(), context.getErrorSource()); Assertions.fail("Failed processing of message.", context.getException()); if (!(context.getException() instanceof ServiceBusException)) { - System.out.printf("Non-ServiceBusException occurred: %s%n", context.getException()); + LOGGER.log(LogLevel.VERBOSE, () -> "Non-ServiceBusException occurred: " + context.getException()); } }; @@ -268,17 +271,17 @@ void crossEntitySubscriptionTransaction(boolean isSessionEnabled) throws Interru // Create an instance of the processor through the ServiceBusClientBuilder // Act - System.out.println("Starting the processor"); + LOGGER.log(LogLevel.VERBOSE, () -> "Starting the processor"); processorA.start(); toClose((AutoCloseable) () -> processorA.stop()); // Assert - System.out.println("Listening for 10 seconds..."); + LOGGER.log(LogLevel.VERBOSE, () -> "Listening for 10 seconds..."); if (countdownLatch.await(10, TimeUnit.SECONDS)) { - System.out.println("Completed processing successfully."); + LOGGER.log(LogLevel.VERBOSE, () -> "Completed processing successfully."); Assertions.assertTrue(transactionComplete.get()); } else { - System.out.println("Closing processor."); + LOGGER.log(LogLevel.VERBOSE, () -> "Closing processor."); Assertions.fail("Failed to process message."); } @@ -361,12 +364,12 @@ void crossEntityQueueTransactionWithReceiverSenderTest(boolean isSessionEnabled) toClose(subscription); // Act - System.out.println("Listening for 10 seconds..."); + LOGGER.log(LogLevel.VERBOSE, () -> "Listening for 10 seconds..."); if (countdownLatch.await(10, TimeUnit.SECONDS)) { - System.out.println("Completed message processing successfully."); + LOGGER.log(LogLevel.VERBOSE, () -> "Completed message processing successfully."); Assertions.assertTrue(transactionComplete.get()); } else { - System.out.println("Some error."); + LOGGER.log(LogLevel.VERBOSE, () -> "Some error."); Assertions.fail("Failed to process message."); } @@ -447,12 +450,12 @@ void crossEntitySubscriptionTransactionWithReceiverSenderTest(boolean isSessionE }).subscribe(); toClose(subscription); // Act - System.out.println("Listening for 10 seconds..."); + LOGGER.log(LogLevel.VERBOSE, () -> "Listening for 10 seconds..."); if (countdownLatch.await(10, TimeUnit.SECONDS)) { - System.out.println("Completed message processing successfully."); + LOGGER.log(LogLevel.VERBOSE, () -> "Completed message processing successfully."); Assertions.assertTrue(transactionComplete.get()); } else { - System.out.println("Some error."); + LOGGER.log(LogLevel.VERBOSE, () -> "Some error."); Assertions.fail("Failed to process message."); } diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClientTest.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClientTest.java index 42052a460dc0..4686edf67643 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClientTest.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClientTest.java @@ -24,6 +24,7 @@ import com.azure.core.util.ClientOptions; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.core.util.tracing.StartSpanOptions; import com.azure.core.util.tracing.Tracer; import com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusReceiverClientBuilder; @@ -1317,13 +1318,14 @@ void autoCompleteMessage(boolean isV2) { try { // Act & Assert - StepVerifier.create(receiver2.receiveMessages().take(numberOfEvents).doOnComplete(() -> System.out.println("take complete.."))) + StepVerifier.create(receiver2.receiveMessages().take(numberOfEvents) + .doOnComplete(() -> LOGGER.log(LogLevel.VERBOSE, () -> "take complete.."))) .then(() -> messages.forEach(m -> messageSink.next(m))) .expectNextCount(numberOfEvents) .expectComplete() .verify(DEFAULT_TIMEOUT); } finally { - System.out.println("CLOSING...."); + LOGGER.log(LogLevel.VERBOSE, () -> "CLOSING...."); receiver2.close(); } diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusSenderAsyncClientIntegrationTest.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusSenderAsyncClientIntegrationTest.java index 2da9dc8d8788..d62e825e3a4d 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusSenderAsyncClientIntegrationTest.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusSenderAsyncClientIntegrationTest.java @@ -4,6 +4,7 @@ package com.azure.messaging.servicebus; import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.messaging.servicebus.implementation.MessagingEntityType; import com.azure.messaging.servicebus.models.CreateMessageBatchOptions; import com.azure.messaging.servicebus.models.ServiceBusReceiveMode; @@ -35,6 +36,8 @@ */ @Tag("integration") class ServiceBusSenderAsyncClientIntegrationTest extends IntegrationTestBase { + private static final ClientLogger LOGGER = new ClientLogger(ServiceBusSenderAsyncClientIntegrationTest.class); + private ServiceBusSenderAsyncClient sender; private ServiceBusReceiverAsyncClient receiver; private final AtomicInteger messagesPending = new AtomicInteger(); @@ -358,17 +361,17 @@ void transactionMessageSendAndCompleteTransaction(MessagingEntityType entityType .verify(TIMEOUT); StepVerifier.create(receiver.receiveMessages().take(total)) .assertNext(receivedMessage -> { - System.out.println("1"); + LOGGER.log(LogLevel.VERBOSE, () -> "1"); assertMessageEquals(receivedMessage, messageId, isSessionEnabled); messagesPending.decrementAndGet(); }) .assertNext(receivedMessage -> { - System.out.println("2"); + LOGGER.log(LogLevel.VERBOSE, () -> "2"); assertMessageEquals(receivedMessage, messageId, isSessionEnabled); messagesPending.decrementAndGet(); }) .assertNext(receivedMessage -> { - System.out.println("3"); + LOGGER.log(LogLevel.VERBOSE, () -> "3"); assertMessageEquals(receivedMessage, messageId, isSessionEnabled); messagesPending.decrementAndGet(); }) diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusSessionManagerTest.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusSessionManagerTest.java index 05804738519f..aa93866c66fd 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusSessionManagerTest.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusSessionManagerTest.java @@ -13,6 +13,7 @@ import com.azure.core.credential.TokenCredential; import com.azure.core.util.ClientOptions; import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.messaging.servicebus.implementation.MessagingEntityType; import com.azure.messaging.servicebus.implementation.ServiceBusAmqpConnection; import com.azure.messaging.servicebus.implementation.ServiceBusConnectionProcessor; @@ -382,23 +383,23 @@ void multipleSessions() { } }) .assertNext(context -> { - System.out.println("1"); + LOGGER.log(LogLevel.VERBOSE, () -> "1"); assertMessageEquals(sessionId, receivedMessage, context); }) .assertNext(context -> { - System.out.println("2"); + LOGGER.log(LogLevel.VERBOSE, () -> "2"); assertMessageEquals(sessionId, receivedMessage, context); }) .assertNext(context -> { - System.out.println("3"); + LOGGER.log(LogLevel.VERBOSE, () -> "3"); assertMessageEquals(sessionId, receivedMessage, context); }) .assertNext(context -> { - System.out.println("4"); + LOGGER.log(LogLevel.VERBOSE, () -> "4"); assertMessageEquals(sessionId, receivedMessage, context); }) .assertNext(context -> { - System.out.println("5"); + LOGGER.log(LogLevel.VERBOSE, () -> "5"); assertMessageEquals(sessionId, receivedMessage, context); }) .thenAwait(Duration.ofSeconds(13)) @@ -408,15 +409,15 @@ void multipleSessions() { } }) .assertNext(context -> { - System.out.println("6"); + LOGGER.log(LogLevel.VERBOSE, () -> "6"); assertMessageEquals(sessionId2, receivedMessage2, context); }) .assertNext(context -> { - System.out.println("7"); + LOGGER.log(LogLevel.VERBOSE, () -> "7"); assertMessageEquals(sessionId2, receivedMessage2, context); }) .assertNext(context -> { - System.out.println("8"); + LOGGER.log(LogLevel.VERBOSE, () -> "8"); assertMessageEquals(sessionId2, receivedMessage2, context); }) .thenAwait(Duration.ofSeconds(15)) diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/TestUtils.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/TestUtils.java index 6416b0409ef5..8531bdedeb7a 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/TestUtils.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/TestUtils.java @@ -8,6 +8,8 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Configuration; import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.messaging.servicebus.administration.models.AccessRights; import com.azure.messaging.servicebus.administration.models.AuthorizationRule; import org.apache.qpid.proton.Proton; @@ -46,6 +48,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; public class TestUtils { + private static final ClientLogger LOGGER = new ClientLogger(TestUtils.class); // System and application properties from the generated test message. static final Instant ENQUEUED_TIME = Instant.ofEpochSecond(1561344661); @@ -145,7 +148,7 @@ public static String getConnectionString(boolean withSas) { } return String.format(connectionStringWithSasAndEntityFormat, endpoint, signatureValue, entityPath); } catch (Exception e) { - e.printStackTrace(); + LOGGER.log(LogLevel.VERBOSE, () -> "Error while getting connection string", e); } } return connectionString; diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/TracingIntegrationTests.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/TracingIntegrationTests.java index 7a50929d25f9..6bc5730921d2 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/TracingIntegrationTests.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/TracingIntegrationTests.java @@ -592,6 +592,62 @@ public void sendAndProcessNoAutoComplete() throws InterruptedException { assertSettledVsProcessed(completed, processed, 1); } + @Test + public void sendAndProcessSessionNoAutoComplete() throws InterruptedException { + String sessionQueueName = getSessionQueueName(0); + String sessionId = UUID.randomUUID().toString(); + ServiceBusMessage message = new ServiceBusMessage(CONTENTS_BYTES).setSessionId(sessionId); + + OpenTelemetry otel = configureOTel(getFullyQualifiedDomainName(), sessionQueueName); + clientOptions = new ClientOptions().setTracingOptions(new OpenTelemetryTracingOptions().setOpenTelemetry(otel)); + sender = toClose(new ServiceBusClientBuilder() + .connectionString(getConnectionString()) + .clientOptions(clientOptions) + .sender() + .queueName(sessionQueueName) + .buildAsyncClient()); + + StepVerifier.create(sender.sendMessage(message)).expectComplete().verify(TIMEOUT); + + CountDownLatch processFound = new CountDownLatch(2); + spanProcessor.notifyIfCondition(processFound, span -> span.getName().equals("ServiceBus.process") || span.getName().equals("ServiceBus.complete")); + + AtomicReference currentInProcess = new AtomicReference<>(); + AtomicReference receivedMessage = new AtomicReference<>(); + processor = toClose(new ServiceBusClientBuilder() + .connectionString(getConnectionString()) + .clientOptions(clientOptions) + .sessionProcessor() + .maxConcurrentSessions(1) + .queueName(sessionQueueName) + .disableAutoComplete() + .processMessage(mc -> { + currentInProcess.compareAndSet(null, Span.current()); + receivedMessage.compareAndSet(null, mc.getMessage()); + mc.complete(); + }) + .processError(e -> fail("unexpected error", e.getException())) + .buildProcessorClient()); + + toClose((AutoCloseable) () -> processor.stop()); + processor.start(); + assertTrue(processFound.await(20, TimeUnit.SECONDS)); + processor.stop(); + + assertTrue(currentInProcess.get().getSpanContext().isValid()); + List spans = spanProcessor.getEndedSpans(); + + List processed = findSpans(spans, "ServiceBus.process") + .stream().filter(p -> p.equals(currentInProcess.get())).collect(Collectors.toList()); + assertEquals(1, processed.size()); + assertConsumerSpan(processed.get(0), receivedMessage.get(), "ServiceBus.process"); + + List completed = findSpans(spans, "ServiceBus.complete"); + assertEquals(1, completed.size()); + assertClientSpan(completed.get(0), Collections.singletonList(receivedMessage.get()), "ServiceBus.complete", "settle"); + assertSettledVsProcessed(completed, processed, 1); + } + @Test public void sendAndProcessParallel() throws InterruptedException { int messageCount = 10; diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ServiceBusReceiveLinkProcessorTest.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ServiceBusReceiveLinkProcessorTest.java index 3f108c6b6678..66720fb5fd24 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ServiceBusReceiveLinkProcessorTest.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ServiceBusReceiveLinkProcessorTest.java @@ -7,6 +7,8 @@ import com.azure.core.amqp.exception.AmqpErrorCondition; import com.azure.core.amqp.exception.AmqpErrorContext; import com.azure.core.amqp.exception.AmqpException; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import org.apache.qpid.proton.amqp.transport.DeliveryState; import org.apache.qpid.proton.message.Message; import org.junit.jupiter.api.AfterEach; @@ -36,6 +38,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertSame; @@ -55,6 +58,8 @@ * Tests for {@link ServiceBusReceiveLinkProcessor}. */ class ServiceBusReceiveLinkProcessorTest { + private static final ClientLogger LOGGER = new ClientLogger(ServiceBusReceiveLinkProcessorTest.class); + private static final int PREFETCH = 5; @Mock private ServiceBusReceiveLink link1; @@ -172,9 +177,9 @@ void respectsBackpressureLessThanMinimum() throws InterruptedException { // Act semaphore.acquire(); processor.subscribe( - e -> System.out.println("message: " + e), + e -> LOGGER.log(LogLevel.VERBOSE, () -> "message: " + e), Assertions::fail, - () -> System.out.println("Complete."), + () -> LOGGER.log(LogLevel.VERBOSE, () -> "Complete."), s -> { s.request(backpressure); semaphore.release(); @@ -262,9 +267,7 @@ void newLinkOnClose() { }) .expectNext(message3) .expectNext(message4) - .then(() -> { - processor.cancel(); - }) + .then(processor::cancel) .verifyComplete(); assertTrue(processor.isTerminated()); @@ -336,12 +339,12 @@ void nonRetryableError() { // Verify that we get the first connection. StepVerifier.create(processor) .then(() -> { - System.out.println("Outputting exception."); + LOGGER.log(LogLevel.VERBOSE, () -> "Outputting exception."); endpointProcessor.error(amqpException); }) .expectErrorSatisfies(error -> { - System.out.println("Asserting exception."); - assertTrue(error instanceof AmqpException); + LOGGER.log(LogLevel.VERBOSE, () -> "Asserting exception."); + assertInstanceOf(AmqpException.class, error); AmqpException exception = (AmqpException) error; assertFalse(exception.isTransient()); diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/instrumentation/ServiceBusReceiverInstrumentationTests.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/instrumentation/ServiceBusReceiverInstrumentationTests.java index 46597b57f963..55766945d4e4 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/instrumentation/ServiceBusReceiverInstrumentationTests.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/instrumentation/ServiceBusReceiverInstrumentationTests.java @@ -35,7 +35,7 @@ public void testInstrumentNullMessageNoMeter() { ServiceBusReceiverInstrumentation instrumentation = new ServiceBusReceiverInstrumentation(tracer, null, "fqdn", "entityPath", null, ReceiverKind.ASYNC_RECEIVER); - instrumentation.startProcessInstrumentation("span name", null, Context.NONE); + instrumentation.startProcessInstrumentation("span name", null, null, Context.NONE); instrumentation.instrumentSettlement(Mono.just(1), null, Context.NONE, DispositionStatus.ABANDONED); verify(tracer, never()).start(anyString(), any(StartSpanOptions.class), any(Context.class)); } @@ -48,7 +48,7 @@ public void testInstrumentNullMessageNoTracer() { "fqdn", "entityPath", null, ReceiverKind.ASYNC_RECEIVER); // does not throw - instrumentation.startProcessInstrumentation("span name", null, Context.NONE); + instrumentation.startProcessInstrumentation("span name", null, null, Context.NONE); instrumentation.instrumentSettlement(Mono.just(1), null, Context.NONE, DispositionStatus.ABANDONED); } @@ -58,7 +58,7 @@ public void testInstrumentNullMessageDisabled() { "fqdn", "entityPath", null, ReceiverKind.ASYNC_RECEIVER); // does not throw - instrumentation.startProcessInstrumentation("span name", null, Context.NONE); + instrumentation.startProcessInstrumentation("span name", null, null, Context.NONE); instrumentation.instrumentSettlement(Mono.just(1), null, Context.NONE, DispositionStatus.ABANDONED); } } diff --git a/sdk/spring/CHANGELOG.md b/sdk/spring/CHANGELOG.md index 86a39eb52077..e9cff45da533 100644 --- a/sdk/spring/CHANGELOG.md +++ b/sdk/spring/CHANGELOG.md @@ -1,5 +1,18 @@ # Release History +## 4.18.0 (2024-05-07) +- This release is compatible with Spring Boot 2.5.0-2.5.15, 2.6.0-2.6.15, 2.7.0-2.7.18. (Note: 2.5.x (x>15), 2.6.y (y>15) and 2.7.z (z>18) should be supported, but they aren't tested with this release.) +- This release is compatible with Spring Cloud 2020.0.3-2020.0.6, 2021.0.0-2021.0.9. (Note: 2020.0.x (x>6) and 2021.0.y (y>9) should be supported, but they aren't tested with this release.) + +### Spring Cloud Azure Dependencies (BOM) + +#### Dependency Updates +- Upgrade `azure-sdk-bom` to 1.2.23. + +### Azure Spring Data Cosmos +This section includes changes in `azure-spring-data-cosmos` module. +Please refer to [azure-spring-data-cosmos/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/spring/azure-spring-data-cosmos/CHANGELOG.md#3450-2024-05-07) for more details. + ## 5.11.0 (2024-03-29) - This release is compatible with Spring Boot 3.0.0-3.0.13, 3.1.0-3.1.8, 3.2.0-3.2.4. (Note: 3.0.x (x>13), 3.1.y (y>8) and 3.2.z (z>4) should be supported, but they aren't tested with this release.) - This release is compatible with Spring Cloud 2022.0.0-2022.0.5, 2023.0.0-2023.0.0. (Note: 2022.0.x (x>5) and 2023.0.y (y>0) should be supported, but they aren't tested with this release.) diff --git a/sdk/spring/README.md b/sdk/spring/README.md index bcc381424cf4..ad63adfed482 100644 --- a/sdk/spring/README.md +++ b/sdk/spring/README.md @@ -139,7 +139,7 @@ If you’re a Maven user, add our BOM to your pom.xml `` s com.azure.spring spring-cloud-azure-dependencies - 4.17.0 + 4.18.0 pom import diff --git a/sdk/spring/azure-spring-data-cosmos/CHANGELOG.md b/sdk/spring/azure-spring-data-cosmos/CHANGELOG.md index b2e844f18e23..ee1ac98b5886 100644 --- a/sdk/spring/azure-spring-data-cosmos/CHANGELOG.md +++ b/sdk/spring/azure-spring-data-cosmos/CHANGELOG.md @@ -1,16 +1,26 @@ ## Release History -### 3.45.0-beta.1 (Unreleased) +### 3.46.0-beta.1 (Unreleased) #### Features Added -* Exposing the `indexQueryMetrics` to the `CosmosConfig` via the `application.properties` configuration file - See [PR 39433](https://github.com/Azure/azure-sdk-for-java/pull/39433). #### Breaking Changes +#### Bugs Fixed + +#### Other Changes + +### 3.45.0 (2024-05-07) + +#### Features Added +* Exposing the `indexQueryMetrics` to the `CosmosConfig` via the `application.properties` configuration file - See [PR 39433](https://github.com/Azure/azure-sdk-for-java/pull/39433). + #### Bugs Fixed * Fixed all saveAll/insertAll bulk functionality to populated audit data - See [PR 39620](https://github.com/Azure/azure-sdk-for-java/pull/39620). +* Fixed `existsById` API in `ReactiveCosmosTemplate` to return `Mono` containing `False` in case the item does not exist - See [PR 40022](https://github.com/Azure/azure-sdk-for-java/pull/40022) #### Other Changes +* Updated `azure-cosmos` to version `4.58.0`. ### 5.11.0 (2024-03-29) diff --git a/sdk/spring/azure-spring-data-cosmos/README.md b/sdk/spring/azure-spring-data-cosmos/README.md index 2439fec3860e..8d417d0265d6 100644 --- a/sdk/spring/azure-spring-data-cosmos/README.md +++ b/sdk/spring/azure-spring-data-cosmos/README.md @@ -100,7 +100,7 @@ If you are using Maven, add the following dependency. com.azure azure-spring-data-cosmos - 3.44.0 + 3.45.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/spring/azure-spring-data-cosmos/pom.xml b/sdk/spring/azure-spring-data-cosmos/pom.xml index ff5b5d10fe5a..38407fa19e58 100644 --- a/sdk/spring/azure-spring-data-cosmos/pom.xml +++ b/sdk/spring/azure-spring-data-cosmos/pom.xml @@ -12,7 +12,7 @@ com.azure azure-spring-data-cosmos - 3.45.0-beta.1 + 3.46.0-beta.1 jar Spring Data for Azure Cosmos DB SQL API Spring Data for Azure Cosmos DB SQL API diff --git a/sdk/spring/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplate.java b/sdk/spring/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplate.java index b33a473d6b2d..20612e32dc35 100644 --- a/sdk/spring/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplate.java +++ b/sdk/spring/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplate.java @@ -850,7 +850,8 @@ public Mono exists(CosmosQuery query, Class domainType, String conta */ public Mono existsById(Object id, Class domainType, String containerName) { return findById(containerName, id, domainType) - .flatMap(o -> Mono.just(o != null)); + .flatMap(o -> Mono.just(o != null)) + .switchIfEmpty(Mono.just(false)); } /** diff --git a/sdk/spring/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplateIT.java b/sdk/spring/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplateIT.java index 9a5248b2dc24..90f30b632128 100644 --- a/sdk/spring/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplateIT.java +++ b/sdk/spring/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplateIT.java @@ -714,6 +714,26 @@ public void testExists() { Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics().getRequestCharge()).isGreaterThan(0); } + @Test + public void testNotExists() { + final Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, "firstName", + Collections.singletonList("randomFirstName"), Part.IgnoreCaseType.NEVER); + final CosmosQuery query = new CosmosQuery(criteria); + final Mono exists = cosmosTemplate.exists(query, Person.class, containerName); + StepVerifier.create(exists).expectNext(false).verifyComplete(); + + // add ignore testing + final Criteria criteriaIgnoreCase = Criteria.getInstance(CriteriaType.IS_EQUAL, "firstName", + Collections.singletonList("randomFirstName".toUpperCase()), Part.IgnoreCaseType.ALWAYS); + final CosmosQuery queryIgnoreCase = new CosmosQuery(criteriaIgnoreCase); + final Mono existsIgnoreCase = cosmosTemplate.exists(queryIgnoreCase, Person.class, containerName); + StepVerifier.create(existsIgnoreCase).expectNext(false).verifyComplete(); + + assertThat(responseDiagnosticsTestUtils.getCosmosDiagnostics()).isNotNull(); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNotNull(); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics().getRequestCharge()).isGreaterThan(0); + } + @Test public void testCount() { final Mono count = cosmosTemplate.count(containerName); diff --git a/sdk/spring/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/ReactiveUUIDIdDomainRepositoryIT.java b/sdk/spring/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/ReactiveUUIDIdDomainRepositoryIT.java index dd13d14ccf5a..56a1a65418a8 100644 --- a/sdk/spring/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/ReactiveUUIDIdDomainRepositoryIT.java +++ b/sdk/spring/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/ReactiveUUIDIdDomainRepositoryIT.java @@ -150,6 +150,9 @@ public void testExistsById() { Mono booleanMono = this.repository.existsById(DOMAIN_1.getNumber()); StepVerifier.create(booleanMono).expectNext(true).expectComplete().verify(); + + booleanMono = this.repository.existsById(UUID.randomUUID()); + StepVerifier.create(booleanMono).expectNext(false).expectComplete().verify(); } private static class InvalidDomain { diff --git a/sdk/spring/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/ReactiveLongIdDomainPartitionPartitionRepositoryIT.java b/sdk/spring/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/ReactiveLongIdDomainPartitionPartitionRepositoryIT.java index 823b7897bc8f..03bf88ce9359 100644 --- a/sdk/spring/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/ReactiveLongIdDomainPartitionPartitionRepositoryIT.java +++ b/sdk/spring/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/ReactiveLongIdDomainPartitionPartitionRepositoryIT.java @@ -171,6 +171,9 @@ public void testExistsById() { Mono booleanMono = this.repository.existsById(DOMAIN_1.getNumber()); StepVerifier.create(booleanMono).expectNext(true).expectComplete().verify(); + + booleanMono = this.repository.existsById(0L); + StepVerifier.create(booleanMono).expectNext(false).expectComplete().verify(); } @Test diff --git a/sdk/spring/spring-cloud-azure-actuator-autoconfigure/CHANGELOG.md b/sdk/spring/spring-cloud-azure-actuator-autoconfigure/CHANGELOG.md index 465a0ceac20d..1303275c337b 100644 --- a/sdk/spring/spring-cloud-azure-actuator-autoconfigure/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-actuator-autoconfigure/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.18.0-beta.1 (Unreleased) +## 4.19.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.18.0 (2024-05-07) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4180-2024-05-07) for more details. + ## 4.17.0 (2024-03-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-actuator-autoconfigure/pom.xml b/sdk/spring/spring-cloud-azure-actuator-autoconfigure/pom.xml index 1fba53d1705f..25077a86639a 100644 --- a/sdk/spring/spring-cloud-azure-actuator-autoconfigure/pom.xml +++ b/sdk/spring/spring-cloud-azure-actuator-autoconfigure/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-cloud-azure-actuator-autoconfigure - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Actuator AutoConfigure Spring Cloud Azure Starter Actuator AutoConfigure @@ -43,17 +43,17 @@ com.azure.spring spring-cloud-azure-actuator - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-autoconfigure - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-appconfiguration-config-web - 4.18.0-beta.1 + 4.19.0-beta.1 true diff --git a/sdk/spring/spring-cloud-azure-actuator/CHANGELOG.md b/sdk/spring/spring-cloud-azure-actuator/CHANGELOG.md index 465a0ceac20d..1303275c337b 100644 --- a/sdk/spring/spring-cloud-azure-actuator/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-actuator/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.18.0-beta.1 (Unreleased) +## 4.19.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.18.0 (2024-05-07) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4180-2024-05-07) for more details. + ## 4.17.0 (2024-03-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-actuator/pom.xml b/sdk/spring/spring-cloud-azure-actuator/pom.xml index de867f093e46..652a5c62968e 100644 --- a/sdk/spring/spring-cloud-azure-actuator/pom.xml +++ b/sdk/spring/spring-cloud-azure-actuator/pom.xml @@ -17,7 +17,7 @@ com.azure.spring spring-cloud-azure-actuator - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Actuator https://microsoft.github.io/spring-cloud-azure @@ -105,7 +105,7 @@ com.azure.spring spring-cloud-azure-appconfiguration-config-web - 4.18.0-beta.1 + 4.19.0-beta.1 true diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config-web/CHANGELOG.md b/sdk/spring/spring-cloud-azure-appconfiguration-config-web/CHANGELOG.md index 13b0a6a7f223..3085354f0d80 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config-web/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config-web/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.18.0-beta.1 (Unreleased) +## 4.19.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.18.0 (2024-05-07) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4180-2024-05-07) for more details. + ## 4.17.0 (2024-03-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config-web/pom.xml b/sdk/spring/spring-cloud-azure-appconfiguration-config-web/pom.xml index 5c91d1b8b219..e118e9a0b181 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config-web/pom.xml +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config-web/pom.xml @@ -10,7 +10,7 @@ com.azure.spring spring-cloud-azure-appconfiguration-config-web - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure App Configuration Config Web Integration of Spring Cloud Config and Azure App Configuration Service @@ -24,7 +24,7 @@ com.azure.spring spring-cloud-azure-appconfiguration-config - 4.18.0-beta.1 + 4.19.0-beta.1 org.springframework.boot diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/CHANGELOG.md b/sdk/spring/spring-cloud-azure-appconfiguration-config/CHANGELOG.md index da680e820d80..ef0518a75b38 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.18.0-beta.1 (Unreleased) +## 4.19.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.18.0 (2024-05-07) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4180-2024-05-07) for more details. + ## 4.17.0 (2024-03-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml b/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml index 9aca0209389d..2442d649f6aa 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml @@ -9,7 +9,7 @@ 4.0.0 com.azure.spring spring-cloud-azure-appconfiguration-config - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure App Configuration Config Integration of Spring Cloud Config and Azure App Configuration Service @@ -63,12 +63,12 @@ com.azure.spring spring-cloud-azure-service - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-autoconfigure - 4.18.0-beta.1 + 4.19.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/TestUtils.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/TestUtils.java index 1a09cdf8ed1a..e9fe610f0e4c 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/TestUtils.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/TestUtils.java @@ -7,6 +7,8 @@ import java.util.Map; import java.util.Set; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.data.appconfiguration.models.ConfigurationSetting; import com.azure.data.appconfiguration.models.FeatureFlagConfigurationSetting; import com.azure.data.appconfiguration.models.FeatureFlagFilter; @@ -23,6 +25,7 @@ * Utility methods which can be used across different test classes */ public final class TestUtils { + private static final ClientLogger LOGGER = new ClientLogger(TestUtils.class); private static final ObjectMapper MAPPER = new ObjectMapper(); @@ -75,7 +78,7 @@ static FeatureFlagConfigurationSetting createItemFeatureFlag(String prefix, Stri item.addClientFilter(filter); } } catch (JsonProcessingException e) { - e.printStackTrace(); + LOGGER.log(LogLevel.VERBOSE, () -> "Failed to create FeatureFlagConfigurationSetting.", e); } return item; } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/CHANGELOG.md b/sdk/spring/spring-cloud-azure-autoconfigure/CHANGELOG.md index 465a0ceac20d..1303275c337b 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-autoconfigure/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.18.0-beta.1 (Unreleased) +## 4.19.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.18.0 (2024-05-07) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4180-2024-05-07) for more details. + ## 4.17.0 (2024-03-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/pom.xml b/sdk/spring/spring-cloud-azure-autoconfigure/pom.xml index 6cd733b405b2..da9cd157ee9b 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/pom.xml +++ b/sdk/spring/spring-cloud-azure-autoconfigure/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-cloud-azure-autoconfigure - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure AutoConfigure Spring Cloud Azure AutoConfigure @@ -37,20 +37,20 @@ com.azure.spring spring-cloud-azure-service - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-resourcemanager - 4.18.0-beta.1 + 4.19.0-beta.1 true com.azure.spring spring-cloud-azure-trace-sleuth - 4.18.0-beta.1 + 4.19.0-beta.1 true @@ -59,7 +59,7 @@ com.azure.spring spring-integration-azure-eventhubs - 4.18.0-beta.1 + 4.19.0-beta.1 true @@ -73,7 +73,7 @@ com.azure.spring spring-integration-azure-servicebus - 4.18.0-beta.1 + 4.19.0-beta.1 true @@ -81,7 +81,7 @@ com.azure.spring spring-integration-azure-storage-queue - 4.18.0-beta.1 + 4.19.0-beta.1 true @@ -111,7 +111,7 @@ com.azure azure-spring-data-cosmos - 3.45.0-beta.1 + 3.46.0-beta.1 true @@ -175,7 +175,7 @@ com.azure azure-messaging-servicebus - 7.16.0 + 7.17.0 true diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/aad/implementation/TestJwks.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/aad/implementation/TestJwks.java index 5dca4d976bd8..99546b479151 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/aad/implementation/TestJwks.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/aad/implementation/TestJwks.java @@ -3,6 +3,8 @@ package com.azure.spring.cloud.autoconfigure.aad.implementation; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.nimbusds.jose.jwk.RSAKey; import com.nimbusds.jose.util.Base64URL; @@ -14,6 +16,7 @@ import java.security.interfaces.RSAPublicKey; public final class TestJwks { + private static final ClientLogger LOGGER = new ClientLogger(TestJwks.class); // @formatter:off public static final RSAKey DEFAULT_RSA_JWK = @@ -38,7 +41,7 @@ public static RSAKey.Builder jwk(RSAPublicKey publicKey, RSAPrivateKey privateKe .x509CertThumbprint(Base64URL.encode(bytes)) .keyID("rsa-jwk-kid"); } catch (CertificateEncodingException | NoSuchAlgorithmException e) { - e.printStackTrace(); + LOGGER.log(LogLevel.VERBOSE, () -> "Failed to generate thumbprint for certificate.", e); } return null; // @formatter:on diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/aad/implementation/graph/UserPrincipalMicrosoftGraphTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/aad/implementation/graph/UserPrincipalMicrosoftGraphTests.java index d49e86657011..98024e7579db 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/aad/implementation/graph/UserPrincipalMicrosoftGraphTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/aad/implementation/graph/UserPrincipalMicrosoftGraphTests.java @@ -3,6 +3,8 @@ package com.azure.spring.cloud.autoconfigure.aad.implementation.graph; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.spring.cloud.autoconfigure.aad.filter.UserPrincipal; import com.azure.spring.cloud.autoconfigure.aad.properties.AadAuthenticationProperties; import com.azure.spring.cloud.autoconfigure.aad.properties.AadAuthorizationServerEndpoints; @@ -49,6 +51,7 @@ @TestInstance(TestInstance.Lifecycle.PER_CLASS) class UserPrincipalMicrosoftGraphTests { + private static final ClientLogger LOGGER = new ClientLogger(UserPrincipalMicrosoftGraphTests.class); private static final String MOCK_MICROSOFT_GRAPH_ENDPOINT = "http://localhost:8080/"; @@ -68,7 +71,7 @@ class UserPrincipalMicrosoftGraphTests { }); userGroupsJson = objectMapper.writeValueAsString(json); } catch (IOException e) { - e.printStackTrace(); + LOGGER.log(LogLevel.VERBOSE, () -> "Failed to load user groups json.", e); userGroupsJson = null; } assertNotNull(userGroupsJson); diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/graph/ThreadInterruptedStatusRestoreTest.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/graph/ThreadInterruptedStatusRestoreTest.java index bd8b448ca437..8ea467b01370 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/graph/ThreadInterruptedStatusRestoreTest.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/graph/ThreadInterruptedStatusRestoreTest.java @@ -3,6 +3,8 @@ package com.azure.spring.cloud.autoconfigure.implementation.graph; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -10,6 +12,7 @@ import java.util.concurrent.TimeUnit; public class ThreadInterruptedStatusRestoreTest { + private static final ClientLogger LOGGER = new ClientLogger(ThreadInterruptedStatusRestoreTest.class); @Test void testThreadInterruptedRestoreFromAnotherThread() throws InterruptedException { @@ -22,9 +25,9 @@ void testThreadInterruptedRestoreFromAnotherThread() throws InterruptedException testThread.interrupt(); latchForInCatch.await(); - System.out.println(Thread.currentThread().getName() + ": begin assertion"); + LOGGER.log(LogLevel.VERBOSE, () -> Thread.currentThread().getName() + ": begin assertion"); Assertions.assertTrue((testThread).getIsInterrupted()); - System.out.println(Thread.currentThread().getName() + ": end assertion"); + LOGGER.log(LogLevel.VERBOSE, () -> Thread.currentThread().getName() + ": end assertion"); } @Test @@ -38,9 +41,9 @@ void testThreadInterruptedNotRestoreFromAnotherThread() throws InterruptedExcept testThread.interrupt(); latchForInCatch.await(); - System.out.println(Thread.currentThread().getName() + ": begin assertion"); + LOGGER.log(LogLevel.VERBOSE, () -> Thread.currentThread().getName() + ": begin assertion"); Assertions.assertFalse(testThread.getIsInterrupted()); - System.out.println(Thread.currentThread().getName() + ": end assertion"); + LOGGER.log(LogLevel.VERBOSE, () -> Thread.currentThread().getName() + ": end assertion"); } @@ -64,7 +67,8 @@ public void run() { latchForInWhile.countDown(); TimeUnit.SECONDS.sleep(3); } catch (InterruptedException ex) { - System.out.println(Thread.currentThread().getName() + ": current thread was interrupted!"); + LOGGER.log(LogLevel.VERBOSE, + () -> Thread.currentThread().getName() + ": current thread was interrupted!"); if (restore) { Thread.currentThread().interrupt(); } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/jms/AzureServiceBusJmsPropertiesTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/jms/AzureServiceBusJmsPropertiesTests.java index e198123d55a9..fff6275c6c85 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/jms/AzureServiceBusJmsPropertiesTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/jms/AzureServiceBusJmsPropertiesTests.java @@ -3,6 +3,8 @@ package com.azure.spring.cloud.autoconfigure.jms; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.spring.cloud.autoconfigure.jms.properties.AzureServiceBusJmsProperties; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -17,6 +19,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue; class AzureServiceBusJmsPropertiesTests { + private static final ClientLogger LOGGER = new ClientLogger(AzureServiceBusJmsPropertiesTests.class); + static final String CONNECTION_STRING = "Endpoint=sb://host/;SharedAccessKeyName=sasKeyName;" + "SharedAccessKey=sasKey"; @@ -31,7 +35,7 @@ void connectionStringNotValid() { String expectedMessage = "'spring.jms.servicebus.connection-string' should be provided."; String actualMessage = ex.getMessage(); - System.out.println("message:" + actualMessage); + LOGGER.log(LogLevel.VERBOSE, () -> "message:" + actualMessage); assertTrue(actualMessage.contains(expectedMessage)); } @@ -47,7 +51,7 @@ void pricingTierNotValid(String pricingTier) { String expectedMessage = "'spring.jms.servicebus.pricing-tier' is not valid"; String actualMessage = ex.getMessage(); - System.out.println("message:" + actualMessage); + LOGGER.log(LogLevel.VERBOSE, () -> "message:" + actualMessage); assertTrue(actualMessage.contains(expectedMessage)); } diff --git a/sdk/spring/spring-cloud-azure-core/CHANGELOG.md b/sdk/spring/spring-cloud-azure-core/CHANGELOG.md index 465a0ceac20d..1303275c337b 100644 --- a/sdk/spring/spring-cloud-azure-core/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-core/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.18.0-beta.1 (Unreleased) +## 4.19.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.18.0 (2024-05-07) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4180-2024-05-07) for more details. + ## 4.17.0 (2024-03-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-core/pom.xml b/sdk/spring/spring-cloud-azure-core/pom.xml index e52f7d5e25ef..3f910bb950f0 100644 --- a/sdk/spring/spring-cloud-azure-core/pom.xml +++ b/sdk/spring/spring-cloud-azure-core/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-cloud-azure-core - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Core https://microsoft.github.io/spring-cloud-azure diff --git a/sdk/spring/spring-cloud-azure-feature-management-web/CHANGELOG.md b/sdk/spring/spring-cloud-azure-feature-management-web/CHANGELOG.md index cb045c6fcbc4..2fb0c4fca339 100644 --- a/sdk/spring/spring-cloud-azure-feature-management-web/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-feature-management-web/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.18.0-beta.1 (Unreleased) +## 4.19.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.18.0 (2024-05-07) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4180-2024-05-07) for more details. + ## 4.17.0 (2024-03-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-feature-management-web/pom.xml b/sdk/spring/spring-cloud-azure-feature-management-web/pom.xml index 5c818caef1e7..60eca8c08ff5 100644 --- a/sdk/spring/spring-cloud-azure-feature-management-web/pom.xml +++ b/sdk/spring/spring-cloud-azure-feature-management-web/pom.xml @@ -9,7 +9,7 @@ com.azure.spring spring-cloud-azure-feature-management-web - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Feature Management Web Adds Feature Management into Spring Web @@ -46,7 +46,7 @@ com.azure.spring spring-cloud-azure-feature-management - 4.18.0-beta.1 + 4.19.0-beta.1 org.springframework.boot @@ -65,7 +65,7 @@ - com.azure.spring:spring-cloud-azure-feature-management:[4.18.0-beta.1] + com.azure.spring:spring-cloud-azure-feature-management:[4.19.0-beta.1] javax.servlet:javax.servlet-api:[4.0.1] org.springframework:spring-web:[5.3.32] org.springframework:spring-webmvc:[5.3.32] diff --git a/sdk/spring/spring-cloud-azure-feature-management/CHANGELOG.md b/sdk/spring/spring-cloud-azure-feature-management/CHANGELOG.md index 1473db8045d9..836db6260b31 100644 --- a/sdk/spring/spring-cloud-azure-feature-management/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-feature-management/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.18.0-beta.1 (Unreleased) +## 4.19.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.18.0 (2024-05-07) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4180-2024-05-07) for more details. + ## 4.17.0 (2024-03-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-feature-management/pom.xml b/sdk/spring/spring-cloud-azure-feature-management/pom.xml index 13bed8a8b617..fe740c88b88e 100644 --- a/sdk/spring/spring-cloud-azure-feature-management/pom.xml +++ b/sdk/spring/spring-cloud-azure-feature-management/pom.xml @@ -11,7 +11,7 @@ com.azure.spring spring-cloud-azure-feature-management - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Feature Management Adds Feature Management into Spring diff --git a/sdk/spring/spring-cloud-azure-integration-test-appconfiguration-config/pom.xml b/sdk/spring/spring-cloud-azure-integration-test-appconfiguration-config/pom.xml index caf82424a10a..bf5a689c0fe6 100644 --- a/sdk/spring/spring-cloud-azure-integration-test-appconfiguration-config/pom.xml +++ b/sdk/spring/spring-cloud-azure-integration-test-appconfiguration-config/pom.xml @@ -24,7 +24,7 @@ com.azure.spring spring-cloud-azure-starter-appconfiguration-config - 4.18.0-beta.1 + 4.19.0-beta.1 org.springframework.boot diff --git a/sdk/spring/spring-cloud-azure-integration-tests/pom.xml b/sdk/spring/spring-cloud-azure-integration-tests/pom.xml index a27b86269a21..d6bbd8c0b7b4 100644 --- a/sdk/spring/spring-cloud-azure-integration-tests/pom.xml +++ b/sdk/spring/spring-cloud-azure-integration-tests/pom.xml @@ -40,72 +40,72 @@ com.azure.spring spring-cloud-azure-starter-servicebus - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-starter-servicebus-jms - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-starter-eventhubs - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-starter-keyvault-secrets - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-starter-storage-blob - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-starter-storage-file-share - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-starter-storage-queue - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-starter-appconfiguration - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-starter-data-cosmos - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-starter-cosmos - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-stream-binder-eventhubs - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-stream-binder-servicebus - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-starter-jdbc-mysql - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-starter-redis - 4.18.0-beta.1 + 4.19.0-beta.1 org.springframework.boot diff --git a/sdk/spring/spring-cloud-azure-resourcemanager/CHANGELOG.md b/sdk/spring/spring-cloud-azure-resourcemanager/CHANGELOG.md index 465a0ceac20d..1303275c337b 100644 --- a/sdk/spring/spring-cloud-azure-resourcemanager/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-resourcemanager/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.18.0-beta.1 (Unreleased) +## 4.19.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.18.0 (2024-05-07) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4180-2024-05-07) for more details. + ## 4.17.0 (2024-03-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-resourcemanager/pom.xml b/sdk/spring/spring-cloud-azure-resourcemanager/pom.xml index 06bbce088766..33ee068b5162 100644 --- a/sdk/spring/spring-cloud-azure-resourcemanager/pom.xml +++ b/sdk/spring/spring-cloud-azure-resourcemanager/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-cloud-azure-resourcemanager - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Resource Manager Spring Cloud Azure Resource Manager @@ -37,7 +37,7 @@ com.azure.spring spring-cloud-azure-core - 4.18.0-beta.1 + 4.19.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-service/CHANGELOG.md b/sdk/spring/spring-cloud-azure-service/CHANGELOG.md index 69bda720e930..aa68b8828d29 100644 --- a/sdk/spring/spring-cloud-azure-service/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-service/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.18.0-beta.1 (Unreleased) +## 4.19.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.18.0 (2024-05-07) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4180-2024-05-07) for more details. + ## 4.17.0 (2024-03-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-service/pom.xml b/sdk/spring/spring-cloud-azure-service/pom.xml index 9cc495eb56df..beb2fc5f648a 100644 --- a/sdk/spring/spring-cloud-azure-service/pom.xml +++ b/sdk/spring/spring-cloud-azure-service/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-cloud-azure-service - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Service Spring Cloud Azure Service @@ -37,7 +37,7 @@ com.azure.spring spring-cloud-azure-core - 4.18.0-beta.1 + 4.19.0-beta.1 @@ -56,7 +56,7 @@ com.azure azure-messaging-servicebus - 7.16.0 + 7.17.0 true diff --git a/sdk/spring/spring-cloud-azure-starter-active-directory-b2c/pom.xml b/sdk/spring/spring-cloud-azure-starter-active-directory-b2c/pom.xml index d54e58f42ac6..d38c8cfca95f 100644 --- a/sdk/spring/spring-cloud-azure-starter-active-directory-b2c/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-active-directory-b2c/pom.xml @@ -7,7 +7,7 @@ com.azure.spring spring-cloud-azure-starter-active-directory-b2c - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter Active Directory B2C Spring Cloud Azure Starter Active Directory B2C @@ -87,7 +87,7 @@ com.azure.spring spring-cloud-azure-starter - 4.18.0-beta.1 + 4.19.0-beta.1 org.springframework.security diff --git a/sdk/spring/spring-cloud-azure-starter-active-directory/pom.xml b/sdk/spring/spring-cloud-azure-starter-active-directory/pom.xml index 56822ae1cdcc..65ee7a0c8e1f 100644 --- a/sdk/spring/spring-cloud-azure-starter-active-directory/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-active-directory/pom.xml @@ -7,7 +7,7 @@ com.azure.spring spring-cloud-azure-starter-active-directory - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter Active Directory Spring Cloud Azure Starter Active Directory @@ -86,7 +86,7 @@ com.azure.spring spring-cloud-azure-starter - 4.18.0-beta.1 + 4.19.0-beta.1 org.springframework.security diff --git a/sdk/spring/spring-cloud-azure-starter-actuator/pom.xml b/sdk/spring/spring-cloud-azure-starter-actuator/pom.xml index cb56bec792fe..5505e39f13df 100644 --- a/sdk/spring/spring-cloud-azure-starter-actuator/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-actuator/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-actuator - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter Actuator Spring Cloud Azure Starter Actuator @@ -88,12 +88,12 @@ com.azure.spring spring-cloud-azure-starter - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-actuator-autoconfigure - 4.18.0-beta.1 + 4.19.0-beta.1 org.springframework.boot diff --git a/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/CHANGELOG.md b/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/CHANGELOG.md index ccd45b959538..c5dbeb34c7a4 100644 --- a/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.18.0-beta.1 (Unreleased) +## 4.19.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.18.0 (2024-05-07) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4180-2024-05-07) for more details. + ## 4.17.0 (2024-03-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/README.md b/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/README.md index ab94a09b3945..7d8d1083487d 100644 --- a/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/README.md +++ b/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/README.md @@ -21,7 +21,7 @@ There are two libraries that can be used spring-cloud-azure-appconfiguration-con com.azure.spring spring-cloud-azure-appconfiguration-config - 4.17.0 + 4.18.0 ``` [//]: # ({x-version-update-end}) @@ -33,7 +33,7 @@ or com.azure.spring spring-cloud-azure-appconfiguration-config-web - 4.17.0 + 4.18.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/pom.xml b/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/pom.xml index 46b1a21899c1..539ffd20d827 100644 --- a/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-cloud-azure-starter-appconfiguration-config - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter App Configuration Config Spring Cloud Azure Starter App Configuration Config @@ -20,12 +20,12 @@ com.azure.spring spring-cloud-azure-appconfiguration-config-web - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-feature-management-web - 4.18.0-beta.1 + 4.19.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-appconfiguration/pom.xml b/sdk/spring/spring-cloud-azure-starter-appconfiguration/pom.xml index ef64a2d7aa22..606ca13761c0 100644 --- a/sdk/spring/spring-cloud-azure-starter-appconfiguration/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-appconfiguration/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-appconfiguration - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter App Configuration Spring Cloud Azure Starter App Configuration @@ -88,7 +88,7 @@ com.azure.spring spring-cloud-azure-starter - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure diff --git a/sdk/spring/spring-cloud-azure-starter-cosmos/pom.xml b/sdk/spring/spring-cloud-azure-starter-cosmos/pom.xml index 961413466935..77a60f670a47 100644 --- a/sdk/spring/spring-cloud-azure-starter-cosmos/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-cosmos/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-cosmos - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter Cosmos DB Spring Cloud Azure Starter Cosmos DB @@ -88,7 +88,7 @@ com.azure.spring spring-cloud-azure-starter - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure diff --git a/sdk/spring/spring-cloud-azure-starter-data-cosmos/pom.xml b/sdk/spring/spring-cloud-azure-starter-data-cosmos/pom.xml index f6d7e5a43353..e347970cb041 100644 --- a/sdk/spring/spring-cloud-azure-starter-data-cosmos/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-data-cosmos/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-data-cosmos - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter Data Cosmos DB Spring Cloud Azure Starter Data Cosmos DB @@ -88,12 +88,12 @@ com.azure.spring spring-cloud-azure-starter - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure azure-spring-data-cosmos - 3.45.0-beta.1 + 3.46.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-eventgrid/pom.xml b/sdk/spring/spring-cloud-azure-starter-eventgrid/pom.xml index f0aa79e39afa..5ea00a9ab071 100644 --- a/sdk/spring/spring-cloud-azure-starter-eventgrid/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-eventgrid/pom.xml @@ -7,7 +7,7 @@ com.azure.spring spring-cloud-azure-starter-eventgrid - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter Event Grid Spring Cloud Azure Starter Event Grid @@ -87,7 +87,7 @@ com.azure.spring spring-cloud-azure-starter - 4.18.0-beta.1 + 4.19.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-eventhubs/pom.xml b/sdk/spring/spring-cloud-azure-starter-eventhubs/pom.xml index b228381b4c49..8fb9ab784b65 100644 --- a/sdk/spring/spring-cloud-azure-starter-eventhubs/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-eventhubs/pom.xml @@ -7,7 +7,7 @@ com.azure.spring spring-cloud-azure-starter-eventhubs - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter Event Hubs Spring Cloud Azure Starter Event Hubs @@ -87,7 +87,7 @@ com.azure.spring spring-cloud-azure-starter - 4.18.0-beta.1 + 4.19.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-integration-eventhubs/pom.xml b/sdk/spring/spring-cloud-azure-starter-integration-eventhubs/pom.xml index 5889b59d7bbf..dfb76b3d5e77 100644 --- a/sdk/spring/spring-cloud-azure-starter-integration-eventhubs/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-integration-eventhubs/pom.xml @@ -7,7 +7,7 @@ com.azure.spring spring-cloud-azure-starter-integration-eventhubs - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter Integration Event Hubs Spring Cloud Azure Starter Integration Event Hubs @@ -87,7 +87,7 @@ com.azure.spring spring-cloud-azure-starter - 4.18.0-beta.1 + 4.19.0-beta.1 org.springframework.boot @@ -97,7 +97,7 @@ com.azure.spring spring-integration-azure-eventhubs - 4.18.0-beta.1 + 4.19.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-integration-servicebus/pom.xml b/sdk/spring/spring-cloud-azure-starter-integration-servicebus/pom.xml index 40d4ea9d1992..a89f23385c88 100644 --- a/sdk/spring/spring-cloud-azure-starter-integration-servicebus/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-integration-servicebus/pom.xml @@ -7,7 +7,7 @@ com.azure.spring spring-cloud-azure-starter-integration-servicebus - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter Integration Service Bus Spring Cloud Azure Starter Integration Service Bus @@ -89,7 +89,7 @@ com.azure.spring spring-cloud-azure-starter - 4.18.0-beta.1 + 4.19.0-beta.1 org.springframework.boot @@ -99,7 +99,7 @@ com.azure.spring spring-integration-azure-servicebus - 4.18.0-beta.1 + 4.19.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-integration-storage-queue/pom.xml b/sdk/spring/spring-cloud-azure-starter-integration-storage-queue/pom.xml index f1b5026f436e..2815759582bf 100644 --- a/sdk/spring/spring-cloud-azure-starter-integration-storage-queue/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-integration-storage-queue/pom.xml @@ -10,7 +10,7 @@ com.azure.spring spring-cloud-azure-starter-integration-storage-queue - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter Integration Storage Queue Spring Cloud Azure Starter Integration Storage Queue @@ -92,7 +92,7 @@ com.azure.spring spring-cloud-azure-starter - 4.18.0-beta.1 + 4.19.0-beta.1 org.springframework.boot @@ -102,7 +102,7 @@ com.azure.spring spring-integration-azure-storage-queue - 4.18.0-beta.1 + 4.19.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-jdbc-mysql/pom.xml b/sdk/spring/spring-cloud-azure-starter-jdbc-mysql/pom.xml index 99303b8f7796..374ffc0b6428 100644 --- a/sdk/spring/spring-cloud-azure-starter-jdbc-mysql/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-jdbc-mysql/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-jdbc-mysql - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter JDBC MySQL Spring Cloud Azure Starter for building applications with JDBC and Azure MySQL Services. Support authenticating with Azure AD. @@ -88,7 +88,7 @@ com.azure.spring spring-cloud-azure-starter - 4.18.0-beta.1 + 4.19.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-jdbc-postgresql/pom.xml b/sdk/spring/spring-cloud-azure-starter-jdbc-postgresql/pom.xml index 1288ef6a3b83..d664aced1b01 100644 --- a/sdk/spring/spring-cloud-azure-starter-jdbc-postgresql/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-jdbc-postgresql/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-jdbc-postgresql - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter JDBC PostgreSQL Spring Cloud Azure Starter for building applications with JDBC and Azure PostgreSQL Services. Support authenticating with Azure AD. @@ -88,7 +88,7 @@ com.azure.spring spring-cloud-azure-starter - 4.18.0-beta.1 + 4.19.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-keyvault-certificates/pom.xml b/sdk/spring/spring-cloud-azure-starter-keyvault-certificates/pom.xml index 50901ef0a0e5..932ca89d9525 100644 --- a/sdk/spring/spring-cloud-azure-starter-keyvault-certificates/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-keyvault-certificates/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-keyvault-certificates - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter Key Vault Certificates Spring Cloud Azure Starter Key Vault Certificates @@ -88,7 +88,7 @@ com.azure.spring spring-cloud-azure-starter - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure diff --git a/sdk/spring/spring-cloud-azure-starter-keyvault-secrets/pom.xml b/sdk/spring/spring-cloud-azure-starter-keyvault-secrets/pom.xml index c42bce0cbdc3..7f4d3ad73772 100644 --- a/sdk/spring/spring-cloud-azure-starter-keyvault-secrets/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-keyvault-secrets/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-keyvault-secrets - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter Key Vault Secrets Spring Cloud Azure Starter Key Vault Secrets @@ -88,7 +88,7 @@ com.azure.spring spring-cloud-azure-starter - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure diff --git a/sdk/spring/spring-cloud-azure-starter-keyvault/pom.xml b/sdk/spring/spring-cloud-azure-starter-keyvault/pom.xml index 7d7039b79f76..2dd3581b3608 100644 --- a/sdk/spring/spring-cloud-azure-starter-keyvault/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-keyvault/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-keyvault - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter Key Vault Spring Cloud Azure Starter Key Vault @@ -88,12 +88,12 @@ com.azure.spring spring-cloud-azure-starter-keyvault-secrets - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-starter-keyvault-certificates - 4.18.0-beta.1 + 4.19.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-redis/pom.xml b/sdk/spring/spring-cloud-azure-starter-redis/pom.xml index 86c3e3c0dac4..3071c83e6ff6 100644 --- a/sdk/spring/spring-cloud-azure-starter-redis/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-redis/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-redis - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter Redis Spring Cloud Azure Starter for building applications with Azure Cache for Redis. Support authenticating with Azure AD. @@ -88,7 +88,7 @@ com.azure.spring spring-cloud-azure-starter - 4.18.0-beta.1 + 4.19.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-servicebus-jms/pom.xml b/sdk/spring/spring-cloud-azure-starter-servicebus-jms/pom.xml index 42e4ce22afa9..4377ac30d9ab 100644 --- a/sdk/spring/spring-cloud-azure-starter-servicebus-jms/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-servicebus-jms/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-servicebus-jms - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter Service Bus JMS Spring Cloud Azure Starter Service Bus JMS @@ -88,7 +88,7 @@ com.azure.spring spring-cloud-azure-starter - 4.18.0-beta.1 + 4.19.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-servicebus/pom.xml b/sdk/spring/spring-cloud-azure-starter-servicebus/pom.xml index a02aed3a8427..f8a85eb12491 100644 --- a/sdk/spring/spring-cloud-azure-starter-servicebus/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-servicebus/pom.xml @@ -7,7 +7,7 @@ com.azure.spring spring-cloud-azure-starter-servicebus - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter Service Bus Spring Cloud Azure Starter Service Bus @@ -89,12 +89,12 @@ com.azure.spring spring-cloud-azure-starter - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure azure-messaging-servicebus - 7.16.0 + 7.17.0 diff --git a/sdk/spring/spring-cloud-azure-starter-storage-blob/pom.xml b/sdk/spring/spring-cloud-azure-starter-storage-blob/pom.xml index 0999561da331..c858539e614e 100644 --- a/sdk/spring/spring-cloud-azure-starter-storage-blob/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-storage-blob/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-storage-blob - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter Storage Blob Spring Cloud Azure Starter Storage Blob @@ -88,7 +88,7 @@ com.azure.spring spring-cloud-azure-starter - 4.18.0-beta.1 + 4.19.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-storage-file-share/pom.xml b/sdk/spring/spring-cloud-azure-starter-storage-file-share/pom.xml index b999e6efbfcd..b80cceb41e2c 100644 --- a/sdk/spring/spring-cloud-azure-starter-storage-file-share/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-storage-file-share/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-storage-file-share - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter Storage File Share Spring Cloud Azure Starter Storage File Share @@ -88,7 +88,7 @@ com.azure.spring spring-cloud-azure-starter - 4.18.0-beta.1 + 4.19.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-storage-queue/pom.xml b/sdk/spring/spring-cloud-azure-starter-storage-queue/pom.xml index e54fff3cb578..b4d9e29f25cc 100644 --- a/sdk/spring/spring-cloud-azure-starter-storage-queue/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-storage-queue/pom.xml @@ -10,7 +10,7 @@ com.azure.spring spring-cloud-azure-starter-storage-queue - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter Storage Queue Spring Cloud Azure Starter Storage Queue @@ -92,7 +92,7 @@ com.azure.spring spring-cloud-azure-starter - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure diff --git a/sdk/spring/spring-cloud-azure-starter-storage/pom.xml b/sdk/spring/spring-cloud-azure-starter-storage/pom.xml index 0a41be67fbc9..6d021919c18f 100644 --- a/sdk/spring/spring-cloud-azure-starter-storage/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-storage/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-storage - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter Storage Spring Cloud Azure Starter Storage @@ -88,19 +88,19 @@ com.azure.spring spring-cloud-azure-starter-storage-blob - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-starter-storage-file-share - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-starter-storage-queue - 4.18.0-beta.1 + 4.19.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-stream-eventhubs/pom.xml b/sdk/spring/spring-cloud-azure-starter-stream-eventhubs/pom.xml index d5d5346e8132..85df3f175dbd 100644 --- a/sdk/spring/spring-cloud-azure-starter-stream-eventhubs/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-stream-eventhubs/pom.xml @@ -7,7 +7,7 @@ com.azure.spring spring-cloud-azure-starter-stream-eventhubs - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter Stream Event Hubs Spring Cloud Azure Starter Stream Event Hubs @@ -87,7 +87,7 @@ com.azure.spring spring-cloud-azure-stream-binder-eventhubs - 4.18.0-beta.1 + 4.19.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-stream-servicebus/pom.xml b/sdk/spring/spring-cloud-azure-starter-stream-servicebus/pom.xml index 1239d2472066..12f878f20a34 100644 --- a/sdk/spring/spring-cloud-azure-starter-stream-servicebus/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-stream-servicebus/pom.xml @@ -7,7 +7,7 @@ com.azure.spring spring-cloud-azure-starter-stream-servicebus - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter Stream Service Bus Spring Cloud Azure Starter Stream Service Bus @@ -87,7 +87,7 @@ com.azure.spring spring-cloud-azure-stream-binder-servicebus - 4.18.0-beta.1 + 4.19.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter/pom.xml b/sdk/spring/spring-cloud-azure-starter/pom.xml index 300fc32c33c5..3b5099ac699f 100644 --- a/sdk/spring/spring-cloud-azure-starter/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Starter Core starter, including auto-configuration support @@ -93,7 +93,7 @@ com.azure.spring spring-cloud-azure-autoconfigure - 4.18.0-beta.1 + 4.19.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/CHANGELOG.md b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/CHANGELOG.md index 465a0ceac20d..1303275c337b 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.18.0-beta.1 (Unreleased) +## 4.19.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.18.0 (2024-05-07) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4180-2024-05-07) for more details. + ## 4.17.0 (2024-03-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/pom.xml b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/pom.xml index d2d41ac556e2..06aa4554c0e2 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/pom.xml +++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-cloud-azure-stream-binder-eventhubs-core - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Stream Binder Event Hubs Core Spring Cloud Azure Stream Binder Event Hubs Core @@ -49,7 +49,7 @@ com.azure.spring spring-integration-azure-eventhubs - 4.18.0-beta.1 + 4.19.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/CHANGELOG.md b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/CHANGELOG.md index 465a0ceac20d..1303275c337b 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.18.0-beta.1 (Unreleased) +## 4.19.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.18.0 (2024-05-07) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4180-2024-05-07) for more details. + ## 4.17.0 (2024-03-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/pom.xml b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/pom.xml index b3823c56bf5d..45f99b72a6f5 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/pom.xml +++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-cloud-azure-stream-binder-eventhubs - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Stream Binder Event Hubs Spring Cloud Azure Stream Binder Event Hubs @@ -37,12 +37,12 @@ com.azure.spring spring-cloud-azure-autoconfigure - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-stream-binder-eventhubs-core - 4.18.0-beta.1 + 4.19.0-beta.1 @@ -60,7 +60,7 @@ com.azure.spring spring-cloud-azure-resourcemanager - 4.18.0-beta.1 + 4.19.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/CHANGELOG.md b/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/CHANGELOG.md index 69bda720e930..aa68b8828d29 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.18.0-beta.1 (Unreleased) +## 4.19.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.18.0 (2024-05-07) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4180-2024-05-07) for more details. + ## 4.17.0 (2024-03-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/pom.xml b/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/pom.xml index 3728af289eba..5bf76654c0a3 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/pom.xml +++ b/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-cloud-azure-stream-binder-servicebus-core - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Stream Binder Service Bus Core Spring Cloud Azure Stream Binder Service Bus Core @@ -43,12 +43,12 @@ com.azure.spring spring-integration-azure-servicebus - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure azure-messaging-servicebus - 7.16.0 + 7.17.0 org.springframework.boot diff --git a/sdk/spring/spring-cloud-azure-stream-binder-servicebus/CHANGELOG.md b/sdk/spring/spring-cloud-azure-stream-binder-servicebus/CHANGELOG.md index 69bda720e930..aa68b8828d29 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-servicebus/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-stream-binder-servicebus/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.18.0-beta.1 (Unreleased) +## 4.19.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.18.0 (2024-05-07) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4180-2024-05-07) for more details. + ## 4.17.0 (2024-03-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-stream-binder-servicebus/pom.xml b/sdk/spring/spring-cloud-azure-stream-binder-servicebus/pom.xml index 0a7291f28ef9..ca4c6a740960 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-servicebus/pom.xml +++ b/sdk/spring/spring-cloud-azure-stream-binder-servicebus/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-cloud-azure-stream-binder-servicebus - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Stream Binder Service Bus Spring Cloud Azure Stream Binder Service Bus @@ -37,17 +37,17 @@ com.azure.spring spring-cloud-azure-stream-binder-servicebus-core - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-autoconfigure - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-cloud-azure-resourcemanager - 4.18.0-beta.1 + 4.19.0-beta.1 org.springframework.boot diff --git a/sdk/spring/spring-cloud-azure-trace-sleuth/CHANGELOG.md b/sdk/spring/spring-cloud-azure-trace-sleuth/CHANGELOG.md index 465a0ceac20d..1303275c337b 100644 --- a/sdk/spring/spring-cloud-azure-trace-sleuth/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-trace-sleuth/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.18.0-beta.1 (Unreleased) +## 4.19.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.18.0 (2024-05-07) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4180-2024-05-07) for more details. + ## 4.17.0 (2024-03-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-trace-sleuth/pom.xml b/sdk/spring/spring-cloud-azure-trace-sleuth/pom.xml index 08f755475e38..699990594057 100644 --- a/sdk/spring/spring-cloud-azure-trace-sleuth/pom.xml +++ b/sdk/spring/spring-cloud-azure-trace-sleuth/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-cloud-azure-trace-sleuth - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Cloud Azure Trace on Sleuth https://microsoft.github.io/spring-cloud-azure @@ -36,7 +36,7 @@ com.azure.spring spring-cloud-azure-core - 4.18.0-beta.1 + 4.19.0-beta.1 org.springframework.cloud diff --git a/sdk/spring/spring-integration-azure-core/CHANGELOG.md b/sdk/spring/spring-integration-azure-core/CHANGELOG.md index 69bda720e930..aa68b8828d29 100644 --- a/sdk/spring/spring-integration-azure-core/CHANGELOG.md +++ b/sdk/spring/spring-integration-azure-core/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.18.0-beta.1 (Unreleased) +## 4.19.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.18.0 (2024-05-07) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4180-2024-05-07) for more details. + ## 4.17.0 (2024-03-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. diff --git a/sdk/spring/spring-integration-azure-core/pom.xml b/sdk/spring/spring-integration-azure-core/pom.xml index 03b52f89ff4e..ce8b62cda41c 100644 --- a/sdk/spring/spring-integration-azure-core/pom.xml +++ b/sdk/spring/spring-integration-azure-core/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-integration-azure-core - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Integration Azure Core Spring Integration Azure Core @@ -41,7 +41,7 @@ com.azure.spring spring-messaging-azure - 4.18.0-beta.1 + 4.19.0-beta.1 org.springframework.integration diff --git a/sdk/spring/spring-integration-azure-eventhubs/CHANGELOG.md b/sdk/spring/spring-integration-azure-eventhubs/CHANGELOG.md index 465a0ceac20d..1303275c337b 100644 --- a/sdk/spring/spring-integration-azure-eventhubs/CHANGELOG.md +++ b/sdk/spring/spring-integration-azure-eventhubs/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.18.0-beta.1 (Unreleased) +## 4.19.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.18.0 (2024-05-07) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4180-2024-05-07) for more details. + ## 4.17.0 (2024-03-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. diff --git a/sdk/spring/spring-integration-azure-eventhubs/pom.xml b/sdk/spring/spring-integration-azure-eventhubs/pom.xml index 0627077adc40..c4621fa56634 100644 --- a/sdk/spring/spring-integration-azure-eventhubs/pom.xml +++ b/sdk/spring/spring-integration-azure-eventhubs/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-integration-azure-eventhubs - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Integration Azure Event Hubs Spring Integration Azure Event Hubs @@ -37,19 +37,19 @@ com.azure.spring spring-integration-azure-core - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-integration-azure-core - 4.18.0-beta.1 + 4.19.0-beta.1 test-jar test com.azure.spring spring-messaging-azure-eventhubs - 4.18.0-beta.1 + 4.19.0-beta.1 diff --git a/sdk/spring/spring-integration-azure-servicebus/CHANGELOG.md b/sdk/spring/spring-integration-azure-servicebus/CHANGELOG.md index 69bda720e930..aa68b8828d29 100644 --- a/sdk/spring/spring-integration-azure-servicebus/CHANGELOG.md +++ b/sdk/spring/spring-integration-azure-servicebus/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.18.0-beta.1 (Unreleased) +## 4.19.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.18.0 (2024-05-07) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4180-2024-05-07) for more details. + ## 4.17.0 (2024-03-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. diff --git a/sdk/spring/spring-integration-azure-servicebus/pom.xml b/sdk/spring/spring-integration-azure-servicebus/pom.xml index 55c5376e7452..66287f9ecbd9 100644 --- a/sdk/spring/spring-integration-azure-servicebus/pom.xml +++ b/sdk/spring/spring-integration-azure-servicebus/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-integration-azure-servicebus - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Integration Azure Service Bus Spring Integration Azure Service Bus @@ -37,24 +37,24 @@ com.azure.spring spring-integration-azure-core - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-integration-azure-core - 4.18.0-beta.1 + 4.19.0-beta.1 test-jar test com.azure.spring spring-messaging-azure-servicebus - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-messaging-azure-servicebus - 4.18.0-beta.1 + 4.19.0-beta.1 test-jar test diff --git a/sdk/spring/spring-integration-azure-storage-queue/CHANGELOG.md b/sdk/spring/spring-integration-azure-storage-queue/CHANGELOG.md index 69bda720e930..aa68b8828d29 100644 --- a/sdk/spring/spring-integration-azure-storage-queue/CHANGELOG.md +++ b/sdk/spring/spring-integration-azure-storage-queue/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.18.0-beta.1 (Unreleased) +## 4.19.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.18.0 (2024-05-07) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4180-2024-05-07) for more details. + ## 4.17.0 (2024-03-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. diff --git a/sdk/spring/spring-integration-azure-storage-queue/pom.xml b/sdk/spring/spring-integration-azure-storage-queue/pom.xml index 0c10e1f5f03d..c79317e1ffc3 100644 --- a/sdk/spring/spring-integration-azure-storage-queue/pom.xml +++ b/sdk/spring/spring-integration-azure-storage-queue/pom.xml @@ -13,7 +13,7 @@ com.azure.spring spring-integration-azure-storage-queue - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Integration Azure Storage Queue Spring Integration Azure Storage Queue @@ -38,12 +38,12 @@ com.azure.spring spring-integration-azure-core - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-messaging-azure-storage-queue - 4.18.0-beta.1 + 4.19.0-beta.1 + 4.19.0-beta.1 Spring Messaging Azure Event Hubs Spring Messaging Azure Event Hubs @@ -37,12 +37,12 @@ com.azure.spring spring-messaging-azure - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-messaging-azure - 4.18.0-beta.1 + 4.19.0-beta.1 test-jar test diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/messaging/eventhubs/core/EventHubsTemplateTests.java b/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/messaging/eventhubs/core/EventHubsTemplateTests.java index 7e931c350b6e..0a6109aa71db 100644 --- a/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/messaging/eventhubs/core/EventHubsTemplateTests.java +++ b/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/messaging/eventhubs/core/EventHubsTemplateTests.java @@ -5,6 +5,8 @@ import com.azure.core.amqp.exception.AmqpErrorCondition; import com.azure.core.amqp.exception.AmqpException; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.messaging.eventhubs.EventData; import com.azure.messaging.eventhubs.EventDataBatch; import com.azure.messaging.eventhubs.EventHubProducerAsyncClient; @@ -31,6 +33,7 @@ class EventHubsTemplateTests { + private static final ClientLogger LOGGER = new ClientLogger(EventHubsTemplateTests.class); private EventHubProducerAsyncClient mockProducerClient; protected String destination = "event-hub"; @@ -93,9 +96,8 @@ void testSendAsyncForMessagesOneBatchAndSendCompletely() { List> messages = messagesList.stream().map((Function>) GenericMessage::new).collect(Collectors.toList()); - Mono mono = this.eventHubsTemplate.sendAsync(this.destination, messages, null).doOnSuccess(t -> { - System.out.println("do on success:" + t); - }); + Mono mono = this.eventHubsTemplate.sendAsync(this.destination, messages, null) + .doOnSuccess(t -> LOGGER.log(LogLevel.VERBOSE, () -> "do on success:" + t)); StepVerifier.create(mono) .verifyComplete(); @@ -125,12 +127,9 @@ void testSendAsyncForMessagesOneBatchAndSendCompletelyWithException() { List> messages = messagesList.stream().map((Function>) GenericMessage::new).collect(Collectors.toList()); - Mono mono = this.eventHubsTemplate.sendAsync(this.destination, messages, null).doOnError(ex -> { - System.out.println("do on Error"); - ex.printStackTrace(); - }).doOnSuccess(t -> { - System.out.println("do on success:" + t); - }); + Mono mono = this.eventHubsTemplate.sendAsync(this.destination, messages, null) + .doOnError(ex -> LOGGER.log(LogLevel.VERBOSE, () -> "do on Error", ex)) + .doOnSuccess(t -> LOGGER.log(LogLevel.VERBOSE, () -> "do on success:" + t)); StepVerifier.create(mono) .verifyComplete(); verify(this.mockProducerClient, times(1)).send(any(EventDataBatch.class)); @@ -160,12 +159,9 @@ void testSendAsyncForMessagesTwoBatchAndSendCompletelyWithException() { List> messages = messagesList.stream().map((Function>) GenericMessage::new).collect(Collectors.toList()); - Mono mono = this.eventHubsTemplate.sendAsync(this.destination, messages, null).doOnError(ex -> { - System.out.println("do on Error"); - ex.printStackTrace(); - }).doOnSuccess(t -> { - System.out.println("do on success:" + t); - }); + Mono mono = this.eventHubsTemplate.sendAsync(this.destination, messages, null) + .doOnError(ex -> LOGGER.log(LogLevel.VERBOSE, () -> "do on Error", ex)) + .doOnSuccess(t -> LOGGER.log(LogLevel.VERBOSE, () -> "do on success:" + t)); StepVerifier.create(mono) .verifyComplete(); verify(this.mockProducerClient, times(2)).send(any(EventDataBatch.class)); @@ -189,12 +185,9 @@ void testSendAsyncForMessagesWithTheSecondEventTooLargeForOneNewBatch() { List> messages = messagesList.stream().map((Function>) GenericMessage::new).collect(Collectors.toList()); - Mono mono = this.eventHubsTemplate.sendAsync(this.destination, messages, null).doOnError(ex -> { - System.out.println("do on Error" + ex.getMessage()); - ex.printStackTrace(); - }).doOnSuccess(t -> { - System.out.println("do on success:" + t); - }); + Mono mono = this.eventHubsTemplate.sendAsync(this.destination, messages, null) + .doOnError(ex -> LOGGER.log(LogLevel.VERBOSE, () -> "do on Error", ex)) + .doOnSuccess(t -> LOGGER.log(LogLevel.VERBOSE, () -> "do on success:" + t)); StepVerifier.create(mono) .verifyComplete(); verify(this.mockProducerClient, times(2)).send(any(EventDataBatch.class)); diff --git a/sdk/spring/spring-messaging-azure-servicebus/CHANGELOG.md b/sdk/spring/spring-messaging-azure-servicebus/CHANGELOG.md index 465a0ceac20d..1303275c337b 100644 --- a/sdk/spring/spring-messaging-azure-servicebus/CHANGELOG.md +++ b/sdk/spring/spring-messaging-azure-servicebus/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.18.0-beta.1 (Unreleased) +## 4.19.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.18.0 (2024-05-07) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4180-2024-05-07) for more details. + ## 4.17.0 (2024-03-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. diff --git a/sdk/spring/spring-messaging-azure-servicebus/pom.xml b/sdk/spring/spring-messaging-azure-servicebus/pom.xml index 5a8526bbca21..f0730a03f99b 100644 --- a/sdk/spring/spring-messaging-azure-servicebus/pom.xml +++ b/sdk/spring/spring-messaging-azure-servicebus/pom.xml @@ -13,7 +13,7 @@ com.azure.spring spring-messaging-azure-servicebus - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Messaging Azure Service Bus Spring Messaging Azure Service Bus @@ -38,19 +38,19 @@ com.azure.spring spring-messaging-azure - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-messaging-azure - 4.18.0-beta.1 + 4.19.0-beta.1 test-jar test com.azure azure-messaging-servicebus - 7.16.0 + 7.17.0 com.azure diff --git a/sdk/spring/spring-messaging-azure-storage-queue/CHANGELOG.md b/sdk/spring/spring-messaging-azure-storage-queue/CHANGELOG.md index 69bda720e930..aa68b8828d29 100644 --- a/sdk/spring/spring-messaging-azure-storage-queue/CHANGELOG.md +++ b/sdk/spring/spring-messaging-azure-storage-queue/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.18.0-beta.1 (Unreleased) +## 4.19.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.18.0 (2024-05-07) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4180-2024-05-07) for more details. + ## 4.17.0 (2024-03-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. diff --git a/sdk/spring/spring-messaging-azure-storage-queue/pom.xml b/sdk/spring/spring-messaging-azure-storage-queue/pom.xml index 8df3a2d0ca0f..55abb82ccc5d 100644 --- a/sdk/spring/spring-messaging-azure-storage-queue/pom.xml +++ b/sdk/spring/spring-messaging-azure-storage-queue/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-messaging-azure-storage-queue - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Messaging Azure Storage Queue Spring Messaging Azure Storage Queue @@ -37,12 +37,12 @@ com.azure.spring spring-messaging-azure - 4.18.0-beta.1 + 4.19.0-beta.1 com.azure.spring spring-messaging-azure - 4.18.0-beta.1 + 4.19.0-beta.1 test-jar test diff --git a/sdk/spring/spring-messaging-azure/CHANGELOG.md b/sdk/spring/spring-messaging-azure/CHANGELOG.md index 465a0ceac20d..1303275c337b 100644 --- a/sdk/spring/spring-messaging-azure/CHANGELOG.md +++ b/sdk/spring/spring-messaging-azure/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.18.0-beta.1 (Unreleased) +## 4.19.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.18.0 (2024-05-07) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4180-2024-05-07) for more details. + ## 4.17.0 (2024-03-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. diff --git a/sdk/spring/spring-messaging-azure/pom.xml b/sdk/spring/spring-messaging-azure/pom.xml index c80a9aa147f5..92af809c1f82 100644 --- a/sdk/spring/spring-messaging-azure/pom.xml +++ b/sdk/spring/spring-messaging-azure/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-messaging-azure - 4.18.0-beta.1 + 4.19.0-beta.1 Spring Messaging Azure Spring Messaging Azure @@ -37,7 +37,7 @@ com.azure.spring spring-cloud-azure-service - 4.18.0-beta.1 + 4.19.0-beta.1 org.springframework diff --git a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/RequestRetryTestFactory.java b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/RequestRetryTestFactory.java index 0a3e792ec5fb..7fed3d1953bb 100644 --- a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/RequestRetryTestFactory.java +++ b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/RequestRetryTestFactory.java @@ -13,6 +13,8 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.UrlBuilder; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.storage.common.policy.RequestRetryOptions; import com.azure.storage.common.policy.RequestRetryPolicy; import reactor.core.Disposable; @@ -33,6 +35,8 @@ import static java.lang.StrictMath.pow; class RequestRetryTestFactory { + private static final ClientLogger LOGGER = new ClientLogger(RequestRetryTestFactory.class); + static final int RETRY_TEST_SCENARIO_RETRY_UNTIL_SUCCESS = 1; static final int RETRY_TEST_SCENARIO_RETRY_UNTIL_MAX_RETRIES = 2; @@ -219,7 +223,8 @@ public Mono send(HttpRequest request) { } }); while (!disposable.isDisposed()) { - System.out.println("Waiting for Flux to finish to prevent blocking on another thread exception"); + LOGGER.log(LogLevel.VERBOSE, + () -> "Waiting for Flux to finish to prevent blocking on another thread exception"); } if (retryTestDefaultData.compareTo(ByteBuffer.wrap(outputStream.toByteArray())) != 0) { throw new IllegalArgumentException(("Body not reset.")); diff --git a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/RetryTests.java b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/RetryTests.java index e0542697dd50..275488bc0ec6 100644 --- a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/RetryTests.java +++ b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/RetryTests.java @@ -5,6 +5,7 @@ import com.azure.core.exception.UnexpectedLengthException; import com.azure.core.http.HttpResponse; +import com.azure.core.util.logging.LogLevel; import com.azure.storage.common.policy.RequestRetryOptions; import com.azure.storage.common.policy.RetryPolicyType; import org.junit.jupiter.api.Test; @@ -32,7 +33,7 @@ public class RetryTests extends BlobTestBase { try { retryTestURL = new URL("https://" + RequestRetryTestFactory.RETRY_TEST_PRIMARY_HOST); } catch (MalformedURLException e) { - e.printStackTrace(); + LOGGER.log(LogLevel.VERBOSE, () -> "Failed to create URL for retry tests.", e); } } diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryApiTests.java index 4a9a58e0cd8b..3c795ad37af9 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryApiTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryApiTests.java @@ -1647,11 +1647,7 @@ public void createShareWithSmallTimeoutsFailForServiceClient() { return; } catch (Exception e) { // Test failed; wait before retrying - try { - Thread.sleep(retryDelayMillis); - } catch (InterruptedException ex) { - Thread.currentThread().interrupt(); - } + sleepIfRunningAgainstService(retryDelayMillis); } } } diff --git a/sdk/vision/azure-ai-vision-imageanalysis/src/test/java/com/azure/ai/vision/imageanalysis/ImageAnalysisClientTestBase.java b/sdk/vision/azure-ai-vision-imageanalysis/src/test/java/com/azure/ai/vision/imageanalysis/ImageAnalysisClientTestBase.java index 12484368612e..c9179536e7f5 100644 --- a/sdk/vision/azure-ai-vision-imageanalysis/src/test/java/com/azure/ai/vision/imageanalysis/ImageAnalysisClientTestBase.java +++ b/sdk/vision/azure-ai-vision-imageanalysis/src/test/java/com/azure/ai/vision/imageanalysis/ImageAnalysisClientTestBase.java @@ -6,9 +6,11 @@ import java.io.File; import java.util.List; import java.util.Map.Entry; +import java.util.Objects; import com.azure.core.credential.KeyCredential; import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpRequest; import com.azure.core.http.policy.HttpLogDetailLevel; import com.azure.core.http.policy.HttpLogOptions; @@ -26,11 +28,15 @@ import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import com.azure.ai.vision.imageanalysis.*; import com.azure.ai.vision.imageanalysis.models.*; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; class ImageAnalysisClientTestBase extends TestProxyTestBase { + private static final ClientLogger LOGGER = new ClientLogger(ImageAnalysisClientTestBase.class); final Boolean printResults = false; // Set to true to print results to console window @@ -64,8 +70,8 @@ private void createClient(String endpointEnvVar, String keyEnvVar, Boolean sync, endpoint = "https://fake-resource-name.cognitiveservices.azure.com"; } - String key = Configuration.getGlobalConfiguration().get(keyEnvVar); // Read real key from environment variable - if (key == null || keyEnvVar == "VISION_KEY_FAKE") { + String key = Configuration.getGlobalConfiguration().get(keyEnvVar); // Read real key from environment variable + if (key == null || Objects.equals(keyEnvVar, "VISION_KEY_FAKE")) { key = "00000000000000000000000000000000"; } @@ -105,7 +111,7 @@ protected void doAnalysis( ImageAnalysisOptions imageAnalysisOptions, // can be null RequestOptions requestOptions) { // can be null - Boolean fromUrl = imageSource.startsWith("http"); + boolean fromUrl = imageSource.startsWith("http"); Boolean genderNeutralCaption = null; List aspectRatios = null; @@ -209,7 +215,7 @@ protected void doAnalysisWithError( int expectedStatusCode, String expectedMessageContains) { - Boolean fromUrl = imageSource.startsWith("http"); + boolean fromUrl = imageSource.startsWith("http"); ImageAnalysisResult result = null; if (sync) { @@ -226,7 +232,7 @@ protected void doAnalysisWithError( options); } } catch (HttpResponseException e) { - System.out.println("Expected exception: " + e.getMessage()); + LOGGER.log(LogLevel.VERBOSE, () -> "Expected exception: " + e.getMessage()); assertEquals(expectedStatusCode, e.getResponse().getStatusCode()); assertTrue(e.getMessage().contains(expectedMessageContains)); return; @@ -245,15 +251,15 @@ protected void doAnalysisWithError( options).block(); } } catch (HttpResponseException e) { - System.out.println("Expected exception: " + e.getMessage()); + LOGGER.log(LogLevel.VERBOSE, () -> "Expected exception: " + e.getMessage()); assertEquals(expectedStatusCode, e.getResponse().getStatusCode()); assertTrue(e.getMessage().contains(expectedMessageContains)); return; } } - System.out.println("Test should have thrown an exception, but it did not"); - assertTrue(false); + LOGGER.log(LogLevel.VERBOSE, () -> "Test should have thrown an exception, but it did not"); + fail(); } private static void validateAnalysisResult( @@ -372,7 +378,7 @@ private static void validateDenseCaptions(ImageAnalysisResult result) { // Do not include the check below. It's okay to have two identical dense captions since they have different bounding boxes. // assertFalse(otherDenseCaption.getText().equals(denseCaption.getText())); assertFalse( - otherDenseCaption.getBoundingBox().getX() == denseCaption.getBoundingBox().getX() + otherDenseCaption.getBoundingBox().getX() == denseCaption.getBoundingBox().getX() && otherDenseCaption.getBoundingBox().getY() == denseCaption.getBoundingBox().getY() && otherDenseCaption.getBoundingBox().getHeight() == denseCaption.getBoundingBox().getHeight() && otherDenseCaption.getBoundingBox().getWidth() == denseCaption.getBoundingBox().getWidth()); @@ -389,7 +395,7 @@ private static void validateObjects(ObjectsResult objectsResult) { assertNotNull(objectsResult); assertTrue(objectsResult.getValues().size() > 1); - Boolean found1 = false; + boolean found1 = false; for (DetectedObject object : objectsResult.getValues()) { assertNotNull(object); assertNotNull(object.getTags()); @@ -401,7 +407,7 @@ private static void validateObjects(ObjectsResult objectsResult) { assertTrue(tag.getConfidence() > 0.0); assertTrue(tag.getConfidence() < 1.0); // We expect to see this in the list of objects - if (tag.getName().toLowerCase().equals("person")) { + if (tag.getName().equalsIgnoreCase("person")) { found1 = true; } } @@ -431,17 +437,17 @@ private static void validateTags(TagsResult tagsResult) { assertNotNull(tagsResult.getValues()); assertTrue(tagsResult.getValues().size() > 1); - Boolean found1 = false, found2 = false; + boolean found1 = false, found2 = false; for (DetectedTag tag : tagsResult.getValues()) { assertNotNull(tag.getName()); assertFalse(tag.getName().isEmpty()); assertTrue(tag.getConfidence() > 0.0); assertTrue(tag.getConfidence() < 1.0); // We expect to see both of these in the list of tags - if (tag.getName().toLowerCase().equals("person")) { + if (tag.getName().equalsIgnoreCase("person")) { found1 = true; } - if (tag.getName().toLowerCase().equals("laptop")) { + if (tag.getName().equalsIgnoreCase("laptop")) { found2 = true; } } @@ -458,7 +464,7 @@ private static void validateTags(TagsResult tagsResult) { private static void validatePeople(ImageAnalysisResult result) { assertNotNull(result.getPeople()); - assertTrue(result.getPeople().getValues().size() > 0); + assertFalse(result.getPeople().getValues().isEmpty()); for (DetectedPerson person : result.getPeople().getValues()) { assertTrue(person.getConfidence() > 0.0); @@ -487,13 +493,13 @@ private static void validateSmartCrops(ImageAnalysisResult result, List assertNotNull(result.getSmartCrops()); List listCropRegions = result.getSmartCrops().getValues(); if (aspectRatios == null) { - assertTrue(listCropRegions.size() == 1); + assertEquals(1, listCropRegions.size()); assertTrue(listCropRegions.get(0).getAspectRatio() >= 0.5); assertTrue(listCropRegions.get(0).getAspectRatio() <= 2.0); } else { - assertTrue(listCropRegions.size() == aspectRatios.size()); + assertEquals(listCropRegions.size(), aspectRatios.size()); for (int i = 0; i < listCropRegions.size(); i++) { - assertTrue(listCropRegions.get(i).getAspectRatio() == aspectRatios.get(i)); + assertEquals(listCropRegions.get(i).getAspectRatio(), aspectRatios.get(i)); assertTrue(listCropRegions.get(0).getAspectRatio() >= 0.75); assertTrue(listCropRegions.get(0).getAspectRatio() <= 1.8); } @@ -537,20 +543,20 @@ private static void validateRead(ImageAnalysisResult result) { // Do some validations on the first line DetectedTextLine line = lines.get(0); assertNotNull(line); - assertTrue(line.getText().equals("Sample text")); + assertEquals("Sample text", line.getText()); List polygon = line.getBoundingPolygon(); assertNotNull(polygon); assertEquals(4, polygon.size()); - for (int i = 0; i < polygon.size(); i++) { - assertTrue(polygon.get(i).getX() > 0); - assertTrue(polygon.get(i).getY() > 0); + for (ImagePoint imagePoint : polygon) { + assertTrue(imagePoint.getX() > 0); + assertTrue(imagePoint.getY() > 0); } // Do some verifications on the 3rd line line = lines.get(2); assertNotNull(line); - assertTrue(line.getText().equals("123 456")); + assertEquals("123 456", line.getText()); List words = line.getWords(); assertNotNull(words); @@ -558,111 +564,111 @@ private static void validateRead(ImageAnalysisResult result) { DetectedTextWord word = words.get(1); assertNotNull(word); - assertTrue(word.getText().equals("456")); + assertEquals("456", word.getText()); assertTrue(word.getConfidence() > 0.0); assertTrue(word.getConfidence() < 1.0); polygon = word.getBoundingPolygon(); assertNotNull(polygon); assertEquals(4, polygon.size()); - for (int i = 0; i < polygon.size(); i++) { - assertTrue(polygon.get(i).getX() > 0); - assertTrue(polygon.get(i).getY() > 0); + for (ImagePoint imagePoint : polygon) { + assertTrue(imagePoint.getX() > 0); + assertTrue(imagePoint.getY() > 0); } } private static void printHttpRequestAndResponse(Response response) { // Print HTTP request details to console HttpRequest request = response.getRequest(); - System.out.println(" HTTP request method: " + request.getHttpMethod()); - System.out.println(" HTTP request URL: " + request.getUrl()); - System.out.println(" HTTP request headers: "); + LOGGER.log(LogLevel.VERBOSE, () -> " HTTP request method: " + request.getHttpMethod()); + LOGGER.log(LogLevel.VERBOSE, () -> " HTTP request URL: " + request.getUrl()); + LOGGER.log(LogLevel.VERBOSE, () -> " HTTP request headers: "); request.getHeaders().forEach(header -> { - System.out.println(" " + header.getName() + ": " + header.getValue()); + LOGGER.log(LogLevel.VERBOSE, () -> " " + header.getName() + ": " + header.getValue()); }); - if (request.getHeaders().getValue("content-type").contains("application/json")) { - System.out.println(" HTTP request body: " + request.getBodyAsBinaryData().toString()); + if (request.getHeaders().getValue(HttpHeaderName.CONTENT_TYPE).contains("application/json")) { + LOGGER.log(LogLevel.VERBOSE, () -> " HTTP request body: " + request.getBodyAsBinaryData().toString()); } // Print HTTP response details to console - System.out.println(" HTTP response status code: " + response.getStatusCode()); - System.out.println(" HTTP response headers: "); + LOGGER.log(LogLevel.VERBOSE, () -> " HTTP response status code: " + response.getStatusCode()); + LOGGER.log(LogLevel.VERBOSE, () -> " HTTP response headers: "); response.getHeaders().forEach(header -> { - System.out.println(" " + header.getName() + ": " + header.getValue()); + LOGGER.log(LogLevel.VERBOSE, () -> " " + header.getName() + ": " + header.getValue()); }); } private static void printAnalysisResults(String testName, ImageAnalysisResult result) { - System.out.println(" ******************** TEST NAME: " + testName + " ******************** "); + LOGGER.log(LogLevel.VERBOSE, () -> " ******************** TEST NAME: " + testName + " ******************** "); try { - System.out.println(" Image height: " + result.getMetadata().getHeight()); - System.out.println(" Image width: " + result.getMetadata().getWidth()); - System.out.println(" Model version: " + result.getModelVersion()); + LOGGER.log(LogLevel.VERBOSE, () -> " Image height: " + result.getMetadata().getHeight()); + LOGGER.log(LogLevel.VERBOSE, () -> " Image width: " + result.getMetadata().getWidth()); + LOGGER.log(LogLevel.VERBOSE, () -> " Model version: " + result.getModelVersion()); if (result.getCaption() != null) { - System.out.println(" Caption:"); - System.out.println(" \"" + result.getCaption().getText() + "\", Confidence " + LOGGER.log(LogLevel.VERBOSE, () -> " Caption:"); + LOGGER.log(LogLevel.VERBOSE, () -> " \"" + result.getCaption().getText() + "\", Confidence " + String.format("%.4f", result.getCaption().getConfidence())); } if (result.getDenseCaptions() != null) { - System.out.println(" Dense Captions:"); + LOGGER.log(LogLevel.VERBOSE, () -> " Dense Captions:"); for (DenseCaption denseCaption : result.getDenseCaptions().getValues()) { - System.out.println(" \"" + denseCaption.getText() + "\", Bounding box " + LOGGER.log(LogLevel.VERBOSE, () -> " \"" + denseCaption.getText() + "\", Bounding box " + denseCaption.getBoundingBox() + ", Confidence " + String.format("%.4f", denseCaption.getConfidence())); } } if (result.getObjects() != null) { - System.out.println(" Objects:"); + LOGGER.log(LogLevel.VERBOSE, () -> " Objects:"); for (DetectedObject detectedObject : result.getObjects().getValues()) { - System.out.println(" \"" + detectedObject.getTags().get(0).getName() + "\", Bounding box " + LOGGER.log(LogLevel.VERBOSE, () -> " \"" + detectedObject.getTags().get(0).getName() + "\", Bounding box " + detectedObject.getBoundingBox() + ", Confidence " + String.format("%.4f", detectedObject.getTags().get(0).getConfidence())); } } if (result.getTags() != null) { - System.out.println(" Tags:"); + LOGGER.log(LogLevel.VERBOSE, () -> " Tags:"); for (DetectedTag tag : result.getTags().getValues()) { - System.out.println(" \"" + tag.getName() + "\", Confidence " + LOGGER.log(LogLevel.VERBOSE, () -> " \"" + tag.getName() + "\", Confidence " + String.format("%.4f", tag.getConfidence())); } } if (result.getPeople() != null) { - System.out.println(" People:"); + LOGGER.log(LogLevel.VERBOSE, () -> " People:"); for (DetectedPerson person : result.getPeople().getValues()) { - System.out.println(" Bounding box " + person.getBoundingBox() + LOGGER.log(LogLevel.VERBOSE, () -> " Bounding box " + person.getBoundingBox() + ", Confidence " + String.format("%.4f", person.getConfidence())); } } if (result.getSmartCrops() != null) { - System.out.println(" Crop Suggestions:"); + LOGGER.log(LogLevel.VERBOSE, () -> " Crop Suggestions:"); for (CropRegion cropRegion : result.getSmartCrops().getValues()) { - System.out.println(" Aspect ratio " + cropRegion.getAspectRatio() + LOGGER.log(LogLevel.VERBOSE, () -> " Aspect ratio " + cropRegion.getAspectRatio() + ": Bounding box " + cropRegion.getBoundingBox()); } } if (result.getRead() != null) { - System.out.println(" Read:"); + LOGGER.log(LogLevel.VERBOSE, () -> " Read:"); for (DetectedTextLine line : result.getRead().getBlocks().get(0).getLines()) { - System.out.println(" Line: '" + line.getText() + LOGGER.log(LogLevel.VERBOSE, () -> " Line: '" + line.getText() + "', Bounding polygon " + line.getBoundingPolygon()); for (DetectedTextWord word : line.getWords()) { - System.out.println(" Word: '" + word.getText() + LOGGER.log(LogLevel.VERBOSE, () -> " Word: '" + word.getText() + "', Bounding polygon " + word.getBoundingPolygon() + ", Confidence " + String.format("%.4f", word.getConfidence())); } } } } catch (Exception e) { - e.printStackTrace(); + LOGGER.log(LogLevel.VERBOSE, () -> "Error printing analysis results", e); } } } diff --git a/sdk/webpubsub/azure-messaging-webpubsub-client/src/test/java/com/azure/messaging/webpubsub/client/GroupMessageTests.java b/sdk/webpubsub/azure-messaging-webpubsub-client/src/test/java/com/azure/messaging/webpubsub/client/GroupMessageTests.java index dd6fc1ad5aff..316e35d9a0db 100644 --- a/sdk/webpubsub/azure-messaging-webpubsub-client/src/test/java/com/azure/messaging/webpubsub/client/GroupMessageTests.java +++ b/sdk/webpubsub/azure-messaging-webpubsub-client/src/test/java/com/azure/messaging/webpubsub/client/GroupMessageTests.java @@ -5,6 +5,8 @@ import com.azure.core.test.annotation.DoNotRecord; import com.azure.core.util.BinaryData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.logging.LogLevel; import com.azure.messaging.webpubsub.client.models.SendMessageFailedException; import com.azure.messaging.webpubsub.client.models.SendToGroupOptions; import com.azure.messaging.webpubsub.client.models.WebPubSubDataFormat; @@ -18,6 +20,7 @@ import java.util.concurrent.TimeUnit; public class GroupMessageTests extends TestBase { + private static final ClientLogger LOGGER = new ClientLogger(GroupMessageTests.class); private static final String HELLO = "hello"; @@ -178,9 +181,10 @@ public void testSendMessagePerformance() throws InterruptedException { final long endNanoReceive = System.nanoTime(); // about 800 ms for 1k messages - System.out.println("send takes milliseconds: " + (endNanoSend - beginNano) / 1E6); + LOGGER.log(LogLevel.VERBOSE, () -> "send takes milliseconds: " + (endNanoSend - beginNano) / 1E6); // about 1 second for 1k messages - System.out.println("send and receive takes milliseconds: " + (endNanoReceive - beginNano) / 1E6); + LOGGER.log(LogLevel.VERBOSE, + () -> "send and receive takes milliseconds: " + (endNanoReceive - beginNano) / 1E6); } finally { client.stop(); } From 179f90483482c8a13d30cf81758596ebd404d785 Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Thu, 9 May 2024 12:08:12 -0700 Subject: [PATCH 11/33] Initial changes --- .../cosmos/models/CosmosQueryRequestOptions.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java index 309fb87a8b22..f9d7d4a72531 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java @@ -265,6 +265,17 @@ public Integer getMaxItemSizeForVectorSearch() { return this.actualRequestOptions.getMaxItemSizeForVectorSearch(); } + /** + * Sets the maximum item size to fetch during non-streaming order by queries. + * + * @param maxItemSizeForVectorSearch the max number of items for vector search. + * @return the CosmosQueryRequestOptions. + */ + public CosmosQueryRequestOptions setMaxItemSizeForVectorSearch(Integer maxItemSizeForVectorSearch) { + this.actualRequestOptions.setMaxItemSizeForVectorSearch(maxItemSizeForVectorSearch); + return this; + } + /** * Gets the request continuation token. * From 70639b5847fa179f2bde0f9676b29c8e190c6cf1 Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Fri, 10 May 2024 13:34:46 -0700 Subject: [PATCH 12/33] Initial changes --- .../implementation/CosmosQueryRequestOptionsImpl.java | 2 +- ...nStreamingOrderByDocumentQueryExecutionContext.java | 10 +++++++--- .../implementation/query/NonStreamingOrderByUtils.java | 5 ++++- .../query/PipelinedDocumentQueryExecutionContext.java | 7 ++++++- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java index c70ded3a906f..6d7b00068393 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java @@ -204,7 +204,7 @@ public CosmosQueryRequestOptionsImpl setMaxItemCount(Integer maxItemCount) { * @return the max number of items for vector search. */ public Integer getMaxItemSizeForVectorSearch() { - return maxItemSizeForVectorSearch; + return this.maxItemSizeForVectorSearch; } /** diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java index 89a8a3065443..2f3abb36e9d1 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java @@ -29,6 +29,7 @@ import java.util.ArrayList; import java.util.Collection; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; @@ -125,10 +126,13 @@ private void initialize( // Since the continuation token will always be null, // we don't need to handle any initialization based on continuationToken. // We can directly initialize without any consideration for continuationToken. + Map partitionKeyRangeToContinuationToken = new HashMap<>(); + for (FeedRangeEpkImpl feedRangeEpk : feedRanges) { + partitionKeyRangeToContinuationToken.put(feedRangeEpk, + null); + } super.initialize(collection, - feedRanges.stream().collect(Collectors.toMap( - feedRangeEpk -> feedRangeEpk, - feedRangeEpk -> null)), + partitionKeyRangeToContinuationToken, initialPageSize, new SqlQuerySpec(querySpec.getQueryText().replace(FormatPlaceHolder, True), querySpec.getParameters())); diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java index 1b4191e26413..b4ac33a1dbc2 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java @@ -74,7 +74,10 @@ private PageToItemTransformer(RequestChargeTracker tracker, Map> apply(Flux.DocumentProducerFeedResponse> source) { - PriorityBlockingQueue> priorityQueue = new PriorityBlockingQueue<>(initialPageSize, consumeComparer); + // the size of the priority queue is set to size+1, because when the pq reaches the max size we add that + // item and then remove the element. If we don't do this, then when adding this element the size of the pq + // will be increased automatically by 50% and then there would be inconsistent results for later pages. + PriorityBlockingQueue> priorityQueue = new PriorityBlockingQueue<>(initialPageSize + 1, consumeComparer); return source.flatMap(documentProducerFeedResponse -> { clientSideRequestStatistics.addAll( diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java index a6ea9fc2d5f6..82746ad412b5 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java @@ -5,6 +5,7 @@ import com.azure.cosmos.CosmosItemSerializer; import com.azure.cosmos.implementation.DiagnosticsClientContext; import com.azure.cosmos.implementation.DocumentCollection; +import com.azure.cosmos.implementation.HttpConstants; import com.azure.cosmos.implementation.ImplementationBridgeHelpers; import com.azure.cosmos.implementation.Document; import com.azure.cosmos.implementation.ObjectNodeMap; @@ -56,7 +57,11 @@ private static BiFunction, Flux Date: Fri, 10 May 2024 13:52:17 -0700 Subject: [PATCH 13/33] Fixes --- .../com/azure/cosmos/rx/VectorIndexTest.java | 345 ------------------ sdk/cosmos/azure-cosmos/CHANGELOG.md | 1 - .../cosmos/implementation/Constants.java | 9 - .../implementation/DocumentCollection.java | 31 -- .../azure/cosmos/models/CompositePath.java | 2 +- .../models/CosmosContainerProperties.java | 22 -- .../cosmos/models/CosmosVectorDataType.java | 58 --- .../models/CosmosVectorDistanceFunction.java | 53 --- .../cosmos/models/CosmosVectorEmbedding.java | 128 ------- .../models/CosmosVectorEmbeddingPolicy.java | 55 --- .../cosmos/models/CosmosVectorIndexSpec.java | 77 ---- .../cosmos/models/CosmosVectorIndexType.java | 36 -- .../azure/cosmos/models/IndexingPolicy.java | 53 +-- .../cosmos/models/ModelBridgeInternal.java | 4 - 14 files changed, 5 insertions(+), 869 deletions(-) delete mode 100644 sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java delete mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDataType.java delete mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDistanceFunction.java delete mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbedding.java delete mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbeddingPolicy.java delete mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexSpec.java delete mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexType.java diff --git a/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java deleted file mode 100644 index 74f13be9d4f4..000000000000 --- a/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java +++ /dev/null @@ -1,345 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.cosmos.rx; - -import com.azure.cosmos.ConsistencyLevel; -import com.azure.cosmos.CosmosAsyncClient; -import com.azure.cosmos.CosmosAsyncContainer; -import com.azure.cosmos.CosmosAsyncDatabase; -import com.azure.cosmos.CosmosClientBuilder; -import com.azure.cosmos.CosmosDatabaseForTest; -import com.azure.cosmos.CosmosException; -import com.azure.cosmos.DirectConnectionConfig; -import com.azure.cosmos.implementation.TestConfigurations; -import com.azure.cosmos.implementation.Utils; -import com.azure.cosmos.implementation.guava25.collect.ImmutableList; -import com.azure.cosmos.models.CosmosContainerProperties; -import com.azure.cosmos.models.CosmosVectorDataType; -import com.azure.cosmos.models.CosmosVectorDistanceFunction; -import com.azure.cosmos.models.CosmosVectorEmbedding; -import com.azure.cosmos.models.CosmosVectorEmbeddingPolicy; -import com.azure.cosmos.models.ExcludedPath; -import com.azure.cosmos.models.IncludedPath; -import com.azure.cosmos.models.IndexingMode; -import com.azure.cosmos.models.IndexingPolicy; -import com.azure.cosmos.models.PartitionKeyDefinition; -import com.azure.cosmos.models.CosmosVectorIndexSpec; -import com.azure.cosmos.models.CosmosVectorIndexType; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Ignore; -import org.testng.annotations.Test; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.UUID; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.fail; - -@Ignore("TODO: Ignore these test cases until the public emulator with vector indexes is released.") -public class VectorIndexTest extends TestSuiteBase { - protected static final int TIMEOUT = 30000; - protected static final int SETUP_TIMEOUT = 20000; - protected static final int SHUTDOWN_TIMEOUT = 20000; - - protected static Logger logger = LoggerFactory.getLogger(VectorIndexTest.class.getSimpleName()); - private final ObjectMapper simpleObjectMapper = Utils.getSimpleObjectMapper(); - private final String databaseId = CosmosDatabaseForTest.generateId(); - private CosmosAsyncClient client; - private CosmosAsyncDatabase database; - - @BeforeClass(groups = {"emulator"}, timeOut = SETUP_TIMEOUT) - public void before_VectorIndexTest() { - // set up the client - client = new CosmosClientBuilder() - .endpoint(TestConfigurations.HOST) - .key(TestConfigurations.MASTER_KEY) - .directMode(DirectConnectionConfig.getDefaultConfig()) - .consistencyLevel(ConsistencyLevel.SESSION) - .contentResponseOnWriteEnabled(true) - .buildAsyncClient(); - - database = createDatabase(client, databaseId); - } - - @AfterClass(groups = {"emulator"}, timeOut = SHUTDOWN_TIMEOUT, alwaysRun = true) - public void afterClass() { - safeDeleteDatabase(database); - safeClose(client); - } - - @Test(groups = {"emulator"}, timeOut = TIMEOUT*10000) - public void shouldCreateVectorEmbeddingPolicy() { - PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); - ArrayList paths = new ArrayList(); - paths.add("/mypk"); - partitionKeyDef.setPaths(paths); - - CosmosContainerProperties collectionDefinition = new CosmosContainerProperties(UUID.randomUUID().toString(), partitionKeyDef); - - IndexingPolicy indexingPolicy = new IndexingPolicy(); - indexingPolicy.setIndexingMode(IndexingMode.CONSISTENT); - ExcludedPath excludedPath = new ExcludedPath("/*"); - indexingPolicy.setExcludedPaths(Collections.singletonList(excludedPath)); - - IncludedPath includedPath1 = new IncludedPath("/name/?"); - IncludedPath includedPath2 = new IncludedPath("/description/?"); - indexingPolicy.setIncludedPaths(ImmutableList.of(includedPath1, includedPath2)); - - indexingPolicy.setVectorIndexes(populateVectorIndexes()); - - CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy = new CosmosVectorEmbeddingPolicy(); - cosmosVectorEmbeddingPolicy.setCosmosVectorEmbeddings(populateEmbeddings()); - - collectionDefinition.setIndexingPolicy(indexingPolicy); - collectionDefinition.setVectorEmbeddingPolicy(cosmosVectorEmbeddingPolicy); - - database.createContainer(collectionDefinition).block(); - CosmosAsyncContainer createdCollection = database.getContainer(collectionDefinition.getId()); - CosmosContainerProperties collectionProperties = createdCollection.read().block().getProperties(); - validateCollectionProperties(collectionDefinition, collectionProperties); - } - - @Test(groups = {"emulator"}, timeOut = TIMEOUT) - public void shouldFailOnEmptyVectorEmbeddingPolicy() { - PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); - ArrayList paths = new ArrayList(); - paths.add("/mypk"); - partitionKeyDef.setPaths(paths); - - CosmosContainerProperties collectionDefinition = new CosmosContainerProperties(UUID.randomUUID().toString(), partitionKeyDef); - - IndexingPolicy indexingPolicy = new IndexingPolicy(); - indexingPolicy.setIndexingMode(IndexingMode.CONSISTENT); - ExcludedPath excludedPath = new ExcludedPath("/*"); - indexingPolicy.setExcludedPaths(Collections.singletonList(excludedPath)); - - IncludedPath includedPath1 = new IncludedPath("/name/?"); - IncludedPath includedPath2 = new IncludedPath("/description/?"); - indexingPolicy.setIncludedPaths(ImmutableList.of(includedPath1, includedPath2)); - - CosmosVectorIndexSpec cosmosVectorIndexSpec = new CosmosVectorIndexSpec(); - cosmosVectorIndexSpec.setPath("/vector1"); - cosmosVectorIndexSpec.setType(CosmosVectorIndexType.FLAT.toString()); - indexingPolicy.setVectorIndexes(ImmutableList.of(cosmosVectorIndexSpec)); - - collectionDefinition.setIndexingPolicy(indexingPolicy); - - try { - database.createContainer(collectionDefinition).block(); - fail("Container creation will fail as no vector embedding policy is being passed"); - } catch (CosmosException ex) { - assertThat(ex.getStatusCode()).isEqualTo(400); - assertThat(ex.getMessage()).contains("vector1 not matching in Embedding's path"); - } - } - - @Test(groups = {"emulator"}, timeOut = TIMEOUT) - public void shouldFailOnWrongVectorIndex() { - PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); - ArrayList paths = new ArrayList(); - paths.add("/mypk"); - partitionKeyDef.setPaths(paths); - - CosmosContainerProperties collectionDefinition = new CosmosContainerProperties(UUID.randomUUID().toString(), partitionKeyDef); - - IndexingPolicy indexingPolicy = new IndexingPolicy(); - indexingPolicy.setIndexingMode(IndexingMode.CONSISTENT); - ExcludedPath excludedPath = new ExcludedPath("/*"); - indexingPolicy.setExcludedPaths(Collections.singletonList(excludedPath)); - - IncludedPath includedPath1 = new IncludedPath("/name/?"); - IncludedPath includedPath2 = new IncludedPath("/description/?"); - indexingPolicy.setIncludedPaths(ImmutableList.of(includedPath1, includedPath2)); - - CosmosVectorIndexSpec cosmosVectorIndexSpec = new CosmosVectorIndexSpec(); - cosmosVectorIndexSpec.setPath("/vector1"); - cosmosVectorIndexSpec.setType("NonFlat"); - indexingPolicy.setVectorIndexes(ImmutableList.of(cosmosVectorIndexSpec)); - collectionDefinition.setIndexingPolicy(indexingPolicy); - - CosmosVectorEmbedding embedding = new CosmosVectorEmbedding(); - embedding.setPath("/vector1"); - embedding.setDataType(CosmosVectorDataType.FLOAT32); - embedding.setDimensions(3L); - embedding.setDistanceFunction(CosmosVectorDistanceFunction.COSINE); - CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy = new CosmosVectorEmbeddingPolicy(); - cosmosVectorEmbeddingPolicy.setCosmosVectorEmbeddings(ImmutableList.of(embedding)); - collectionDefinition.setVectorEmbeddingPolicy(cosmosVectorEmbeddingPolicy); - - try { - database.createContainer(collectionDefinition).block(); - fail("Container creation will fail as wrong vector index type is being passed"); - } catch (CosmosException ex) { - assertThat(ex.getStatusCode()).isEqualTo(400); - assertThat(ex.getMessage()).contains("NonFlat is invalid, Valid types are 'flat' or 'quantizedFlat'"); - } - } - - @Test(groups = {"emulator"}, timeOut = TIMEOUT) - public void shouldCreateVectorIndexSimilarPathDifferentVectorType() { - PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); - ArrayList paths = new ArrayList(); - paths.add("/mypk"); - partitionKeyDef.setPaths(paths); - - CosmosContainerProperties collectionDefinition = new CosmosContainerProperties(UUID.randomUUID().toString(), partitionKeyDef); - - IndexingPolicy indexingPolicy = new IndexingPolicy(); - indexingPolicy.setIndexingMode(IndexingMode.CONSISTENT); - ExcludedPath excludedPath = new ExcludedPath("/*"); - indexingPolicy.setExcludedPaths(Collections.singletonList(excludedPath)); - - IncludedPath includedPath1 = new IncludedPath("/name/?"); - IncludedPath includedPath2 = new IncludedPath("/description/?"); - indexingPolicy.setIncludedPaths(ImmutableList.of(includedPath1, includedPath2)); - - List vectorIndexes = populateVectorIndexes(); - vectorIndexes.get(2).setPath("/vector2"); - indexingPolicy.setVectorIndexes(vectorIndexes); - - List embeddings = populateEmbeddings(); - embeddings.get(2).setPath("/vector2"); - CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy = new CosmosVectorEmbeddingPolicy(); - cosmosVectorEmbeddingPolicy.setCosmosVectorEmbeddings(embeddings); - - collectionDefinition.setIndexingPolicy(indexingPolicy); - collectionDefinition.setVectorEmbeddingPolicy(cosmosVectorEmbeddingPolicy); - - database.createContainer(collectionDefinition).block(); - CosmosAsyncContainer createdCollection = database.getContainer(collectionDefinition.getId()); - CosmosContainerProperties collectionProperties = createdCollection.read().block().getProperties(); - validateCollectionProperties(collectionDefinition, collectionProperties); - } - - @Test(groups = {"unit"}, timeOut = TIMEOUT) - public void shouldFailOnWrongVectorEmbeddingPolicy() { - CosmosVectorEmbedding embedding = new CosmosVectorEmbedding(); - try { - - embedding.setDataType(null); - fail("Embedding creation failed because cosmosVectorDataType argument is empty"); - } catch (NullPointerException ex) { - assertThat(ex.getMessage()).isEqualTo("cosmosVectorDataType cannot be empty"); - } - - try { - embedding.setDistanceFunction(null); - fail("Embedding creation failed because cosmosVectorDistanceFunction argument is empty"); - } catch (NullPointerException ex) { - assertThat(ex.getMessage()).isEqualTo("cosmosVectorDistanceFunction cannot be empty"); - } - - try { - embedding.setDimensions(null); - fail("Embedding creation failed because dimensions argument is empty"); - } catch (NullPointerException ex) { - assertThat(ex.getMessage()).isEqualTo("dimensions cannot be empty"); - } - - try { - embedding.setDimensions(-1L); - fail("Vector Embedding policy creation will fail for negative dimensions being passed"); - } catch (IllegalArgumentException ex) { - assertThat(ex.getMessage()).isEqualTo("Dimensions for the embedding has to be a long value greater than 1 for the vector embedding policy"); - } - } - - @Test(groups = {"unit"}, timeOut = TIMEOUT) - public void shouldValidateVectorEmbeddingPolicySerializationAndDeserialization() throws JsonProcessingException { - IndexingPolicy indexingPolicy = new IndexingPolicy(); - indexingPolicy.setVectorIndexes(populateVectorIndexes()); - - CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy = new CosmosVectorEmbeddingPolicy(); - cosmosVectorEmbeddingPolicy.setCosmosVectorEmbeddings(populateEmbeddings()); - String vectorEmbeddingPolicyJson = getVectorEmbeddingPolicyAsString(); - String expectedVectorEmbeddingPolicyJson = simpleObjectMapper.writeValueAsString(cosmosVectorEmbeddingPolicy); - assertThat(vectorEmbeddingPolicyJson).isEqualTo(expectedVectorEmbeddingPolicyJson); - - CosmosVectorEmbeddingPolicy expectedCosmosVectorEmbeddingPolicy = simpleObjectMapper.readValue(expectedVectorEmbeddingPolicyJson, CosmosVectorEmbeddingPolicy.class); - validateVectorEmbeddingPolicy(cosmosVectorEmbeddingPolicy, expectedCosmosVectorEmbeddingPolicy); - } - - private void validateCollectionProperties(CosmosContainerProperties collectionDefinition, CosmosContainerProperties collectionProperties) { - assertThat(collectionProperties.getVectorEmbeddingPolicy()).isNotNull(); - assertThat(collectionProperties.getVectorEmbeddingPolicy().getVectorEmbeddings()).isNotNull(); - validateVectorEmbeddingPolicy(collectionProperties.getVectorEmbeddingPolicy(), - collectionDefinition.getVectorEmbeddingPolicy()); - - assertThat(collectionProperties.getIndexingPolicy().getVectorIndexes()).isNotNull(); - validateVectorIndexes(collectionDefinition.getIndexingPolicy().getVectorIndexes(), collectionProperties.getIndexingPolicy().getVectorIndexes()); - } - - private void validateVectorEmbeddingPolicy(CosmosVectorEmbeddingPolicy actual, CosmosVectorEmbeddingPolicy expected) { - List actualEmbeddings = actual.getVectorEmbeddings(); - List expectedEmbeddings = expected.getVectorEmbeddings(); - assertThat(expectedEmbeddings).hasSameSizeAs(actualEmbeddings); - for (int i = 0; i < expectedEmbeddings.size(); i++) { - assertThat(expectedEmbeddings.get(i).getPath()).isEqualTo(actualEmbeddings.get(i).getPath()); - assertThat(expectedEmbeddings.get(i).getDataType()).isEqualTo(actualEmbeddings.get(i).getDataType()); - assertThat(expectedEmbeddings.get(i).getDimensions()).isEqualTo(actualEmbeddings.get(i).getDimensions()); - assertThat(expectedEmbeddings.get(i).getDistanceFunction()).isEqualTo(actualEmbeddings.get(i).getDistanceFunction()); - } - } - - private void validateVectorIndexes(List actual, List expected) { - assertThat(expected).hasSameSizeAs(actual); - for (int i = 0; i < expected.size(); i++) { - assertThat(expected.get(i).getPath()).isEqualTo(actual.get(i).getPath()); - assertThat(expected.get(i).getType()).isEqualTo(actual.get(i).getType()); - } - } - - private List populateVectorIndexes() { - CosmosVectorIndexSpec cosmosVectorIndexSpec1 = new CosmosVectorIndexSpec(); - cosmosVectorIndexSpec1.setPath("/vector1"); - cosmosVectorIndexSpec1.setType(CosmosVectorIndexType.FLAT.toString()); - - CosmosVectorIndexSpec cosmosVectorIndexSpec2 = new CosmosVectorIndexSpec(); - cosmosVectorIndexSpec2.setPath("/vector2"); - cosmosVectorIndexSpec2.setType(CosmosVectorIndexType.QUANTIZED_FLAT.toString()); - - CosmosVectorIndexSpec cosmosVectorIndexSpec3 = new CosmosVectorIndexSpec(); - cosmosVectorIndexSpec3.setPath("/vector3"); - cosmosVectorIndexSpec3.setType(CosmosVectorIndexType.DISK_ANN.toString()); - - return Arrays.asList(cosmosVectorIndexSpec1, cosmosVectorIndexSpec2, cosmosVectorIndexSpec3); - } - - private List populateEmbeddings() { - CosmosVectorEmbedding embedding1 = new CosmosVectorEmbedding(); - embedding1.setPath("/vector1"); - embedding1.setDataType(CosmosVectorDataType.INT8); - embedding1.setDimensions(3L); - embedding1.setDistanceFunction(CosmosVectorDistanceFunction.COSINE); - - CosmosVectorEmbedding embedding2 = new CosmosVectorEmbedding(); - embedding2.setPath("/vector2"); - embedding2.setDataType(CosmosVectorDataType.FLOAT32); - embedding2.setDimensions(3L); - embedding2.setDistanceFunction(CosmosVectorDistanceFunction.DOT_PRODUCT); - - CosmosVectorEmbedding embedding3 = new CosmosVectorEmbedding(); - embedding3.setPath("/vector3"); - embedding3.setDataType(CosmosVectorDataType.UINT8); - embedding3.setDimensions(3L); - embedding3.setDistanceFunction(CosmosVectorDistanceFunction.EUCLIDEAN); - return Arrays.asList(embedding1, embedding2, embedding3); - } - - private String getVectorEmbeddingPolicyAsString() { - return "{\"vectorEmbeddings\":[" + - "{\"path\":\"/vector1\",\"dataType\":\"int8\",\"dimensions\":3,\"distanceFunction\":\"cosine\"}," + - "{\"path\":\"/vector2\",\"dataType\":\"float32\",\"dimensions\":3,\"distanceFunction\":\"dotproduct\"}," + - "{\"path\":\"/vector3\",\"dataType\":\"uint8\",\"dimensions\":3,\"distanceFunction\":\"euclidean\"}" + - "]}"; - } -} diff --git a/sdk/cosmos/azure-cosmos/CHANGELOG.md b/sdk/cosmos/azure-cosmos/CHANGELOG.md index 686ee7b6b8e2..01db4f44daa2 100644 --- a/sdk/cosmos/azure-cosmos/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos/CHANGELOG.md @@ -15,7 +15,6 @@ ### 4.59.0 (2024-04-27) #### Features Added -* Added `cosmosVectorEmbeddingPolicy` in `cosmosContainerProperties` and `vectorIndexes` in `indexPolicy` to support vector search in CosmosDB - See[39379](https://github.com/Azure/azure-sdk-for-java/pull/39379) * Added public APIs `getCustomItemSerializer` and `setCustomItemSerializer` to allow customers to specify custom payload transformations or serialization settings. - See [PR 38997](https://github.com/Azure/azure-sdk-for-java/pull/38997) and [PR 39933](https://github.com/Azure/azure-sdk-for-java/pull/39933) #### Other Changes diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Constants.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Constants.java index f789963783ed..8409d5b7ec23 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Constants.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Constants.java @@ -120,15 +120,6 @@ public static final class Properties { public static final String SPATIAL_INDEXES = "spatialIndexes"; public static final String TYPES = "types"; - // Vector Embedding Policy - public static final String VECTOR_EMBEDDING_POLICY = "vectorEmbeddingPolicy"; - public static final String VECTOR_INDEXES = "vectorIndexes"; - public static final String VECTOR_EMBEDDINGS = "vectorEmbeddings"; - public static final String VECTOR_INDEX_TYPE = "type"; - public static final String VECTOR_DATA_TYPE = "dataType"; - public static final String VECTOR_DIMENSIONS = "dimensions"; - public static final String DISTANCE_FUNCTION = "distanceFunction"; - // Unique index. public static final String UNIQUE_KEY_POLICY = "uniqueKeyPolicy"; public static final String UNIQUE_KEYS = "uniqueKeys"; diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentCollection.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentCollection.java index 1930f2275a61..b3d650157796 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentCollection.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentCollection.java @@ -10,7 +10,6 @@ import com.azure.cosmos.models.ClientEncryptionPolicy; import com.azure.cosmos.models.ComputedProperty; import com.azure.cosmos.models.ConflictResolutionPolicy; -import com.azure.cosmos.models.CosmosVectorEmbeddingPolicy; import com.azure.cosmos.models.IndexingPolicy; import com.azure.cosmos.models.ModelBridgeInternal; import com.azure.cosmos.models.PartitionKeyDefinition; @@ -25,8 +24,6 @@ import java.util.Collection; import java.util.Collections; -import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; - /** * Represents a document collection in the Azure Cosmos DB database service. A collection is a named logical container * for documents. @@ -43,7 +40,6 @@ public final class DocumentCollection extends Resource { private UniqueKeyPolicy uniqueKeyPolicy; private PartitionKeyDefinition partitionKeyDefinition; private ClientEncryptionPolicy clientEncryptionPolicyInternal; - private CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy; /** * Constructor. @@ -414,33 +410,6 @@ public void setClientEncryptionPolicy(ClientEncryptionPolicy value) { this.set(Constants.Properties.CLIENT_ENCRYPTION_POLICY, value, CosmosItemSerializer.DEFAULT_SERIALIZER); } - /** - * Gets the Vector Embedding Policy containing paths for embeddings along with path-specific settings for the item - * used in performing vector search on the items in a collection in the Azure CosmosDB database service. - * - * @return the Vector Embedding Policy. - */ - public CosmosVectorEmbeddingPolicy getVectorEmbeddingPolicy() { - if (this.cosmosVectorEmbeddingPolicy == null) { - if (super.has(Constants.Properties.VECTOR_EMBEDDING_POLICY)) { - this.cosmosVectorEmbeddingPolicy = super.getObject(Constants.Properties.VECTOR_EMBEDDING_POLICY, - CosmosVectorEmbeddingPolicy.class); - } - } - return this.cosmosVectorEmbeddingPolicy; - } - - /** - * Sets the Vector Embedding Policy containing paths for embeddings along with path-specific settings for the item - * used in performing vector search on the items in a collection in the Azure CosmosDB database service. - * - * @param value the Vector Embedding Policy. - */ - public void setVectorEmbeddingPolicy(CosmosVectorEmbeddingPolicy value) { - checkNotNull(value, "cosmosVectorEmbeddingPolicy cannot be null"); - this.set(Constants.Properties.VECTOR_EMBEDDING_POLICY, value, CosmosItemSerializer.DEFAULT_SERIALIZER); - } - public void populatePropertyBag() { super.populatePropertyBag(); if (this.indexingPolicy == null) { diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CompositePath.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CompositePath.java index 8cfd99b46e37..a278e0aa8f50 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CompositePath.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CompositePath.java @@ -93,7 +93,7 @@ public CompositePathSortOrder getOrder() { } /** - * Sets the sort order for the composite path. + * Gets the sort order for the composite path. *

* For example if you want to run the query "SELECT * FROM c ORDER BY c.age asc, c.height desc", * then you need to make the order for "/age" "ascending" and the order for "/height" "descending". diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java index 0d357da0cc37..4fae5a797a70 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java @@ -347,28 +347,6 @@ public CosmosContainerProperties setClientEncryptionPolicy(ClientEncryptionPolic return this; } - /** - * Gets the Vector Embedding Policy containing paths for embeddings along with path-specific settings for the item - * used in performing vector search on the items in a collection in the Azure CosmosDB database service. - * - * @return the Vector Embedding Policy. - */ - public CosmosVectorEmbeddingPolicy getVectorEmbeddingPolicy() { - return this.documentCollection.getVectorEmbeddingPolicy(); - } - - /** - * Sets the Vector Embedding Policy containing paths for embeddings along with path-specific settings for the item - * used in performing vector search on the items in a collection in the Azure CosmosDB database service. - * - * @param value the Vector Embedding Policy. - * @return the CosmosContainerProperties. - */ - public CosmosContainerProperties setVectorEmbeddingPolicy(CosmosVectorEmbeddingPolicy value) { - this.documentCollection.setVectorEmbeddingPolicy(value); - return this; - } - Resource getResource() { return this.documentCollection; } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDataType.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDataType.java deleted file mode 100644 index 1a0d42af17a4..000000000000 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDataType.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.cosmos.models; - -import com.fasterxml.jackson.annotation.JsonValue; - -import java.util.Arrays; - -/** - * Data types for the embeddings in Cosmos DB database service. - */ -public enum CosmosVectorDataType { - /** - * Represents a int8 data type. - */ - INT8("int8"), - - /** - * Represents a uint8 data type. - */ - UINT8("uint8"), - - /** - * Represents a float16 data type. - */ - FLOAT16("float16"), - - /** - * Represents a float32 data type. - */ - FLOAT32("float32"); - - private final String overWireValue; - - CosmosVectorDataType(String overWireValue) { - this.overWireValue = overWireValue; - } - - @JsonValue - @Override - public String toString() { - return this.overWireValue; - } - - /** - * Method to retrieve the enum constant by its overWireValue. - * @param value the overWire value of the enum constant - * @return the matching CosmosVectorDataType - * @throws IllegalArgumentException if no matching enum constant is found - */ - public static CosmosVectorDataType fromString(String value) { - return Arrays.stream(CosmosVectorDataType.values()) - .filter(vectorDataType -> vectorDataType.toString().equalsIgnoreCase(value)) - .findFirst() - .orElseThrow(() -> new IllegalArgumentException("Invalid vector data type for the vector embedding policy.")); - } -} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDistanceFunction.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDistanceFunction.java deleted file mode 100644 index 60efd432ad7f..000000000000 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDistanceFunction.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.cosmos.models; - -import com.fasterxml.jackson.annotation.JsonValue; - -import java.util.Arrays; - -/** - * Distance Function for the embeddings in the Cosmos DB database service. - */ -public enum CosmosVectorDistanceFunction { - /** - * Represents the euclidean distance function. - */ - EUCLIDEAN("euclidean"), - - /** - * Represents the cosine distance function. - */ - COSINE("cosine"), - - /** - * Represents the dot product distance function. - */ - DOT_PRODUCT("dotproduct"); - - private final String overWireValue; - - CosmosVectorDistanceFunction(String overWireValue) { - this.overWireValue = overWireValue; - } - - @JsonValue - @Override - public String toString() { - return this.overWireValue; - } - - /** - * Method to retrieve the enum constant by its overWireValue. - * @param value the overWire value of the enum constant - * @return the matching CosmosVectorDataType - * @throws IllegalArgumentException if no matching enum constant is found - */ - public static CosmosVectorDistanceFunction fromString(String value) { - return Arrays.stream(CosmosVectorDistanceFunction.values()) - .filter(vectorDistanceFunction -> vectorDistanceFunction.toString().equalsIgnoreCase(value)) - .findFirst() - .orElseThrow(() -> new IllegalArgumentException("Invalid distance function for the vector embedding policy.")); - } -} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbedding.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbedding.java deleted file mode 100644 index 94a519ef9d38..000000000000 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbedding.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.cosmos.models; - -import com.azure.cosmos.implementation.Constants; -import com.azure.cosmos.implementation.JsonSerializable; -import com.azure.cosmos.implementation.apachecommons.lang.StringUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; - -/** - * Embedding settings within {@link CosmosVectorEmbeddingPolicy} - */ -public final class CosmosVectorEmbedding { - @JsonProperty(Constants.Properties.PATH) - private String path; - @JsonProperty(Constants.Properties.VECTOR_DATA_TYPE) - private String dataType; - @JsonProperty(Constants.Properties.VECTOR_DIMENSIONS) - private Long dimensions; - @JsonProperty(Constants.Properties.DISTANCE_FUNCTION) - private String distanceFunction; - private JsonSerializable jsonSerializable; - - /** - * Constructor - */ - public CosmosVectorEmbedding() { - this.jsonSerializable = new JsonSerializable(); - } - - /** - * Gets the path for the cosmosVectorEmbedding. - * - * @return path - */ - public String getPath() { - return path; - } - - /** - * Sets the path for the cosmosVectorEmbedding. - * - * @param path the path for the cosmosVectorEmbedding - * @return CosmosVectorEmbedding - */ - public CosmosVectorEmbedding setPath(String path) { - if (StringUtils.isEmpty(path)) { - throw new NullPointerException("embedding path is empty"); - } - - if (path.charAt(0) != '/' || path.lastIndexOf('/') != 0) { - throw new IllegalArgumentException(""); - } - - this.path = path; - return this; - } - - /** - * Gets the data type for the cosmosVectorEmbedding. - * - * @return dataType - */ - public CosmosVectorDataType getDataType() { - return CosmosVectorDataType.fromString(dataType); - } - - /** - * Sets the data type for the cosmosVectorEmbedding. - * - * @param dataType the data type for the cosmosVectorEmbedding - * @return CosmosVectorEmbedding - */ - public CosmosVectorEmbedding setDataType(CosmosVectorDataType dataType) { - checkNotNull(dataType, "cosmosVectorDataType cannot be null"); - this.dataType = dataType.toString(); - return this; - } - - /** - * Gets the dimensions for the cosmosVectorEmbedding. - * - * @return dimensions - */ - public Long getDimensions() { - return dimensions; - } - - /** - * Sets the dimensions for the cosmosVectorEmbedding. - * - * @param dimensions the dimensions for the cosmosVectorEmbedding - * @return CosmosVectorEmbedding - */ - public CosmosVectorEmbedding setDimensions(Long dimensions) { - checkNotNull(dimensions, "dimensions cannot be null"); - if (dimensions < 1) { - throw new IllegalArgumentException("Dimensions for the embedding has to be a long value greater than 0 " + - "for the vector embedding policy"); - } - - this.dimensions = dimensions; - return this; - } - - /** - * Gets the distanceFunction for the cosmosVectorEmbedding. - * - * @return distanceFunction - */ - public CosmosVectorDistanceFunction getDistanceFunction() { - return CosmosVectorDistanceFunction.fromString(distanceFunction); - } - - /** - * Sets the distanceFunction for the cosmosVectorEmbedding. - * - * @param distanceFunction the distanceFunction for the cosmosVectorEmbedding - * @return CosmosVectorEmbedding - */ - public CosmosVectorEmbedding setDistanceFunction(CosmosVectorDistanceFunction distanceFunction) { - checkNotNull(distanceFunction, "cosmosVectorDistanceFunction cannot be empty"); - this.distanceFunction = distanceFunction.toString(); - return this; - } -} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbeddingPolicy.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbeddingPolicy.java deleted file mode 100644 index c54c843ebd96..000000000000 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbeddingPolicy.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.cosmos.models; - -import com.azure.cosmos.implementation.Constants; -import com.azure.cosmos.implementation.JsonSerializable; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -/** - * Vector Embedding Policy - */ -public final class CosmosVectorEmbeddingPolicy { - - private JsonSerializable jsonSerializable; - /** - * Paths for embeddings along with path-specific settings for the item. - */ - @JsonProperty(Constants.Properties.VECTOR_EMBEDDINGS) - private List cosmosVectorEmbeddings; - - /** - * Constructor - */ - public CosmosVectorEmbeddingPolicy() { - this.jsonSerializable = new JsonSerializable(); - } - - /** - * Gets the paths for embeddings along with path-specific settings for the item. - * - * @return the paths for embeddings along with path-specific settings for the item. - */ - public List getVectorEmbeddings() { - return this.cosmosVectorEmbeddings; - } - - /** - * Sets the paths for embeddings along with path-specific settings for the item. - * - * @param cosmosVectorEmbeddings paths for embeddings along with path-specific settings for the item. - */ - public void setCosmosVectorEmbeddings(List cosmosVectorEmbeddings) { - cosmosVectorEmbeddings.forEach(embedding -> { - if (embedding == null) { - throw new NullPointerException("Embedding cannot be null."); - } - }); - this.cosmosVectorEmbeddings = cosmosVectorEmbeddings; -// this.jsonSerializable.set(Constants.Properties.VECTOR_EMBEDDINGS, cosmosVectorEmbeddings); - } - -} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexSpec.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexSpec.java deleted file mode 100644 index 13b1559810ca..000000000000 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexSpec.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.cosmos.models; - -import com.azure.cosmos.CosmosItemSerializer; -import com.azure.cosmos.implementation.Constants; -import com.azure.cosmos.implementation.JsonSerializable; - -import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; - -/** - * Vector Indexes spec for Azure CosmosDB service. - */ -public final class CosmosVectorIndexSpec { - - private JsonSerializable jsonSerializable; - private String type; - - /** - * Constructor - */ - public CosmosVectorIndexSpec() { this.jsonSerializable = new JsonSerializable(); } - - /** - * Gets path. - * - * @return the path. - */ - public String getPath() { - return this.jsonSerializable.getString(Constants.Properties.PATH); - } - - /** - * Sets path. - * - * @param path the path. - * @return the SpatialSpec. - */ - public CosmosVectorIndexSpec setPath(String path) { - this.jsonSerializable.set(Constants.Properties.PATH, path, CosmosItemSerializer.DEFAULT_SERIALIZER); - return this; - } - - /** - * Gets the vector index type for the vector index - * - * @return the vector index type - */ - public String getType() { - if (this.type == null) { - this.type = this.jsonSerializable.getString(Constants.Properties.VECTOR_INDEX_TYPE); - } - return this.type; - } - - /** - * Sets the vector index type for the vector index - * - * @param type the vector index type - * @return the VectorIndexSpec - */ - public CosmosVectorIndexSpec setType(String type) { - checkNotNull(type, "cosmosVectorIndexType cannot be null"); - this.type = type; - this.jsonSerializable.set(Constants.Properties.VECTOR_INDEX_TYPE, this.type, CosmosItemSerializer.DEFAULT_SERIALIZER); - return this; - } - - void populatePropertyBag() { - this.jsonSerializable.populatePropertyBag(); - } - - JsonSerializable getJsonSerializable() { - return this.jsonSerializable; - } -} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexType.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexType.java deleted file mode 100644 index 679ea1f991c0..000000000000 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexType.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.cosmos.models; - -/** - * Defines the index type of vector index specification in the Azure Cosmos DB service. - */ -public enum CosmosVectorIndexType { - /** - * Represents a flat vector index type. - */ - FLAT("flat"), - - /** - * Represents a quantized flat vector index type. - */ - QUANTIZED_FLAT("quantizedFlat"), - - /** - * Represents a disk ANN vector index type. - */ - DISK_ANN("diskANN"); - - - private final String overWireValue; - - CosmosVectorIndexType(String overWireValue) { - this.overWireValue = overWireValue; - } - - @Override - public String toString() { - return this.overWireValue; - } -} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java index 678cea56fcc4..939fc773c7e7 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java @@ -20,12 +20,11 @@ */ public final class IndexingPolicy { private static final String DEFAULT_PATH = "/*"; - private final JsonSerializable jsonSerializable; private List includedPaths; private List excludedPaths; private List> compositeIndexes; private List spatialIndexes; - private List vectorIndexes; + private final JsonSerializable jsonSerializable; /** * Constructor. @@ -53,7 +52,7 @@ public IndexingPolicy() { * * * @param defaultIndexOverrides comma separated set of indexes that serve as default index specifications for the - * root path. + * root path. * @throws IllegalArgumentException throws when defaultIndexOverrides is null */ IndexingPolicy(Index[] defaultIndexOverrides) { @@ -234,7 +233,7 @@ public IndexingPolicy setCompositeIndexes(List> compositeInd } /** - * Gets the spatial indexes for additional indexes. + * Sets the spatial indexes for additional indexes. * * @return the spatial indexes. */ @@ -265,55 +264,11 @@ public IndexingPolicy setSpatialIndexes(List spatialIndexes) { return this; } - /** - * Gets the vector indexes. - * - * @return the vector indexes - */ - public List getVectorIndexes() { - if (this.vectorIndexes == null) { - this.vectorIndexes = this.jsonSerializable.getList(Constants.Properties.VECTOR_INDEXES, CosmosVectorIndexSpec.class); - - if (this.vectorIndexes == null) { - this.vectorIndexes = new ArrayList(); - } - } - - return this.vectorIndexes; - } - - /** - * Sets the vector indexes. - * - * Example of the vectorIndexes: - * "vectorIndexes": [ - * { - * "path": "/vector1", - * "type": "diskANN" - * }, - * { - * "path": "/vector1", - * "type": "flat" - * }, - * { - * "path": "/vector2", - * "type": "quantizedFlat" - * }] - * - * @param vectorIndexes the vector indexes - * @return the Indexing Policy. - */ - public IndexingPolicy setVectorIndexes(List vectorIndexes) { - this.vectorIndexes = vectorIndexes; - this.jsonSerializable.set(Constants.Properties.VECTOR_INDEXES,this.vectorIndexes, CosmosItemSerializer.DEFAULT_SERIALIZER); - return this; - } - void populatePropertyBag() { this.jsonSerializable.populatePropertyBag(); // If indexing mode is not 'none' and not paths are set, set them to the defaults if (this.getIndexingMode() != IndexingMode.NONE && this.getIncludedPaths().size() == 0 - && this.getExcludedPaths().size() == 0) { + && this.getExcludedPaths().size() == 0) { IncludedPath includedPath = new IncludedPath(IndexingPolicy.DEFAULT_PATH); this.getIncludedPaths().add(includedPath); } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java index e814cc16681b..cb9aba599c77 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java @@ -435,8 +435,6 @@ public static void populatePropertyBag(T t) { ((PartitionKeyDefinition) t).populatePropertyBag(); } else if (t instanceof SpatialSpec) { ((SpatialSpec) t).populatePropertyBag(); - } else if (t instanceof CosmosVectorIndexSpec) { - ((CosmosVectorIndexSpec) t).populatePropertyBag(); } else if (t instanceof SqlParameter) { ((SqlParameter) t).populatePropertyBag(); } else if (t instanceof SqlQuerySpec) { @@ -470,8 +468,6 @@ public static JsonSerializable getJsonSerializable(T t) { return ((PartitionKeyDefinition) t).getJsonSerializable(); } else if (t instanceof SpatialSpec) { return ((SpatialSpec) t).getJsonSerializable(); - } else if (t instanceof CosmosVectorIndexSpec) { - return ((CosmosVectorIndexSpec) t).getJsonSerializable(); } else if (t instanceof SqlParameter) { return ((SqlParameter) t).getJsonSerializable(); } else if (t instanceof SqlQuerySpec) { From 9d427e635f0c7c8300e31ba8c9e82cc5c99f5888 Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Fri, 10 May 2024 15:27:40 -0700 Subject: [PATCH 14/33] Users/akataria/vectorindexing (#40117) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adding changes for vectorIndex and vectorEmbeddingPolicy * Adding some necessary comments * Adding test case * updating enum values * Updating test case * Updating test case * Updating test case * updating changelog * Updating test case * Resolving comments * Resolving comments * Fixing test case * Resolving comments * Resolving Comments * Fixing build issues * Resolving comments * Resolving Comments * [Cosmos][VectorIndex]Adding changes for vectorIndex and vectorEmbeddingPolicy (#40004) * Adding changes for vectorIndex and vectorEmbeddingPolicy * Adding some necessary comments * Adding test case * updating enum values * Updating test case * Updating test case * Updating test case * updating changelog * Updating test case * Resolving comments * Resolving comments * Fixing test case * Resolving comments * Resolving Comments * Fixing build issues * Resolving comments * Resolving Comments * [Cosmos][VectorSearch] Non Streaming Order By Query (#40085) * Increment versions for core releases (#40003) Increment package versions for core releases * Ensure ServiceBus session idle timeout fall back to retry-options::try-timeout (#39994) * Added Alpha3 Java Media Streaming Events (#40002) * Added Alpha3 Java Media Streaming Events * updating readme to add the media streaming events to remove model --------- Co-authored-by: Vinothini Dharmaraj * Update version of github-event-processor to 1.0.0-dev.20240502.2 (#40012) Co-authored-by: James Suplizio * Prepare May 2024 Identity Release (#40006) * Prepare Identity Broker May 2024 Release (#40014) * Increment package versions for identity releases (#40015) * [JobRouter] SDK Review updates (#40011) * SDK Review updates * Update auto-generated models * Add customization * Fix customization * Update package * Update tests * Linting * FixFaultInjectionRuleFailedToApplyPerPartitionInGatewayMode (#40005) * fix fault injection rule failed to apply per partition in gateway mode --------- Co-authored-by: annie-mac * azure-cosmos-test_1.0.0.beta.7Release (#40021) * release azure-cosmos-test 1.0.0.beta.7 --------- Co-authored-by: annie-mac --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac * [Cosmos][VectorSearch] Non Streaming Order By Query (#40096) * Initial changes * Initial changes * Increment versions for core releases (#40003) Increment package versions for core releases * Ensure ServiceBus session idle timeout fall back to retry-options::try-timeout (#39994) * Added Alpha3 Java Media Streaming Events (#40002) * Added Alpha3 Java Media Streaming Events * updating readme to add the media streaming events to remove model --------- Co-authored-by: Vinothini Dharmaraj * Update version of github-event-processor to 1.0.0-dev.20240502.2 (#40012) Co-authored-by: James Suplizio * Prepare May 2024 Identity Release (#40006) * Prepare Identity Broker May 2024 Release (#40014) * Increment package versions for identity releases (#40015) * [JobRouter] SDK Review updates (#40011) * SDK Review updates * Update auto-generated models * Add customization * Fix customization * Update package * Update tests * Linting * FixFaultInjectionRuleFailedToApplyPerPartitionInGatewayMode (#40005) * fix fault injection rule failed to apply per partition in gateway mode --------- Co-authored-by: annie-mac * azure-cosmos-test_1.0.0.beta.7Release (#40021) * release azure-cosmos-test 1.0.0.beta.7 --------- Co-authored-by: annie-mac * Fixed existsById API in ReactiveCosmosTemplate (#40022) * Fixed existsById API in ReactiveCosmosTemplate * Added changelog * Initial changes * Initial changes * Skip Recorded test and delete Event record until test proxy to work with Event recordings (#40029) Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> * Fix invalid CODEOWNERS (#40032) * Initial changes * ServiceBus: fix session tracing (#39962) * remove additional matrix * Fix session processing and disposition instrumentation * return matrix config * review suggestions * [Automation] Generate SDK based on TypeSpec 0.15.15 (#40048) * [CODEOWNERS] Updates for org changes (#40049) * [CODEOWNERS] Updates for org changes The focus of these changes is to remove an individual who no longer is responsible for the products which their GH account is associated to. * Move from using the docker image to java2docfx for docs validation (#39744) * Move from using the docker image to java2docfx for docs validation * Temporarily turn on docs processing for template libraries for testing * Actually install the rex validation tool * Fix the if not Test-Path statement * Update java2docfx version and add a couple of diagnostics output lines * Add missing close paren * Ensure that Sort-Object always returns an array even if there's only one item * add another piece of diagnostics output * trying one more thing * remove some diag, add other * Remove the additional diagnostics, add permanent output message * Invoke java -jar on java2docfx to show the help command to ensure the install is okay * fiddling with the java -jar command * Set the working directory to the java2docfx directory before executing the mvn dependency download * Actually create the directory before trying to set location...oops * Update rex validation to verify MAVEN_HOME is set * Updates for Java PR 39875 which had changes from this PR that were more immediate * Update java2docfx version * remove check for MAVEN_HOME which was only for testing * Update the version of java2docfx to test a fix * Update version of java2docfx to 1.0.4 * revert template's ci.yml changes that were only necessary to test java2docfx * owners (#39686) * Use ClientLogger in testing output (#40010) Use ClientLogger in testing output * Fix null pointer exception and context usage (#40053) * Rename AML to AzureMachineLearning (#40056) * Fixed the Key Vault `test-resources.json` file to properly configure a deployment script for certificate creation. (#40037) * Close response body in bearer policy (#40052) * Running Prepare-Release for azure-messaging-servicebus 7.17.0 (#40058) * mgmt, TypeSpec code generation pipeline (#39963) * typespec generation pipeline echo command PR_TITLE * generation typespec Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines * remove typespec pipeline file * fix pr title * address comments * Add codeowner linter owners (#39997) * Update to ESRP task version that supports federated auth (#40059) * Increment package versions for cosmos releases (#40031) * Update azure-sdk-build-tools Repository Resource Refs in Yaml files (#39627) * Add reduced embeddings sample to azure-search-documents (#40069) * Add reduced embeddings sample * Fix cspell * Fix link * Search May Preview Regen Updates (#40057) * Search May Preview Regeneration - Still need to add varargs convenience * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * adding varargs * Additional adjustments to FieldBuilder and Search Index Customizations * Updating cspell.json * Adjust `SearchScoreThreshold` customization Re-enable code generation in CI * Updates: - Updated Cspell - Rename `maxStoragePerIndex` property to `maxStoragePerIndexInBytes` in SearchServiceLimits - Set `hybridSearch` property to be type `HybridSearch` in SearchRequest - Add `hybridSearch` to SearchOptions and `SearchAsyncClient.createSearchRequest()` * Adding Support and testing byte[] and List within field builder * Fix linting --------- Co-authored-by: alzimmermsft <48699787+alzimmermsft@users.noreply.github.com> * Preparing Search May 2024 Beta Release (#40071) * Preparing Search May 2024 Beta Release * Preparing Search May 2024 Beta Release * Resolving comments * Fixing build issues * eng, update autorest.java, improve error output in sdk automation (#40073) * improve error output * autorest.java 4.1.29 * Merge to main after spring cloud azure 4.18.0 released (#40075) * Prepare for Spring Cloud Azure 4.18.0 release (#40063) * update version client * update version/changelog/readme * update changelog * Increment versions for spring releases (#40074) * Increment package versions for spring releases * Update version_client.txt * Update pom.xml --------- Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> * Miscellaneous Core performance improvements (#39552) Miscellaneous Core performance improvements * Increment package versions for search releases (#40072) * Update io.fabric8:kubernetes-client (#40086) 5.12.3 -> 6.12.1 * Increment package versions for servicebus releases (#40094) * Emit stable auto-instrumented otel metrics (#39960) * Update otel metrics logic * add runtime metrics * adding a few metrics I forgot * small correction * Update * Fix * Update * Delete pre-stable metrics --------- Co-authored-by: Harsimar Kaur (from Dev Box) --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac Co-authored-by: Kushagra Thapar Co-authored-by: minwoolee-msft <77083090+minwoolee-msft@users.noreply.github.com> Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> Co-authored-by: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Co-authored-by: Liudmila Molkova Co-authored-by: Jesse Squire Co-authored-by: Harsimar Kaur Co-authored-by: vcolin7 Co-authored-by: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Co-authored-by: Wes Haggard Co-authored-by: Patrick Hallisey Co-authored-by: Jair Myree Co-authored-by: Weidong Xu Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> Co-authored-by: Helen <56097766+heyams@users.noreply.github.com> Co-authored-by: Harsimar Kaur (from Dev Box) * [Cosmos][VectorSearch] Non Streaming Order By Query (#40098) * Initial changes * Initial changes * Increment versions for core releases (#40003) Increment package versions for core releases * Ensure ServiceBus session idle timeout fall back to retry-options::try-timeout (#39994) * Added Alpha3 Java Media Streaming Events (#40002) * Added Alpha3 Java Media Streaming Events * updating readme to add the media streaming events to remove model --------- Co-authored-by: Vinothini Dharmaraj * Update version of github-event-processor to 1.0.0-dev.20240502.2 (#40012) Co-authored-by: James Suplizio * Prepare May 2024 Identity Release (#40006) * Prepare Identity Broker May 2024 Release (#40014) * Increment package versions for identity releases (#40015) * [JobRouter] SDK Review updates (#40011) * SDK Review updates * Update auto-generated models * Add customization * Fix customization * Update package * Update tests * Linting * FixFaultInjectionRuleFailedToApplyPerPartitionInGatewayMode (#40005) * fix fault injection rule failed to apply per partition in gateway mode --------- Co-authored-by: annie-mac * azure-cosmos-test_1.0.0.beta.7Release (#40021) * release azure-cosmos-test 1.0.0.beta.7 --------- Co-authored-by: annie-mac * Fixed existsById API in ReactiveCosmosTemplate (#40022) * Fixed existsById API in ReactiveCosmosTemplate * Added changelog * Initial changes * Initial changes * Skip Recorded test and delete Event record until test proxy to work with Event recordings (#40029) Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> * Fix invalid CODEOWNERS (#40032) * Initial changes * ServiceBus: fix session tracing (#39962) * remove additional matrix * Fix session processing and disposition instrumentation * return matrix config * review suggestions * [Automation] Generate SDK based on TypeSpec 0.15.15 (#40048) * [CODEOWNERS] Updates for org changes (#40049) * [CODEOWNERS] Updates for org changes The focus of these changes is to remove an individual who no longer is responsible for the products which their GH account is associated to. * Move from using the docker image to java2docfx for docs validation (#39744) * Move from using the docker image to java2docfx for docs validation * Temporarily turn on docs processing for template libraries for testing * Actually install the rex validation tool * Fix the if not Test-Path statement * Update java2docfx version and add a couple of diagnostics output lines * Add missing close paren * Ensure that Sort-Object always returns an array even if there's only one item * add another piece of diagnostics output * trying one more thing * remove some diag, add other * Remove the additional diagnostics, add permanent output message * Invoke java -jar on java2docfx to show the help command to ensure the install is okay * fiddling with the java -jar command * Set the working directory to the java2docfx directory before executing the mvn dependency download * Actually create the directory before trying to set location...oops * Update rex validation to verify MAVEN_HOME is set * Updates for Java PR 39875 which had changes from this PR that were more immediate * Update java2docfx version * remove check for MAVEN_HOME which was only for testing * Update the version of java2docfx to test a fix * Update version of java2docfx to 1.0.4 * revert template's ci.yml changes that were only necessary to test java2docfx * owners (#39686) * Use ClientLogger in testing output (#40010) Use ClientLogger in testing output * Fix null pointer exception and context usage (#40053) * Rename AML to AzureMachineLearning (#40056) * Fixed the Key Vault `test-resources.json` file to properly configure a deployment script for certificate creation. (#40037) * Close response body in bearer policy (#40052) * Running Prepare-Release for azure-messaging-servicebus 7.17.0 (#40058) * mgmt, TypeSpec code generation pipeline (#39963) * typespec generation pipeline echo command PR_TITLE * generation typespec Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines * remove typespec pipeline file * fix pr title * address comments * Add codeowner linter owners (#39997) * Update to ESRP task version that supports federated auth (#40059) * Increment package versions for cosmos releases (#40031) * Update azure-sdk-build-tools Repository Resource Refs in Yaml files (#39627) * Add reduced embeddings sample to azure-search-documents (#40069) * Add reduced embeddings sample * Fix cspell * Fix link * Search May Preview Regen Updates (#40057) * Search May Preview Regeneration - Still need to add varargs convenience * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * adding varargs * Additional adjustments to FieldBuilder and Search Index Customizations * Updating cspell.json * Adjust `SearchScoreThreshold` customization Re-enable code generation in CI * Updates: - Updated Cspell - Rename `maxStoragePerIndex` property to `maxStoragePerIndexInBytes` in SearchServiceLimits - Set `hybridSearch` property to be type `HybridSearch` in SearchRequest - Add `hybridSearch` to SearchOptions and `SearchAsyncClient.createSearchRequest()` * Adding Support and testing byte[] and List within field builder * Fix linting --------- Co-authored-by: alzimmermsft <48699787+alzimmermsft@users.noreply.github.com> * Preparing Search May 2024 Beta Release (#40071) * Preparing Search May 2024 Beta Release * Preparing Search May 2024 Beta Release * Resolving comments * Fixing build issues * eng, update autorest.java, improve error output in sdk automation (#40073) * improve error output * autorest.java 4.1.29 * Merge to main after spring cloud azure 4.18.0 released (#40075) * Prepare for Spring Cloud Azure 4.18.0 release (#40063) * update version client * update version/changelog/readme * update changelog * Increment versions for spring releases (#40074) * Increment package versions for spring releases * Update version_client.txt * Update pom.xml --------- Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> * Miscellaneous Core performance improvements (#39552) Miscellaneous Core performance improvements * Increment package versions for search releases (#40072) * Update io.fabric8:kubernetes-client (#40086) 5.12.3 -> 6.12.1 * Increment package versions for servicebus releases (#40094) * Emit stable auto-instrumented otel metrics (#39960) * Update otel metrics logic * add runtime metrics * adding a few metrics I forgot * small correction * Update * Fix * Update * Delete pre-stable metrics --------- Co-authored-by: Harsimar Kaur (from Dev Box) * Initial changes --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac Co-authored-by: Kushagra Thapar Co-authored-by: minwoolee-msft <77083090+minwoolee-msft@users.noreply.github.com> Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> Co-authored-by: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Co-authored-by: Liudmila Molkova Co-authored-by: Jesse Squire Co-authored-by: Harsimar Kaur Co-authored-by: vcolin7 Co-authored-by: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Co-authored-by: Wes Haggard Co-authored-by: Patrick Hallisey Co-authored-by: Jair Myree Co-authored-by: Weidong Xu Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> Co-authored-by: Helen <56097766+heyams@users.noreply.github.com> Co-authored-by: Harsimar Kaur (from Dev Box) * Resolving comments * Resolving comments * [Cosmos][VectorSearch] Non Streaming Order By Query (#40115) * Initial changes * Initial changes * Increment versions for core releases (#40003) Increment package versions for core releases * Ensure ServiceBus session idle timeout fall back to retry-options::try-timeout (#39994) * Added Alpha3 Java Media Streaming Events (#40002) * Added Alpha3 Java Media Streaming Events * updating readme to add the media streaming events to remove model --------- Co-authored-by: Vinothini Dharmaraj * Update version of github-event-processor to 1.0.0-dev.20240502.2 (#40012) Co-authored-by: James Suplizio * Prepare May 2024 Identity Release (#40006) * Prepare Identity Broker May 2024 Release (#40014) * Increment package versions for identity releases (#40015) * [JobRouter] SDK Review updates (#40011) * SDK Review updates * Update auto-generated models * Add customization * Fix customization * Update package * Update tests * Linting * FixFaultInjectionRuleFailedToApplyPerPartitionInGatewayMode (#40005) * fix fault injection rule failed to apply per partition in gateway mode --------- Co-authored-by: annie-mac * azure-cosmos-test_1.0.0.beta.7Release (#40021) * release azure-cosmos-test 1.0.0.beta.7 --------- Co-authored-by: annie-mac * Fixed existsById API in ReactiveCosmosTemplate (#40022) * Fixed existsById API in ReactiveCosmosTemplate * Added changelog * Initial changes * Initial changes * Skip Recorded test and delete Event record until test proxy to work with Event recordings (#40029) Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> * Fix invalid CODEOWNERS (#40032) * Initial changes * ServiceBus: fix session tracing (#39962) * remove additional matrix * Fix session processing and disposition instrumentation * return matrix config * review suggestions * [Automation] Generate SDK based on TypeSpec 0.15.15 (#40048) * [CODEOWNERS] Updates for org changes (#40049) * [CODEOWNERS] Updates for org changes The focus of these changes is to remove an individual who no longer is responsible for the products which their GH account is associated to. * Move from using the docker image to java2docfx for docs validation (#39744) * Move from using the docker image to java2docfx for docs validation * Temporarily turn on docs processing for template libraries for testing * Actually install the rex validation tool * Fix the if not Test-Path statement * Update java2docfx version and add a couple of diagnostics output lines * Add missing close paren * Ensure that Sort-Object always returns an array even if there's only one item * add another piece of diagnostics output * trying one more thing * remove some diag, add other * Remove the additional diagnostics, add permanent output message * Invoke java -jar on java2docfx to show the help command to ensure the install is okay * fiddling with the java -jar command * Set the working directory to the java2docfx directory before executing the mvn dependency download * Actually create the directory before trying to set location...oops * Update rex validation to verify MAVEN_HOME is set * Updates for Java PR 39875 which had changes from this PR that were more immediate * Update java2docfx version * remove check for MAVEN_HOME which was only for testing * Update the version of java2docfx to test a fix * Update version of java2docfx to 1.0.4 * revert template's ci.yml changes that were only necessary to test java2docfx * owners (#39686) * Use ClientLogger in testing output (#40010) Use ClientLogger in testing output * Fix null pointer exception and context usage (#40053) * Rename AML to AzureMachineLearning (#40056) * Fixed the Key Vault `test-resources.json` file to properly configure a deployment script for certificate creation. (#40037) * Close response body in bearer policy (#40052) * Running Prepare-Release for azure-messaging-servicebus 7.17.0 (#40058) * mgmt, TypeSpec code generation pipeline (#39963) * typespec generation pipeline echo command PR_TITLE * generation typespec Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines * remove typespec pipeline file * fix pr title * address comments * Add codeowner linter owners (#39997) * Update to ESRP task version that supports federated auth (#40059) * Increment package versions for cosmos releases (#40031) * Update azure-sdk-build-tools Repository Resource Refs in Yaml files (#39627) * Add reduced embeddings sample to azure-search-documents (#40069) * Add reduced embeddings sample * Fix cspell * Fix link * Search May Preview Regen Updates (#40057) * Search May Preview Regeneration - Still need to add varargs convenience * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * adding varargs * Additional adjustments to FieldBuilder and Search Index Customizations * Updating cspell.json * Adjust `SearchScoreThreshold` customization Re-enable code generation in CI * Updates: - Updated Cspell - Rename `maxStoragePerIndex` property to `maxStoragePerIndexInBytes` in SearchServiceLimits - Set `hybridSearch` property to be type `HybridSearch` in SearchRequest - Add `hybridSearch` to SearchOptions and `SearchAsyncClient.createSearchRequest()` * Adding Support and testing byte[] and List within field builder * Fix linting --------- Co-authored-by: alzimmermsft <48699787+alzimmermsft@users.noreply.github.com> * Preparing Search May 2024 Beta Release (#40071) * Preparing Search May 2024 Beta Release * Preparing Search May 2024 Beta Release * Resolving comments * Fixing build issues * eng, update autorest.java, improve error output in sdk automation (#40073) * improve error output * autorest.java 4.1.29 * Merge to main after spring cloud azure 4.18.0 released (#40075) * Prepare for Spring Cloud Azure 4.18.0 release (#40063) * update version client * update version/changelog/readme * update changelog * Increment versions for spring releases (#40074) * Increment package versions for spring releases * Update version_client.txt * Update pom.xml --------- Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> * Miscellaneous Core performance improvements (#39552) Miscellaneous Core performance improvements * Increment package versions for search releases (#40072) * Update io.fabric8:kubernetes-client (#40086) 5.12.3 -> 6.12.1 * Increment package versions for servicebus releases (#40094) * Emit stable auto-instrumented otel metrics (#39960) * Update otel metrics logic * add runtime metrics * adding a few metrics I forgot * small correction * Update * Fix * Update * Delete pre-stable metrics --------- Co-authored-by: Harsimar Kaur (from Dev Box) * [Key Vault] Added support for `/prerestore` and `/prebackup` endpoints in Backup clients (#39878) * Updated `autorest.md` files in all swagger folders. * Re-generated implementation code. * Updated ServiceVersion expandable enums. * Added public APIs for the new /prebacukp and /prerestore endpoints. * Added tests. * Refactored Backup client tests. * Updated tests. * Updated test recordings. * Updated documentation and samples. * Addressed PR feedback. * Initial changes * Prepare to release beta.22 (#40097) * Fix template name (#40099) * Fix template name * Also install the rex validation tool * Update partner release to use WIF (#40101) * core mgmt, `SubResource` implements `JsonSerializable` to support azure-json (#40076) * test * implementation * fix lint * spotless:apply * Update spring-reference and sync changelog (#40105) * update spring-reference.yml * update CHANGELOG.md * Support per-call response timeout in all HttpClient implementations (#40017) Support per-call response timeout in all HttpClient implementations * Change how JavaType is resolved to support JsonSerializable better (#40112) * Initial changes * Fixes --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac Co-authored-by: Kushagra Thapar Co-authored-by: minwoolee-msft <77083090+minwoolee-msft@users.noreply.github.com> Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> Co-authored-by: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Co-authored-by: Liudmila Molkova Co-authored-by: Jesse Squire Co-authored-by: Harsimar Kaur Co-authored-by: vcolin7 Co-authored-by: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Co-authored-by: Wes Haggard Co-authored-by: Patrick Hallisey Co-authored-by: Jair Myree Co-authored-by: Weidong Xu Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> Co-authored-by: Helen <56097766+heyams@users.noreply.github.com> Co-authored-by: Harsimar Kaur (from Dev Box) --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac Co-authored-by: Kushagra Thapar Co-authored-by: minwoolee-msft <77083090+minwoolee-msft@users.noreply.github.com> Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> Co-authored-by: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Co-authored-by: Liudmila Molkova Co-authored-by: Jesse Squire Co-authored-by: Harsimar Kaur Co-authored-by: vcolin7 Co-authored-by: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Co-authored-by: Wes Haggard Co-authored-by: Patrick Hallisey Co-authored-by: Jair Myree Co-authored-by: Weidong Xu Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> Co-authored-by: Helen <56097766+heyams@users.noreply.github.com> Co-authored-by: Harsimar Kaur (from Dev Box) --- sdk/cosmos/azure-cosmos-test/CHANGELOG.md | 6 +- .../com/azure/cosmos/rx/VectorIndexTest.java | 345 ++++++++++++++++++ sdk/cosmos/azure-cosmos/CHANGELOG.md | 6 +- .../azure/cosmos/implementation/Configs.java | 15 + .../cosmos/implementation/Constants.java | 9 + .../CosmosQueryRequestOptionsImpl.java | 22 ++ .../implementation/DocumentCollection.java | 33 +- .../DocumentQueryExecutionContextFactory.java | 36 +- ...onStreamingOrderByBadRequestException.java | 20 + .../NonStreamingOrderByDocumentProducer.java | 43 +++ ...gOrderByDocumentQueryExecutionContext.java | 268 ++++++++++++++ .../query/NonStreamingOrderByUtils.java | 114 ++++++ ...ParallelDocumentQueryExecutionContext.java | 3 +- ...ipelinedDocumentQueryExecutionContext.java | 24 +- .../query/PipelinedQueryExecutionContext.java | 2 +- .../PipelinedQueryExecutionContextBase.java | 3 +- .../implementation/query/QueryFeature.java | 3 +- .../implementation/query/QueryInfo.java | 6 + .../query/QueryPlanRetriever.java | 3 +- .../azure/cosmos/models/CompositePath.java | 2 +- .../models/CosmosContainerProperties.java | 22 ++ .../models/CosmosQueryRequestOptions.java | 20 + .../cosmos/models/CosmosVectorDataType.java | 59 +++ .../models/CosmosVectorDistanceFunction.java | 54 +++ .../cosmos/models/CosmosVectorEmbedding.java | 128 +++++++ .../models/CosmosVectorEmbeddingPolicy.java | 54 +++ .../cosmos/models/CosmosVectorIndexSpec.java | 79 ++++ .../cosmos/models/CosmosVectorIndexType.java | 36 ++ .../azure/cosmos/models/IndexingPolicy.java | 58 ++- .../cosmos/models/ModelBridgeInternal.java | 9 + .../azure-messaging-servicebus/CHANGELOG.md | 3 + 31 files changed, 1462 insertions(+), 23 deletions(-) create mode 100644 sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByBadRequestException.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentProducer.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDataType.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDistanceFunction.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbedding.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbeddingPolicy.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexSpec.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexType.java diff --git a/sdk/cosmos/azure-cosmos-test/CHANGELOG.md b/sdk/cosmos/azure-cosmos-test/CHANGELOG.md index 8bfe27c5aa13..e7cdc6f02af1 100644 --- a/sdk/cosmos/azure-cosmos-test/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos-test/CHANGELOG.md @@ -7,8 +7,12 @@ #### Breaking Changes #### Bugs Fixed +* Fixed an issue where `FaultInjectionRule` can not apply on partition level when using `Gateway` Mode and non-session consistency - See [40005](https://github.com/Azure/azure-sdk-for-java/pull/40005) -#### Other Changes +### 1.0.0-beta.7 (2024-05-03) + +#### Bugs Fixed +* Fixed an issue where `FaultInjectionRule` can not apply on partition level when using `Gateway` Mode and non-session consistency - See [40005](https://github.com/Azure/azure-sdk-for-java/pull/40005) ### 1.0.0-beta.7 (2024-05-03) diff --git a/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java new file mode 100644 index 000000000000..d4f5b8cf6602 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.rx; + +import com.azure.cosmos.ConsistencyLevel; +import com.azure.cosmos.CosmosAsyncClient; +import com.azure.cosmos.CosmosAsyncContainer; +import com.azure.cosmos.CosmosAsyncDatabase; +import com.azure.cosmos.CosmosClientBuilder; +import com.azure.cosmos.CosmosDatabaseForTest; +import com.azure.cosmos.CosmosException; +import com.azure.cosmos.DirectConnectionConfig; +import com.azure.cosmos.implementation.TestConfigurations; +import com.azure.cosmos.implementation.Utils; +import com.azure.cosmos.implementation.guava25.collect.ImmutableList; +import com.azure.cosmos.models.CosmosContainerProperties; +import com.azure.cosmos.models.CosmosVectorDataType; +import com.azure.cosmos.models.CosmosVectorDistanceFunction; +import com.azure.cosmos.models.CosmosVectorEmbedding; +import com.azure.cosmos.models.CosmosVectorEmbeddingPolicy; +import com.azure.cosmos.models.ExcludedPath; +import com.azure.cosmos.models.IncludedPath; +import com.azure.cosmos.models.IndexingMode; +import com.azure.cosmos.models.IndexingPolicy; +import com.azure.cosmos.models.PartitionKeyDefinition; +import com.azure.cosmos.models.CosmosVectorIndexSpec; +import com.azure.cosmos.models.CosmosVectorIndexType; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Ignore; +import org.testng.annotations.Test; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.UUID; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; + +@Ignore("TODO: Ignore these test cases until the public emulator with vector indexes is released.") +public class VectorIndexTest extends TestSuiteBase { + protected static final int TIMEOUT = 30000; + protected static final int SETUP_TIMEOUT = 20000; + protected static final int SHUTDOWN_TIMEOUT = 20000; + + protected static Logger logger = LoggerFactory.getLogger(VectorIndexTest.class.getSimpleName()); + private final ObjectMapper simpleObjectMapper = Utils.getSimpleObjectMapper(); + private final String databaseId = CosmosDatabaseForTest.generateId(); + private CosmosAsyncClient client; + private CosmosAsyncDatabase database; + + @BeforeClass(groups = {"emulator"}, timeOut = SETUP_TIMEOUT) + public void before_VectorIndexTest() { + // set up the client + client = new CosmosClientBuilder() + .endpoint(TestConfigurations.HOST) + .key(TestConfigurations.MASTER_KEY) + .directMode(DirectConnectionConfig.getDefaultConfig()) + .consistencyLevel(ConsistencyLevel.SESSION) + .contentResponseOnWriteEnabled(true) + .buildAsyncClient(); + + database = createDatabase(client, databaseId); + } + + @AfterClass(groups = {"emulator"}, timeOut = SHUTDOWN_TIMEOUT, alwaysRun = true) + public void afterClass() { + safeDeleteDatabase(database); + safeClose(client); + } + + @Test(groups = {"emulator"}, timeOut = TIMEOUT*10000) + public void shouldCreateVectorEmbeddingPolicy() { + PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); + ArrayList paths = new ArrayList(); + paths.add("/mypk"); + partitionKeyDef.setPaths(paths); + + CosmosContainerProperties collectionDefinition = new CosmosContainerProperties(UUID.randomUUID().toString(), partitionKeyDef); + + IndexingPolicy indexingPolicy = new IndexingPolicy(); + indexingPolicy.setIndexingMode(IndexingMode.CONSISTENT); + ExcludedPath excludedPath = new ExcludedPath("/*"); + indexingPolicy.setExcludedPaths(Collections.singletonList(excludedPath)); + + IncludedPath includedPath1 = new IncludedPath("/name/?"); + IncludedPath includedPath2 = new IncludedPath("/description/?"); + indexingPolicy.setIncludedPaths(ImmutableList.of(includedPath1, includedPath2)); + + indexingPolicy.setVectorIndexes(populateVectorIndexes()); + + CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy = new CosmosVectorEmbeddingPolicy(); + cosmosVectorEmbeddingPolicy.setCosmosVectorEmbeddings(populateEmbeddings()); + + collectionDefinition.setIndexingPolicy(indexingPolicy); + collectionDefinition.setVectorEmbeddingPolicy(cosmosVectorEmbeddingPolicy); + + database.createContainer(collectionDefinition).block(); + CosmosAsyncContainer createdCollection = database.getContainer(collectionDefinition.getId()); + CosmosContainerProperties collectionProperties = createdCollection.read().block().getProperties(); + validateCollectionProperties(collectionDefinition, collectionProperties); + } + + @Test(groups = {"emulator"}, timeOut = TIMEOUT) + public void shouldFailOnEmptyVectorEmbeddingPolicy() { + PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); + ArrayList paths = new ArrayList(); + paths.add("/mypk"); + partitionKeyDef.setPaths(paths); + + CosmosContainerProperties collectionDefinition = new CosmosContainerProperties(UUID.randomUUID().toString(), partitionKeyDef); + + IndexingPolicy indexingPolicy = new IndexingPolicy(); + indexingPolicy.setIndexingMode(IndexingMode.CONSISTENT); + ExcludedPath excludedPath = new ExcludedPath("/*"); + indexingPolicy.setExcludedPaths(Collections.singletonList(excludedPath)); + + IncludedPath includedPath1 = new IncludedPath("/name/?"); + IncludedPath includedPath2 = new IncludedPath("/description/?"); + indexingPolicy.setIncludedPaths(ImmutableList.of(includedPath1, includedPath2)); + + CosmosVectorIndexSpec cosmosVectorIndexSpec = new CosmosVectorIndexSpec(); + cosmosVectorIndexSpec.setPath("/vector1"); + cosmosVectorIndexSpec.setType(CosmosVectorIndexType.FLAT.toString()); + indexingPolicy.setVectorIndexes(ImmutableList.of(cosmosVectorIndexSpec)); + + collectionDefinition.setIndexingPolicy(indexingPolicy); + + try { + database.createContainer(collectionDefinition).block(); + fail("Container creation will fail as no vector embedding policy is being passed"); + } catch (CosmosException ex) { + assertThat(ex.getStatusCode()).isEqualTo(400); + assertThat(ex.getMessage()).contains("vector1 not matching in Embedding's path"); + } + } + + @Test(groups = {"emulator"}, timeOut = TIMEOUT) + public void shouldFailOnWrongVectorIndex() { + PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); + ArrayList paths = new ArrayList(); + paths.add("/mypk"); + partitionKeyDef.setPaths(paths); + + CosmosContainerProperties collectionDefinition = new CosmosContainerProperties(UUID.randomUUID().toString(), partitionKeyDef); + + IndexingPolicy indexingPolicy = new IndexingPolicy(); + indexingPolicy.setIndexingMode(IndexingMode.CONSISTENT); + ExcludedPath excludedPath = new ExcludedPath("/*"); + indexingPolicy.setExcludedPaths(Collections.singletonList(excludedPath)); + + IncludedPath includedPath1 = new IncludedPath("/name/?"); + IncludedPath includedPath2 = new IncludedPath("/description/?"); + indexingPolicy.setIncludedPaths(ImmutableList.of(includedPath1, includedPath2)); + + CosmosVectorIndexSpec cosmosVectorIndexSpec = new CosmosVectorIndexSpec(); + cosmosVectorIndexSpec.setPath("/vector1"); + cosmosVectorIndexSpec.setType("NonFlat"); + indexingPolicy.setVectorIndexes(ImmutableList.of(cosmosVectorIndexSpec)); + collectionDefinition.setIndexingPolicy(indexingPolicy); + + CosmosVectorEmbedding embedding = new CosmosVectorEmbedding(); + embedding.setPath("/vector1"); + embedding.setDataType(CosmosVectorDataType.FLOAT32); + embedding.setDimensions(3L); + embedding.setDistanceFunction(CosmosVectorDistanceFunction.COSINE); + CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy = new CosmosVectorEmbeddingPolicy(); + cosmosVectorEmbeddingPolicy.setCosmosVectorEmbeddings(ImmutableList.of(embedding)); + collectionDefinition.setVectorEmbeddingPolicy(cosmosVectorEmbeddingPolicy); + + try { + database.createContainer(collectionDefinition).block(); + fail("Container creation will fail as wrong vector index type is being passed"); + } catch (CosmosException ex) { + assertThat(ex.getStatusCode()).isEqualTo(400); + assertThat(ex.getMessage()).contains("NonFlat is invalid, Valid types are 'flat' or 'quantizedFlat'"); + } + } + + @Test(groups = {"emulator"}, timeOut = TIMEOUT) + public void shouldCreateVectorIndexSimilarPathDifferentVectorType() { + PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); + ArrayList paths = new ArrayList(); + paths.add("/mypk"); + partitionKeyDef.setPaths(paths); + + CosmosContainerProperties collectionDefinition = new CosmosContainerProperties(UUID.randomUUID().toString(), partitionKeyDef); + + IndexingPolicy indexingPolicy = new IndexingPolicy(); + indexingPolicy.setIndexingMode(IndexingMode.CONSISTENT); + ExcludedPath excludedPath = new ExcludedPath("/*"); + indexingPolicy.setExcludedPaths(Collections.singletonList(excludedPath)); + + IncludedPath includedPath1 = new IncludedPath("/name/?"); + IncludedPath includedPath2 = new IncludedPath("/description/?"); + indexingPolicy.setIncludedPaths(ImmutableList.of(includedPath1, includedPath2)); + + List vectorIndexes = populateVectorIndexes(); + vectorIndexes.get(2).setPath("/vector2"); + indexingPolicy.setVectorIndexes(vectorIndexes); + + List embeddings = populateEmbeddings(); + embeddings.get(2).setPath("/vector2"); + CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy = new CosmosVectorEmbeddingPolicy(); + cosmosVectorEmbeddingPolicy.setCosmosVectorEmbeddings(embeddings); + + collectionDefinition.setIndexingPolicy(indexingPolicy); + collectionDefinition.setVectorEmbeddingPolicy(cosmosVectorEmbeddingPolicy); + + database.createContainer(collectionDefinition).block(); + CosmosAsyncContainer createdCollection = database.getContainer(collectionDefinition.getId()); + CosmosContainerProperties collectionProperties = createdCollection.read().block().getProperties(); + validateCollectionProperties(collectionDefinition, collectionProperties); + } + + @Test(groups = {"unit"}, timeOut = TIMEOUT) + public void shouldFailOnWrongVectorEmbeddingPolicy() { + CosmosVectorEmbedding embedding = new CosmosVectorEmbedding(); + try { + + embedding.setDataType(null); + fail("Embedding creation failed because cosmosVectorDataType argument is empty"); + } catch (NullPointerException ex) { + assertThat(ex.getMessage()).isEqualTo("cosmosVectorDataType cannot be empty"); + } + + try { + embedding.setDistanceFunction(null); + fail("Embedding creation failed because cosmosVectorDistanceFunction argument is empty"); + } catch (NullPointerException ex) { + assertThat(ex.getMessage()).isEqualTo("cosmosVectorDistanceFunction cannot be null"); + } + + try { + embedding.setDimensions(null); + fail("Embedding creation failed because dimensions argument is empty"); + } catch (NullPointerException ex) { + assertThat(ex.getMessage()).isEqualTo("dimensions cannot be empty"); + } + + try { + embedding.setDimensions(-1L); + fail("Vector Embedding policy creation will fail for negative dimensions being passed"); + } catch (IllegalArgumentException ex) { + assertThat(ex.getMessage()).isEqualTo("Dimensions for the embedding has to be a long value greater than 1 for the vector embedding policy"); + } + } + + @Test(groups = {"unit"}, timeOut = TIMEOUT) + public void shouldValidateVectorEmbeddingPolicySerializationAndDeserialization() throws JsonProcessingException { + IndexingPolicy indexingPolicy = new IndexingPolicy(); + indexingPolicy.setVectorIndexes(populateVectorIndexes()); + + CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy = new CosmosVectorEmbeddingPolicy(); + cosmosVectorEmbeddingPolicy.setCosmosVectorEmbeddings(populateEmbeddings()); + String vectorEmbeddingPolicyJson = getVectorEmbeddingPolicyAsString(); + String expectedVectorEmbeddingPolicyJson = simpleObjectMapper.writeValueAsString(cosmosVectorEmbeddingPolicy); + assertThat(vectorEmbeddingPolicyJson).isEqualTo(expectedVectorEmbeddingPolicyJson); + + CosmosVectorEmbeddingPolicy expectedCosmosVectorEmbeddingPolicy = simpleObjectMapper.readValue(expectedVectorEmbeddingPolicyJson, CosmosVectorEmbeddingPolicy.class); + validateVectorEmbeddingPolicy(cosmosVectorEmbeddingPolicy, expectedCosmosVectorEmbeddingPolicy); + } + + private void validateCollectionProperties(CosmosContainerProperties collectionDefinition, CosmosContainerProperties collectionProperties) { + assertThat(collectionProperties.getVectorEmbeddingPolicy()).isNotNull(); + assertThat(collectionProperties.getVectorEmbeddingPolicy().getVectorEmbeddings()).isNotNull(); + validateVectorEmbeddingPolicy(collectionProperties.getVectorEmbeddingPolicy(), + collectionDefinition.getVectorEmbeddingPolicy()); + + assertThat(collectionProperties.getIndexingPolicy().getVectorIndexes()).isNotNull(); + validateVectorIndexes(collectionDefinition.getIndexingPolicy().getVectorIndexes(), collectionProperties.getIndexingPolicy().getVectorIndexes()); + } + + private void validateVectorEmbeddingPolicy(CosmosVectorEmbeddingPolicy actual, CosmosVectorEmbeddingPolicy expected) { + List actualEmbeddings = actual.getVectorEmbeddings(); + List expectedEmbeddings = expected.getVectorEmbeddings(); + assertThat(expectedEmbeddings).hasSameSizeAs(actualEmbeddings); + for (int i = 0; i < expectedEmbeddings.size(); i++) { + assertThat(expectedEmbeddings.get(i).getPath()).isEqualTo(actualEmbeddings.get(i).getPath()); + assertThat(expectedEmbeddings.get(i).getDataType()).isEqualTo(actualEmbeddings.get(i).getDataType()); + assertThat(expectedEmbeddings.get(i).getDimensions()).isEqualTo(actualEmbeddings.get(i).getDimensions()); + assertThat(expectedEmbeddings.get(i).getDistanceFunction()).isEqualTo(actualEmbeddings.get(i).getDistanceFunction()); + } + } + + private void validateVectorIndexes(List actual, List expected) { + assertThat(expected).hasSameSizeAs(actual); + for (int i = 0; i < expected.size(); i++) { + assertThat(expected.get(i).getPath()).isEqualTo(actual.get(i).getPath()); + assertThat(expected.get(i).getType()).isEqualTo(actual.get(i).getType()); + } + } + + private List populateVectorIndexes() { + CosmosVectorIndexSpec cosmosVectorIndexSpec1 = new CosmosVectorIndexSpec(); + cosmosVectorIndexSpec1.setPath("/vector1"); + cosmosVectorIndexSpec1.setType(CosmosVectorIndexType.FLAT.toString()); + + CosmosVectorIndexSpec cosmosVectorIndexSpec2 = new CosmosVectorIndexSpec(); + cosmosVectorIndexSpec2.setPath("/vector2"); + cosmosVectorIndexSpec2.setType(CosmosVectorIndexType.QUANTIZED_FLAT.toString()); + + CosmosVectorIndexSpec cosmosVectorIndexSpec3 = new CosmosVectorIndexSpec(); + cosmosVectorIndexSpec3.setPath("/vector3"); + cosmosVectorIndexSpec3.setType(CosmosVectorIndexType.DISK_ANN.toString()); + + return Arrays.asList(cosmosVectorIndexSpec1, cosmosVectorIndexSpec2, cosmosVectorIndexSpec3); + } + + private List populateEmbeddings() { + CosmosVectorEmbedding embedding1 = new CosmosVectorEmbedding(); + embedding1.setPath("/vector1"); + embedding1.setDataType(CosmosVectorDataType.INT8); + embedding1.setDimensions(3L); + embedding1.setDistanceFunction(CosmosVectorDistanceFunction.COSINE); + + CosmosVectorEmbedding embedding2 = new CosmosVectorEmbedding(); + embedding2.setPath("/vector2"); + embedding2.setDataType(CosmosVectorDataType.FLOAT32); + embedding2.setDimensions(3L); + embedding2.setDistanceFunction(CosmosVectorDistanceFunction.DOT_PRODUCT); + + CosmosVectorEmbedding embedding3 = new CosmosVectorEmbedding(); + embedding3.setPath("/vector3"); + embedding3.setDataType(CosmosVectorDataType.UINT8); + embedding3.setDimensions(3L); + embedding3.setDistanceFunction(CosmosVectorDistanceFunction.EUCLIDEAN); + return Arrays.asList(embedding1, embedding2, embedding3); + } + + private String getVectorEmbeddingPolicyAsString() { + return "{\"vectorEmbeddings\":[" + + "{\"path\":\"/vector1\",\"dataType\":\"int8\",\"dimensions\":3,\"distanceFunction\":\"cosine\"}," + + "{\"path\":\"/vector2\",\"dataType\":\"float32\",\"dimensions\":3,\"distanceFunction\":\"dotproduct\"}," + + "{\"path\":\"/vector3\",\"dataType\":\"uint8\",\"dimensions\":3,\"distanceFunction\":\"euclidean\"}" + + "]}"; + } +} diff --git a/sdk/cosmos/azure-cosmos/CHANGELOG.md b/sdk/cosmos/azure-cosmos/CHANGELOG.md index 4ea8a84052bd..16cedfc04ef2 100644 --- a/sdk/cosmos/azure-cosmos/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos/CHANGELOG.md @@ -3,6 +3,9 @@ ### 4.60.0-beta.1 (Unreleased) #### Features Added +* Added `cosmosVectorEmbeddingPolicy` in `cosmosContainerProperties` and `vectorIndexes` in `indexPolicy` to support vector search in CosmosDB - See[39379](https://github.com/Azure/azure-sdk-for-java/pull/39379) + +* Added support for non-streaming OrderBy query and a query feature `NonStreamingOrderBy` to support Vector Search queries. - See [PR 39897](https://github.com/Azure/azure-sdk-for-java/pull/39897/) #### Breaking Changes @@ -11,10 +14,9 @@ #### Other Changes ### 4.59.0 (2024-04-27) - #### Features Added * Added public APIs `getCustomItemSerializer` and `setCustomItemSerializer` to allow customers to specify custom payload transformations or serialization settings. - See [PR 38997](https://github.com/Azure/azure-sdk-for-java/pull/38997) and [PR 39933](https://github.com/Azure/azure-sdk-for-java/pull/39933) - + #### Other Changes * Load Blackbird or Afterburner into the ObjectMapper depending upon Java version and presence of modules in classpath. Make Afterburner and Blackbird optional maven dependencies. See - [PR 39689](https://github.com/Azure/azure-sdk-for-java/pull/39689) diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java index da368de5360d..c643379b2fe6 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java @@ -166,6 +166,13 @@ public class Configs { public static final String MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED = "COSMOS.MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED"; private static final int DEFAULT_MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED = 1; + private static final String MAX_ITEM_SIZE_FOR_VECTOR_SEARCH = "COSMOS.MAX_ITEM_SIZE_FOR_VECTOR_SEARCH"; + private static final int DEFAULT_MAX_ITEM_SIZE_FOR_VECTOR_SEARCH = 50000; + + private static final String MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED = "COSMOS.MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED"; + + private static final boolean DEFAULT_MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED = true; + public static final int MIN_MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED = 1; public static final String TCP_CONNECTION_ACQUISITION_TIMEOUT_IN_MS = "COSMOS.TCP_CONNECTION_ACQUISITION_TIMEOUT_IN_MS"; @@ -484,6 +491,14 @@ public static int getMaxRetriesInLocalRegionWhenRemoteRegionPreferred() { MIN_MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED); } + public static int getMaxItemSizeForVectorSearch() { + return getJVMConfigAsInt(MAX_ITEM_SIZE_FOR_VECTOR_SEARCH, DEFAULT_MAX_ITEM_SIZE_FOR_VECTOR_SEARCH); + } + + public static boolean getMaxItemSizeForVectorSearchEnabled() { + return getJVMConfigAsBoolean(MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED, DEFAULT_MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED); + } + public static Duration getMinRetryTimeInLocalRegionWhenRemoteRegionPreferred() { return Duration.ofMillis(Math.max( diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Constants.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Constants.java index 8409d5b7ec23..f789963783ed 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Constants.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Constants.java @@ -120,6 +120,15 @@ public static final class Properties { public static final String SPATIAL_INDEXES = "spatialIndexes"; public static final String TYPES = "types"; + // Vector Embedding Policy + public static final String VECTOR_EMBEDDING_POLICY = "vectorEmbeddingPolicy"; + public static final String VECTOR_INDEXES = "vectorIndexes"; + public static final String VECTOR_EMBEDDINGS = "vectorEmbeddings"; + public static final String VECTOR_INDEX_TYPE = "type"; + public static final String VECTOR_DATA_TYPE = "dataType"; + public static final String VECTOR_DIMENSIONS = "dimensions"; + public static final String DISTANCE_FUNCTION = "distanceFunction"; + // Unique index. public static final String UNIQUE_KEY_POLICY = "uniqueKeyPolicy"; public static final String UNIQUE_KEYS = "uniqueKeys"; diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java index 4dc62089acc5..6d7b00068393 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java @@ -25,6 +25,7 @@ public final class CosmosQueryRequestOptionsImpl extends CosmosQueryRequestOptio private boolean queryPlanRetrievalDisallowed; private boolean emptyPageDiagnosticsEnabled; private String queryName; + private Integer maxItemSizeForVectorSearch; private List cancelledRequestDiagnosticsTracker = new ArrayList<>(); /** @@ -62,6 +63,7 @@ public CosmosQueryRequestOptionsImpl(CosmosQueryRequestOptionsImpl options) { this.queryName = options.queryName; this.feedRange = options.feedRange; this.cancelledRequestDiagnosticsTracker = options.cancelledRequestDiagnosticsTracker; + this.maxItemSizeForVectorSearch = options.maxItemSizeForVectorSearch; } /** @@ -196,6 +198,26 @@ public CosmosQueryRequestOptionsImpl setMaxItemCount(Integer maxItemCount) { return this; } + /** + * Gets the maximum item size to fetch during non-streaming order by queries. + * + * @return the max number of items for vector search. + */ + public Integer getMaxItemSizeForVectorSearch() { + return this.maxItemSizeForVectorSearch; + } + + /** + * Sets the maximum item size to fetch during non-streaming order by queries. + * + * @param maxItemSizeForVectorSearch the max number of items for vector search. + * return the CosmosQueryRequestOptions. + */ + public CosmosQueryRequestOptionsImpl setMaxItemSizeForVectorSearch(Integer maxItemSizeForVectorSearch) { + this.maxItemSizeForVectorSearch = maxItemSizeForVectorSearch; + return this; + } + /** * Gets the request continuation token. * diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentCollection.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentCollection.java index 678bdb90378c..1930f2275a61 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentCollection.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentCollection.java @@ -6,10 +6,11 @@ import com.azure.cosmos.CosmosItemSerializer; import com.azure.cosmos.implementation.apachecommons.lang.StringUtils; import com.azure.cosmos.implementation.caches.SerializableWrapper; -import com.azure.cosmos.models.ClientEncryptionPolicy; import com.azure.cosmos.models.ChangeFeedPolicy; +import com.azure.cosmos.models.ClientEncryptionPolicy; import com.azure.cosmos.models.ComputedProperty; import com.azure.cosmos.models.ConflictResolutionPolicy; +import com.azure.cosmos.models.CosmosVectorEmbeddingPolicy; import com.azure.cosmos.models.IndexingPolicy; import com.azure.cosmos.models.ModelBridgeInternal; import com.azure.cosmos.models.PartitionKeyDefinition; @@ -24,6 +25,8 @@ import java.util.Collection; import java.util.Collections; +import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; + /** * Represents a document collection in the Azure Cosmos DB database service. A collection is a named logical container * for documents. @@ -40,6 +43,7 @@ public final class DocumentCollection extends Resource { private UniqueKeyPolicy uniqueKeyPolicy; private PartitionKeyDefinition partitionKeyDefinition; private ClientEncryptionPolicy clientEncryptionPolicyInternal; + private CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy; /** * Constructor. @@ -410,6 +414,33 @@ public void setClientEncryptionPolicy(ClientEncryptionPolicy value) { this.set(Constants.Properties.CLIENT_ENCRYPTION_POLICY, value, CosmosItemSerializer.DEFAULT_SERIALIZER); } + /** + * Gets the Vector Embedding Policy containing paths for embeddings along with path-specific settings for the item + * used in performing vector search on the items in a collection in the Azure CosmosDB database service. + * + * @return the Vector Embedding Policy. + */ + public CosmosVectorEmbeddingPolicy getVectorEmbeddingPolicy() { + if (this.cosmosVectorEmbeddingPolicy == null) { + if (super.has(Constants.Properties.VECTOR_EMBEDDING_POLICY)) { + this.cosmosVectorEmbeddingPolicy = super.getObject(Constants.Properties.VECTOR_EMBEDDING_POLICY, + CosmosVectorEmbeddingPolicy.class); + } + } + return this.cosmosVectorEmbeddingPolicy; + } + + /** + * Sets the Vector Embedding Policy containing paths for embeddings along with path-specific settings for the item + * used in performing vector search on the items in a collection in the Azure CosmosDB database service. + * + * @param value the Vector Embedding Policy. + */ + public void setVectorEmbeddingPolicy(CosmosVectorEmbeddingPolicy value) { + checkNotNull(value, "cosmosVectorEmbeddingPolicy cannot be null"); + this.set(Constants.Properties.VECTOR_EMBEDDING_POLICY, value, CosmosItemSerializer.DEFAULT_SERIALIZER); + } + public void populatePropertyBag() { super.populatePropertyBag(); if (this.indexingPolicy == null) { diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java index a13cfc65348d..7a530816856b 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java @@ -4,9 +4,11 @@ import com.azure.cosmos.BridgeInternal; import com.azure.cosmos.implementation.BadRequestException; +import com.azure.cosmos.implementation.Configs; import com.azure.cosmos.implementation.Constants; import com.azure.cosmos.implementation.DiagnosticsClientContext; import com.azure.cosmos.implementation.DocumentCollection; +import com.azure.cosmos.implementation.HttpConstants; import com.azure.cosmos.implementation.ImplementationBridgeHelpers; import com.azure.cosmos.implementation.OperationType; import com.azure.cosmos.implementation.PartitionKeyRange; @@ -239,7 +241,8 @@ private static boolean canCacheQuery(QueryInfo queryInfo) { && !queryInfo.hasTop() && !queryInfo.hasOffset() && !queryInfo.hasDCount() - && !queryInfo.hasOrderBy(); + && !queryInfo.hasOrderBy() + && !queryInfo.hasNonStreamingOrderBy(); } private static boolean isScopedToSinglePartition(CosmosQueryRequestOptions cosmosQueryRequestOptions) { @@ -358,6 +361,37 @@ public static Flux> createSpecia boolean getLazyFeedResponse = queryInfo.hasTop(); + // We need to compute the optimal initial age size for non-streaming order-by queries + if (queryInfo.hasNonStreamingOrderBy() && Configs.getMaxItemSizeForVectorSearchEnabled()) { + // Validate the TOP or LIMIT for non-streaming order-by queries + if (!queryInfo.hasTop() && !queryInfo.hasLimit() && queryInfo.getTop() < 0 && queryInfo.getLimit() < 0) { + throw new NonStreamingOrderByBadRequestException(HttpConstants.StatusCodes.BADREQUEST, + "Executing a vector search query without TOP or LIMIT can consume a large number of RUs" + + "very fast and have long runtimes. Please ensure you are using one of the above two filters" + + "with you vector search query."); + } + // Validate the size of TOP or LIMIT against MaxItemSizeForVectorSearch + int maxLimit = Math.max(queryInfo.hasTop() ? queryInfo.getTop() : 0, + queryInfo.hasLimit() ? queryInfo.getLimit() : 0); + int maxItemSizeForVectorSearch = Math.max(Configs.getMaxItemSizeForVectorSearch(), + ModelBridgeInternal.getMaxItemSizeForVectorSearchFromQueryRequestOptions(cosmosQueryRequestOptions)); + if (maxLimit > maxItemSizeForVectorSearch) { + throw new NonStreamingOrderByBadRequestException(HttpConstants.StatusCodes.BADREQUEST, + "Executing a vector search query with TOP or LIMIT larger than the maxItemSizeForVectorSearch " + + "is not allowed"); + } + // Set initialPageSize based on the smallest of TOP or LIMIT + if (queryInfo.hasTop() || queryInfo.hasLimit()) { + int pageSizeWithTopOrLimit = Math.min(queryInfo.hasTop() ? queryInfo.getTop() : Integer.MAX_VALUE, + queryInfo.hasLimit() ? queryInfo.getLimit() : Integer.MAX_VALUE); + if (initialPageSize > 0) { + initialPageSize = Math.min(pageSizeWithTopOrLimit, initialPageSize); + } else { + initialPageSize = pageSizeWithTopOrLimit; + } + } + } + // We need to compute the optimal initial page size for order-by queries if (queryInfo.hasOrderBy()) { int top; diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByBadRequestException.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByBadRequestException.java new file mode 100644 index 000000000000..4b3b41fbc675 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByBadRequestException.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.cosmos.implementation.query; + +import com.azure.cosmos.CosmosException; + +public class NonStreamingOrderByBadRequestException extends CosmosException { + + private static final long serialVersionUID = 1L; + + /** + * Creates a new instance of the NonStreamingOrderByBadRequestException class. + * + * @param statusCode the http status code of the response. + * @param errorMessage the error message. + */ + public NonStreamingOrderByBadRequestException(int statusCode, String errorMessage) { + super(statusCode, errorMessage); + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentProducer.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentProducer.java new file mode 100644 index 000000000000..c64ef5d1fbda --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentProducer.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.implementation.query; + +import com.azure.cosmos.implementation.Document; +import com.azure.cosmos.implementation.DocumentClientRetryPolicy; +import com.azure.cosmos.implementation.RxDocumentServiceRequest; +import com.azure.cosmos.implementation.feedranges.FeedRangeEpkImpl; +import com.azure.cosmos.implementation.query.orderbyquery.OrderbyRowComparer; +import com.azure.cosmos.models.CosmosQueryRequestOptions; +import com.azure.cosmos.models.FeedResponse; +import reactor.core.publisher.Mono; + +import java.util.UUID; +import java.util.function.Function; +import java.util.function.Supplier; + +public class NonStreamingOrderByDocumentProducer extends DocumentProducer { + private final OrderbyRowComparer consumeComparer; + + NonStreamingOrderByDocumentProducer( + OrderbyRowComparer consumeComparer, + IDocumentQueryClient client, + String collectionResourceId, + CosmosQueryRequestOptions cosmosQueryRequestOptions, + TriFunction createRequestFunc, + Function>> executeRequestFunc, + FeedRangeEpkImpl feedRange, + String collectionLink, + Supplier createRetryPolicyFunc, + Class resourceType, + UUID correlatedActivityId, + int initialPageSize, + String initialContinuationToken, + int top, + Supplier operationContextTextProvider) { + super(client, collectionResourceId, cosmosQueryRequestOptions, createRequestFunc, executeRequestFunc, + collectionLink, createRetryPolicyFunc, resourceType, correlatedActivityId, initialPageSize, + initialContinuationToken, top, feedRange, operationContextTextProvider); + this.consumeComparer = consumeComparer; + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java new file mode 100644 index 000000000000..2f3abb36e9d1 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.implementation.query; + +import com.azure.cosmos.BridgeInternal; +import com.azure.cosmos.CosmosException; +import com.azure.cosmos.implementation.ClientSideRequestStatistics; +import com.azure.cosmos.implementation.DiagnosticsClientContext; +import com.azure.cosmos.implementation.Document; +import com.azure.cosmos.implementation.DocumentClientRetryPolicy; +import com.azure.cosmos.implementation.DocumentCollection; +import com.azure.cosmos.implementation.HttpConstants; +import com.azure.cosmos.implementation.ImplementationBridgeHelpers; +import com.azure.cosmos.implementation.QueryMetrics; +import com.azure.cosmos.implementation.RequestChargeTracker; +import com.azure.cosmos.implementation.ResourceType; +import com.azure.cosmos.implementation.RxDocumentServiceRequest; +import com.azure.cosmos.implementation.Utils; +import com.azure.cosmos.implementation.feedranges.FeedRangeEpkImpl; +import com.azure.cosmos.implementation.query.orderbyquery.OrderByRowResult; +import com.azure.cosmos.implementation.query.orderbyquery.OrderbyRowComparer; +import com.azure.cosmos.models.CosmosQueryRequestOptions; +import com.azure.cosmos.models.FeedResponse; +import com.azure.cosmos.models.ModelBridgeInternal; +import com.azure.cosmos.models.SqlQuerySpec; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +public class NonStreamingOrderByDocumentQueryExecutionContext + extends ParallelDocumentQueryExecutionContextBase { + + private final static + ImplementationBridgeHelpers.CosmosDiagnosticsHelper.CosmosDiagnosticsAccessor diagnosticsAccessor = + ImplementationBridgeHelpers.CosmosDiagnosticsHelper.getCosmosDiagnosticsAccessor(); + + private static final ImplementationBridgeHelpers.FeedResponseHelper.FeedResponseAccessor feedResponseAccessor = + ImplementationBridgeHelpers.FeedResponseHelper.getFeedResponseAccessor(); + + private final static String FormatPlaceHolder = "{documentdb-formattableorderbyquery-filter}"; + private final static String True = "true"; + + private final OrderbyRowComparer consumeComparer; + private final RequestChargeTracker tracker; + private final ConcurrentMap queryMetricMap; + private final Collection clientSideRequestStatistics; + private Flux> orderByObservable; + + private int maxPageSizePerPartition; + + public NonStreamingOrderByDocumentQueryExecutionContext( + DiagnosticsClientContext diagnosticsClientContext, + IDocumentQueryClient client, + ResourceType resourceTypeEnum, + SqlQuerySpec query, + CosmosQueryRequestOptions cosmosQueryRequestOptions, + String resourceLink, + String rewrittenQuery, + OrderbyRowComparer consumeComparer, + UUID correlatedActivityId, + boolean hasSelectValue, + final AtomicBoolean isQueryCancelledOnTimeout) { + super(diagnosticsClientContext, client, resourceTypeEnum, Document.class, query, cosmosQueryRequestOptions, + resourceLink, rewrittenQuery, correlatedActivityId, hasSelectValue, isQueryCancelledOnTimeout); + this.consumeComparer = consumeComparer; + this.tracker = new RequestChargeTracker(); + this.queryMetricMap = new ConcurrentHashMap<>(); + this.clientSideRequestStatistics = ConcurrentHashMap.newKeySet(); + } + + public static Flux> createAsync( + DiagnosticsClientContext diagnosticsClientContext, + IDocumentQueryClient client, + PipelinedDocumentQueryParams initParams, + DocumentCollection collection) { + + QueryInfo queryInfo = initParams.getQueryInfo(); + + NonStreamingOrderByDocumentQueryExecutionContext context = new NonStreamingOrderByDocumentQueryExecutionContext( + diagnosticsClientContext, + client, + initParams.getResourceTypeEnum(), + initParams.getQuery(), + initParams.getCosmosQueryRequestOptions(), + initParams.getResourceLink(), + initParams.getQueryInfo().getRewrittenQuery(), + new OrderbyRowComparer<>(queryInfo.getOrderBy()), + initParams.getCorrelatedActivityId(), + queryInfo.hasSelectValue(), + initParams.isQueryCancelledOnTimeout()); + + context.setTop(initParams.getTop()); + + try { + context.initialize( + initParams.getFeedRanges(), + initParams.getQueryInfo().getOrderBy(), + initParams.getQueryInfo().getOrderByExpressions(), + initParams.getInitialPageSize(), + collection); + + return Flux.just(context); + } catch (CosmosException dce) { + return Flux.error(dce); + } + } + + private void initialize( + List feedRanges, List sortOrders, + Collection orderByExpressions, + int initialPageSize, + DocumentCollection collection) throws CosmosException { + // Since the continuation token will always be null, + // we don't need to handle any initialization based on continuationToken. + // We can directly initialize without any consideration for continuationToken. + Map partitionKeyRangeToContinuationToken = new HashMap<>(); + for (FeedRangeEpkImpl feedRangeEpk : feedRanges) { + partitionKeyRangeToContinuationToken.put(feedRangeEpk, + null); + } + super.initialize(collection, + partitionKeyRangeToContinuationToken, + initialPageSize, + new SqlQuerySpec(querySpec.getQueryText().replace(FormatPlaceHolder, True), + querySpec.getParameters())); + + orderByObservable = NonStreamingOrderByUtils.nonStreamingOrderedMerge( + consumeComparer, + tracker, + documentProducers, + initialPageSize, + queryMetricMap, + clientSideRequestStatistics); + } + + @Override + protected NonStreamingOrderByDocumentProducer createDocumentProducer( + String collectionRid, + String continuationToken, + int initialPageSize, + CosmosQueryRequestOptions cosmosQueryRequestOptions, + SqlQuerySpec querySpecForInit, + Map commonRequestHeaders, + TriFunction createRequestFunc, + Function>> executeFunc, + Supplier createRetryPolicyFunc, + FeedRangeEpkImpl feedRange) { + return new NonStreamingOrderByDocumentProducer( + consumeComparer, + client, + collectionRid, + cosmosQueryRequestOptions, + createRequestFunc, + executeFunc, + feedRange, + collectionRid, + createRetryPolicyFunc, + Document.class, + correlatedActivityId, + maxPageSizePerPartition, + continuationToken, + top, + this.getOperationContextTextProvider()); + } + + @Override + public Flux> drainAsync(int maxPageSize) { + return this.orderByObservable.transformDeferred(new ItemToPageTransformer(tracker, + maxPageSize, + this.queryMetricMap, + this.clientSideRequestStatistics)); + } + + @Override + public Flux> executeAsync() { + return drainAsync(ModelBridgeInternal.getMaxItemCountFromQueryRequestOptions(cosmosQueryRequestOptions)); + } + + private static class ItemToPageTransformer implements + Function>, Flux>> { + private final static int DEFAULT_PAGE_SIZE = 100; + private final RequestChargeTracker tracker; + private final int maxPageSize; + private final ConcurrentMap queryMetricMap; + private final Collection clientSideRequestStatistics; + + public ItemToPageTransformer(RequestChargeTracker tracker, + int maxPageSize, + ConcurrentMap queryMetricsMap, + Collection clientSideRequestStatistics) { + this.tracker = tracker; + this.maxPageSize = maxPageSize > 0 ? maxPageSize : DEFAULT_PAGE_SIZE; + this.queryMetricMap = queryMetricsMap; + this.clientSideRequestStatistics = clientSideRequestStatistics; + } + + private static Map headerResponse(double requestCharge) { + return Utils.immutableMapOf(HttpConstants.HttpHeaders.REQUEST_CHARGE, String.valueOf(requestCharge)); + } + + @Override + public Flux> apply(Flux> source) { + return source + .window(maxPageSize).map(Flux::collectList) + .flatMap(resultListObs -> resultListObs, 1) + .map(orderByRowResults -> { + // construct a page from result with request charge + FeedResponse> feedResponse = feedResponseAccessor.createFeedResponse( + orderByRowResults, + headerResponse(tracker.getAndResetCharge()), + null); + if (!queryMetricMap.isEmpty()) { + for (Map.Entry entry : queryMetricMap.entrySet()) { + BridgeInternal.putQueryMetricsIntoMap(feedResponse, + entry.getKey(), + entry.getValue()); + } + } + return feedResponse; + }) + .concatWith(Flux.defer(() -> { + return Flux.just(feedResponseAccessor.createFeedResponse(Utils.immutableListOf(), + null, null)); + })) + .map(feedOfOrderByRowResults -> { + List unwrappedResults = new ArrayList<>(); + for (OrderByRowResult orderByRowResult : feedOfOrderByRowResults.getResults()) { + unwrappedResults.add(orderByRowResult.getPayload()); + } + FeedResponse feedResponse = BridgeInternal.createFeedResponseWithQueryMetrics(unwrappedResults, + feedOfOrderByRowResults.getResponseHeaders(), + BridgeInternal.queryMetricsFromFeedResponse(feedOfOrderByRowResults), + ModelBridgeInternal.getQueryPlanDiagnosticsContext(feedOfOrderByRowResults), + false, + false, feedOfOrderByRowResults.getCosmosDiagnostics()); + diagnosticsAccessor.addClientSideDiagnosticsToFeed( + feedResponse.getCosmosDiagnostics(), clientSideRequestStatistics); + return feedResponse; + }).switchIfEmpty(Flux.defer(() -> { + // create an empty page if there is no result + FeedResponse frp = BridgeInternal.createFeedResponseWithQueryMetrics(Utils.immutableListOf(), + headerResponse( + tracker.getAndResetCharge()), + queryMetricMap, + null, + false, + false, + null); + diagnosticsAccessor.addClientSideDiagnosticsToFeed( + frp.getCosmosDiagnostics(), clientSideRequestStatistics); + return Flux.just(frp); + })); + } + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java new file mode 100644 index 000000000000..b4ac33a1dbc2 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.cosmos.implementation.query; + +import com.azure.cosmos.BridgeInternal; +import com.azure.cosmos.implementation.ClientSideRequestStatistics; +import com.azure.cosmos.implementation.Configs; +import com.azure.cosmos.implementation.Document; +import com.azure.cosmos.implementation.ImplementationBridgeHelpers; +import com.azure.cosmos.implementation.QueryMetrics; +import com.azure.cosmos.implementation.RequestChargeTracker; +import com.azure.cosmos.implementation.Resource; +import com.azure.cosmos.implementation.query.orderbyquery.OrderByRowResult; +import com.azure.cosmos.implementation.query.orderbyquery.OrderbyRowComparer; +import reactor.core.publisher.Flux; + +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.concurrent.PriorityBlockingQueue; +import java.util.function.Function; + +public class NonStreamingOrderByUtils { + private final static + ImplementationBridgeHelpers.CosmosDiagnosticsHelper.CosmosDiagnosticsAccessor diagnosticsAccessor = + ImplementationBridgeHelpers.CosmosDiagnosticsHelper.getCosmosDiagnosticsAccessor(); + + public static Flux> nonStreamingOrderedMerge(OrderbyRowComparer consumeComparer, + RequestChargeTracker tracker, + List> documentProducers, + int initialPageSize, + Map queryMetricsMap, + Collection clientSideRequestStatistics) { + @SuppressWarnings("unchecked") + Flux>[] fluxes = documentProducers + .subList(0, documentProducers.size()) + .stream() + .map(producer -> + toNonStreamingOrderByQueryResultObservable(producer, tracker, queryMetricsMap, initialPageSize, + consumeComparer, clientSideRequestStatistics)) + .toArray(Flux[]::new); + return Flux.mergeComparingDelayError(1,consumeComparer, fluxes); + } + + private static Flux> toNonStreamingOrderByQueryResultObservable(DocumentProducer producer, + RequestChargeTracker tracker, + Map queryMetricsMap, + int initialPageSize, + OrderbyRowComparer consumeComparer, + Collection clientSideRequestStatisticsList) { + return producer + .produceAsync() + .transformDeferred(new NonStreamingOrderByUtils.PageToItemTransformer(tracker, queryMetricsMap, initialPageSize, + consumeComparer, clientSideRequestStatisticsList)); + } + + private static class PageToItemTransformer implements + Function.DocumentProducerFeedResponse>, Flux>> { + private final RequestChargeTracker tracker; + private final Map queryMetricsMap; + private final Integer initialPageSize; + private final OrderbyRowComparer consumeComparer; + private final Collection clientSideRequestStatistics; + + private PageToItemTransformer(RequestChargeTracker tracker, Map queryMetricsMap, + Integer initialPageSize, OrderbyRowComparer consumeComparer, + Collection clientSideRequestStatistics) { + this.tracker = tracker; + this.queryMetricsMap = queryMetricsMap; + this.initialPageSize = initialPageSize; + this.consumeComparer = consumeComparer; + this.clientSideRequestStatistics = clientSideRequestStatistics; + } + + @Override + public Flux> apply(Flux.DocumentProducerFeedResponse> source) { + // the size of the priority queue is set to size+1, because when the pq reaches the max size we add that + // item and then remove the element. If we don't do this, then when adding this element the size of the pq + // will be increased automatically by 50% and then there would be inconsistent results for later pages. + PriorityBlockingQueue> priorityQueue = new PriorityBlockingQueue<>(initialPageSize + 1, consumeComparer); + + return source.flatMap(documentProducerFeedResponse -> { + clientSideRequestStatistics.addAll( + diagnosticsAccessor.getClientSideRequestStatisticsForQueryPipelineAggregations(documentProducerFeedResponse + .pageResult.getCosmosDiagnostics())); + + QueryMetrics.mergeQueryMetricsMap(queryMetricsMap, + BridgeInternal.queryMetricsFromFeedResponse(documentProducerFeedResponse.pageResult)); + List results = documentProducerFeedResponse.pageResult.getResults(); + results.forEach(r -> { + OrderByRowResult orderByRowResult = new OrderByRowResult( + r.toJson(), + documentProducerFeedResponse.sourceFeedRange, + null); + if (Configs.getMaxItemSizeForVectorSearchEnabled()) { + if (priorityQueue.size() < initialPageSize) { + priorityQueue.add(orderByRowResult); + } else { + priorityQueue.add(orderByRowResult); + priorityQueue.poll(); + } + } else { + priorityQueue.add(orderByRowResult); + } + + }); + tracker.addCharge(documentProducerFeedResponse.pageResult.getRequestCharge()); + // Returning an empty Flux since we are only processing and managing state here + return Flux.empty(); + }, 1) + .thenMany(Flux.defer(() -> Flux.fromIterable(priorityQueue))); + } + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/ParallelDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/ParallelDocumentQueryExecutionContext.java index 020b8633d2be..6ed30d3a7fbe 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/ParallelDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/ParallelDocumentQueryExecutionContext.java @@ -106,7 +106,8 @@ public static Flux> createAsync( || queryInfo.hasAggregates() || queryInfo.hasGroupBy() || queryInfo.hasDCount() - || queryInfo.hasDistinct()), + || queryInfo.hasDistinct() + || queryInfo.hasNonStreamingOrderBy()), initParams.isQueryCancelledOnTimeout()); context.setTop(initParams.getTop()); diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java index 7b6104271762..82746ad412b5 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java @@ -5,6 +5,7 @@ import com.azure.cosmos.CosmosItemSerializer; import com.azure.cosmos.implementation.DiagnosticsClientContext; import com.azure.cosmos.implementation.DocumentCollection; +import com.azure.cosmos.implementation.HttpConstants; import com.azure.cosmos.implementation.ImplementationBridgeHelpers; import com.azure.cosmos.implementation.Document; import com.azure.cosmos.implementation.ObjectNodeMap; @@ -15,6 +16,8 @@ import java.util.function.BiFunction; +import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; + /** * While this class is public, but it is not part of our published public APIs. * This is meant to be internally used only by our sdk. @@ -53,12 +56,21 @@ private static BiFunction, Flux { CosmosQueryRequestOptions orderByCosmosQueryRequestOptions = qryOptAccessor.clone(requestOptions); - ModelBridgeInternal.setQueryRequestOptionsContinuationToken(orderByCosmosQueryRequestOptions, continuationToken); - qryOptAccessor.getImpl(orderByCosmosQueryRequestOptions).setCustomItemSerializer(null); - - documentQueryParams.setCosmosQueryRequestOptions(orderByCosmosQueryRequestOptions); - - return OrderByDocumentQueryExecutionContext.createAsync(diagnosticsClientContext, client, documentQueryParams, collection); + if (queryInfo.hasNonStreamingOrderBy()) { + if (continuationToken != null) { + throw new NonStreamingOrderByBadRequestException( + HttpConstants.StatusCodes.BADREQUEST, + "Can not use a continuation token for a vector search query"); + } + qryOptAccessor.getImpl(orderByCosmosQueryRequestOptions).setCustomItemSerializer(null); + documentQueryParams.setCosmosQueryRequestOptions(orderByCosmosQueryRequestOptions); + return NonStreamingOrderByDocumentQueryExecutionContext.createAsync(diagnosticsClientContext, client, documentQueryParams, collection); + } else { + ModelBridgeInternal.setQueryRequestOptionsContinuationToken(orderByCosmosQueryRequestOptions, continuationToken); + qryOptAccessor.getImpl(orderByCosmosQueryRequestOptions).setCustomItemSerializer(null); + documentQueryParams.setCosmosQueryRequestOptions(orderByCosmosQueryRequestOptions); + return OrderByDocumentQueryExecutionContext.createAsync(diagnosticsClientContext, client, documentQueryParams, collection); + } }; } else { diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContext.java index c7f67711fabd..6c3fa2827216 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContext.java @@ -137,7 +137,7 @@ public Flux> executeAsync() { } private static QueryInfo validateQueryInfo(QueryInfo queryInfo) { - if (queryInfo.hasOrderBy() || queryInfo.hasAggregates() || queryInfo.hasGroupBy()) { + if (queryInfo.hasOrderBy() || queryInfo.hasAggregates() || queryInfo.hasGroupBy() || queryInfo.hasNonStreamingOrderBy()) { // Any query with order by, aggregates or group by needs to go through the Document query pipeline throw new IllegalStateException("This query must not use the simple query pipeline."); } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContextBase.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContextBase.java index 232f942b8590..39c6c27efad8 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContextBase.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContextBase.java @@ -63,7 +63,8 @@ public static Flux> createAsync( || queryInfo.hasAggregates() || queryInfo.hasGroupBy() || queryInfo.hasDCount() - || queryInfo.hasDistinct()) { + || queryInfo.hasDistinct() + || queryInfo.hasNonStreamingOrderBy()) { return PipelinedDocumentQueryExecutionContext.createAsyncCore( diagnosticsClientContext, diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryFeature.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryFeature.java index ce2b4865767c..1dd3e5928b92 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryFeature.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryFeature.java @@ -14,5 +14,6 @@ public enum QueryFeature { OrderBy, Top, NonValueAggregate, - DCount + DCount, + NonStreamingOrderBy } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryInfo.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryInfo.java index 65efb92c3325..48870a5ae52d 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryInfo.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryInfo.java @@ -36,6 +36,7 @@ public final class QueryInfo extends JsonSerializable { private DistinctQueryType distinctQueryType; private QueryPlanDiagnosticsContext queryPlanDiagnosticsContext; private DCountInfo dCountInfo; + private boolean nonStreamingOrderBy; public QueryInfo() { } @@ -160,6 +161,11 @@ public boolean hasGroupBy() { return groupByExpressions != null && !groupByExpressions.isEmpty(); } + public boolean hasNonStreamingOrderBy() { + this.nonStreamingOrderBy = Boolean.TRUE.equals(super.getBoolean("hasNonStreamingOrderBy")); + return this.nonStreamingOrderBy; + } + public Map getGroupByAliasToAggregateType(){ Map groupByAliasToAggregateMap; groupByAliasToAggregateMap = super.getMap("groupByAliasToAggregateType"); diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryPlanRetriever.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryPlanRetriever.java index ce91ff2029e9..83f82dbde363 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryPlanRetriever.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryPlanRetriever.java @@ -43,7 +43,8 @@ class QueryPlanRetriever { QueryFeature.GroupBy.name() + ", " + QueryFeature.Top.name() + ", " + QueryFeature.DCount.name() + ", " + - QueryFeature.NonValueAggregate.name(); + QueryFeature.NonValueAggregate.name() + ", " + + QueryFeature.NonStreamingOrderBy.name(); static Mono getQueryPlanThroughGatewayAsync(DiagnosticsClientContext diagnosticsClientContext, IDocumentQueryClient queryClient, diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CompositePath.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CompositePath.java index a278e0aa8f50..8cfd99b46e37 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CompositePath.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CompositePath.java @@ -93,7 +93,7 @@ public CompositePathSortOrder getOrder() { } /** - * Gets the sort order for the composite path. + * Sets the sort order for the composite path. *

* For example if you want to run the query "SELECT * FROM c ORDER BY c.age asc, c.height desc", * then you need to make the order for "/age" "ascending" and the order for "/height" "descending". diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java index 4fae5a797a70..0d357da0cc37 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java @@ -347,6 +347,28 @@ public CosmosContainerProperties setClientEncryptionPolicy(ClientEncryptionPolic return this; } + /** + * Gets the Vector Embedding Policy containing paths for embeddings along with path-specific settings for the item + * used in performing vector search on the items in a collection in the Azure CosmosDB database service. + * + * @return the Vector Embedding Policy. + */ + public CosmosVectorEmbeddingPolicy getVectorEmbeddingPolicy() { + return this.documentCollection.getVectorEmbeddingPolicy(); + } + + /** + * Sets the Vector Embedding Policy containing paths for embeddings along with path-specific settings for the item + * used in performing vector search on the items in a collection in the Azure CosmosDB database service. + * + * @param value the Vector Embedding Policy. + * @return the CosmosContainerProperties. + */ + public CosmosContainerProperties setVectorEmbeddingPolicy(CosmosVectorEmbeddingPolicy value) { + this.documentCollection.setVectorEmbeddingPolicy(value); + return this; + } + Resource getResource() { return this.documentCollection; } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java index c9bf3909fd5d..f9d7d4a72531 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java @@ -256,6 +256,26 @@ CosmosQueryRequestOptions setMaxItemCount(Integer maxItemCount) { return this; } + /** + * Gets the maximum item size to fetch during non-streaming order by queries. + * + * @return the max number of items for vector search. + */ + public Integer getMaxItemSizeForVectorSearch() { + return this.actualRequestOptions.getMaxItemSizeForVectorSearch(); + } + + /** + * Sets the maximum item size to fetch during non-streaming order by queries. + * + * @param maxItemSizeForVectorSearch the max number of items for vector search. + * @return the CosmosQueryRequestOptions. + */ + public CosmosQueryRequestOptions setMaxItemSizeForVectorSearch(Integer maxItemSizeForVectorSearch) { + this.actualRequestOptions.setMaxItemSizeForVectorSearch(maxItemSizeForVectorSearch); + return this; + } + /** * Gets the request continuation token. * diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDataType.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDataType.java new file mode 100644 index 000000000000..d8a4a63edbe2 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDataType.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.models; + +import com.fasterxml.jackson.annotation.JsonValue; + +import java.util.Arrays; + +/** + * Data types for the embeddings in Cosmos DB database service. + */ +public enum CosmosVectorDataType { + /** + * Represents a int8 data type. + */ + INT8("int8"), + + /** + * Represents a uint8 data type. + */ + UINT8("uint8"), + + /** + * Represents a float16 data type. + */ + FLOAT16("float16"), + + /** + * Represents a float32 data type. + */ + FLOAT32("float32"); + + private final String overWireValue; + + CosmosVectorDataType(String overWireValue) { + this.overWireValue = overWireValue; + } + + @JsonValue + @Override + public String toString() { + return this.overWireValue; + } + + /** + * Method to retrieve the enum constant by its overWireValue. + * @param value the overWire value of the enum constant + * @return the matching CosmosVectorDataType + * @throws IllegalArgumentException if no matching enum constant is found + */ + public static CosmosVectorDataType fromString(String value) { + return Arrays.stream(CosmosVectorDataType.values()) + .filter(vectorDataType -> vectorDataType.toString().equalsIgnoreCase(value)) + .findFirst() + .orElseThrow(() -> new IllegalArgumentException(String.format( + "Invalid vector data type with value {%s} for the vector embedding policy.", value))); + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDistanceFunction.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDistanceFunction.java new file mode 100644 index 000000000000..57f74fab3dc9 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDistanceFunction.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.models; + +import com.fasterxml.jackson.annotation.JsonValue; + +import java.util.Arrays; + +/** + * Distance Function for the embeddings in the Cosmos DB database service. + */ +public enum CosmosVectorDistanceFunction { + /** + * Represents the euclidean distance function. + */ + EUCLIDEAN("euclidean"), + + /** + * Represents the cosine distance function. + */ + COSINE("cosine"), + + /** + * Represents the dot product distance function. + */ + DOT_PRODUCT("dotproduct"); + + private final String overWireValue; + + CosmosVectorDistanceFunction(String overWireValue) { + this.overWireValue = overWireValue; + } + + @JsonValue + @Override + public String toString() { + return this.overWireValue; + } + + /** + * Method to retrieve the enum constant by its overWireValue. + * @param value the overWire value of the enum constant + * @return the matching CosmosVectorDataType + * @throws IllegalArgumentException if no matching enum constant is found + */ + public static CosmosVectorDistanceFunction fromString(String value) { + return Arrays.stream(CosmosVectorDistanceFunction.values()) + .filter(vectorDistanceFunction -> vectorDistanceFunction.toString().equalsIgnoreCase(value)) + .findFirst() + .orElseThrow(() -> new IllegalArgumentException(String.format( + "Invalid distance function with value {%s} for the vector embedding policy.", value ))); + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbedding.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbedding.java new file mode 100644 index 000000000000..0f111d34e00a --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbedding.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.models; + +import com.azure.cosmos.implementation.Constants; +import com.azure.cosmos.implementation.JsonSerializable; +import com.azure.cosmos.implementation.apachecommons.lang.StringUtils; +import com.fasterxml.jackson.annotation.JsonProperty; +import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; + +/** + * Embedding settings within {@link CosmosVectorEmbeddingPolicy} + */ +public final class CosmosVectorEmbedding { + @JsonProperty(Constants.Properties.PATH) + private String path; + @JsonProperty(Constants.Properties.VECTOR_DATA_TYPE) + private String dataType; + @JsonProperty(Constants.Properties.VECTOR_DIMENSIONS) + private Long dimensions; + @JsonProperty(Constants.Properties.DISTANCE_FUNCTION) + private String distanceFunction; + private JsonSerializable jsonSerializable; + + /** + * Constructor + */ + public CosmosVectorEmbedding() { + this.jsonSerializable = new JsonSerializable(); + } + + /** + * Gets the path for the cosmosVectorEmbedding. + * + * @return path + */ + public String getPath() { + return path; + } + + /** + * Sets the path for the cosmosVectorEmbedding. + * + * @param path the path for the cosmosVectorEmbedding + * @return CosmosVectorEmbedding + */ + public CosmosVectorEmbedding setPath(String path) { + if (StringUtils.isEmpty(path)) { + throw new NullPointerException("embedding path is either null or empty"); + } + + if (path.charAt(0) != '/' || path.lastIndexOf('/') != 0) { + throw new IllegalArgumentException(""); + } + + this.path = path; + return this; + } + + /** + * Gets the data type for the cosmosVectorEmbedding. + * + * @return dataType + */ + public CosmosVectorDataType getDataType() { + return CosmosVectorDataType.fromString(dataType); + } + + /** + * Sets the data type for the cosmosVectorEmbedding. + * + * @param dataType the data type for the cosmosVectorEmbedding + * @return CosmosVectorEmbedding + */ + public CosmosVectorEmbedding setDataType(CosmosVectorDataType dataType) { + checkNotNull(dataType, "cosmosVectorDataType cannot be null"); + this.dataType = dataType.toString(); + return this; + } + + /** + * Gets the dimensions for the cosmosVectorEmbedding. + * + * @return dimensions + */ + public Long getDimensions() { + return dimensions; + } + + /** + * Sets the dimensions for the cosmosVectorEmbedding. + * + * @param dimensions the dimensions for the cosmosVectorEmbedding + * @return CosmosVectorEmbedding + */ + public CosmosVectorEmbedding setDimensions(Long dimensions) { + checkNotNull(dimensions, "dimensions cannot be null"); + if (dimensions < 1) { + throw new IllegalArgumentException("Dimensions for the embedding has to be a long value greater than 0 " + + "for the vector embedding policy"); + } + + this.dimensions = dimensions; + return this; + } + + /** + * Gets the distanceFunction for the cosmosVectorEmbedding. + * + * @return distanceFunction + */ + public CosmosVectorDistanceFunction getDistanceFunction() { + return CosmosVectorDistanceFunction.fromString(distanceFunction); + } + + /** + * Sets the distanceFunction for the cosmosVectorEmbedding. + * + * @param distanceFunction the distanceFunction for the cosmosVectorEmbedding + * @return CosmosVectorEmbedding + */ + public CosmosVectorEmbedding setDistanceFunction(CosmosVectorDistanceFunction distanceFunction) { + checkNotNull(distanceFunction, "cosmosVectorDistanceFunction cannot be null"); + this.distanceFunction = distanceFunction.toString(); + return this; + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbeddingPolicy.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbeddingPolicy.java new file mode 100644 index 000000000000..6abcc0028723 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbeddingPolicy.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.models; + +import com.azure.cosmos.implementation.Constants; +import com.azure.cosmos.implementation.JsonSerializable; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; + +/** + * Vector Embedding Policy + */ +public final class CosmosVectorEmbeddingPolicy { + + private JsonSerializable jsonSerializable; + /** + * Paths for embeddings along with path-specific settings for the item. + */ + @JsonProperty(Constants.Properties.VECTOR_EMBEDDINGS) + private List cosmosVectorEmbeddings; + + /** + * Constructor + */ + public CosmosVectorEmbeddingPolicy() { + this.jsonSerializable = new JsonSerializable(); + } + + /** + * Gets the paths for embeddings along with path-specific settings for the item. + * + * @return the paths for embeddings along with path-specific settings for the item. + */ + public List getVectorEmbeddings() { + return this.cosmosVectorEmbeddings; + } + + /** + * Sets the paths for embeddings along with path-specific settings for the item. + * + * @param cosmosVectorEmbeddings paths for embeddings along with path-specific settings for the item. + */ + public void setCosmosVectorEmbeddings(List cosmosVectorEmbeddings) { + cosmosVectorEmbeddings.forEach(embedding -> { + checkNotNull(embedding, "Null values are not allowed in cosmosVectorEmbeddings list."); + }); + this.cosmosVectorEmbeddings = cosmosVectorEmbeddings; + } + +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexSpec.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexSpec.java new file mode 100644 index 000000000000..4ea617eea041 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexSpec.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.models; + +import com.azure.cosmos.CosmosItemSerializer; +import com.azure.cosmos.implementation.Constants; +import com.azure.cosmos.implementation.JsonSerializable; + +import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; + +/** + * Vector Indexes spec for Azure CosmosDB service. + */ +public final class CosmosVectorIndexSpec { + + private final JsonSerializable jsonSerializable; + private String type; + + /** + * Constructor + */ + public CosmosVectorIndexSpec() { + this.jsonSerializable = new JsonSerializable(); + } + + /** + * Gets path. + * + * @return the path. + */ + public String getPath() { + return this.jsonSerializable.getString(Constants.Properties.PATH); + } + + /** + * Sets path. + * + * @param path the path. + * @return the SpatialSpec. + */ + public CosmosVectorIndexSpec setPath(String path) { + this.jsonSerializable.set(Constants.Properties.PATH, path, CosmosItemSerializer.DEFAULT_SERIALIZER); + return this; + } + + /** + * Gets the vector index type for the vector index + * + * @return the vector index type + */ + public String getType() { + if (this.type == null) { + this.type = this.jsonSerializable.getString(Constants.Properties.VECTOR_INDEX_TYPE); + } + return this.type; + } + + /** + * Sets the vector index type for the vector index + * + * @param type the vector index type + * @return the VectorIndexSpec + */ + public CosmosVectorIndexSpec setType(String type) { + checkNotNull(type, "cosmosVectorIndexType cannot be null"); + this.type = type; + this.jsonSerializable.set(Constants.Properties.VECTOR_INDEX_TYPE, this.type, CosmosItemSerializer.DEFAULT_SERIALIZER); + return this; + } + + void populatePropertyBag() { + this.jsonSerializable.populatePropertyBag(); + } + + JsonSerializable getJsonSerializable() { + return this.jsonSerializable; + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexType.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexType.java new file mode 100644 index 000000000000..679ea1f991c0 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexType.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.models; + +/** + * Defines the index type of vector index specification in the Azure Cosmos DB service. + */ +public enum CosmosVectorIndexType { + /** + * Represents a flat vector index type. + */ + FLAT("flat"), + + /** + * Represents a quantized flat vector index type. + */ + QUANTIZED_FLAT("quantizedFlat"), + + /** + * Represents a disk ANN vector index type. + */ + DISK_ANN("diskANN"); + + + private final String overWireValue; + + CosmosVectorIndexType(String overWireValue) { + this.overWireValue = overWireValue; + } + + @Override + public String toString() { + return this.overWireValue; + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java index 4ee5153877f8..530557cad90f 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java @@ -25,8 +25,8 @@ public final class IndexingPolicy { private List excludedPaths; private List> compositeIndexes; private List spatialIndexes; - - private JsonSerializable jsonSerializable; + private List vectorIndexes; + private final JsonSerializable jsonSerializable; /** * Constructor. @@ -54,7 +54,7 @@ public IndexingPolicy() { * * * @param defaultIndexOverrides comma separated set of indexes that serve as default index specifications for the - * root path. + * root path. * @throws IllegalArgumentException throws when defaultIndexOverrides is null */ IndexingPolicy(Index[] defaultIndexOverrides) { @@ -235,7 +235,7 @@ public IndexingPolicy setCompositeIndexes(List> compositeInd } /** - * Sets the spatial indexes for additional indexes. + * Gets the spatial indexes for additional indexes. * * @return the spatial indexes. */ @@ -266,11 +266,55 @@ public IndexingPolicy setSpatialIndexes(List spatialIndexes) { return this; } + /** + * Gets the vector indexes. + * + * @return the vector indexes + */ + public List getVectorIndexes() { + if (this.vectorIndexes == null) { + this.vectorIndexes = this.jsonSerializable.getList(Constants.Properties.VECTOR_INDEXES, CosmosVectorIndexSpec.class); + + if (this.vectorIndexes == null) { + this.vectorIndexes = new ArrayList(); + } + } + + return this.vectorIndexes; + } + + /** + * Sets the vector indexes. + * + * Example of the vectorIndexes: + * "vectorIndexes": [ + * { + * "path": "/vector1", + * "type": "diskANN" + * }, + * { + * "path": "/vector1", + * "type": "flat" + * }, + * { + * "path": "/vector2", + * "type": "quantizedFlat" + * }] + * + * @param vectorIndexes the vector indexes + * @return the Indexing Policy. + */ + public IndexingPolicy setVectorIndexes(List vectorIndexes) { + this.vectorIndexes = vectorIndexes; + this.jsonSerializable.set(Constants.Properties.VECTOR_INDEXES,this.vectorIndexes, CosmosItemSerializer.DEFAULT_SERIALIZER); + return this; + } + void populatePropertyBag() { this.jsonSerializable.populatePropertyBag(); // If indexing mode is not 'none' and not paths are set, set them to the defaults if (this.getIndexingMode() != IndexingMode.NONE && this.getIncludedPaths().size() == 0 - && this.getExcludedPaths().size() == 0) { + && this.getExcludedPaths().size() == 0) { IncludedPath includedPath = new IncludedPath(IndexingPolicy.DEFAULT_PATH); this.getIncludedPaths().add(includedPath); } @@ -296,5 +340,7 @@ void populatePropertyBag() { } } - JsonSerializable getJsonSerializable() { return this.jsonSerializable; } + JsonSerializable getJsonSerializable() { + return this.jsonSerializable; + } } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java index a8f344ce4e2d..e814cc16681b 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java @@ -435,6 +435,8 @@ public static void populatePropertyBag(T t) { ((PartitionKeyDefinition) t).populatePropertyBag(); } else if (t instanceof SpatialSpec) { ((SpatialSpec) t).populatePropertyBag(); + } else if (t instanceof CosmosVectorIndexSpec) { + ((CosmosVectorIndexSpec) t).populatePropertyBag(); } else if (t instanceof SqlParameter) { ((SqlParameter) t).populatePropertyBag(); } else if (t instanceof SqlQuerySpec) { @@ -468,6 +470,8 @@ public static JsonSerializable getJsonSerializable(T t) { return ((PartitionKeyDefinition) t).getJsonSerializable(); } else if (t instanceof SpatialSpec) { return ((SpatialSpec) t).getJsonSerializable(); + } else if (t instanceof CosmosVectorIndexSpec) { + return ((CosmosVectorIndexSpec) t).getJsonSerializable(); } else if (t instanceof SqlParameter) { return ((SqlParameter) t).getJsonSerializable(); } else if (t instanceof SqlQuerySpec) { @@ -540,6 +544,11 @@ public static Integer getMaxItemCountFromQueryRequestOptions(CosmosQueryRequestO return options.getMaxItemCount(); } + @Warning(value = INTERNAL_USE_ONLY_WARNING) + public static Integer getMaxItemSizeForVectorSearchFromQueryRequestOptions(CosmosQueryRequestOptions options) { + return options.getMaxItemSizeForVectorSearch(); + } + @Warning(value = INTERNAL_USE_ONLY_WARNING) public static String getRequestContinuationFromQueryRequestOptions(CosmosQueryRequestOptions options) { return options.getRequestContinuation(); diff --git a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md index 6d699b6e17bd..486ca9852bc7 100644 --- a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md @@ -8,6 +8,9 @@ ### Bugs Fixed +- Fixes the session message disposition to use management node as fall back. ([#39913](https://github.com/Azure/azure-sdk-for-java/issues/ 39913)) +- Fixes the session processor idle timeout to fall back to RetryOptions::tryTimeout. ([#39993](https://github.com/Azure/azure-sdk-for-java/issues/39993)) + ### Other Changes ## 7.17.0 (2024-05-06) From 0f1be0c0cea82e798663031291618594da3d89d1 Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Fri, 10 May 2024 15:29:47 -0700 Subject: [PATCH 15/33] Users/akataria/non streaming order by (#40118) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Initial changes * Initial changes * [Cosmos][VectorIndex]Adding changes for vectorIndex and vectorEmbeddingPolicy (#40004) * Adding changes for vectorIndex and vectorEmbeddingPolicy * Adding some necessary comments * Adding test case * updating enum values * Updating test case * Updating test case * Updating test case * updating changelog * Updating test case * Resolving comments * Resolving comments * Fixing test case * Resolving comments * Resolving Comments * Fixing build issues * Resolving comments * Resolving Comments * Initial changes * Initial changes * Initial changes * Resolving comments * Fixing build issues * [Cosmos][VectorSearch] Non Streaming Order By Query (#40085) * Increment versions for core releases (#40003) Increment package versions for core releases * Ensure ServiceBus session idle timeout fall back to retry-options::try-timeout (#39994) * Added Alpha3 Java Media Streaming Events (#40002) * Added Alpha3 Java Media Streaming Events * updating readme to add the media streaming events to remove model --------- Co-authored-by: Vinothini Dharmaraj * Update version of github-event-processor to 1.0.0-dev.20240502.2 (#40012) Co-authored-by: James Suplizio * Prepare May 2024 Identity Release (#40006) * Prepare Identity Broker May 2024 Release (#40014) * Increment package versions for identity releases (#40015) * [JobRouter] SDK Review updates (#40011) * SDK Review updates * Update auto-generated models * Add customization * Fix customization * Update package * Update tests * Linting * FixFaultInjectionRuleFailedToApplyPerPartitionInGatewayMode (#40005) * fix fault injection rule failed to apply per partition in gateway mode --------- Co-authored-by: annie-mac * azure-cosmos-test_1.0.0.beta.7Release (#40021) * release azure-cosmos-test 1.0.0.beta.7 --------- Co-authored-by: annie-mac --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac * [Cosmos][VectorSearch] Non Streaming Order By Query (#40096) * Initial changes * Initial changes * Increment versions for core releases (#40003) Increment package versions for core releases * Ensure ServiceBus session idle timeout fall back to retry-options::try-timeout (#39994) * Added Alpha3 Java Media Streaming Events (#40002) * Added Alpha3 Java Media Streaming Events * updating readme to add the media streaming events to remove model --------- Co-authored-by: Vinothini Dharmaraj * Update version of github-event-processor to 1.0.0-dev.20240502.2 (#40012) Co-authored-by: James Suplizio * Prepare May 2024 Identity Release (#40006) * Prepare Identity Broker May 2024 Release (#40014) * Increment package versions for identity releases (#40015) * [JobRouter] SDK Review updates (#40011) * SDK Review updates * Update auto-generated models * Add customization * Fix customization * Update package * Update tests * Linting * FixFaultInjectionRuleFailedToApplyPerPartitionInGatewayMode (#40005) * fix fault injection rule failed to apply per partition in gateway mode --------- Co-authored-by: annie-mac * azure-cosmos-test_1.0.0.beta.7Release (#40021) * release azure-cosmos-test 1.0.0.beta.7 --------- Co-authored-by: annie-mac * Fixed existsById API in ReactiveCosmosTemplate (#40022) * Fixed existsById API in ReactiveCosmosTemplate * Added changelog * Initial changes * Initial changes * Skip Recorded test and delete Event record until test proxy to work with Event recordings (#40029) Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> * Fix invalid CODEOWNERS (#40032) * Initial changes * ServiceBus: fix session tracing (#39962) * remove additional matrix * Fix session processing and disposition instrumentation * return matrix config * review suggestions * [Automation] Generate SDK based on TypeSpec 0.15.15 (#40048) * [CODEOWNERS] Updates for org changes (#40049) * [CODEOWNERS] Updates for org changes The focus of these changes is to remove an individual who no longer is responsible for the products which their GH account is associated to. * Move from using the docker image to java2docfx for docs validation (#39744) * Move from using the docker image to java2docfx for docs validation * Temporarily turn on docs processing for template libraries for testing * Actually install the rex validation tool * Fix the if not Test-Path statement * Update java2docfx version and add a couple of diagnostics output lines * Add missing close paren * Ensure that Sort-Object always returns an array even if there's only one item * add another piece of diagnostics output * trying one more thing * remove some diag, add other * Remove the additional diagnostics, add permanent output message * Invoke java -jar on java2docfx to show the help command to ensure the install is okay * fiddling with the java -jar command * Set the working directory to the java2docfx directory before executing the mvn dependency download * Actually create the directory before trying to set location...oops * Update rex validation to verify MAVEN_HOME is set * Updates for Java PR 39875 which had changes from this PR that were more immediate * Update java2docfx version * remove check for MAVEN_HOME which was only for testing * Update the version of java2docfx to test a fix * Update version of java2docfx to 1.0.4 * revert template's ci.yml changes that were only necessary to test java2docfx * owners (#39686) * Use ClientLogger in testing output (#40010) Use ClientLogger in testing output * Fix null pointer exception and context usage (#40053) * Rename AML to AzureMachineLearning (#40056) * Fixed the Key Vault `test-resources.json` file to properly configure a deployment script for certificate creation. (#40037) * Close response body in bearer policy (#40052) * Running Prepare-Release for azure-messaging-servicebus 7.17.0 (#40058) * mgmt, TypeSpec code generation pipeline (#39963) * typespec generation pipeline echo command PR_TITLE * generation typespec Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines * remove typespec pipeline file * fix pr title * address comments * Add codeowner linter owners (#39997) * Update to ESRP task version that supports federated auth (#40059) * Increment package versions for cosmos releases (#40031) * Update azure-sdk-build-tools Repository Resource Refs in Yaml files (#39627) * Add reduced embeddings sample to azure-search-documents (#40069) * Add reduced embeddings sample * Fix cspell * Fix link * Search May Preview Regen Updates (#40057) * Search May Preview Regeneration - Still need to add varargs convenience * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * adding varargs * Additional adjustments to FieldBuilder and Search Index Customizations * Updating cspell.json * Adjust `SearchScoreThreshold` customization Re-enable code generation in CI * Updates: - Updated Cspell - Rename `maxStoragePerIndex` property to `maxStoragePerIndexInBytes` in SearchServiceLimits - Set `hybridSearch` property to be type `HybridSearch` in SearchRequest - Add `hybridSearch` to SearchOptions and `SearchAsyncClient.createSearchRequest()` * Adding Support and testing byte[] and List within field builder * Fix linting --------- Co-authored-by: alzimmermsft <48699787+alzimmermsft@users.noreply.github.com> * Preparing Search May 2024 Beta Release (#40071) * Preparing Search May 2024 Beta Release * Preparing Search May 2024 Beta Release * Resolving comments * Fixing build issues * eng, update autorest.java, improve error output in sdk automation (#40073) * improve error output * autorest.java 4.1.29 * Merge to main after spring cloud azure 4.18.0 released (#40075) * Prepare for Spring Cloud Azure 4.18.0 release (#40063) * update version client * update version/changelog/readme * update changelog * Increment versions for spring releases (#40074) * Increment package versions for spring releases * Update version_client.txt * Update pom.xml --------- Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> * Miscellaneous Core performance improvements (#39552) Miscellaneous Core performance improvements * Increment package versions for search releases (#40072) * Update io.fabric8:kubernetes-client (#40086) 5.12.3 -> 6.12.1 * Increment package versions for servicebus releases (#40094) * Emit stable auto-instrumented otel metrics (#39960) * Update otel metrics logic * add runtime metrics * adding a few metrics I forgot * small correction * Update * Fix * Update * Delete pre-stable metrics --------- Co-authored-by: Harsimar Kaur (from Dev Box) --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac Co-authored-by: Kushagra Thapar Co-authored-by: minwoolee-msft <77083090+minwoolee-msft@users.noreply.github.com> Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> Co-authored-by: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Co-authored-by: Liudmila Molkova Co-authored-by: Jesse Squire Co-authored-by: Harsimar Kaur Co-authored-by: vcolin7 Co-authored-by: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Co-authored-by: Wes Haggard Co-authored-by: Patrick Hallisey Co-authored-by: Jair Myree Co-authored-by: Weidong Xu Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> Co-authored-by: Helen <56097766+heyams@users.noreply.github.com> Co-authored-by: Harsimar Kaur (from Dev Box) * Initial changes * Initial changes * Fixes --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac Co-authored-by: Kushagra Thapar Co-authored-by: minwoolee-msft <77083090+minwoolee-msft@users.noreply.github.com> Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> Co-authored-by: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Co-authored-by: Liudmila Molkova Co-authored-by: Jesse Squire Co-authored-by: Harsimar Kaur Co-authored-by: vcolin7 Co-authored-by: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Co-authored-by: Wes Haggard Co-authored-by: Patrick Hallisey Co-authored-by: Jair Myree Co-authored-by: Weidong Xu Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> Co-authored-by: Helen <56097766+heyams@users.noreply.github.com> Co-authored-by: Harsimar Kaur (from Dev Box) --- sdk/cosmos/azure-cosmos-test/CHANGELOG.md | 8 -------- sdk/cosmos/azure-cosmos/CHANGELOG.md | 2 ++ .../main/java/com/azure/cosmos/models/IndexingPolicy.java | 1 - sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md | 2 ++ 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/sdk/cosmos/azure-cosmos-test/CHANGELOG.md b/sdk/cosmos/azure-cosmos-test/CHANGELOG.md index e7cdc6f02af1..99f9e771c704 100644 --- a/sdk/cosmos/azure-cosmos-test/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos-test/CHANGELOG.md @@ -6,14 +6,6 @@ #### Breaking Changes -#### Bugs Fixed -* Fixed an issue where `FaultInjectionRule` can not apply on partition level when using `Gateway` Mode and non-session consistency - See [40005](https://github.com/Azure/azure-sdk-for-java/pull/40005) - -### 1.0.0-beta.7 (2024-05-03) - -#### Bugs Fixed -* Fixed an issue where `FaultInjectionRule` can not apply on partition level when using `Gateway` Mode and non-session consistency - See [40005](https://github.com/Azure/azure-sdk-for-java/pull/40005) - ### 1.0.0-beta.7 (2024-05-03) #### Bugs Fixed diff --git a/sdk/cosmos/azure-cosmos/CHANGELOG.md b/sdk/cosmos/azure-cosmos/CHANGELOG.md index 16cedfc04ef2..4b6e5817c550 100644 --- a/sdk/cosmos/azure-cosmos/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos/CHANGELOG.md @@ -7,6 +7,8 @@ * Added support for non-streaming OrderBy query and a query feature `NonStreamingOrderBy` to support Vector Search queries. - See [PR 39897](https://github.com/Azure/azure-sdk-for-java/pull/39897/) +* Added support for non-streaming OrderBy query and a query feature `NonStreamingOrderBy` to support Vector Search queries. - See [PR 39897](https://github.com/Azure/azure-sdk-for-java/pull/39897/) + #### Breaking Changes #### Bugs Fixed diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java index 530557cad90f..3077fb67f3ab 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java @@ -20,7 +20,6 @@ */ public final class IndexingPolicy { private static final String DEFAULT_PATH = "/*"; - private List includedPaths; private List excludedPaths; private List> compositeIndexes; diff --git a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md index 486ca9852bc7..791294e3270f 100644 --- a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md @@ -7,6 +7,8 @@ ### Breaking Changes ### Bugs Fixed +- Fixes the session message disposition to use management node as fall back. ([#39913](https://github.com/Azure/azure-sdk-for-java/issues/ 39913)) +- Fixes the session processor idle timeout to fall back to RetryOptions::tryTimeout. ([#39993](https://github.com/Azure/azure-sdk-for-java/issues/39993)) - Fixes the session message disposition to use management node as fall back. ([#39913](https://github.com/Azure/azure-sdk-for-java/issues/ 39913)) - Fixes the session processor idle timeout to fall back to RetryOptions::tryTimeout. ([#39993](https://github.com/Azure/azure-sdk-for-java/issues/39993)) From d4dcad23979da9e6ae1dba5ed0487ae1a1adf388 Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Fri, 10 May 2024 15:48:27 -0700 Subject: [PATCH 16/33] Fixing some merge issues --- sdk/cosmos/azure-cosmos-test/CHANGELOG.md | 4 + .../com/azure/cosmos/rx/VectorIndexTest.java | 6 - sdk/cosmos/azure-cosmos/CHANGELOG.md | 7 +- .../cosmos/implementation/Constants.java | 9 -- .../implementation/DocumentCollection.java | 30 ---- .../azure/cosmos/models/CompositePath.java | 2 +- .../models/CosmosContainerProperties.java | 22 --- .../cosmos/models/CosmosVectorDataType.java | 59 -------- .../models/CosmosVectorDistanceFunction.java | 54 -------- .../cosmos/models/CosmosVectorEmbedding.java | 128 ------------------ .../models/CosmosVectorEmbeddingPolicy.java | 54 -------- .../cosmos/models/CosmosVectorIndexSpec.java | 79 ----------- .../cosmos/models/CosmosVectorIndexType.java | 36 ----- .../azure/cosmos/models/IndexingPolicy.java | 45 ------ .../cosmos/models/ModelBridgeInternal.java | 4 - .../azure-messaging-servicebus/CHANGELOG.md | 5 - 16 files changed, 8 insertions(+), 536 deletions(-) delete mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDataType.java delete mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDistanceFunction.java delete mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbedding.java delete mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbeddingPolicy.java delete mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexSpec.java delete mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexType.java diff --git a/sdk/cosmos/azure-cosmos-test/CHANGELOG.md b/sdk/cosmos/azure-cosmos-test/CHANGELOG.md index 99f9e771c704..8bfe27c5aa13 100644 --- a/sdk/cosmos/azure-cosmos-test/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos-test/CHANGELOG.md @@ -6,6 +6,10 @@ #### Breaking Changes +#### Bugs Fixed + +#### Other Changes + ### 1.0.0-beta.7 (2024-05-03) #### Bugs Fixed diff --git a/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java index d4f5b8cf6602..e276c472fffb 100644 --- a/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java +++ b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java @@ -15,17 +15,11 @@ import com.azure.cosmos.implementation.Utils; import com.azure.cosmos.implementation.guava25.collect.ImmutableList; import com.azure.cosmos.models.CosmosContainerProperties; -import com.azure.cosmos.models.CosmosVectorDataType; -import com.azure.cosmos.models.CosmosVectorDistanceFunction; -import com.azure.cosmos.models.CosmosVectorEmbedding; -import com.azure.cosmos.models.CosmosVectorEmbeddingPolicy; import com.azure.cosmos.models.ExcludedPath; import com.azure.cosmos.models.IncludedPath; import com.azure.cosmos.models.IndexingMode; import com.azure.cosmos.models.IndexingPolicy; import com.azure.cosmos.models.PartitionKeyDefinition; -import com.azure.cosmos.models.CosmosVectorIndexSpec; -import com.azure.cosmos.models.CosmosVectorIndexType; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import org.slf4j.Logger; diff --git a/sdk/cosmos/azure-cosmos/CHANGELOG.md b/sdk/cosmos/azure-cosmos/CHANGELOG.md index 4b6e5817c550..13285d30fc21 100644 --- a/sdk/cosmos/azure-cosmos/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos/CHANGELOG.md @@ -5,9 +5,7 @@ #### Features Added * Added `cosmosVectorEmbeddingPolicy` in `cosmosContainerProperties` and `vectorIndexes` in `indexPolicy` to support vector search in CosmosDB - See[39379](https://github.com/Azure/azure-sdk-for-java/pull/39379) -* Added support for non-streaming OrderBy query and a query feature `NonStreamingOrderBy` to support Vector Search queries. - See [PR 39897](https://github.com/Azure/azure-sdk-for-java/pull/39897/) - -* Added support for non-streaming OrderBy query and a query feature `NonStreamingOrderBy` to support Vector Search queries. - See [PR 39897](https://github.com/Azure/azure-sdk-for-java/pull/39897/) +* Added support for non-streaming OrderBy query and a query feature `NonStreamingOrderBy` to support Vector Search queries. - See [PR 39897](https://github.com/Azure/azure-sdk-for-java/pull/39897/) #### Breaking Changes @@ -16,9 +14,10 @@ #### Other Changes ### 4.59.0 (2024-04-27) + #### Features Added * Added public APIs `getCustomItemSerializer` and `setCustomItemSerializer` to allow customers to specify custom payload transformations or serialization settings. - See [PR 38997](https://github.com/Azure/azure-sdk-for-java/pull/38997) and [PR 39933](https://github.com/Azure/azure-sdk-for-java/pull/39933) - + #### Other Changes * Load Blackbird or Afterburner into the ObjectMapper depending upon Java version and presence of modules in classpath. Make Afterburner and Blackbird optional maven dependencies. See - [PR 39689](https://github.com/Azure/azure-sdk-for-java/pull/39689) diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Constants.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Constants.java index f789963783ed..8409d5b7ec23 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Constants.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Constants.java @@ -120,15 +120,6 @@ public static final class Properties { public static final String SPATIAL_INDEXES = "spatialIndexes"; public static final String TYPES = "types"; - // Vector Embedding Policy - public static final String VECTOR_EMBEDDING_POLICY = "vectorEmbeddingPolicy"; - public static final String VECTOR_INDEXES = "vectorIndexes"; - public static final String VECTOR_EMBEDDINGS = "vectorEmbeddings"; - public static final String VECTOR_INDEX_TYPE = "type"; - public static final String VECTOR_DATA_TYPE = "dataType"; - public static final String VECTOR_DIMENSIONS = "dimensions"; - public static final String DISTANCE_FUNCTION = "distanceFunction"; - // Unique index. public static final String UNIQUE_KEY_POLICY = "uniqueKeyPolicy"; public static final String UNIQUE_KEYS = "uniqueKeys"; diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentCollection.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentCollection.java index 1930f2275a61..969d6145c1bc 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentCollection.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentCollection.java @@ -10,7 +10,6 @@ import com.azure.cosmos.models.ClientEncryptionPolicy; import com.azure.cosmos.models.ComputedProperty; import com.azure.cosmos.models.ConflictResolutionPolicy; -import com.azure.cosmos.models.CosmosVectorEmbeddingPolicy; import com.azure.cosmos.models.IndexingPolicy; import com.azure.cosmos.models.ModelBridgeInternal; import com.azure.cosmos.models.PartitionKeyDefinition; @@ -25,7 +24,6 @@ import java.util.Collection; import java.util.Collections; -import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; /** * Represents a document collection in the Azure Cosmos DB database service. A collection is a named logical container @@ -43,7 +41,6 @@ public final class DocumentCollection extends Resource { private UniqueKeyPolicy uniqueKeyPolicy; private PartitionKeyDefinition partitionKeyDefinition; private ClientEncryptionPolicy clientEncryptionPolicyInternal; - private CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy; /** * Constructor. @@ -414,33 +411,6 @@ public void setClientEncryptionPolicy(ClientEncryptionPolicy value) { this.set(Constants.Properties.CLIENT_ENCRYPTION_POLICY, value, CosmosItemSerializer.DEFAULT_SERIALIZER); } - /** - * Gets the Vector Embedding Policy containing paths for embeddings along with path-specific settings for the item - * used in performing vector search on the items in a collection in the Azure CosmosDB database service. - * - * @return the Vector Embedding Policy. - */ - public CosmosVectorEmbeddingPolicy getVectorEmbeddingPolicy() { - if (this.cosmosVectorEmbeddingPolicy == null) { - if (super.has(Constants.Properties.VECTOR_EMBEDDING_POLICY)) { - this.cosmosVectorEmbeddingPolicy = super.getObject(Constants.Properties.VECTOR_EMBEDDING_POLICY, - CosmosVectorEmbeddingPolicy.class); - } - } - return this.cosmosVectorEmbeddingPolicy; - } - - /** - * Sets the Vector Embedding Policy containing paths for embeddings along with path-specific settings for the item - * used in performing vector search on the items in a collection in the Azure CosmosDB database service. - * - * @param value the Vector Embedding Policy. - */ - public void setVectorEmbeddingPolicy(CosmosVectorEmbeddingPolicy value) { - checkNotNull(value, "cosmosVectorEmbeddingPolicy cannot be null"); - this.set(Constants.Properties.VECTOR_EMBEDDING_POLICY, value, CosmosItemSerializer.DEFAULT_SERIALIZER); - } - public void populatePropertyBag() { super.populatePropertyBag(); if (this.indexingPolicy == null) { diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CompositePath.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CompositePath.java index 8cfd99b46e37..a278e0aa8f50 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CompositePath.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CompositePath.java @@ -93,7 +93,7 @@ public CompositePathSortOrder getOrder() { } /** - * Sets the sort order for the composite path. + * Gets the sort order for the composite path. *

* For example if you want to run the query "SELECT * FROM c ORDER BY c.age asc, c.height desc", * then you need to make the order for "/age" "ascending" and the order for "/height" "descending". diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java index 0d357da0cc37..4fae5a797a70 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java @@ -347,28 +347,6 @@ public CosmosContainerProperties setClientEncryptionPolicy(ClientEncryptionPolic return this; } - /** - * Gets the Vector Embedding Policy containing paths for embeddings along with path-specific settings for the item - * used in performing vector search on the items in a collection in the Azure CosmosDB database service. - * - * @return the Vector Embedding Policy. - */ - public CosmosVectorEmbeddingPolicy getVectorEmbeddingPolicy() { - return this.documentCollection.getVectorEmbeddingPolicy(); - } - - /** - * Sets the Vector Embedding Policy containing paths for embeddings along with path-specific settings for the item - * used in performing vector search on the items in a collection in the Azure CosmosDB database service. - * - * @param value the Vector Embedding Policy. - * @return the CosmosContainerProperties. - */ - public CosmosContainerProperties setVectorEmbeddingPolicy(CosmosVectorEmbeddingPolicy value) { - this.documentCollection.setVectorEmbeddingPolicy(value); - return this; - } - Resource getResource() { return this.documentCollection; } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDataType.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDataType.java deleted file mode 100644 index d8a4a63edbe2..000000000000 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDataType.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.cosmos.models; - -import com.fasterxml.jackson.annotation.JsonValue; - -import java.util.Arrays; - -/** - * Data types for the embeddings in Cosmos DB database service. - */ -public enum CosmosVectorDataType { - /** - * Represents a int8 data type. - */ - INT8("int8"), - - /** - * Represents a uint8 data type. - */ - UINT8("uint8"), - - /** - * Represents a float16 data type. - */ - FLOAT16("float16"), - - /** - * Represents a float32 data type. - */ - FLOAT32("float32"); - - private final String overWireValue; - - CosmosVectorDataType(String overWireValue) { - this.overWireValue = overWireValue; - } - - @JsonValue - @Override - public String toString() { - return this.overWireValue; - } - - /** - * Method to retrieve the enum constant by its overWireValue. - * @param value the overWire value of the enum constant - * @return the matching CosmosVectorDataType - * @throws IllegalArgumentException if no matching enum constant is found - */ - public static CosmosVectorDataType fromString(String value) { - return Arrays.stream(CosmosVectorDataType.values()) - .filter(vectorDataType -> vectorDataType.toString().equalsIgnoreCase(value)) - .findFirst() - .orElseThrow(() -> new IllegalArgumentException(String.format( - "Invalid vector data type with value {%s} for the vector embedding policy.", value))); - } -} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDistanceFunction.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDistanceFunction.java deleted file mode 100644 index 57f74fab3dc9..000000000000 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDistanceFunction.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.cosmos.models; - -import com.fasterxml.jackson.annotation.JsonValue; - -import java.util.Arrays; - -/** - * Distance Function for the embeddings in the Cosmos DB database service. - */ -public enum CosmosVectorDistanceFunction { - /** - * Represents the euclidean distance function. - */ - EUCLIDEAN("euclidean"), - - /** - * Represents the cosine distance function. - */ - COSINE("cosine"), - - /** - * Represents the dot product distance function. - */ - DOT_PRODUCT("dotproduct"); - - private final String overWireValue; - - CosmosVectorDistanceFunction(String overWireValue) { - this.overWireValue = overWireValue; - } - - @JsonValue - @Override - public String toString() { - return this.overWireValue; - } - - /** - * Method to retrieve the enum constant by its overWireValue. - * @param value the overWire value of the enum constant - * @return the matching CosmosVectorDataType - * @throws IllegalArgumentException if no matching enum constant is found - */ - public static CosmosVectorDistanceFunction fromString(String value) { - return Arrays.stream(CosmosVectorDistanceFunction.values()) - .filter(vectorDistanceFunction -> vectorDistanceFunction.toString().equalsIgnoreCase(value)) - .findFirst() - .orElseThrow(() -> new IllegalArgumentException(String.format( - "Invalid distance function with value {%s} for the vector embedding policy.", value ))); - } -} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbedding.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbedding.java deleted file mode 100644 index 0f111d34e00a..000000000000 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbedding.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.cosmos.models; - -import com.azure.cosmos.implementation.Constants; -import com.azure.cosmos.implementation.JsonSerializable; -import com.azure.cosmos.implementation.apachecommons.lang.StringUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; - -/** - * Embedding settings within {@link CosmosVectorEmbeddingPolicy} - */ -public final class CosmosVectorEmbedding { - @JsonProperty(Constants.Properties.PATH) - private String path; - @JsonProperty(Constants.Properties.VECTOR_DATA_TYPE) - private String dataType; - @JsonProperty(Constants.Properties.VECTOR_DIMENSIONS) - private Long dimensions; - @JsonProperty(Constants.Properties.DISTANCE_FUNCTION) - private String distanceFunction; - private JsonSerializable jsonSerializable; - - /** - * Constructor - */ - public CosmosVectorEmbedding() { - this.jsonSerializable = new JsonSerializable(); - } - - /** - * Gets the path for the cosmosVectorEmbedding. - * - * @return path - */ - public String getPath() { - return path; - } - - /** - * Sets the path for the cosmosVectorEmbedding. - * - * @param path the path for the cosmosVectorEmbedding - * @return CosmosVectorEmbedding - */ - public CosmosVectorEmbedding setPath(String path) { - if (StringUtils.isEmpty(path)) { - throw new NullPointerException("embedding path is either null or empty"); - } - - if (path.charAt(0) != '/' || path.lastIndexOf('/') != 0) { - throw new IllegalArgumentException(""); - } - - this.path = path; - return this; - } - - /** - * Gets the data type for the cosmosVectorEmbedding. - * - * @return dataType - */ - public CosmosVectorDataType getDataType() { - return CosmosVectorDataType.fromString(dataType); - } - - /** - * Sets the data type for the cosmosVectorEmbedding. - * - * @param dataType the data type for the cosmosVectorEmbedding - * @return CosmosVectorEmbedding - */ - public CosmosVectorEmbedding setDataType(CosmosVectorDataType dataType) { - checkNotNull(dataType, "cosmosVectorDataType cannot be null"); - this.dataType = dataType.toString(); - return this; - } - - /** - * Gets the dimensions for the cosmosVectorEmbedding. - * - * @return dimensions - */ - public Long getDimensions() { - return dimensions; - } - - /** - * Sets the dimensions for the cosmosVectorEmbedding. - * - * @param dimensions the dimensions for the cosmosVectorEmbedding - * @return CosmosVectorEmbedding - */ - public CosmosVectorEmbedding setDimensions(Long dimensions) { - checkNotNull(dimensions, "dimensions cannot be null"); - if (dimensions < 1) { - throw new IllegalArgumentException("Dimensions for the embedding has to be a long value greater than 0 " + - "for the vector embedding policy"); - } - - this.dimensions = dimensions; - return this; - } - - /** - * Gets the distanceFunction for the cosmosVectorEmbedding. - * - * @return distanceFunction - */ - public CosmosVectorDistanceFunction getDistanceFunction() { - return CosmosVectorDistanceFunction.fromString(distanceFunction); - } - - /** - * Sets the distanceFunction for the cosmosVectorEmbedding. - * - * @param distanceFunction the distanceFunction for the cosmosVectorEmbedding - * @return CosmosVectorEmbedding - */ - public CosmosVectorEmbedding setDistanceFunction(CosmosVectorDistanceFunction distanceFunction) { - checkNotNull(distanceFunction, "cosmosVectorDistanceFunction cannot be null"); - this.distanceFunction = distanceFunction.toString(); - return this; - } -} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbeddingPolicy.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbeddingPolicy.java deleted file mode 100644 index 6abcc0028723..000000000000 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbeddingPolicy.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.cosmos.models; - -import com.azure.cosmos.implementation.Constants; -import com.azure.cosmos.implementation.JsonSerializable; -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.List; - -import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; - -/** - * Vector Embedding Policy - */ -public final class CosmosVectorEmbeddingPolicy { - - private JsonSerializable jsonSerializable; - /** - * Paths for embeddings along with path-specific settings for the item. - */ - @JsonProperty(Constants.Properties.VECTOR_EMBEDDINGS) - private List cosmosVectorEmbeddings; - - /** - * Constructor - */ - public CosmosVectorEmbeddingPolicy() { - this.jsonSerializable = new JsonSerializable(); - } - - /** - * Gets the paths for embeddings along with path-specific settings for the item. - * - * @return the paths for embeddings along with path-specific settings for the item. - */ - public List getVectorEmbeddings() { - return this.cosmosVectorEmbeddings; - } - - /** - * Sets the paths for embeddings along with path-specific settings for the item. - * - * @param cosmosVectorEmbeddings paths for embeddings along with path-specific settings for the item. - */ - public void setCosmosVectorEmbeddings(List cosmosVectorEmbeddings) { - cosmosVectorEmbeddings.forEach(embedding -> { - checkNotNull(embedding, "Null values are not allowed in cosmosVectorEmbeddings list."); - }); - this.cosmosVectorEmbeddings = cosmosVectorEmbeddings; - } - -} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexSpec.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexSpec.java deleted file mode 100644 index 4ea617eea041..000000000000 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexSpec.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.cosmos.models; - -import com.azure.cosmos.CosmosItemSerializer; -import com.azure.cosmos.implementation.Constants; -import com.azure.cosmos.implementation.JsonSerializable; - -import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; - -/** - * Vector Indexes spec for Azure CosmosDB service. - */ -public final class CosmosVectorIndexSpec { - - private final JsonSerializable jsonSerializable; - private String type; - - /** - * Constructor - */ - public CosmosVectorIndexSpec() { - this.jsonSerializable = new JsonSerializable(); - } - - /** - * Gets path. - * - * @return the path. - */ - public String getPath() { - return this.jsonSerializable.getString(Constants.Properties.PATH); - } - - /** - * Sets path. - * - * @param path the path. - * @return the SpatialSpec. - */ - public CosmosVectorIndexSpec setPath(String path) { - this.jsonSerializable.set(Constants.Properties.PATH, path, CosmosItemSerializer.DEFAULT_SERIALIZER); - return this; - } - - /** - * Gets the vector index type for the vector index - * - * @return the vector index type - */ - public String getType() { - if (this.type == null) { - this.type = this.jsonSerializable.getString(Constants.Properties.VECTOR_INDEX_TYPE); - } - return this.type; - } - - /** - * Sets the vector index type for the vector index - * - * @param type the vector index type - * @return the VectorIndexSpec - */ - public CosmosVectorIndexSpec setType(String type) { - checkNotNull(type, "cosmosVectorIndexType cannot be null"); - this.type = type; - this.jsonSerializable.set(Constants.Properties.VECTOR_INDEX_TYPE, this.type, CosmosItemSerializer.DEFAULT_SERIALIZER); - return this; - } - - void populatePropertyBag() { - this.jsonSerializable.populatePropertyBag(); - } - - JsonSerializable getJsonSerializable() { - return this.jsonSerializable; - } -} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexType.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexType.java deleted file mode 100644 index 679ea1f991c0..000000000000 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexType.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.cosmos.models; - -/** - * Defines the index type of vector index specification in the Azure Cosmos DB service. - */ -public enum CosmosVectorIndexType { - /** - * Represents a flat vector index type. - */ - FLAT("flat"), - - /** - * Represents a quantized flat vector index type. - */ - QUANTIZED_FLAT("quantizedFlat"), - - /** - * Represents a disk ANN vector index type. - */ - DISK_ANN("diskANN"); - - - private final String overWireValue; - - CosmosVectorIndexType(String overWireValue) { - this.overWireValue = overWireValue; - } - - @Override - public String toString() { - return this.overWireValue; - } -} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java index 3077fb67f3ab..03f49782fa9d 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java @@ -24,7 +24,6 @@ public final class IndexingPolicy { private List excludedPaths; private List> compositeIndexes; private List spatialIndexes; - private List vectorIndexes; private final JsonSerializable jsonSerializable; /** @@ -265,50 +264,6 @@ public IndexingPolicy setSpatialIndexes(List spatialIndexes) { return this; } - /** - * Gets the vector indexes. - * - * @return the vector indexes - */ - public List getVectorIndexes() { - if (this.vectorIndexes == null) { - this.vectorIndexes = this.jsonSerializable.getList(Constants.Properties.VECTOR_INDEXES, CosmosVectorIndexSpec.class); - - if (this.vectorIndexes == null) { - this.vectorIndexes = new ArrayList(); - } - } - - return this.vectorIndexes; - } - - /** - * Sets the vector indexes. - * - * Example of the vectorIndexes: - * "vectorIndexes": [ - * { - * "path": "/vector1", - * "type": "diskANN" - * }, - * { - * "path": "/vector1", - * "type": "flat" - * }, - * { - * "path": "/vector2", - * "type": "quantizedFlat" - * }] - * - * @param vectorIndexes the vector indexes - * @return the Indexing Policy. - */ - public IndexingPolicy setVectorIndexes(List vectorIndexes) { - this.vectorIndexes = vectorIndexes; - this.jsonSerializable.set(Constants.Properties.VECTOR_INDEXES,this.vectorIndexes, CosmosItemSerializer.DEFAULT_SERIALIZER); - return this; - } - void populatePropertyBag() { this.jsonSerializable.populatePropertyBag(); // If indexing mode is not 'none' and not paths are set, set them to the defaults diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java index e814cc16681b..cb9aba599c77 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java @@ -435,8 +435,6 @@ public static void populatePropertyBag(T t) { ((PartitionKeyDefinition) t).populatePropertyBag(); } else if (t instanceof SpatialSpec) { ((SpatialSpec) t).populatePropertyBag(); - } else if (t instanceof CosmosVectorIndexSpec) { - ((CosmosVectorIndexSpec) t).populatePropertyBag(); } else if (t instanceof SqlParameter) { ((SqlParameter) t).populatePropertyBag(); } else if (t instanceof SqlQuerySpec) { @@ -470,8 +468,6 @@ public static JsonSerializable getJsonSerializable(T t) { return ((PartitionKeyDefinition) t).getJsonSerializable(); } else if (t instanceof SpatialSpec) { return ((SpatialSpec) t).getJsonSerializable(); - } else if (t instanceof CosmosVectorIndexSpec) { - return ((CosmosVectorIndexSpec) t).getJsonSerializable(); } else if (t instanceof SqlParameter) { return ((SqlParameter) t).getJsonSerializable(); } else if (t instanceof SqlQuerySpec) { diff --git a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md index 791294e3270f..6d699b6e17bd 100644 --- a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md @@ -7,11 +7,6 @@ ### Breaking Changes ### Bugs Fixed -- Fixes the session message disposition to use management node as fall back. ([#39913](https://github.com/Azure/azure-sdk-for-java/issues/ 39913)) -- Fixes the session processor idle timeout to fall back to RetryOptions::tryTimeout. ([#39993](https://github.com/Azure/azure-sdk-for-java/issues/39993)) - -- Fixes the session message disposition to use management node as fall back. ([#39913](https://github.com/Azure/azure-sdk-for-java/issues/ 39913)) -- Fixes the session processor idle timeout to fall back to RetryOptions::tryTimeout. ([#39993](https://github.com/Azure/azure-sdk-for-java/issues/39993)) ### Other Changes From cdaa5bc5ecf55fbca9c8195b4bd70a22373d9fe9 Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Fri, 10 May 2024 15:53:02 -0700 Subject: [PATCH 17/33] Fixing some merge issues --- .../com/azure/cosmos/rx/VectorIndexTest.java | 339 ------------------ sdk/cosmos/azure-cosmos/CHANGELOG.md | 1 - .../implementation/DocumentCollection.java | 3 +- .../azure/cosmos/models/IndexingPolicy.java | 12 +- 4 files changed, 7 insertions(+), 348 deletions(-) delete mode 100644 sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java diff --git a/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java deleted file mode 100644 index e276c472fffb..000000000000 --- a/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java +++ /dev/null @@ -1,339 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.cosmos.rx; - -import com.azure.cosmos.ConsistencyLevel; -import com.azure.cosmos.CosmosAsyncClient; -import com.azure.cosmos.CosmosAsyncContainer; -import com.azure.cosmos.CosmosAsyncDatabase; -import com.azure.cosmos.CosmosClientBuilder; -import com.azure.cosmos.CosmosDatabaseForTest; -import com.azure.cosmos.CosmosException; -import com.azure.cosmos.DirectConnectionConfig; -import com.azure.cosmos.implementation.TestConfigurations; -import com.azure.cosmos.implementation.Utils; -import com.azure.cosmos.implementation.guava25.collect.ImmutableList; -import com.azure.cosmos.models.CosmosContainerProperties; -import com.azure.cosmos.models.ExcludedPath; -import com.azure.cosmos.models.IncludedPath; -import com.azure.cosmos.models.IndexingMode; -import com.azure.cosmos.models.IndexingPolicy; -import com.azure.cosmos.models.PartitionKeyDefinition; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Ignore; -import org.testng.annotations.Test; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.UUID; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.fail; - -@Ignore("TODO: Ignore these test cases until the public emulator with vector indexes is released.") -public class VectorIndexTest extends TestSuiteBase { - protected static final int TIMEOUT = 30000; - protected static final int SETUP_TIMEOUT = 20000; - protected static final int SHUTDOWN_TIMEOUT = 20000; - - protected static Logger logger = LoggerFactory.getLogger(VectorIndexTest.class.getSimpleName()); - private final ObjectMapper simpleObjectMapper = Utils.getSimpleObjectMapper(); - private final String databaseId = CosmosDatabaseForTest.generateId(); - private CosmosAsyncClient client; - private CosmosAsyncDatabase database; - - @BeforeClass(groups = {"emulator"}, timeOut = SETUP_TIMEOUT) - public void before_VectorIndexTest() { - // set up the client - client = new CosmosClientBuilder() - .endpoint(TestConfigurations.HOST) - .key(TestConfigurations.MASTER_KEY) - .directMode(DirectConnectionConfig.getDefaultConfig()) - .consistencyLevel(ConsistencyLevel.SESSION) - .contentResponseOnWriteEnabled(true) - .buildAsyncClient(); - - database = createDatabase(client, databaseId); - } - - @AfterClass(groups = {"emulator"}, timeOut = SHUTDOWN_TIMEOUT, alwaysRun = true) - public void afterClass() { - safeDeleteDatabase(database); - safeClose(client); - } - - @Test(groups = {"emulator"}, timeOut = TIMEOUT*10000) - public void shouldCreateVectorEmbeddingPolicy() { - PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); - ArrayList paths = new ArrayList(); - paths.add("/mypk"); - partitionKeyDef.setPaths(paths); - - CosmosContainerProperties collectionDefinition = new CosmosContainerProperties(UUID.randomUUID().toString(), partitionKeyDef); - - IndexingPolicy indexingPolicy = new IndexingPolicy(); - indexingPolicy.setIndexingMode(IndexingMode.CONSISTENT); - ExcludedPath excludedPath = new ExcludedPath("/*"); - indexingPolicy.setExcludedPaths(Collections.singletonList(excludedPath)); - - IncludedPath includedPath1 = new IncludedPath("/name/?"); - IncludedPath includedPath2 = new IncludedPath("/description/?"); - indexingPolicy.setIncludedPaths(ImmutableList.of(includedPath1, includedPath2)); - - indexingPolicy.setVectorIndexes(populateVectorIndexes()); - - CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy = new CosmosVectorEmbeddingPolicy(); - cosmosVectorEmbeddingPolicy.setCosmosVectorEmbeddings(populateEmbeddings()); - - collectionDefinition.setIndexingPolicy(indexingPolicy); - collectionDefinition.setVectorEmbeddingPolicy(cosmosVectorEmbeddingPolicy); - - database.createContainer(collectionDefinition).block(); - CosmosAsyncContainer createdCollection = database.getContainer(collectionDefinition.getId()); - CosmosContainerProperties collectionProperties = createdCollection.read().block().getProperties(); - validateCollectionProperties(collectionDefinition, collectionProperties); - } - - @Test(groups = {"emulator"}, timeOut = TIMEOUT) - public void shouldFailOnEmptyVectorEmbeddingPolicy() { - PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); - ArrayList paths = new ArrayList(); - paths.add("/mypk"); - partitionKeyDef.setPaths(paths); - - CosmosContainerProperties collectionDefinition = new CosmosContainerProperties(UUID.randomUUID().toString(), partitionKeyDef); - - IndexingPolicy indexingPolicy = new IndexingPolicy(); - indexingPolicy.setIndexingMode(IndexingMode.CONSISTENT); - ExcludedPath excludedPath = new ExcludedPath("/*"); - indexingPolicy.setExcludedPaths(Collections.singletonList(excludedPath)); - - IncludedPath includedPath1 = new IncludedPath("/name/?"); - IncludedPath includedPath2 = new IncludedPath("/description/?"); - indexingPolicy.setIncludedPaths(ImmutableList.of(includedPath1, includedPath2)); - - CosmosVectorIndexSpec cosmosVectorIndexSpec = new CosmosVectorIndexSpec(); - cosmosVectorIndexSpec.setPath("/vector1"); - cosmosVectorIndexSpec.setType(CosmosVectorIndexType.FLAT.toString()); - indexingPolicy.setVectorIndexes(ImmutableList.of(cosmosVectorIndexSpec)); - - collectionDefinition.setIndexingPolicy(indexingPolicy); - - try { - database.createContainer(collectionDefinition).block(); - fail("Container creation will fail as no vector embedding policy is being passed"); - } catch (CosmosException ex) { - assertThat(ex.getStatusCode()).isEqualTo(400); - assertThat(ex.getMessage()).contains("vector1 not matching in Embedding's path"); - } - } - - @Test(groups = {"emulator"}, timeOut = TIMEOUT) - public void shouldFailOnWrongVectorIndex() { - PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); - ArrayList paths = new ArrayList(); - paths.add("/mypk"); - partitionKeyDef.setPaths(paths); - - CosmosContainerProperties collectionDefinition = new CosmosContainerProperties(UUID.randomUUID().toString(), partitionKeyDef); - - IndexingPolicy indexingPolicy = new IndexingPolicy(); - indexingPolicy.setIndexingMode(IndexingMode.CONSISTENT); - ExcludedPath excludedPath = new ExcludedPath("/*"); - indexingPolicy.setExcludedPaths(Collections.singletonList(excludedPath)); - - IncludedPath includedPath1 = new IncludedPath("/name/?"); - IncludedPath includedPath2 = new IncludedPath("/description/?"); - indexingPolicy.setIncludedPaths(ImmutableList.of(includedPath1, includedPath2)); - - CosmosVectorIndexSpec cosmosVectorIndexSpec = new CosmosVectorIndexSpec(); - cosmosVectorIndexSpec.setPath("/vector1"); - cosmosVectorIndexSpec.setType("NonFlat"); - indexingPolicy.setVectorIndexes(ImmutableList.of(cosmosVectorIndexSpec)); - collectionDefinition.setIndexingPolicy(indexingPolicy); - - CosmosVectorEmbedding embedding = new CosmosVectorEmbedding(); - embedding.setPath("/vector1"); - embedding.setDataType(CosmosVectorDataType.FLOAT32); - embedding.setDimensions(3L); - embedding.setDistanceFunction(CosmosVectorDistanceFunction.COSINE); - CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy = new CosmosVectorEmbeddingPolicy(); - cosmosVectorEmbeddingPolicy.setCosmosVectorEmbeddings(ImmutableList.of(embedding)); - collectionDefinition.setVectorEmbeddingPolicy(cosmosVectorEmbeddingPolicy); - - try { - database.createContainer(collectionDefinition).block(); - fail("Container creation will fail as wrong vector index type is being passed"); - } catch (CosmosException ex) { - assertThat(ex.getStatusCode()).isEqualTo(400); - assertThat(ex.getMessage()).contains("NonFlat is invalid, Valid types are 'flat' or 'quantizedFlat'"); - } - } - - @Test(groups = {"emulator"}, timeOut = TIMEOUT) - public void shouldCreateVectorIndexSimilarPathDifferentVectorType() { - PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); - ArrayList paths = new ArrayList(); - paths.add("/mypk"); - partitionKeyDef.setPaths(paths); - - CosmosContainerProperties collectionDefinition = new CosmosContainerProperties(UUID.randomUUID().toString(), partitionKeyDef); - - IndexingPolicy indexingPolicy = new IndexingPolicy(); - indexingPolicy.setIndexingMode(IndexingMode.CONSISTENT); - ExcludedPath excludedPath = new ExcludedPath("/*"); - indexingPolicy.setExcludedPaths(Collections.singletonList(excludedPath)); - - IncludedPath includedPath1 = new IncludedPath("/name/?"); - IncludedPath includedPath2 = new IncludedPath("/description/?"); - indexingPolicy.setIncludedPaths(ImmutableList.of(includedPath1, includedPath2)); - - List vectorIndexes = populateVectorIndexes(); - vectorIndexes.get(2).setPath("/vector2"); - indexingPolicy.setVectorIndexes(vectorIndexes); - - List embeddings = populateEmbeddings(); - embeddings.get(2).setPath("/vector2"); - CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy = new CosmosVectorEmbeddingPolicy(); - cosmosVectorEmbeddingPolicy.setCosmosVectorEmbeddings(embeddings); - - collectionDefinition.setIndexingPolicy(indexingPolicy); - collectionDefinition.setVectorEmbeddingPolicy(cosmosVectorEmbeddingPolicy); - - database.createContainer(collectionDefinition).block(); - CosmosAsyncContainer createdCollection = database.getContainer(collectionDefinition.getId()); - CosmosContainerProperties collectionProperties = createdCollection.read().block().getProperties(); - validateCollectionProperties(collectionDefinition, collectionProperties); - } - - @Test(groups = {"unit"}, timeOut = TIMEOUT) - public void shouldFailOnWrongVectorEmbeddingPolicy() { - CosmosVectorEmbedding embedding = new CosmosVectorEmbedding(); - try { - - embedding.setDataType(null); - fail("Embedding creation failed because cosmosVectorDataType argument is empty"); - } catch (NullPointerException ex) { - assertThat(ex.getMessage()).isEqualTo("cosmosVectorDataType cannot be empty"); - } - - try { - embedding.setDistanceFunction(null); - fail("Embedding creation failed because cosmosVectorDistanceFunction argument is empty"); - } catch (NullPointerException ex) { - assertThat(ex.getMessage()).isEqualTo("cosmosVectorDistanceFunction cannot be null"); - } - - try { - embedding.setDimensions(null); - fail("Embedding creation failed because dimensions argument is empty"); - } catch (NullPointerException ex) { - assertThat(ex.getMessage()).isEqualTo("dimensions cannot be empty"); - } - - try { - embedding.setDimensions(-1L); - fail("Vector Embedding policy creation will fail for negative dimensions being passed"); - } catch (IllegalArgumentException ex) { - assertThat(ex.getMessage()).isEqualTo("Dimensions for the embedding has to be a long value greater than 1 for the vector embedding policy"); - } - } - - @Test(groups = {"unit"}, timeOut = TIMEOUT) - public void shouldValidateVectorEmbeddingPolicySerializationAndDeserialization() throws JsonProcessingException { - IndexingPolicy indexingPolicy = new IndexingPolicy(); - indexingPolicy.setVectorIndexes(populateVectorIndexes()); - - CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy = new CosmosVectorEmbeddingPolicy(); - cosmosVectorEmbeddingPolicy.setCosmosVectorEmbeddings(populateEmbeddings()); - String vectorEmbeddingPolicyJson = getVectorEmbeddingPolicyAsString(); - String expectedVectorEmbeddingPolicyJson = simpleObjectMapper.writeValueAsString(cosmosVectorEmbeddingPolicy); - assertThat(vectorEmbeddingPolicyJson).isEqualTo(expectedVectorEmbeddingPolicyJson); - - CosmosVectorEmbeddingPolicy expectedCosmosVectorEmbeddingPolicy = simpleObjectMapper.readValue(expectedVectorEmbeddingPolicyJson, CosmosVectorEmbeddingPolicy.class); - validateVectorEmbeddingPolicy(cosmosVectorEmbeddingPolicy, expectedCosmosVectorEmbeddingPolicy); - } - - private void validateCollectionProperties(CosmosContainerProperties collectionDefinition, CosmosContainerProperties collectionProperties) { - assertThat(collectionProperties.getVectorEmbeddingPolicy()).isNotNull(); - assertThat(collectionProperties.getVectorEmbeddingPolicy().getVectorEmbeddings()).isNotNull(); - validateVectorEmbeddingPolicy(collectionProperties.getVectorEmbeddingPolicy(), - collectionDefinition.getVectorEmbeddingPolicy()); - - assertThat(collectionProperties.getIndexingPolicy().getVectorIndexes()).isNotNull(); - validateVectorIndexes(collectionDefinition.getIndexingPolicy().getVectorIndexes(), collectionProperties.getIndexingPolicy().getVectorIndexes()); - } - - private void validateVectorEmbeddingPolicy(CosmosVectorEmbeddingPolicy actual, CosmosVectorEmbeddingPolicy expected) { - List actualEmbeddings = actual.getVectorEmbeddings(); - List expectedEmbeddings = expected.getVectorEmbeddings(); - assertThat(expectedEmbeddings).hasSameSizeAs(actualEmbeddings); - for (int i = 0; i < expectedEmbeddings.size(); i++) { - assertThat(expectedEmbeddings.get(i).getPath()).isEqualTo(actualEmbeddings.get(i).getPath()); - assertThat(expectedEmbeddings.get(i).getDataType()).isEqualTo(actualEmbeddings.get(i).getDataType()); - assertThat(expectedEmbeddings.get(i).getDimensions()).isEqualTo(actualEmbeddings.get(i).getDimensions()); - assertThat(expectedEmbeddings.get(i).getDistanceFunction()).isEqualTo(actualEmbeddings.get(i).getDistanceFunction()); - } - } - - private void validateVectorIndexes(List actual, List expected) { - assertThat(expected).hasSameSizeAs(actual); - for (int i = 0; i < expected.size(); i++) { - assertThat(expected.get(i).getPath()).isEqualTo(actual.get(i).getPath()); - assertThat(expected.get(i).getType()).isEqualTo(actual.get(i).getType()); - } - } - - private List populateVectorIndexes() { - CosmosVectorIndexSpec cosmosVectorIndexSpec1 = new CosmosVectorIndexSpec(); - cosmosVectorIndexSpec1.setPath("/vector1"); - cosmosVectorIndexSpec1.setType(CosmosVectorIndexType.FLAT.toString()); - - CosmosVectorIndexSpec cosmosVectorIndexSpec2 = new CosmosVectorIndexSpec(); - cosmosVectorIndexSpec2.setPath("/vector2"); - cosmosVectorIndexSpec2.setType(CosmosVectorIndexType.QUANTIZED_FLAT.toString()); - - CosmosVectorIndexSpec cosmosVectorIndexSpec3 = new CosmosVectorIndexSpec(); - cosmosVectorIndexSpec3.setPath("/vector3"); - cosmosVectorIndexSpec3.setType(CosmosVectorIndexType.DISK_ANN.toString()); - - return Arrays.asList(cosmosVectorIndexSpec1, cosmosVectorIndexSpec2, cosmosVectorIndexSpec3); - } - - private List populateEmbeddings() { - CosmosVectorEmbedding embedding1 = new CosmosVectorEmbedding(); - embedding1.setPath("/vector1"); - embedding1.setDataType(CosmosVectorDataType.INT8); - embedding1.setDimensions(3L); - embedding1.setDistanceFunction(CosmosVectorDistanceFunction.COSINE); - - CosmosVectorEmbedding embedding2 = new CosmosVectorEmbedding(); - embedding2.setPath("/vector2"); - embedding2.setDataType(CosmosVectorDataType.FLOAT32); - embedding2.setDimensions(3L); - embedding2.setDistanceFunction(CosmosVectorDistanceFunction.DOT_PRODUCT); - - CosmosVectorEmbedding embedding3 = new CosmosVectorEmbedding(); - embedding3.setPath("/vector3"); - embedding3.setDataType(CosmosVectorDataType.UINT8); - embedding3.setDimensions(3L); - embedding3.setDistanceFunction(CosmosVectorDistanceFunction.EUCLIDEAN); - return Arrays.asList(embedding1, embedding2, embedding3); - } - - private String getVectorEmbeddingPolicyAsString() { - return "{\"vectorEmbeddings\":[" + - "{\"path\":\"/vector1\",\"dataType\":\"int8\",\"dimensions\":3,\"distanceFunction\":\"cosine\"}," + - "{\"path\":\"/vector2\",\"dataType\":\"float32\",\"dimensions\":3,\"distanceFunction\":\"dotproduct\"}," + - "{\"path\":\"/vector3\",\"dataType\":\"uint8\",\"dimensions\":3,\"distanceFunction\":\"euclidean\"}" + - "]}"; - } -} diff --git a/sdk/cosmos/azure-cosmos/CHANGELOG.md b/sdk/cosmos/azure-cosmos/CHANGELOG.md index 13285d30fc21..c19504eb91a1 100644 --- a/sdk/cosmos/azure-cosmos/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos/CHANGELOG.md @@ -3,7 +3,6 @@ ### 4.60.0-beta.1 (Unreleased) #### Features Added -* Added `cosmosVectorEmbeddingPolicy` in `cosmosContainerProperties` and `vectorIndexes` in `indexPolicy` to support vector search in CosmosDB - See[39379](https://github.com/Azure/azure-sdk-for-java/pull/39379) * Added support for non-streaming OrderBy query and a query feature `NonStreamingOrderBy` to support Vector Search queries. - See [PR 39897](https://github.com/Azure/azure-sdk-for-java/pull/39897/) diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentCollection.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentCollection.java index 969d6145c1bc..678bdb90378c 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentCollection.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentCollection.java @@ -6,8 +6,8 @@ import com.azure.cosmos.CosmosItemSerializer; import com.azure.cosmos.implementation.apachecommons.lang.StringUtils; import com.azure.cosmos.implementation.caches.SerializableWrapper; -import com.azure.cosmos.models.ChangeFeedPolicy; import com.azure.cosmos.models.ClientEncryptionPolicy; +import com.azure.cosmos.models.ChangeFeedPolicy; import com.azure.cosmos.models.ComputedProperty; import com.azure.cosmos.models.ConflictResolutionPolicy; import com.azure.cosmos.models.IndexingPolicy; @@ -24,7 +24,6 @@ import java.util.Collection; import java.util.Collections; - /** * Represents a document collection in the Azure Cosmos DB database service. A collection is a named logical container * for documents. diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java index 03f49782fa9d..48db91ae2687 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java @@ -20,10 +20,12 @@ */ public final class IndexingPolicy { private static final String DEFAULT_PATH = "/*"; + private List includedPaths; private List excludedPaths; private List> compositeIndexes; private List spatialIndexes; + private final JsonSerializable jsonSerializable; /** @@ -52,7 +54,7 @@ public IndexingPolicy() { * * * @param defaultIndexOverrides comma separated set of indexes that serve as default index specifications for the - * root path. + * root path. * @throws IllegalArgumentException throws when defaultIndexOverrides is null */ IndexingPolicy(Index[] defaultIndexOverrides) { @@ -233,7 +235,7 @@ public IndexingPolicy setCompositeIndexes(List> compositeInd } /** - * Gets the spatial indexes for additional indexes. + * Sets the spatial indexes for additional indexes. * * @return the spatial indexes. */ @@ -268,7 +270,7 @@ void populatePropertyBag() { this.jsonSerializable.populatePropertyBag(); // If indexing mode is not 'none' and not paths are set, set them to the defaults if (this.getIndexingMode() != IndexingMode.NONE && this.getIncludedPaths().size() == 0 - && this.getExcludedPaths().size() == 0) { + && this.getExcludedPaths().size() == 0) { IncludedPath includedPath = new IncludedPath(IndexingPolicy.DEFAULT_PATH); this.getIncludedPaths().add(includedPath); } @@ -294,7 +296,5 @@ void populatePropertyBag() { } } - JsonSerializable getJsonSerializable() { - return this.jsonSerializable; - } + JsonSerializable getJsonSerializable() { return this.jsonSerializable; } } From dfa8b64be3d2b6bd195bfd2ef6d42e7f33ea7525 Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Fri, 10 May 2024 15:54:01 -0700 Subject: [PATCH 18/33] Fixing some merge issues --- .../src/main/java/com/azure/cosmos/models/IndexingPolicy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java index 48db91ae2687..4ee5153877f8 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java @@ -26,7 +26,7 @@ public final class IndexingPolicy { private List> compositeIndexes; private List spatialIndexes; - private final JsonSerializable jsonSerializable; + private JsonSerializable jsonSerializable; /** * Constructor. From 7549cbea29db01252200b077c6f9881d75548631 Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Tue, 14 May 2024 14:01:49 -0700 Subject: [PATCH 19/33] Resolving comments --- .../azure/cosmos/implementation/Configs.java | 22 ++++++++++++------- .../CosmosQueryRequestOptionsImpl.java | 14 ++++++------ .../ImplementationBridgeHelpers.java | 2 ++ .../DocumentQueryExecutionContextFactory.java | 15 +++++++++---- .../query/QueryPlanRetriever.java | 16 +++++++++++++- .../models/CosmosQueryRequestOptions.java | 15 ++++++++----- .../cosmos/models/ModelBridgeInternal.java | 5 ----- 7 files changed, 59 insertions(+), 30 deletions(-) diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java index c643379b2fe6..941cc81c1b8d 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java @@ -166,12 +166,12 @@ public class Configs { public static final String MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED = "COSMOS.MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED"; private static final int DEFAULT_MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED = 1; - private static final String MAX_ITEM_SIZE_FOR_VECTOR_SEARCH = "COSMOS.MAX_ITEM_SIZE_FOR_VECTOR_SEARCH"; - private static final int DEFAULT_MAX_ITEM_SIZE_FOR_VECTOR_SEARCH = 50000; + private static final String MAX_ITEM_COUNT_FOR_VECTOR_SEARCH = "COSMOS.MAX_ITEM_SIZE_FOR_VECTOR_SEARCH"; + private static final int DEFAULT_MAX_ITEM_COUNT_FOR_VECTOR_SEARCH = 50000; - private static final String MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED = "COSMOS.MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED"; + private static final String AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY = "COSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY"; - private static final boolean DEFAULT_MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED = true; + private static final boolean DEFAULT_AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY = false; public static final int MIN_MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED = 1; @@ -491,12 +491,18 @@ public static int getMaxRetriesInLocalRegionWhenRemoteRegionPreferred() { MIN_MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED); } - public static int getMaxItemSizeForVectorSearch() { - return getJVMConfigAsInt(MAX_ITEM_SIZE_FOR_VECTOR_SEARCH, DEFAULT_MAX_ITEM_SIZE_FOR_VECTOR_SEARCH); + public static int getMaxItemCountForVectorSearch() { + return Integer.parseInt(System.getProperty(MAX_ITEM_COUNT_FOR_VECTOR_SEARCH, + firstNonNull( + emptyToNull(System.getenv().get(MAX_ITEM_COUNT_FOR_VECTOR_SEARCH)), + String.valueOf(DEFAULT_MAX_ITEM_COUNT_FOR_VECTOR_SEARCH)))); } - public static boolean getMaxItemSizeForVectorSearchEnabled() { - return getJVMConfigAsBoolean(MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED, DEFAULT_MAX_ITEM_SIZE_FOR_VECTOR_SEARCH_ENABLED); + public static boolean getAzureCosmosNonStreamingOrderByDisabled() { + return Boolean.parseBoolean(System.getProperty(AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY, + firstNonNull( + emptyToNull(System.getenv().get(AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY)), + String.valueOf(DEFAULT_AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY)))); } public static Duration getMinRetryTimeInLocalRegionWhenRemoteRegionPreferred() { diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java index 6d7b00068393..bd30ee28382e 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java @@ -25,7 +25,7 @@ public final class CosmosQueryRequestOptionsImpl extends CosmosQueryRequestOptio private boolean queryPlanRetrievalDisallowed; private boolean emptyPageDiagnosticsEnabled; private String queryName; - private Integer maxItemSizeForVectorSearch; + private Integer maxItemCountForVectorSearch; private List cancelledRequestDiagnosticsTracker = new ArrayList<>(); /** @@ -63,7 +63,7 @@ public CosmosQueryRequestOptionsImpl(CosmosQueryRequestOptionsImpl options) { this.queryName = options.queryName; this.feedRange = options.feedRange; this.cancelledRequestDiagnosticsTracker = options.cancelledRequestDiagnosticsTracker; - this.maxItemSizeForVectorSearch = options.maxItemSizeForVectorSearch; + this.maxItemCountForVectorSearch = options.maxItemCountForVectorSearch; } /** @@ -203,18 +203,18 @@ public CosmosQueryRequestOptionsImpl setMaxItemCount(Integer maxItemCount) { * * @return the max number of items for vector search. */ - public Integer getMaxItemSizeForVectorSearch() { - return this.maxItemSizeForVectorSearch; + public Integer getMaxItemCountForVectorSearch() { + return this.maxItemCountForVectorSearch; } /** * Sets the maximum item size to fetch during non-streaming order by queries. * - * @param maxItemSizeForVectorSearch the max number of items for vector search. + * @param maxItemCountForVectorSearch the max number of items for vector search. * return the CosmosQueryRequestOptions. */ - public CosmosQueryRequestOptionsImpl setMaxItemSizeForVectorSearch(Integer maxItemSizeForVectorSearch) { - this.maxItemSizeForVectorSearch = maxItemSizeForVectorSearch; + public CosmosQueryRequestOptionsImpl setMaxItemCountForVectorSearch(Integer maxItemCountForVectorSearch) { + this.maxItemCountForVectorSearch = maxItemCountForVectorSearch; return this; } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/ImplementationBridgeHelpers.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/ImplementationBridgeHelpers.java index db2bfd16f871..16b8f5ef39b5 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/ImplementationBridgeHelpers.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/ImplementationBridgeHelpers.java @@ -281,6 +281,8 @@ void setCancelledRequestDiagnosticsTracker( Integer getMaxItemCount(CosmosQueryRequestOptions options); String getRequestContinuation(CosmosQueryRequestOptions options); + + Integer getMaxItemCountForVectorSearch(CosmosQueryRequestOptions options); } } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java index 7a530816856b..8e5dd07bf5a9 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java @@ -50,6 +50,12 @@ */ public class DocumentQueryExecutionContextFactory { + private static final ImplementationBridgeHelpers + .CosmosQueryRequestOptionsHelper + .CosmosQueryRequestOptionsAccessor qryOptAccessor = ImplementationBridgeHelpers + .CosmosQueryRequestOptionsHelper + .getCosmosQueryRequestOptionsAccessor(); + private final static int PageSizeFactorForTop = 5; private static final Logger logger = LoggerFactory.getLogger(DocumentQueryExecutionContextFactory.class); private static Mono> resolveCollection(DiagnosticsClientContext diagnosticsClientContext, @@ -362,7 +368,7 @@ public static Flux> createSpecia boolean getLazyFeedResponse = queryInfo.hasTop(); // We need to compute the optimal initial age size for non-streaming order-by queries - if (queryInfo.hasNonStreamingOrderBy() && Configs.getMaxItemSizeForVectorSearchEnabled()) { + if (queryInfo.hasNonStreamingOrderBy()) { // Validate the TOP or LIMIT for non-streaming order-by queries if (!queryInfo.hasTop() && !queryInfo.hasLimit() && queryInfo.getTop() < 0 && queryInfo.getLimit() < 0) { throw new NonStreamingOrderByBadRequestException(HttpConstants.StatusCodes.BADREQUEST, @@ -373,8 +379,8 @@ public static Flux> createSpecia // Validate the size of TOP or LIMIT against MaxItemSizeForVectorSearch int maxLimit = Math.max(queryInfo.hasTop() ? queryInfo.getTop() : 0, queryInfo.hasLimit() ? queryInfo.getLimit() : 0); - int maxItemSizeForVectorSearch = Math.max(Configs.getMaxItemSizeForVectorSearch(), - ModelBridgeInternal.getMaxItemSizeForVectorSearchFromQueryRequestOptions(cosmosQueryRequestOptions)); + int maxItemSizeForVectorSearch = Math.max(Configs.getMaxItemCountForVectorSearch(), + qryOptAccessor.getMaxItemCountForVectorSearch(cosmosQueryRequestOptions)); if (maxLimit > maxItemSizeForVectorSearch) { throw new NonStreamingOrderByBadRequestException(HttpConstants.StatusCodes.BADREQUEST, "Executing a vector search query with TOP or LIMIT larger than the maxItemSizeForVectorSearch " + @@ -383,7 +389,8 @@ public static Flux> createSpecia // Set initialPageSize based on the smallest of TOP or LIMIT if (queryInfo.hasTop() || queryInfo.hasLimit()) { int pageSizeWithTopOrLimit = Math.min(queryInfo.hasTop() ? queryInfo.getTop() : Integer.MAX_VALUE, - queryInfo.hasLimit() ? queryInfo.getLimit() : Integer.MAX_VALUE); + queryInfo.hasLimit() && queryInfo.hasOffset() ? + queryInfo.getLimit() + queryInfo.getOffset() : Integer.MAX_VALUE); if (initialPageSize > 0) { initialPageSize = Math.min(pageSizeWithTopOrLimit, initialPageSize); } else { diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryPlanRetriever.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryPlanRetriever.java index 83f82dbde363..fb79a316c445 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryPlanRetriever.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryPlanRetriever.java @@ -5,6 +5,7 @@ import com.azure.cosmos.BridgeInternal; import com.azure.cosmos.CosmosEndToEndOperationLatencyPolicyConfig; +import com.azure.cosmos.implementation.Configs; import com.azure.cosmos.implementation.DiagnosticsClientContext; import com.azure.cosmos.implementation.ImplementationBridgeHelpers; import com.azure.cosmos.implementation.routing.PartitionKeyInternal; @@ -46,6 +47,18 @@ class QueryPlanRetriever { QueryFeature.NonValueAggregate.name() + ", " + QueryFeature.NonStreamingOrderBy.name(); + private static final String OLD_SUPPORTED_QUERY_FEATURES = QueryFeature.Aggregate.name() + ", " + + QueryFeature.CompositeAggregate.name() + ", " + + QueryFeature.MultipleOrderBy.name() + ", " + + QueryFeature.MultipleAggregates.name() + ", " + + QueryFeature.OrderBy.name() + ", " + + QueryFeature.OffsetAndLimit.name() + ", " + + QueryFeature.Distinct.name() + ", " + + QueryFeature.GroupBy.name() + ", " + + QueryFeature.Top.name() + ", " + + QueryFeature.DCount.name() + ", " + + QueryFeature.NonValueAggregate.name(); + static Mono getQueryPlanThroughGatewayAsync(DiagnosticsClientContext diagnosticsClientContext, IDocumentQueryClient queryClient, SqlQuerySpec sqlQuerySpec, @@ -62,7 +75,8 @@ static Mono getQueryPlanThroughGatewayAsync(Diagn final Map requestHeaders = new HashMap<>(); requestHeaders.put(HttpConstants.HttpHeaders.CONTENT_TYPE, RuntimeConstants.MediaTypes.JSON); requestHeaders.put(HttpConstants.HttpHeaders.IS_QUERY_PLAN_REQUEST, TRUE); - requestHeaders.put(HttpConstants.HttpHeaders.SUPPORTED_QUERY_FEATURES, SUPPORTED_QUERY_FEATURES); + requestHeaders.put(HttpConstants.HttpHeaders.SUPPORTED_QUERY_FEATURES, + Configs.getAzureCosmosNonStreamingOrderByDisabled() ? OLD_SUPPORTED_QUERY_FEATURES : SUPPORTED_QUERY_FEATURES); requestHeaders.put(HttpConstants.HttpHeaders.QUERY_VERSION, HttpConstants.Versions.QUERY_VERSION); if (partitionKey != null && partitionKey != PartitionKey.NONE) { diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java index f9d7d4a72531..856dee68b563 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java @@ -261,18 +261,18 @@ CosmosQueryRequestOptions setMaxItemCount(Integer maxItemCount) { * * @return the max number of items for vector search. */ - public Integer getMaxItemSizeForVectorSearch() { - return this.actualRequestOptions.getMaxItemSizeForVectorSearch(); + Integer getMaxItemCountForVectorSearch() { + return this.actualRequestOptions.getMaxItemCountForVectorSearch(); } /** * Sets the maximum item size to fetch during non-streaming order by queries. * - * @param maxItemSizeForVectorSearch the max number of items for vector search. + * @param maxItemCountForVectorSearch the max number of items for vector search. * @return the CosmosQueryRequestOptions. */ - public CosmosQueryRequestOptions setMaxItemSizeForVectorSearch(Integer maxItemSizeForVectorSearch) { - this.actualRequestOptions.setMaxItemSizeForVectorSearch(maxItemSizeForVectorSearch); + CosmosQueryRequestOptions setMaxItemCountForVectorSearch(Integer maxItemCountForVectorSearch) { + this.actualRequestOptions.setMaxItemCountForVectorSearch(maxItemCountForVectorSearch); return this; } @@ -623,6 +623,11 @@ public Integer getMaxItemCount(CosmosQueryRequestOptions options) { public String getRequestContinuation(CosmosQueryRequestOptions options) { return options.getRequestContinuation(); } + + @Override + public Integer getMaxItemCountForVectorSearch(CosmosQueryRequestOptions options) { + return options.getMaxItemCountForVectorSearch(); + } }); } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java index cb9aba599c77..a8f344ce4e2d 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java @@ -540,11 +540,6 @@ public static Integer getMaxItemCountFromQueryRequestOptions(CosmosQueryRequestO return options.getMaxItemCount(); } - @Warning(value = INTERNAL_USE_ONLY_WARNING) - public static Integer getMaxItemSizeForVectorSearchFromQueryRequestOptions(CosmosQueryRequestOptions options) { - return options.getMaxItemSizeForVectorSearch(); - } - @Warning(value = INTERNAL_USE_ONLY_WARNING) public static String getRequestContinuationFromQueryRequestOptions(CosmosQueryRequestOptions options) { return options.getRequestContinuation(); From 30d837097aa909a9e78e2548f2ecf059a9559137 Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Tue, 14 May 2024 14:34:45 -0700 Subject: [PATCH 20/33] Users/akataria/vectorindexing (#40158) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adding changes for vectorIndex and vectorEmbeddingPolicy * Adding some necessary comments * Adding test case * updating enum values * Updating test case * Updating test case * Updating test case * updating changelog * Updating test case * Resolving comments * Resolving comments * Fixing test case * Resolving comments * Resolving Comments * Fixing build issues * Resolving comments * Resolving Comments * [Cosmos][VectorIndex]Adding changes for vectorIndex and vectorEmbeddingPolicy (#40004) * Adding changes for vectorIndex and vectorEmbeddingPolicy * Adding some necessary comments * Adding test case * updating enum values * Updating test case * Updating test case * Updating test case * updating changelog * Updating test case * Resolving comments * Resolving comments * Fixing test case * Resolving comments * Resolving Comments * Fixing build issues * Resolving comments * Resolving Comments * [Cosmos][VectorSearch] Non Streaming Order By Query (#40085) * Increment versions for core releases (#40003) Increment package versions for core releases * Ensure ServiceBus session idle timeout fall back to retry-options::try-timeout (#39994) * Added Alpha3 Java Media Streaming Events (#40002) * Added Alpha3 Java Media Streaming Events * updating readme to add the media streaming events to remove model --------- Co-authored-by: Vinothini Dharmaraj * Update version of github-event-processor to 1.0.0-dev.20240502.2 (#40012) Co-authored-by: James Suplizio * Prepare May 2024 Identity Release (#40006) * Prepare Identity Broker May 2024 Release (#40014) * Increment package versions for identity releases (#40015) * [JobRouter] SDK Review updates (#40011) * SDK Review updates * Update auto-generated models * Add customization * Fix customization * Update package * Update tests * Linting * FixFaultInjectionRuleFailedToApplyPerPartitionInGatewayMode (#40005) * fix fault injection rule failed to apply per partition in gateway mode --------- Co-authored-by: annie-mac * azure-cosmos-test_1.0.0.beta.7Release (#40021) * release azure-cosmos-test 1.0.0.beta.7 --------- Co-authored-by: annie-mac --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac * [Cosmos][VectorSearch] Non Streaming Order By Query (#40096) * Initial changes * Initial changes * Increment versions for core releases (#40003) Increment package versions for core releases * Ensure ServiceBus session idle timeout fall back to retry-options::try-timeout (#39994) * Added Alpha3 Java Media Streaming Events (#40002) * Added Alpha3 Java Media Streaming Events * updating readme to add the media streaming events to remove model --------- Co-authored-by: Vinothini Dharmaraj * Update version of github-event-processor to 1.0.0-dev.20240502.2 (#40012) Co-authored-by: James Suplizio * Prepare May 2024 Identity Release (#40006) * Prepare Identity Broker May 2024 Release (#40014) * Increment package versions for identity releases (#40015) * [JobRouter] SDK Review updates (#40011) * SDK Review updates * Update auto-generated models * Add customization * Fix customization * Update package * Update tests * Linting * FixFaultInjectionRuleFailedToApplyPerPartitionInGatewayMode (#40005) * fix fault injection rule failed to apply per partition in gateway mode --------- Co-authored-by: annie-mac * azure-cosmos-test_1.0.0.beta.7Release (#40021) * release azure-cosmos-test 1.0.0.beta.7 --------- Co-authored-by: annie-mac * Fixed existsById API in ReactiveCosmosTemplate (#40022) * Fixed existsById API in ReactiveCosmosTemplate * Added changelog * Initial changes * Initial changes * Skip Recorded test and delete Event record until test proxy to work with Event recordings (#40029) Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> * Fix invalid CODEOWNERS (#40032) * Initial changes * ServiceBus: fix session tracing (#39962) * remove additional matrix * Fix session processing and disposition instrumentation * return matrix config * review suggestions * [Automation] Generate SDK based on TypeSpec 0.15.15 (#40048) * [CODEOWNERS] Updates for org changes (#40049) * [CODEOWNERS] Updates for org changes The focus of these changes is to remove an individual who no longer is responsible for the products which their GH account is associated to. * Move from using the docker image to java2docfx for docs validation (#39744) * Move from using the docker image to java2docfx for docs validation * Temporarily turn on docs processing for template libraries for testing * Actually install the rex validation tool * Fix the if not Test-Path statement * Update java2docfx version and add a couple of diagnostics output lines * Add missing close paren * Ensure that Sort-Object always returns an array even if there's only one item * add another piece of diagnostics output * trying one more thing * remove some diag, add other * Remove the additional diagnostics, add permanent output message * Invoke java -jar on java2docfx to show the help command to ensure the install is okay * fiddling with the java -jar command * Set the working directory to the java2docfx directory before executing the mvn dependency download * Actually create the directory before trying to set location...oops * Update rex validation to verify MAVEN_HOME is set * Updates for Java PR 39875 which had changes from this PR that were more immediate * Update java2docfx version * remove check for MAVEN_HOME which was only for testing * Update the version of java2docfx to test a fix * Update version of java2docfx to 1.0.4 * revert template's ci.yml changes that were only necessary to test java2docfx * owners (#39686) * Use ClientLogger in testing output (#40010) Use ClientLogger in testing output * Fix null pointer exception and context usage (#40053) * Rename AML to AzureMachineLearning (#40056) * Fixed the Key Vault `test-resources.json` file to properly configure a deployment script for certificate creation. (#40037) * Close response body in bearer policy (#40052) * Running Prepare-Release for azure-messaging-servicebus 7.17.0 (#40058) * mgmt, TypeSpec code generation pipeline (#39963) * typespec generation pipeline echo command PR_TITLE * generation typespec Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines * remove typespec pipeline file * fix pr title * address comments * Add codeowner linter owners (#39997) * Update to ESRP task version that supports federated auth (#40059) * Increment package versions for cosmos releases (#40031) * Update azure-sdk-build-tools Repository Resource Refs in Yaml files (#39627) * Add reduced embeddings sample to azure-search-documents (#40069) * Add reduced embeddings sample * Fix cspell * Fix link * Search May Preview Regen Updates (#40057) * Search May Preview Regeneration - Still need to add varargs convenience * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * adding varargs * Additional adjustments to FieldBuilder and Search Index Customizations * Updating cspell.json * Adjust `SearchScoreThreshold` customization Re-enable code generation in CI * Updates: - Updated Cspell - Rename `maxStoragePerIndex` property to `maxStoragePerIndexInBytes` in SearchServiceLimits - Set `hybridSearch` property to be type `HybridSearch` in SearchRequest - Add `hybridSearch` to SearchOptions and `SearchAsyncClient.createSearchRequest()` * Adding Support and testing byte[] and List within field builder * Fix linting --------- Co-authored-by: alzimmermsft <48699787+alzimmermsft@users.noreply.github.com> * Preparing Search May 2024 Beta Release (#40071) * Preparing Search May 2024 Beta Release * Preparing Search May 2024 Beta Release * Resolving comments * Fixing build issues * eng, update autorest.java, improve error output in sdk automation (#40073) * improve error output * autorest.java 4.1.29 * Merge to main after spring cloud azure 4.18.0 released (#40075) * Prepare for Spring Cloud Azure 4.18.0 release (#40063) * update version client * update version/changelog/readme * update changelog * Increment versions for spring releases (#40074) * Increment package versions for spring releases * Update version_client.txt * Update pom.xml --------- Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> * Miscellaneous Core performance improvements (#39552) Miscellaneous Core performance improvements * Increment package versions for search releases (#40072) * Update io.fabric8:kubernetes-client (#40086) 5.12.3 -> 6.12.1 * Increment package versions for servicebus releases (#40094) * Emit stable auto-instrumented otel metrics (#39960) * Update otel metrics logic * add runtime metrics * adding a few metrics I forgot * small correction * Update * Fix * Update * Delete pre-stable metrics --------- Co-authored-by: Harsimar Kaur (from Dev Box) --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac Co-authored-by: Kushagra Thapar Co-authored-by: minwoolee-msft <77083090+minwoolee-msft@users.noreply.github.com> Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> Co-authored-by: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Co-authored-by: Liudmila Molkova Co-authored-by: Jesse Squire Co-authored-by: Harsimar Kaur Co-authored-by: vcolin7 Co-authored-by: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Co-authored-by: Wes Haggard Co-authored-by: Patrick Hallisey Co-authored-by: Jair Myree Co-authored-by: Weidong Xu Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> Co-authored-by: Helen <56097766+heyams@users.noreply.github.com> Co-authored-by: Harsimar Kaur (from Dev Box) * [Cosmos][VectorSearch] Non Streaming Order By Query (#40098) * Initial changes * Initial changes * Increment versions for core releases (#40003) Increment package versions for core releases * Ensure ServiceBus session idle timeout fall back to retry-options::try-timeout (#39994) * Added Alpha3 Java Media Streaming Events (#40002) * Added Alpha3 Java Media Streaming Events * updating readme to add the media streaming events to remove model --------- Co-authored-by: Vinothini Dharmaraj * Update version of github-event-processor to 1.0.0-dev.20240502.2 (#40012) Co-authored-by: James Suplizio * Prepare May 2024 Identity Release (#40006) * Prepare Identity Broker May 2024 Release (#40014) * Increment package versions for identity releases (#40015) * [JobRouter] SDK Review updates (#40011) * SDK Review updates * Update auto-generated models * Add customization * Fix customization * Update package * Update tests * Linting * FixFaultInjectionRuleFailedToApplyPerPartitionInGatewayMode (#40005) * fix fault injection rule failed to apply per partition in gateway mode --------- Co-authored-by: annie-mac * azure-cosmos-test_1.0.0.beta.7Release (#40021) * release azure-cosmos-test 1.0.0.beta.7 --------- Co-authored-by: annie-mac * Fixed existsById API in ReactiveCosmosTemplate (#40022) * Fixed existsById API in ReactiveCosmosTemplate * Added changelog * Initial changes * Initial changes * Skip Recorded test and delete Event record until test proxy to work with Event recordings (#40029) Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> * Fix invalid CODEOWNERS (#40032) * Initial changes * ServiceBus: fix session tracing (#39962) * remove additional matrix * Fix session processing and disposition instrumentation * return matrix config * review suggestions * [Automation] Generate SDK based on TypeSpec 0.15.15 (#40048) * [CODEOWNERS] Updates for org changes (#40049) * [CODEOWNERS] Updates for org changes The focus of these changes is to remove an individual who no longer is responsible for the products which their GH account is associated to. * Move from using the docker image to java2docfx for docs validation (#39744) * Move from using the docker image to java2docfx for docs validation * Temporarily turn on docs processing for template libraries for testing * Actually install the rex validation tool * Fix the if not Test-Path statement * Update java2docfx version and add a couple of diagnostics output lines * Add missing close paren * Ensure that Sort-Object always returns an array even if there's only one item * add another piece of diagnostics output * trying one more thing * remove some diag, add other * Remove the additional diagnostics, add permanent output message * Invoke java -jar on java2docfx to show the help command to ensure the install is okay * fiddling with the java -jar command * Set the working directory to the java2docfx directory before executing the mvn dependency download * Actually create the directory before trying to set location...oops * Update rex validation to verify MAVEN_HOME is set * Updates for Java PR 39875 which had changes from this PR that were more immediate * Update java2docfx version * remove check for MAVEN_HOME which was only for testing * Update the version of java2docfx to test a fix * Update version of java2docfx to 1.0.4 * revert template's ci.yml changes that were only necessary to test java2docfx * owners (#39686) * Use ClientLogger in testing output (#40010) Use ClientLogger in testing output * Fix null pointer exception and context usage (#40053) * Rename AML to AzureMachineLearning (#40056) * Fixed the Key Vault `test-resources.json` file to properly configure a deployment script for certificate creation. (#40037) * Close response body in bearer policy (#40052) * Running Prepare-Release for azure-messaging-servicebus 7.17.0 (#40058) * mgmt, TypeSpec code generation pipeline (#39963) * typespec generation pipeline echo command PR_TITLE * generation typespec Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines * remove typespec pipeline file * fix pr title * address comments * Add codeowner linter owners (#39997) * Update to ESRP task version that supports federated auth (#40059) * Increment package versions for cosmos releases (#40031) * Update azure-sdk-build-tools Repository Resource Refs in Yaml files (#39627) * Add reduced embeddings sample to azure-search-documents (#40069) * Add reduced embeddings sample * Fix cspell * Fix link * Search May Preview Regen Updates (#40057) * Search May Preview Regeneration - Still need to add varargs convenience * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * adding varargs * Additional adjustments to FieldBuilder and Search Index Customizations * Updating cspell.json * Adjust `SearchScoreThreshold` customization Re-enable code generation in CI * Updates: - Updated Cspell - Rename `maxStoragePerIndex` property to `maxStoragePerIndexInBytes` in SearchServiceLimits - Set `hybridSearch` property to be type `HybridSearch` in SearchRequest - Add `hybridSearch` to SearchOptions and `SearchAsyncClient.createSearchRequest()` * Adding Support and testing byte[] and List within field builder * Fix linting --------- Co-authored-by: alzimmermsft <48699787+alzimmermsft@users.noreply.github.com> * Preparing Search May 2024 Beta Release (#40071) * Preparing Search May 2024 Beta Release * Preparing Search May 2024 Beta Release * Resolving comments * Fixing build issues * eng, update autorest.java, improve error output in sdk automation (#40073) * improve error output * autorest.java 4.1.29 * Merge to main after spring cloud azure 4.18.0 released (#40075) * Prepare for Spring Cloud Azure 4.18.0 release (#40063) * update version client * update version/changelog/readme * update changelog * Increment versions for spring releases (#40074) * Increment package versions for spring releases * Update version_client.txt * Update pom.xml --------- Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> * Miscellaneous Core performance improvements (#39552) Miscellaneous Core performance improvements * Increment package versions for search releases (#40072) * Update io.fabric8:kubernetes-client (#40086) 5.12.3 -> 6.12.1 * Increment package versions for servicebus releases (#40094) * Emit stable auto-instrumented otel metrics (#39960) * Update otel metrics logic * add runtime metrics * adding a few metrics I forgot * small correction * Update * Fix * Update * Delete pre-stable metrics --------- Co-authored-by: Harsimar Kaur (from Dev Box) * Initial changes --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac Co-authored-by: Kushagra Thapar Co-authored-by: minwoolee-msft <77083090+minwoolee-msft@users.noreply.github.com> Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> Co-authored-by: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Co-authored-by: Liudmila Molkova Co-authored-by: Jesse Squire Co-authored-by: Harsimar Kaur Co-authored-by: vcolin7 Co-authored-by: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Co-authored-by: Wes Haggard Co-authored-by: Patrick Hallisey Co-authored-by: Jair Myree Co-authored-by: Weidong Xu Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> Co-authored-by: Helen <56097766+heyams@users.noreply.github.com> Co-authored-by: Harsimar Kaur (from Dev Box) * Resolving comments * Resolving comments * [Cosmos][VectorSearch] Non Streaming Order By Query (#40115) * Initial changes * Initial changes * Increment versions for core releases (#40003) Increment package versions for core releases * Ensure ServiceBus session idle timeout fall back to retry-options::try-timeout (#39994) * Added Alpha3 Java Media Streaming Events (#40002) * Added Alpha3 Java Media Streaming Events * updating readme to add the media streaming events to remove model --------- Co-authored-by: Vinothini Dharmaraj * Update version of github-event-processor to 1.0.0-dev.20240502.2 (#40012) Co-authored-by: James Suplizio * Prepare May 2024 Identity Release (#40006) * Prepare Identity Broker May 2024 Release (#40014) * Increment package versions for identity releases (#40015) * [JobRouter] SDK Review updates (#40011) * SDK Review updates * Update auto-generated models * Add customization * Fix customization * Update package * Update tests * Linting * FixFaultInjectionRuleFailedToApplyPerPartitionInGatewayMode (#40005) * fix fault injection rule failed to apply per partition in gateway mode --------- Co-authored-by: annie-mac * azure-cosmos-test_1.0.0.beta.7Release (#40021) * release azure-cosmos-test 1.0.0.beta.7 --------- Co-authored-by: annie-mac * Fixed existsById API in ReactiveCosmosTemplate (#40022) * Fixed existsById API in ReactiveCosmosTemplate * Added changelog * Initial changes * Initial changes * Skip Recorded test and delete Event record until test proxy to work with Event recordings (#40029) Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> * Fix invalid CODEOWNERS (#40032) * Initial changes * ServiceBus: fix session tracing (#39962) * remove additional matrix * Fix session processing and disposition instrumentation * return matrix config * review suggestions * [Automation] Generate SDK based on TypeSpec 0.15.15 (#40048) * [CODEOWNERS] Updates for org changes (#40049) * [CODEOWNERS] Updates for org changes The focus of these changes is to remove an individual who no longer is responsible for the products which their GH account is associated to. * Move from using the docker image to java2docfx for docs validation (#39744) * Move from using the docker image to java2docfx for docs validation * Temporarily turn on docs processing for template libraries for testing * Actually install the rex validation tool * Fix the if not Test-Path statement * Update java2docfx version and add a couple of diagnostics output lines * Add missing close paren * Ensure that Sort-Object always returns an array even if there's only one item * add another piece of diagnostics output * trying one more thing * remove some diag, add other * Remove the additional diagnostics, add permanent output message * Invoke java -jar on java2docfx to show the help command to ensure the install is okay * fiddling with the java -jar command * Set the working directory to the java2docfx directory before executing the mvn dependency download * Actually create the directory before trying to set location...oops * Update rex validation to verify MAVEN_HOME is set * Updates for Java PR 39875 which had changes from this PR that were more immediate * Update java2docfx version * remove check for MAVEN_HOME which was only for testing * Update the version of java2docfx to test a fix * Update version of java2docfx to 1.0.4 * revert template's ci.yml changes that were only necessary to test java2docfx * owners (#39686) * Use ClientLogger in testing output (#40010) Use ClientLogger in testing output * Fix null pointer exception and context usage (#40053) * Rename AML to AzureMachineLearning (#40056) * Fixed the Key Vault `test-resources.json` file to properly configure a deployment script for certificate creation. (#40037) * Close response body in bearer policy (#40052) * Running Prepare-Release for azure-messaging-servicebus 7.17.0 (#40058) * mgmt, TypeSpec code generation pipeline (#39963) * typespec generation pipeline echo command PR_TITLE * generation typespec Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines * remove typespec pipeline file * fix pr title * address comments * Add codeowner linter owners (#39997) * Update to ESRP task version that supports federated auth (#40059) * Increment package versions for cosmos releases (#40031) * Update azure-sdk-build-tools Repository Resource Refs in Yaml files (#39627) * Add reduced embeddings sample to azure-search-documents (#40069) * Add reduced embeddings sample * Fix cspell * Fix link * Search May Preview Regen Updates (#40057) * Search May Preview Regeneration - Still need to add varargs convenience * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * adding varargs * Additional adjustments to FieldBuilder and Search Index Customizations * Updating cspell.json * Adjust `SearchScoreThreshold` customization Re-enable code generation in CI * Updates: - Updated Cspell - Rename `maxStoragePerIndex` property to `maxStoragePerIndexInBytes` in SearchServiceLimits - Set `hybridSearch` property to be type `HybridSearch` in SearchRequest - Add `hybridSearch` to SearchOptions and `SearchAsyncClient.createSearchRequest()` * Adding Support and testing byte[] and List within field builder * Fix linting --------- Co-authored-by: alzimmermsft <48699787+alzimmermsft@users.noreply.github.com> * Preparing Search May 2024 Beta Release (#40071) * Preparing Search May 2024 Beta Release * Preparing Search May 2024 Beta Release * Resolving comments * Fixing build issues * eng, update autorest.java, improve error output in sdk automation (#40073) * improve error output * autorest.java 4.1.29 * Merge to main after spring cloud azure 4.18.0 released (#40075) * Prepare for Spring Cloud Azure 4.18.0 release (#40063) * update version client * update version/changelog/readme * update changelog * Increment versions for spring releases (#40074) * Increment package versions for spring releases * Update version_client.txt * Update pom.xml --------- Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> * Miscellaneous Core performance improvements (#39552) Miscellaneous Core performance improvements * Increment package versions for search releases (#40072) * Update io.fabric8:kubernetes-client (#40086) 5.12.3 -> 6.12.1 * Increment package versions for servicebus releases (#40094) * Emit stable auto-instrumented otel metrics (#39960) * Update otel metrics logic * add runtime metrics * adding a few metrics I forgot * small correction * Update * Fix * Update * Delete pre-stable metrics --------- Co-authored-by: Harsimar Kaur (from Dev Box) * [Key Vault] Added support for `/prerestore` and `/prebackup` endpoints in Backup clients (#39878) * Updated `autorest.md` files in all swagger folders. * Re-generated implementation code. * Updated ServiceVersion expandable enums. * Added public APIs for the new /prebacukp and /prerestore endpoints. * Added tests. * Refactored Backup client tests. * Updated tests. * Updated test recordings. * Updated documentation and samples. * Addressed PR feedback. * Initial changes * Prepare to release beta.22 (#40097) * Fix template name (#40099) * Fix template name * Also install the rex validation tool * Update partner release to use WIF (#40101) * core mgmt, `SubResource` implements `JsonSerializable` to support azure-json (#40076) * test * implementation * fix lint * spotless:apply * Update spring-reference and sync changelog (#40105) * update spring-reference.yml * update CHANGELOG.md * Support per-call response timeout in all HttpClient implementations (#40017) Support per-call response timeout in all HttpClient implementations * Change how JavaType is resolved to support JsonSerializable better (#40112) * Initial changes * Fixes --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac Co-authored-by: Kushagra Thapar Co-authored-by: minwoolee-msft <77083090+minwoolee-msft@users.noreply.github.com> Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> Co-authored-by: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Co-authored-by: Liudmila Molkova Co-authored-by: Jesse Squire Co-authored-by: Harsimar Kaur Co-authored-by: vcolin7 Co-authored-by: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Co-authored-by: Wes Haggard Co-authored-by: Patrick Hallisey Co-authored-by: Jair Myree Co-authored-by: Weidong Xu Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> Co-authored-by: Helen <56097766+heyams@users.noreply.github.com> Co-authored-by: Harsimar Kaur (from Dev Box) * Fixing merge issues * Fixing merge issues --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac Co-authored-by: Kushagra Thapar Co-authored-by: minwoolee-msft <77083090+minwoolee-msft@users.noreply.github.com> Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> Co-authored-by: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Co-authored-by: Liudmila Molkova Co-authored-by: Jesse Squire Co-authored-by: Harsimar Kaur Co-authored-by: vcolin7 Co-authored-by: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Co-authored-by: Wes Haggard Co-authored-by: Patrick Hallisey Co-authored-by: Jair Myree Co-authored-by: Weidong Xu Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> Co-authored-by: Helen <56097766+heyams@users.noreply.github.com> Co-authored-by: Harsimar Kaur (from Dev Box) --- .../com/azure/cosmos/rx/VectorIndexTest.java | 345 ++++++++++++++++++ sdk/cosmos/azure-cosmos/CHANGELOG.md | 6 +- .../cosmos/implementation/Constants.java | 9 + .../implementation/DocumentCollection.java | 33 +- .../DocumentQueryExecutionContextFactory.java | 2 + ...ipelinedDocumentQueryExecutionContext.java | 3 + .../query/PipelinedQueryExecutionContext.java | 2 +- .../azure/cosmos/models/CompositePath.java | 2 +- .../models/CosmosContainerProperties.java | 22 ++ .../cosmos/models/CosmosVectorDataType.java | 59 +++ .../models/CosmosVectorDistanceFunction.java | 54 +++ .../cosmos/models/CosmosVectorEmbedding.java | 128 +++++++ .../models/CosmosVectorEmbeddingPolicy.java | 54 +++ .../cosmos/models/CosmosVectorIndexSpec.java | 79 ++++ .../cosmos/models/CosmosVectorIndexType.java | 36 ++ .../azure/cosmos/models/IndexingPolicy.java | 58 ++- .../cosmos/models/ModelBridgeInternal.java | 4 + 17 files changed, 885 insertions(+), 11 deletions(-) create mode 100644 sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDataType.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDistanceFunction.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbedding.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbeddingPolicy.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexSpec.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexType.java diff --git a/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java new file mode 100644 index 000000000000..d4f5b8cf6602 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/VectorIndexTest.java @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.rx; + +import com.azure.cosmos.ConsistencyLevel; +import com.azure.cosmos.CosmosAsyncClient; +import com.azure.cosmos.CosmosAsyncContainer; +import com.azure.cosmos.CosmosAsyncDatabase; +import com.azure.cosmos.CosmosClientBuilder; +import com.azure.cosmos.CosmosDatabaseForTest; +import com.azure.cosmos.CosmosException; +import com.azure.cosmos.DirectConnectionConfig; +import com.azure.cosmos.implementation.TestConfigurations; +import com.azure.cosmos.implementation.Utils; +import com.azure.cosmos.implementation.guava25.collect.ImmutableList; +import com.azure.cosmos.models.CosmosContainerProperties; +import com.azure.cosmos.models.CosmosVectorDataType; +import com.azure.cosmos.models.CosmosVectorDistanceFunction; +import com.azure.cosmos.models.CosmosVectorEmbedding; +import com.azure.cosmos.models.CosmosVectorEmbeddingPolicy; +import com.azure.cosmos.models.ExcludedPath; +import com.azure.cosmos.models.IncludedPath; +import com.azure.cosmos.models.IndexingMode; +import com.azure.cosmos.models.IndexingPolicy; +import com.azure.cosmos.models.PartitionKeyDefinition; +import com.azure.cosmos.models.CosmosVectorIndexSpec; +import com.azure.cosmos.models.CosmosVectorIndexType; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Ignore; +import org.testng.annotations.Test; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.UUID; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; + +@Ignore("TODO: Ignore these test cases until the public emulator with vector indexes is released.") +public class VectorIndexTest extends TestSuiteBase { + protected static final int TIMEOUT = 30000; + protected static final int SETUP_TIMEOUT = 20000; + protected static final int SHUTDOWN_TIMEOUT = 20000; + + protected static Logger logger = LoggerFactory.getLogger(VectorIndexTest.class.getSimpleName()); + private final ObjectMapper simpleObjectMapper = Utils.getSimpleObjectMapper(); + private final String databaseId = CosmosDatabaseForTest.generateId(); + private CosmosAsyncClient client; + private CosmosAsyncDatabase database; + + @BeforeClass(groups = {"emulator"}, timeOut = SETUP_TIMEOUT) + public void before_VectorIndexTest() { + // set up the client + client = new CosmosClientBuilder() + .endpoint(TestConfigurations.HOST) + .key(TestConfigurations.MASTER_KEY) + .directMode(DirectConnectionConfig.getDefaultConfig()) + .consistencyLevel(ConsistencyLevel.SESSION) + .contentResponseOnWriteEnabled(true) + .buildAsyncClient(); + + database = createDatabase(client, databaseId); + } + + @AfterClass(groups = {"emulator"}, timeOut = SHUTDOWN_TIMEOUT, alwaysRun = true) + public void afterClass() { + safeDeleteDatabase(database); + safeClose(client); + } + + @Test(groups = {"emulator"}, timeOut = TIMEOUT*10000) + public void shouldCreateVectorEmbeddingPolicy() { + PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); + ArrayList paths = new ArrayList(); + paths.add("/mypk"); + partitionKeyDef.setPaths(paths); + + CosmosContainerProperties collectionDefinition = new CosmosContainerProperties(UUID.randomUUID().toString(), partitionKeyDef); + + IndexingPolicy indexingPolicy = new IndexingPolicy(); + indexingPolicy.setIndexingMode(IndexingMode.CONSISTENT); + ExcludedPath excludedPath = new ExcludedPath("/*"); + indexingPolicy.setExcludedPaths(Collections.singletonList(excludedPath)); + + IncludedPath includedPath1 = new IncludedPath("/name/?"); + IncludedPath includedPath2 = new IncludedPath("/description/?"); + indexingPolicy.setIncludedPaths(ImmutableList.of(includedPath1, includedPath2)); + + indexingPolicy.setVectorIndexes(populateVectorIndexes()); + + CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy = new CosmosVectorEmbeddingPolicy(); + cosmosVectorEmbeddingPolicy.setCosmosVectorEmbeddings(populateEmbeddings()); + + collectionDefinition.setIndexingPolicy(indexingPolicy); + collectionDefinition.setVectorEmbeddingPolicy(cosmosVectorEmbeddingPolicy); + + database.createContainer(collectionDefinition).block(); + CosmosAsyncContainer createdCollection = database.getContainer(collectionDefinition.getId()); + CosmosContainerProperties collectionProperties = createdCollection.read().block().getProperties(); + validateCollectionProperties(collectionDefinition, collectionProperties); + } + + @Test(groups = {"emulator"}, timeOut = TIMEOUT) + public void shouldFailOnEmptyVectorEmbeddingPolicy() { + PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); + ArrayList paths = new ArrayList(); + paths.add("/mypk"); + partitionKeyDef.setPaths(paths); + + CosmosContainerProperties collectionDefinition = new CosmosContainerProperties(UUID.randomUUID().toString(), partitionKeyDef); + + IndexingPolicy indexingPolicy = new IndexingPolicy(); + indexingPolicy.setIndexingMode(IndexingMode.CONSISTENT); + ExcludedPath excludedPath = new ExcludedPath("/*"); + indexingPolicy.setExcludedPaths(Collections.singletonList(excludedPath)); + + IncludedPath includedPath1 = new IncludedPath("/name/?"); + IncludedPath includedPath2 = new IncludedPath("/description/?"); + indexingPolicy.setIncludedPaths(ImmutableList.of(includedPath1, includedPath2)); + + CosmosVectorIndexSpec cosmosVectorIndexSpec = new CosmosVectorIndexSpec(); + cosmosVectorIndexSpec.setPath("/vector1"); + cosmosVectorIndexSpec.setType(CosmosVectorIndexType.FLAT.toString()); + indexingPolicy.setVectorIndexes(ImmutableList.of(cosmosVectorIndexSpec)); + + collectionDefinition.setIndexingPolicy(indexingPolicy); + + try { + database.createContainer(collectionDefinition).block(); + fail("Container creation will fail as no vector embedding policy is being passed"); + } catch (CosmosException ex) { + assertThat(ex.getStatusCode()).isEqualTo(400); + assertThat(ex.getMessage()).contains("vector1 not matching in Embedding's path"); + } + } + + @Test(groups = {"emulator"}, timeOut = TIMEOUT) + public void shouldFailOnWrongVectorIndex() { + PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); + ArrayList paths = new ArrayList(); + paths.add("/mypk"); + partitionKeyDef.setPaths(paths); + + CosmosContainerProperties collectionDefinition = new CosmosContainerProperties(UUID.randomUUID().toString(), partitionKeyDef); + + IndexingPolicy indexingPolicy = new IndexingPolicy(); + indexingPolicy.setIndexingMode(IndexingMode.CONSISTENT); + ExcludedPath excludedPath = new ExcludedPath("/*"); + indexingPolicy.setExcludedPaths(Collections.singletonList(excludedPath)); + + IncludedPath includedPath1 = new IncludedPath("/name/?"); + IncludedPath includedPath2 = new IncludedPath("/description/?"); + indexingPolicy.setIncludedPaths(ImmutableList.of(includedPath1, includedPath2)); + + CosmosVectorIndexSpec cosmosVectorIndexSpec = new CosmosVectorIndexSpec(); + cosmosVectorIndexSpec.setPath("/vector1"); + cosmosVectorIndexSpec.setType("NonFlat"); + indexingPolicy.setVectorIndexes(ImmutableList.of(cosmosVectorIndexSpec)); + collectionDefinition.setIndexingPolicy(indexingPolicy); + + CosmosVectorEmbedding embedding = new CosmosVectorEmbedding(); + embedding.setPath("/vector1"); + embedding.setDataType(CosmosVectorDataType.FLOAT32); + embedding.setDimensions(3L); + embedding.setDistanceFunction(CosmosVectorDistanceFunction.COSINE); + CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy = new CosmosVectorEmbeddingPolicy(); + cosmosVectorEmbeddingPolicy.setCosmosVectorEmbeddings(ImmutableList.of(embedding)); + collectionDefinition.setVectorEmbeddingPolicy(cosmosVectorEmbeddingPolicy); + + try { + database.createContainer(collectionDefinition).block(); + fail("Container creation will fail as wrong vector index type is being passed"); + } catch (CosmosException ex) { + assertThat(ex.getStatusCode()).isEqualTo(400); + assertThat(ex.getMessage()).contains("NonFlat is invalid, Valid types are 'flat' or 'quantizedFlat'"); + } + } + + @Test(groups = {"emulator"}, timeOut = TIMEOUT) + public void shouldCreateVectorIndexSimilarPathDifferentVectorType() { + PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); + ArrayList paths = new ArrayList(); + paths.add("/mypk"); + partitionKeyDef.setPaths(paths); + + CosmosContainerProperties collectionDefinition = new CosmosContainerProperties(UUID.randomUUID().toString(), partitionKeyDef); + + IndexingPolicy indexingPolicy = new IndexingPolicy(); + indexingPolicy.setIndexingMode(IndexingMode.CONSISTENT); + ExcludedPath excludedPath = new ExcludedPath("/*"); + indexingPolicy.setExcludedPaths(Collections.singletonList(excludedPath)); + + IncludedPath includedPath1 = new IncludedPath("/name/?"); + IncludedPath includedPath2 = new IncludedPath("/description/?"); + indexingPolicy.setIncludedPaths(ImmutableList.of(includedPath1, includedPath2)); + + List vectorIndexes = populateVectorIndexes(); + vectorIndexes.get(2).setPath("/vector2"); + indexingPolicy.setVectorIndexes(vectorIndexes); + + List embeddings = populateEmbeddings(); + embeddings.get(2).setPath("/vector2"); + CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy = new CosmosVectorEmbeddingPolicy(); + cosmosVectorEmbeddingPolicy.setCosmosVectorEmbeddings(embeddings); + + collectionDefinition.setIndexingPolicy(indexingPolicy); + collectionDefinition.setVectorEmbeddingPolicy(cosmosVectorEmbeddingPolicy); + + database.createContainer(collectionDefinition).block(); + CosmosAsyncContainer createdCollection = database.getContainer(collectionDefinition.getId()); + CosmosContainerProperties collectionProperties = createdCollection.read().block().getProperties(); + validateCollectionProperties(collectionDefinition, collectionProperties); + } + + @Test(groups = {"unit"}, timeOut = TIMEOUT) + public void shouldFailOnWrongVectorEmbeddingPolicy() { + CosmosVectorEmbedding embedding = new CosmosVectorEmbedding(); + try { + + embedding.setDataType(null); + fail("Embedding creation failed because cosmosVectorDataType argument is empty"); + } catch (NullPointerException ex) { + assertThat(ex.getMessage()).isEqualTo("cosmosVectorDataType cannot be empty"); + } + + try { + embedding.setDistanceFunction(null); + fail("Embedding creation failed because cosmosVectorDistanceFunction argument is empty"); + } catch (NullPointerException ex) { + assertThat(ex.getMessage()).isEqualTo("cosmosVectorDistanceFunction cannot be null"); + } + + try { + embedding.setDimensions(null); + fail("Embedding creation failed because dimensions argument is empty"); + } catch (NullPointerException ex) { + assertThat(ex.getMessage()).isEqualTo("dimensions cannot be empty"); + } + + try { + embedding.setDimensions(-1L); + fail("Vector Embedding policy creation will fail for negative dimensions being passed"); + } catch (IllegalArgumentException ex) { + assertThat(ex.getMessage()).isEqualTo("Dimensions for the embedding has to be a long value greater than 1 for the vector embedding policy"); + } + } + + @Test(groups = {"unit"}, timeOut = TIMEOUT) + public void shouldValidateVectorEmbeddingPolicySerializationAndDeserialization() throws JsonProcessingException { + IndexingPolicy indexingPolicy = new IndexingPolicy(); + indexingPolicy.setVectorIndexes(populateVectorIndexes()); + + CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy = new CosmosVectorEmbeddingPolicy(); + cosmosVectorEmbeddingPolicy.setCosmosVectorEmbeddings(populateEmbeddings()); + String vectorEmbeddingPolicyJson = getVectorEmbeddingPolicyAsString(); + String expectedVectorEmbeddingPolicyJson = simpleObjectMapper.writeValueAsString(cosmosVectorEmbeddingPolicy); + assertThat(vectorEmbeddingPolicyJson).isEqualTo(expectedVectorEmbeddingPolicyJson); + + CosmosVectorEmbeddingPolicy expectedCosmosVectorEmbeddingPolicy = simpleObjectMapper.readValue(expectedVectorEmbeddingPolicyJson, CosmosVectorEmbeddingPolicy.class); + validateVectorEmbeddingPolicy(cosmosVectorEmbeddingPolicy, expectedCosmosVectorEmbeddingPolicy); + } + + private void validateCollectionProperties(CosmosContainerProperties collectionDefinition, CosmosContainerProperties collectionProperties) { + assertThat(collectionProperties.getVectorEmbeddingPolicy()).isNotNull(); + assertThat(collectionProperties.getVectorEmbeddingPolicy().getVectorEmbeddings()).isNotNull(); + validateVectorEmbeddingPolicy(collectionProperties.getVectorEmbeddingPolicy(), + collectionDefinition.getVectorEmbeddingPolicy()); + + assertThat(collectionProperties.getIndexingPolicy().getVectorIndexes()).isNotNull(); + validateVectorIndexes(collectionDefinition.getIndexingPolicy().getVectorIndexes(), collectionProperties.getIndexingPolicy().getVectorIndexes()); + } + + private void validateVectorEmbeddingPolicy(CosmosVectorEmbeddingPolicy actual, CosmosVectorEmbeddingPolicy expected) { + List actualEmbeddings = actual.getVectorEmbeddings(); + List expectedEmbeddings = expected.getVectorEmbeddings(); + assertThat(expectedEmbeddings).hasSameSizeAs(actualEmbeddings); + for (int i = 0; i < expectedEmbeddings.size(); i++) { + assertThat(expectedEmbeddings.get(i).getPath()).isEqualTo(actualEmbeddings.get(i).getPath()); + assertThat(expectedEmbeddings.get(i).getDataType()).isEqualTo(actualEmbeddings.get(i).getDataType()); + assertThat(expectedEmbeddings.get(i).getDimensions()).isEqualTo(actualEmbeddings.get(i).getDimensions()); + assertThat(expectedEmbeddings.get(i).getDistanceFunction()).isEqualTo(actualEmbeddings.get(i).getDistanceFunction()); + } + } + + private void validateVectorIndexes(List actual, List expected) { + assertThat(expected).hasSameSizeAs(actual); + for (int i = 0; i < expected.size(); i++) { + assertThat(expected.get(i).getPath()).isEqualTo(actual.get(i).getPath()); + assertThat(expected.get(i).getType()).isEqualTo(actual.get(i).getType()); + } + } + + private List populateVectorIndexes() { + CosmosVectorIndexSpec cosmosVectorIndexSpec1 = new CosmosVectorIndexSpec(); + cosmosVectorIndexSpec1.setPath("/vector1"); + cosmosVectorIndexSpec1.setType(CosmosVectorIndexType.FLAT.toString()); + + CosmosVectorIndexSpec cosmosVectorIndexSpec2 = new CosmosVectorIndexSpec(); + cosmosVectorIndexSpec2.setPath("/vector2"); + cosmosVectorIndexSpec2.setType(CosmosVectorIndexType.QUANTIZED_FLAT.toString()); + + CosmosVectorIndexSpec cosmosVectorIndexSpec3 = new CosmosVectorIndexSpec(); + cosmosVectorIndexSpec3.setPath("/vector3"); + cosmosVectorIndexSpec3.setType(CosmosVectorIndexType.DISK_ANN.toString()); + + return Arrays.asList(cosmosVectorIndexSpec1, cosmosVectorIndexSpec2, cosmosVectorIndexSpec3); + } + + private List populateEmbeddings() { + CosmosVectorEmbedding embedding1 = new CosmosVectorEmbedding(); + embedding1.setPath("/vector1"); + embedding1.setDataType(CosmosVectorDataType.INT8); + embedding1.setDimensions(3L); + embedding1.setDistanceFunction(CosmosVectorDistanceFunction.COSINE); + + CosmosVectorEmbedding embedding2 = new CosmosVectorEmbedding(); + embedding2.setPath("/vector2"); + embedding2.setDataType(CosmosVectorDataType.FLOAT32); + embedding2.setDimensions(3L); + embedding2.setDistanceFunction(CosmosVectorDistanceFunction.DOT_PRODUCT); + + CosmosVectorEmbedding embedding3 = new CosmosVectorEmbedding(); + embedding3.setPath("/vector3"); + embedding3.setDataType(CosmosVectorDataType.UINT8); + embedding3.setDimensions(3L); + embedding3.setDistanceFunction(CosmosVectorDistanceFunction.EUCLIDEAN); + return Arrays.asList(embedding1, embedding2, embedding3); + } + + private String getVectorEmbeddingPolicyAsString() { + return "{\"vectorEmbeddings\":[" + + "{\"path\":\"/vector1\",\"dataType\":\"int8\",\"dimensions\":3,\"distanceFunction\":\"cosine\"}," + + "{\"path\":\"/vector2\",\"dataType\":\"float32\",\"dimensions\":3,\"distanceFunction\":\"dotproduct\"}," + + "{\"path\":\"/vector3\",\"dataType\":\"uint8\",\"dimensions\":3,\"distanceFunction\":\"euclidean\"}" + + "]}"; + } +} diff --git a/sdk/cosmos/azure-cosmos/CHANGELOG.md b/sdk/cosmos/azure-cosmos/CHANGELOG.md index 4ea8a84052bd..16cedfc04ef2 100644 --- a/sdk/cosmos/azure-cosmos/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos/CHANGELOG.md @@ -3,6 +3,9 @@ ### 4.60.0-beta.1 (Unreleased) #### Features Added +* Added `cosmosVectorEmbeddingPolicy` in `cosmosContainerProperties` and `vectorIndexes` in `indexPolicy` to support vector search in CosmosDB - See[39379](https://github.com/Azure/azure-sdk-for-java/pull/39379) + +* Added support for non-streaming OrderBy query and a query feature `NonStreamingOrderBy` to support Vector Search queries. - See [PR 39897](https://github.com/Azure/azure-sdk-for-java/pull/39897/) #### Breaking Changes @@ -11,10 +14,9 @@ #### Other Changes ### 4.59.0 (2024-04-27) - #### Features Added * Added public APIs `getCustomItemSerializer` and `setCustomItemSerializer` to allow customers to specify custom payload transformations or serialization settings. - See [PR 38997](https://github.com/Azure/azure-sdk-for-java/pull/38997) and [PR 39933](https://github.com/Azure/azure-sdk-for-java/pull/39933) - + #### Other Changes * Load Blackbird or Afterburner into the ObjectMapper depending upon Java version and presence of modules in classpath. Make Afterburner and Blackbird optional maven dependencies. See - [PR 39689](https://github.com/Azure/azure-sdk-for-java/pull/39689) diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Constants.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Constants.java index 8409d5b7ec23..f789963783ed 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Constants.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Constants.java @@ -120,6 +120,15 @@ public static final class Properties { public static final String SPATIAL_INDEXES = "spatialIndexes"; public static final String TYPES = "types"; + // Vector Embedding Policy + public static final String VECTOR_EMBEDDING_POLICY = "vectorEmbeddingPolicy"; + public static final String VECTOR_INDEXES = "vectorIndexes"; + public static final String VECTOR_EMBEDDINGS = "vectorEmbeddings"; + public static final String VECTOR_INDEX_TYPE = "type"; + public static final String VECTOR_DATA_TYPE = "dataType"; + public static final String VECTOR_DIMENSIONS = "dimensions"; + public static final String DISTANCE_FUNCTION = "distanceFunction"; + // Unique index. public static final String UNIQUE_KEY_POLICY = "uniqueKeyPolicy"; public static final String UNIQUE_KEYS = "uniqueKeys"; diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentCollection.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentCollection.java index 678bdb90378c..1930f2275a61 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentCollection.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentCollection.java @@ -6,10 +6,11 @@ import com.azure.cosmos.CosmosItemSerializer; import com.azure.cosmos.implementation.apachecommons.lang.StringUtils; import com.azure.cosmos.implementation.caches.SerializableWrapper; -import com.azure.cosmos.models.ClientEncryptionPolicy; import com.azure.cosmos.models.ChangeFeedPolicy; +import com.azure.cosmos.models.ClientEncryptionPolicy; import com.azure.cosmos.models.ComputedProperty; import com.azure.cosmos.models.ConflictResolutionPolicy; +import com.azure.cosmos.models.CosmosVectorEmbeddingPolicy; import com.azure.cosmos.models.IndexingPolicy; import com.azure.cosmos.models.ModelBridgeInternal; import com.azure.cosmos.models.PartitionKeyDefinition; @@ -24,6 +25,8 @@ import java.util.Collection; import java.util.Collections; +import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; + /** * Represents a document collection in the Azure Cosmos DB database service. A collection is a named logical container * for documents. @@ -40,6 +43,7 @@ public final class DocumentCollection extends Resource { private UniqueKeyPolicy uniqueKeyPolicy; private PartitionKeyDefinition partitionKeyDefinition; private ClientEncryptionPolicy clientEncryptionPolicyInternal; + private CosmosVectorEmbeddingPolicy cosmosVectorEmbeddingPolicy; /** * Constructor. @@ -410,6 +414,33 @@ public void setClientEncryptionPolicy(ClientEncryptionPolicy value) { this.set(Constants.Properties.CLIENT_ENCRYPTION_POLICY, value, CosmosItemSerializer.DEFAULT_SERIALIZER); } + /** + * Gets the Vector Embedding Policy containing paths for embeddings along with path-specific settings for the item + * used in performing vector search on the items in a collection in the Azure CosmosDB database service. + * + * @return the Vector Embedding Policy. + */ + public CosmosVectorEmbeddingPolicy getVectorEmbeddingPolicy() { + if (this.cosmosVectorEmbeddingPolicy == null) { + if (super.has(Constants.Properties.VECTOR_EMBEDDING_POLICY)) { + this.cosmosVectorEmbeddingPolicy = super.getObject(Constants.Properties.VECTOR_EMBEDDING_POLICY, + CosmosVectorEmbeddingPolicy.class); + } + } + return this.cosmosVectorEmbeddingPolicy; + } + + /** + * Sets the Vector Embedding Policy containing paths for embeddings along with path-specific settings for the item + * used in performing vector search on the items in a collection in the Azure CosmosDB database service. + * + * @param value the Vector Embedding Policy. + */ + public void setVectorEmbeddingPolicy(CosmosVectorEmbeddingPolicy value) { + checkNotNull(value, "cosmosVectorEmbeddingPolicy cannot be null"); + this.set(Constants.Properties.VECTOR_EMBEDDING_POLICY, value, CosmosItemSerializer.DEFAULT_SERIALIZER); + } + public void populatePropertyBag() { super.populatePropertyBag(); if (this.indexingPolicy == null) { diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java index a13cfc65348d..c9f1c19cb126 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java @@ -4,9 +4,11 @@ import com.azure.cosmos.BridgeInternal; import com.azure.cosmos.implementation.BadRequestException; +import com.azure.cosmos.implementation.Configs; import com.azure.cosmos.implementation.Constants; import com.azure.cosmos.implementation.DiagnosticsClientContext; import com.azure.cosmos.implementation.DocumentCollection; +import com.azure.cosmos.implementation.HttpConstants; import com.azure.cosmos.implementation.ImplementationBridgeHelpers; import com.azure.cosmos.implementation.OperationType; import com.azure.cosmos.implementation.PartitionKeyRange; diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java index 7b6104271762..3f3e1795ac6b 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java @@ -5,6 +5,7 @@ import com.azure.cosmos.CosmosItemSerializer; import com.azure.cosmos.implementation.DiagnosticsClientContext; import com.azure.cosmos.implementation.DocumentCollection; +import com.azure.cosmos.implementation.HttpConstants; import com.azure.cosmos.implementation.ImplementationBridgeHelpers; import com.azure.cosmos.implementation.Document; import com.azure.cosmos.implementation.ObjectNodeMap; @@ -15,6 +16,8 @@ import java.util.function.BiFunction; +import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; + /** * While this class is public, but it is not part of our published public APIs. * This is meant to be internally used only by our sdk. diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContext.java index c7f67711fabd..6c3fa2827216 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContext.java @@ -137,7 +137,7 @@ public Flux> executeAsync() { } private static QueryInfo validateQueryInfo(QueryInfo queryInfo) { - if (queryInfo.hasOrderBy() || queryInfo.hasAggregates() || queryInfo.hasGroupBy()) { + if (queryInfo.hasOrderBy() || queryInfo.hasAggregates() || queryInfo.hasGroupBy() || queryInfo.hasNonStreamingOrderBy()) { // Any query with order by, aggregates or group by needs to go through the Document query pipeline throw new IllegalStateException("This query must not use the simple query pipeline."); } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CompositePath.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CompositePath.java index a278e0aa8f50..8cfd99b46e37 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CompositePath.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CompositePath.java @@ -93,7 +93,7 @@ public CompositePathSortOrder getOrder() { } /** - * Gets the sort order for the composite path. + * Sets the sort order for the composite path. *

* For example if you want to run the query "SELECT * FROM c ORDER BY c.age asc, c.height desc", * then you need to make the order for "/age" "ascending" and the order for "/height" "descending". diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java index 4fae5a797a70..0d357da0cc37 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosContainerProperties.java @@ -347,6 +347,28 @@ public CosmosContainerProperties setClientEncryptionPolicy(ClientEncryptionPolic return this; } + /** + * Gets the Vector Embedding Policy containing paths for embeddings along with path-specific settings for the item + * used in performing vector search on the items in a collection in the Azure CosmosDB database service. + * + * @return the Vector Embedding Policy. + */ + public CosmosVectorEmbeddingPolicy getVectorEmbeddingPolicy() { + return this.documentCollection.getVectorEmbeddingPolicy(); + } + + /** + * Sets the Vector Embedding Policy containing paths for embeddings along with path-specific settings for the item + * used in performing vector search on the items in a collection in the Azure CosmosDB database service. + * + * @param value the Vector Embedding Policy. + * @return the CosmosContainerProperties. + */ + public CosmosContainerProperties setVectorEmbeddingPolicy(CosmosVectorEmbeddingPolicy value) { + this.documentCollection.setVectorEmbeddingPolicy(value); + return this; + } + Resource getResource() { return this.documentCollection; } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDataType.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDataType.java new file mode 100644 index 000000000000..d8a4a63edbe2 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDataType.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.models; + +import com.fasterxml.jackson.annotation.JsonValue; + +import java.util.Arrays; + +/** + * Data types for the embeddings in Cosmos DB database service. + */ +public enum CosmosVectorDataType { + /** + * Represents a int8 data type. + */ + INT8("int8"), + + /** + * Represents a uint8 data type. + */ + UINT8("uint8"), + + /** + * Represents a float16 data type. + */ + FLOAT16("float16"), + + /** + * Represents a float32 data type. + */ + FLOAT32("float32"); + + private final String overWireValue; + + CosmosVectorDataType(String overWireValue) { + this.overWireValue = overWireValue; + } + + @JsonValue + @Override + public String toString() { + return this.overWireValue; + } + + /** + * Method to retrieve the enum constant by its overWireValue. + * @param value the overWire value of the enum constant + * @return the matching CosmosVectorDataType + * @throws IllegalArgumentException if no matching enum constant is found + */ + public static CosmosVectorDataType fromString(String value) { + return Arrays.stream(CosmosVectorDataType.values()) + .filter(vectorDataType -> vectorDataType.toString().equalsIgnoreCase(value)) + .findFirst() + .orElseThrow(() -> new IllegalArgumentException(String.format( + "Invalid vector data type with value {%s} for the vector embedding policy.", value))); + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDistanceFunction.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDistanceFunction.java new file mode 100644 index 000000000000..57f74fab3dc9 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorDistanceFunction.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.models; + +import com.fasterxml.jackson.annotation.JsonValue; + +import java.util.Arrays; + +/** + * Distance Function for the embeddings in the Cosmos DB database service. + */ +public enum CosmosVectorDistanceFunction { + /** + * Represents the euclidean distance function. + */ + EUCLIDEAN("euclidean"), + + /** + * Represents the cosine distance function. + */ + COSINE("cosine"), + + /** + * Represents the dot product distance function. + */ + DOT_PRODUCT("dotproduct"); + + private final String overWireValue; + + CosmosVectorDistanceFunction(String overWireValue) { + this.overWireValue = overWireValue; + } + + @JsonValue + @Override + public String toString() { + return this.overWireValue; + } + + /** + * Method to retrieve the enum constant by its overWireValue. + * @param value the overWire value of the enum constant + * @return the matching CosmosVectorDataType + * @throws IllegalArgumentException if no matching enum constant is found + */ + public static CosmosVectorDistanceFunction fromString(String value) { + return Arrays.stream(CosmosVectorDistanceFunction.values()) + .filter(vectorDistanceFunction -> vectorDistanceFunction.toString().equalsIgnoreCase(value)) + .findFirst() + .orElseThrow(() -> new IllegalArgumentException(String.format( + "Invalid distance function with value {%s} for the vector embedding policy.", value ))); + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbedding.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbedding.java new file mode 100644 index 000000000000..0f111d34e00a --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbedding.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.models; + +import com.azure.cosmos.implementation.Constants; +import com.azure.cosmos.implementation.JsonSerializable; +import com.azure.cosmos.implementation.apachecommons.lang.StringUtils; +import com.fasterxml.jackson.annotation.JsonProperty; +import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; + +/** + * Embedding settings within {@link CosmosVectorEmbeddingPolicy} + */ +public final class CosmosVectorEmbedding { + @JsonProperty(Constants.Properties.PATH) + private String path; + @JsonProperty(Constants.Properties.VECTOR_DATA_TYPE) + private String dataType; + @JsonProperty(Constants.Properties.VECTOR_DIMENSIONS) + private Long dimensions; + @JsonProperty(Constants.Properties.DISTANCE_FUNCTION) + private String distanceFunction; + private JsonSerializable jsonSerializable; + + /** + * Constructor + */ + public CosmosVectorEmbedding() { + this.jsonSerializable = new JsonSerializable(); + } + + /** + * Gets the path for the cosmosVectorEmbedding. + * + * @return path + */ + public String getPath() { + return path; + } + + /** + * Sets the path for the cosmosVectorEmbedding. + * + * @param path the path for the cosmosVectorEmbedding + * @return CosmosVectorEmbedding + */ + public CosmosVectorEmbedding setPath(String path) { + if (StringUtils.isEmpty(path)) { + throw new NullPointerException("embedding path is either null or empty"); + } + + if (path.charAt(0) != '/' || path.lastIndexOf('/') != 0) { + throw new IllegalArgumentException(""); + } + + this.path = path; + return this; + } + + /** + * Gets the data type for the cosmosVectorEmbedding. + * + * @return dataType + */ + public CosmosVectorDataType getDataType() { + return CosmosVectorDataType.fromString(dataType); + } + + /** + * Sets the data type for the cosmosVectorEmbedding. + * + * @param dataType the data type for the cosmosVectorEmbedding + * @return CosmosVectorEmbedding + */ + public CosmosVectorEmbedding setDataType(CosmosVectorDataType dataType) { + checkNotNull(dataType, "cosmosVectorDataType cannot be null"); + this.dataType = dataType.toString(); + return this; + } + + /** + * Gets the dimensions for the cosmosVectorEmbedding. + * + * @return dimensions + */ + public Long getDimensions() { + return dimensions; + } + + /** + * Sets the dimensions for the cosmosVectorEmbedding. + * + * @param dimensions the dimensions for the cosmosVectorEmbedding + * @return CosmosVectorEmbedding + */ + public CosmosVectorEmbedding setDimensions(Long dimensions) { + checkNotNull(dimensions, "dimensions cannot be null"); + if (dimensions < 1) { + throw new IllegalArgumentException("Dimensions for the embedding has to be a long value greater than 0 " + + "for the vector embedding policy"); + } + + this.dimensions = dimensions; + return this; + } + + /** + * Gets the distanceFunction for the cosmosVectorEmbedding. + * + * @return distanceFunction + */ + public CosmosVectorDistanceFunction getDistanceFunction() { + return CosmosVectorDistanceFunction.fromString(distanceFunction); + } + + /** + * Sets the distanceFunction for the cosmosVectorEmbedding. + * + * @param distanceFunction the distanceFunction for the cosmosVectorEmbedding + * @return CosmosVectorEmbedding + */ + public CosmosVectorEmbedding setDistanceFunction(CosmosVectorDistanceFunction distanceFunction) { + checkNotNull(distanceFunction, "cosmosVectorDistanceFunction cannot be null"); + this.distanceFunction = distanceFunction.toString(); + return this; + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbeddingPolicy.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbeddingPolicy.java new file mode 100644 index 000000000000..6abcc0028723 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbeddingPolicy.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.models; + +import com.azure.cosmos.implementation.Constants; +import com.azure.cosmos.implementation.JsonSerializable; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; + +/** + * Vector Embedding Policy + */ +public final class CosmosVectorEmbeddingPolicy { + + private JsonSerializable jsonSerializable; + /** + * Paths for embeddings along with path-specific settings for the item. + */ + @JsonProperty(Constants.Properties.VECTOR_EMBEDDINGS) + private List cosmosVectorEmbeddings; + + /** + * Constructor + */ + public CosmosVectorEmbeddingPolicy() { + this.jsonSerializable = new JsonSerializable(); + } + + /** + * Gets the paths for embeddings along with path-specific settings for the item. + * + * @return the paths for embeddings along with path-specific settings for the item. + */ + public List getVectorEmbeddings() { + return this.cosmosVectorEmbeddings; + } + + /** + * Sets the paths for embeddings along with path-specific settings for the item. + * + * @param cosmosVectorEmbeddings paths for embeddings along with path-specific settings for the item. + */ + public void setCosmosVectorEmbeddings(List cosmosVectorEmbeddings) { + cosmosVectorEmbeddings.forEach(embedding -> { + checkNotNull(embedding, "Null values are not allowed in cosmosVectorEmbeddings list."); + }); + this.cosmosVectorEmbeddings = cosmosVectorEmbeddings; + } + +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexSpec.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexSpec.java new file mode 100644 index 000000000000..4ea617eea041 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexSpec.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.models; + +import com.azure.cosmos.CosmosItemSerializer; +import com.azure.cosmos.implementation.Constants; +import com.azure.cosmos.implementation.JsonSerializable; + +import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; + +/** + * Vector Indexes spec for Azure CosmosDB service. + */ +public final class CosmosVectorIndexSpec { + + private final JsonSerializable jsonSerializable; + private String type; + + /** + * Constructor + */ + public CosmosVectorIndexSpec() { + this.jsonSerializable = new JsonSerializable(); + } + + /** + * Gets path. + * + * @return the path. + */ + public String getPath() { + return this.jsonSerializable.getString(Constants.Properties.PATH); + } + + /** + * Sets path. + * + * @param path the path. + * @return the SpatialSpec. + */ + public CosmosVectorIndexSpec setPath(String path) { + this.jsonSerializable.set(Constants.Properties.PATH, path, CosmosItemSerializer.DEFAULT_SERIALIZER); + return this; + } + + /** + * Gets the vector index type for the vector index + * + * @return the vector index type + */ + public String getType() { + if (this.type == null) { + this.type = this.jsonSerializable.getString(Constants.Properties.VECTOR_INDEX_TYPE); + } + return this.type; + } + + /** + * Sets the vector index type for the vector index + * + * @param type the vector index type + * @return the VectorIndexSpec + */ + public CosmosVectorIndexSpec setType(String type) { + checkNotNull(type, "cosmosVectorIndexType cannot be null"); + this.type = type; + this.jsonSerializable.set(Constants.Properties.VECTOR_INDEX_TYPE, this.type, CosmosItemSerializer.DEFAULT_SERIALIZER); + return this; + } + + void populatePropertyBag() { + this.jsonSerializable.populatePropertyBag(); + } + + JsonSerializable getJsonSerializable() { + return this.jsonSerializable; + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexType.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexType.java new file mode 100644 index 000000000000..679ea1f991c0 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexType.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.models; + +/** + * Defines the index type of vector index specification in the Azure Cosmos DB service. + */ +public enum CosmosVectorIndexType { + /** + * Represents a flat vector index type. + */ + FLAT("flat"), + + /** + * Represents a quantized flat vector index type. + */ + QUANTIZED_FLAT("quantizedFlat"), + + /** + * Represents a disk ANN vector index type. + */ + DISK_ANN("diskANN"); + + + private final String overWireValue; + + CosmosVectorIndexType(String overWireValue) { + this.overWireValue = overWireValue; + } + + @Override + public String toString() { + return this.overWireValue; + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java index 4ee5153877f8..530557cad90f 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java @@ -25,8 +25,8 @@ public final class IndexingPolicy { private List excludedPaths; private List> compositeIndexes; private List spatialIndexes; - - private JsonSerializable jsonSerializable; + private List vectorIndexes; + private final JsonSerializable jsonSerializable; /** * Constructor. @@ -54,7 +54,7 @@ public IndexingPolicy() { * * * @param defaultIndexOverrides comma separated set of indexes that serve as default index specifications for the - * root path. + * root path. * @throws IllegalArgumentException throws when defaultIndexOverrides is null */ IndexingPolicy(Index[] defaultIndexOverrides) { @@ -235,7 +235,7 @@ public IndexingPolicy setCompositeIndexes(List> compositeInd } /** - * Sets the spatial indexes for additional indexes. + * Gets the spatial indexes for additional indexes. * * @return the spatial indexes. */ @@ -266,11 +266,55 @@ public IndexingPolicy setSpatialIndexes(List spatialIndexes) { return this; } + /** + * Gets the vector indexes. + * + * @return the vector indexes + */ + public List getVectorIndexes() { + if (this.vectorIndexes == null) { + this.vectorIndexes = this.jsonSerializable.getList(Constants.Properties.VECTOR_INDEXES, CosmosVectorIndexSpec.class); + + if (this.vectorIndexes == null) { + this.vectorIndexes = new ArrayList(); + } + } + + return this.vectorIndexes; + } + + /** + * Sets the vector indexes. + * + * Example of the vectorIndexes: + * "vectorIndexes": [ + * { + * "path": "/vector1", + * "type": "diskANN" + * }, + * { + * "path": "/vector1", + * "type": "flat" + * }, + * { + * "path": "/vector2", + * "type": "quantizedFlat" + * }] + * + * @param vectorIndexes the vector indexes + * @return the Indexing Policy. + */ + public IndexingPolicy setVectorIndexes(List vectorIndexes) { + this.vectorIndexes = vectorIndexes; + this.jsonSerializable.set(Constants.Properties.VECTOR_INDEXES,this.vectorIndexes, CosmosItemSerializer.DEFAULT_SERIALIZER); + return this; + } + void populatePropertyBag() { this.jsonSerializable.populatePropertyBag(); // If indexing mode is not 'none' and not paths are set, set them to the defaults if (this.getIndexingMode() != IndexingMode.NONE && this.getIncludedPaths().size() == 0 - && this.getExcludedPaths().size() == 0) { + && this.getExcludedPaths().size() == 0) { IncludedPath includedPath = new IncludedPath(IndexingPolicy.DEFAULT_PATH); this.getIncludedPaths().add(includedPath); } @@ -296,5 +340,7 @@ void populatePropertyBag() { } } - JsonSerializable getJsonSerializable() { return this.jsonSerializable; } + JsonSerializable getJsonSerializable() { + return this.jsonSerializable; + } } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java index a8f344ce4e2d..4931c9b3b1b0 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/ModelBridgeInternal.java @@ -435,6 +435,8 @@ public static void populatePropertyBag(T t) { ((PartitionKeyDefinition) t).populatePropertyBag(); } else if (t instanceof SpatialSpec) { ((SpatialSpec) t).populatePropertyBag(); + } else if (t instanceof CosmosVectorIndexSpec) { + ((CosmosVectorIndexSpec) t).populatePropertyBag(); } else if (t instanceof SqlParameter) { ((SqlParameter) t).populatePropertyBag(); } else if (t instanceof SqlQuerySpec) { @@ -468,6 +470,8 @@ public static JsonSerializable getJsonSerializable(T t) { return ((PartitionKeyDefinition) t).getJsonSerializable(); } else if (t instanceof SpatialSpec) { return ((SpatialSpec) t).getJsonSerializable(); + } else if (t instanceof CosmosVectorIndexSpec) { + return ((CosmosVectorIndexSpec) t).getJsonSerializable(); } else if (t instanceof SqlParameter) { return ((SqlParameter) t).getJsonSerializable(); } else if (t instanceof SqlQuerySpec) { From 82793584a4c642a2589a024242543c9ccf50c9c0 Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Tue, 14 May 2024 14:35:41 -0700 Subject: [PATCH 21/33] Users/akataria/non streaming order by (#40159) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Initial changes * Initial changes * [Cosmos][VectorIndex]Adding changes for vectorIndex and vectorEmbeddingPolicy (#40004) * Adding changes for vectorIndex and vectorEmbeddingPolicy * Adding some necessary comments * Adding test case * updating enum values * Updating test case * Updating test case * Updating test case * updating changelog * Updating test case * Resolving comments * Resolving comments * Fixing test case * Resolving comments * Resolving Comments * Fixing build issues * Resolving comments * Resolving Comments * Initial changes * Initial changes * Initial changes * Resolving comments * Fixing build issues * [Cosmos][VectorSearch] Non Streaming Order By Query (#40085) * Increment versions for core releases (#40003) Increment package versions for core releases * Ensure ServiceBus session idle timeout fall back to retry-options::try-timeout (#39994) * Added Alpha3 Java Media Streaming Events (#40002) * Added Alpha3 Java Media Streaming Events * updating readme to add the media streaming events to remove model --------- Co-authored-by: Vinothini Dharmaraj * Update version of github-event-processor to 1.0.0-dev.20240502.2 (#40012) Co-authored-by: James Suplizio * Prepare May 2024 Identity Release (#40006) * Prepare Identity Broker May 2024 Release (#40014) * Increment package versions for identity releases (#40015) * [JobRouter] SDK Review updates (#40011) * SDK Review updates * Update auto-generated models * Add customization * Fix customization * Update package * Update tests * Linting * FixFaultInjectionRuleFailedToApplyPerPartitionInGatewayMode (#40005) * fix fault injection rule failed to apply per partition in gateway mode --------- Co-authored-by: annie-mac * azure-cosmos-test_1.0.0.beta.7Release (#40021) * release azure-cosmos-test 1.0.0.beta.7 --------- Co-authored-by: annie-mac --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac * [Cosmos][VectorSearch] Non Streaming Order By Query (#40096) * Initial changes * Initial changes * Increment versions for core releases (#40003) Increment package versions for core releases * Ensure ServiceBus session idle timeout fall back to retry-options::try-timeout (#39994) * Added Alpha3 Java Media Streaming Events (#40002) * Added Alpha3 Java Media Streaming Events * updating readme to add the media streaming events to remove model --------- Co-authored-by: Vinothini Dharmaraj * Update version of github-event-processor to 1.0.0-dev.20240502.2 (#40012) Co-authored-by: James Suplizio * Prepare May 2024 Identity Release (#40006) * Prepare Identity Broker May 2024 Release (#40014) * Increment package versions for identity releases (#40015) * [JobRouter] SDK Review updates (#40011) * SDK Review updates * Update auto-generated models * Add customization * Fix customization * Update package * Update tests * Linting * FixFaultInjectionRuleFailedToApplyPerPartitionInGatewayMode (#40005) * fix fault injection rule failed to apply per partition in gateway mode --------- Co-authored-by: annie-mac * azure-cosmos-test_1.0.0.beta.7Release (#40021) * release azure-cosmos-test 1.0.0.beta.7 --------- Co-authored-by: annie-mac * Fixed existsById API in ReactiveCosmosTemplate (#40022) * Fixed existsById API in ReactiveCosmosTemplate * Added changelog * Initial changes * Initial changes * Skip Recorded test and delete Event record until test proxy to work with Event recordings (#40029) Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> * Fix invalid CODEOWNERS (#40032) * Initial changes * ServiceBus: fix session tracing (#39962) * remove additional matrix * Fix session processing and disposition instrumentation * return matrix config * review suggestions * [Automation] Generate SDK based on TypeSpec 0.15.15 (#40048) * [CODEOWNERS] Updates for org changes (#40049) * [CODEOWNERS] Updates for org changes The focus of these changes is to remove an individual who no longer is responsible for the products which their GH account is associated to. * Move from using the docker image to java2docfx for docs validation (#39744) * Move from using the docker image to java2docfx for docs validation * Temporarily turn on docs processing for template libraries for testing * Actually install the rex validation tool * Fix the if not Test-Path statement * Update java2docfx version and add a couple of diagnostics output lines * Add missing close paren * Ensure that Sort-Object always returns an array even if there's only one item * add another piece of diagnostics output * trying one more thing * remove some diag, add other * Remove the additional diagnostics, add permanent output message * Invoke java -jar on java2docfx to show the help command to ensure the install is okay * fiddling with the java -jar command * Set the working directory to the java2docfx directory before executing the mvn dependency download * Actually create the directory before trying to set location...oops * Update rex validation to verify MAVEN_HOME is set * Updates for Java PR 39875 which had changes from this PR that were more immediate * Update java2docfx version * remove check for MAVEN_HOME which was only for testing * Update the version of java2docfx to test a fix * Update version of java2docfx to 1.0.4 * revert template's ci.yml changes that were only necessary to test java2docfx * owners (#39686) * Use ClientLogger in testing output (#40010) Use ClientLogger in testing output * Fix null pointer exception and context usage (#40053) * Rename AML to AzureMachineLearning (#40056) * Fixed the Key Vault `test-resources.json` file to properly configure a deployment script for certificate creation. (#40037) * Close response body in bearer policy (#40052) * Running Prepare-Release for azure-messaging-servicebus 7.17.0 (#40058) * mgmt, TypeSpec code generation pipeline (#39963) * typespec generation pipeline echo command PR_TITLE * generation typespec Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines * remove typespec pipeline file * fix pr title * address comments * Add codeowner linter owners (#39997) * Update to ESRP task version that supports federated auth (#40059) * Increment package versions for cosmos releases (#40031) * Update azure-sdk-build-tools Repository Resource Refs in Yaml files (#39627) * Add reduced embeddings sample to azure-search-documents (#40069) * Add reduced embeddings sample * Fix cspell * Fix link * Search May Preview Regen Updates (#40057) * Search May Preview Regeneration - Still need to add varargs convenience * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * adding varargs * Additional adjustments to FieldBuilder and Search Index Customizations * Updating cspell.json * Adjust `SearchScoreThreshold` customization Re-enable code generation in CI * Updates: - Updated Cspell - Rename `maxStoragePerIndex` property to `maxStoragePerIndexInBytes` in SearchServiceLimits - Set `hybridSearch` property to be type `HybridSearch` in SearchRequest - Add `hybridSearch` to SearchOptions and `SearchAsyncClient.createSearchRequest()` * Adding Support and testing byte[] and List within field builder * Fix linting --------- Co-authored-by: alzimmermsft <48699787+alzimmermsft@users.noreply.github.com> * Preparing Search May 2024 Beta Release (#40071) * Preparing Search May 2024 Beta Release * Preparing Search May 2024 Beta Release * Resolving comments * Fixing build issues * eng, update autorest.java, improve error output in sdk automation (#40073) * improve error output * autorest.java 4.1.29 * Merge to main after spring cloud azure 4.18.0 released (#40075) * Prepare for Spring Cloud Azure 4.18.0 release (#40063) * update version client * update version/changelog/readme * update changelog * Increment versions for spring releases (#40074) * Increment package versions for spring releases * Update version_client.txt * Update pom.xml --------- Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> * Miscellaneous Core performance improvements (#39552) Miscellaneous Core performance improvements * Increment package versions for search releases (#40072) * Update io.fabric8:kubernetes-client (#40086) 5.12.3 -> 6.12.1 * Increment package versions for servicebus releases (#40094) * Emit stable auto-instrumented otel metrics (#39960) * Update otel metrics logic * add runtime metrics * adding a few metrics I forgot * small correction * Update * Fix * Update * Delete pre-stable metrics --------- Co-authored-by: Harsimar Kaur (from Dev Box) --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac Co-authored-by: Kushagra Thapar Co-authored-by: minwoolee-msft <77083090+minwoolee-msft@users.noreply.github.com> Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> Co-authored-by: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Co-authored-by: Liudmila Molkova Co-authored-by: Jesse Squire Co-authored-by: Harsimar Kaur Co-authored-by: vcolin7 Co-authored-by: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Co-authored-by: Wes Haggard Co-authored-by: Patrick Hallisey Co-authored-by: Jair Myree Co-authored-by: Weidong Xu Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> Co-authored-by: Helen <56097766+heyams@users.noreply.github.com> Co-authored-by: Harsimar Kaur (from Dev Box) * Initial changes * Initial changes * Fixes * Users/akataria/vectorindexing (#40117) * Adding changes for vectorIndex and vectorEmbeddingPolicy * Adding some necessary comments * Adding test case * updating enum values * Updating test case * Updating test case * Updating test case * updating changelog * Updating test case * Resolving comments * Resolving comments * Fixing test case * Resolving comments * Resolving Comments * Fixing build issues * Resolving comments * Resolving Comments * [Cosmos][VectorIndex]Adding changes for vectorIndex and vectorEmbeddingPolicy (#40004) * Adding changes for vectorIndex and vectorEmbeddingPolicy * Adding some necessary comments * Adding test case * updating enum values * Updating test case * Updating test case * Updating test case * updating changelog * Updating test case * Resolving comments * Resolving comments * Fixing test case * Resolving comments * Resolving Comments * Fixing build issues * Resolving comments * Resolving Comments * [Cosmos][VectorSearch] Non Streaming Order By Query (#40085) * Increment versions for core releases (#40003) Increment package versions for core releases * Ensure ServiceBus session idle timeout fall back to retry-options::try-timeout (#39994) * Added Alpha3 Java Media Streaming Events (#40002) * Added Alpha3 Java Media Streaming Events * updating readme to add the media streaming events to remove model --------- Co-authored-by: Vinothini Dharmaraj * Update version of github-event-processor to 1.0.0-dev.20240502.2 (#40012) Co-authored-by: James Suplizio * Prepare May 2024 Identity Release (#40006) * Prepare Identity Broker May 2024 Release (#40014) * Increment package versions for identity releases (#40015) * [JobRouter] SDK Review updates (#40011) * SDK Review updates * Update auto-generated models * Add customization * Fix customization * Update package * Update tests * Linting * FixFaultInjectionRuleFailedToApplyPerPartitionInGatewayMode (#40005) * fix fault injection rule failed to apply per partition in gateway mode --------- Co-authored-by: annie-mac * azure-cosmos-test_1.0.0.beta.7Release (#40021) * release azure-cosmos-test 1.0.0.beta.7 --------- Co-authored-by: annie-mac --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac * [Cosmos][VectorSearch] Non Streaming Order By Query (#40096) * Initial changes * Initial changes * Increment versions for core releases (#40003) Increment package versions for core releases * Ensure ServiceBus session idle timeout fall back to retry-options::try-timeout (#39994) * Added Alpha3 Java Media Streaming Events (#40002) * Added Alpha3 Java Media Streaming Events * updating readme to add the media streaming events to remove model --------- Co-authored-by: Vinothini Dharmaraj * Update version of github-event-processor to 1.0.0-dev.20240502.2 (#40012) Co-authored-by: James Suplizio * Prepare May 2024 Identity Release (#40006) * Prepare Identity Broker May 2024 Release (#40014) * Increment package versions for identity releases (#40015) * [JobRouter] SDK Review updates (#40011) * SDK Review updates * Update auto-generated models * Add customization * Fix customization * Update package * Update tests * Linting * FixFaultInjectionRuleFailedToApplyPerPartitionInGatewayMode (#40005) * fix fault injection rule failed to apply per partition in gateway mode --------- Co-authored-by: annie-mac * azure-cosmos-test_1.0.0.beta.7Release (#40021) * release azure-cosmos-test 1.0.0.beta.7 --------- Co-authored-by: annie-mac * Fixed existsById API in ReactiveCosmosTemplate (#40022) * Fixed existsById API in ReactiveCosmosTemplate * Added changelog * Initial changes * Initial changes * Skip Recorded test and delete Event record until test proxy to work with Event recordings (#40029) Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> * Fix invalid CODEOWNERS (#40032) * Initial changes * ServiceBus: fix session tracing (#39962) * remove additional matrix * Fix session processing and disposition instrumentation * return matrix config * review suggestions * [Automation] Generate SDK based on TypeSpec 0.15.15 (#40048) * [CODEOWNERS] Updates for org changes (#40049) * [CODEOWNERS] Updates for org changes The focus of these changes is to remove an individual who no longer is responsible for the products which their GH account is associated to. * Move from using the docker image to java2docfx for docs validation (#39744) * Move from using the docker image to java2docfx for docs validation * Temporarily turn on docs processing for template libraries for testing * Actually install the rex validation tool * Fix the if not Test-Path statement * Update java2docfx version and add a couple of diagnostics output lines * Add missing close paren * Ensure that Sort-Object always returns an array even if there's only one item * add another piece of diagnostics output * trying one more thing * remove some diag, add other * Remove the additional diagnostics, add permanent output message * Invoke java -jar on java2docfx to show the help command to ensure the install is okay * fiddling with the java -jar command * Set the working directory to the java2docfx directory before executing the mvn dependency download * Actually create the directory before trying to set location...oops * Update rex validation to verify MAVEN_HOME is set * Updates for Java PR 39875 which had changes from this PR that were more immediate * Update java2docfx version * remove check for MAVEN_HOME which was only for testing * Update the version of java2docfx to test a fix * Update version of java2docfx to 1.0.4 * revert template's ci.yml changes that were only necessary to test java2docfx * owners (#39686) * Use ClientLogger in testing output (#40010) Use ClientLogger in testing output * Fix null pointer exception and context usage (#40053) * Rename AML to AzureMachineLearning (#40056) * Fixed the Key Vault `test-resources.json` file to properly configure a deployment script for certificate creation. (#40037) * Close response body in bearer policy (#40052) * Running Prepare-Release for azure-messaging-servicebus 7.17.0 (#40058) * mgmt, TypeSpec code generation pipeline (#39963) * typespec generation pipeline echo command PR_TITLE * generation typespec Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines * remove typespec pipeline file * fix pr title * address comments * Add codeowner linter owners (#39997) * Update to ESRP task version that supports federated auth (#40059) * Increment package versions for cosmos releases (#40031) * Update azure-sdk-build-tools Repository Resource Refs in Yaml files (#39627) * Add reduced embeddings sample to azure-search-documents (#40069) * Add reduced embeddings sample * Fix cspell * Fix link * Search May Preview Regen Updates (#40057) * Search May Preview Regeneration - Still need to add varargs convenience * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * adding varargs * Additional adjustments to FieldBuilder and Search Index Customizations * Updating cspell.json * Adjust `SearchScoreThreshold` customization Re-enable code generation in CI * Updates: - Updated Cspell - Rename `maxStoragePerIndex` property to `maxStoragePerIndexInBytes` in SearchServiceLimits - Set `hybridSearch` property to be type `HybridSearch` in SearchRequest - Add `hybridSearch` to SearchOptions and `SearchAsyncClient.createSearchRequest()` * Adding Support and testing byte[] and List within field builder * Fix linting --------- Co-authored-by: alzimmermsft <48699787+alzimmermsft@users.noreply.github.com> * Preparing Search May 2024 Beta Release (#40071) * Preparing Search May 2024 Beta Release * Preparing Search May 2024 Beta Release * Resolving comments * Fixing build issues * eng, update autorest.java, improve error output in sdk automation (#40073) * improve error output * autorest.java 4.1.29 * Merge to main after spring cloud azure 4.18.0 released (#40075) * Prepare for Spring Cloud Azure 4.18.0 release (#40063) * update version client * update version/changelog/readme * update changelog * Increment versions for spring releases (#40074) * Increment package versions for spring releases * Update version_client.txt * Update pom.xml --------- Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> * Miscellaneous Core performance improvements (#39552) Miscellaneous Core performance improvements * Increment package versions for search releases (#40072) * Update io.fabric8:kubernetes-client (#40086) 5.12.3 -> 6.12.1 * Increment package versions for servicebus releases (#40094) * Emit stable auto-instrumented otel metrics (#39960) * Update otel metrics logic * add runtime metrics * adding a few metrics I forgot * small correction * Update * Fix * Update * Delete pre-stable metrics --------- Co-authored-by: Harsimar Kaur (from Dev Box) --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac Co-authored-by: Kushagra Thapar Co-authored-by: minwoolee-msft <77083090+minwoolee-msft@users.noreply.github.com> Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> Co-authored-by: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Co-authored-by: Liudmila Molkova Co-authored-by: Jesse Squire Co-authored-by: Harsimar Kaur Co-authored-by: vcolin7 Co-authored-by: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Co-authored-by: Wes Haggard Co-authored-by: Patrick Hallisey Co-authored-by: Jair Myree Co-authored-by: Weidong Xu Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> Co-authored-by: Helen <56097766+heyams@users.noreply.github.com> Co-authored-by: Harsimar Kaur (from Dev Box) * [Cosmos][VectorSearch] Non Streaming Order By Query (#40098) * Initial changes * Initial changes * Increment versions for core releases (#40003) Increment package versions for core releases * Ensure ServiceBus session idle timeout fall back to retry-options::try-timeout (#39994) * Added Alpha3 Java Media Streaming Events (#40002) * Added Alpha3 Java Media Streaming Events * updating readme to add the media streaming events to remove model --------- Co-authored-by: Vinothini Dharmaraj * Update version of github-event-processor to 1.0.0-dev.20240502.2 (#40012) Co-authored-by: James Suplizio * Prepare May 2024 Identity Release (#40006) * Prepare Identity Broker May 2024 Release (#40014) * Increment package versions for identity releases (#40015) * [JobRouter] SDK Review updates (#40011) * SDK Review updates * Update auto-generated models * Add customization * Fix customization * Update package * Update tests * Linting * FixFaultInjectionRuleFailedToApplyPerPartitionInGatewayMode (#40005) * fix fault injection rule failed to apply per partition in gateway mode --------- Co-authored-by: annie-mac * azure-cosmos-test_1.0.0.beta.7Release (#40021) * release azure-cosmos-test 1.0.0.beta.7 --------- Co-authored-by: annie-mac * Fixed existsById API in ReactiveCosmosTemplate (#40022) * Fixed existsById API in ReactiveCosmosTemplate * Added changelog * Initial changes * Initial changes * Skip Recorded test and delete Event record until test proxy to work with Event recordings (#40029) Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> * Fix invalid CODEOWNERS (#40032) * Initial changes * ServiceBus: fix session tracing (#39962) * remove additional matrix * Fix session processing and disposition instrumentation * return matrix config * review suggestions * [Automation] Generate SDK based on TypeSpec 0.15.15 (#40048) * [CODEOWNERS] Updates for org changes (#40049) * [CODEOWNERS] Updates for org changes The focus of these changes is to remove an individual who no longer is responsible for the products which their GH account is associated to. * Move from using the docker image to java2docfx for docs validation (#39744) * Move from using the docker image to java2docfx for docs validation * Temporarily turn on docs processing for template libraries for testing * Actually install the rex validation tool * Fix the if not Test-Path statement * Update java2docfx version and add a couple of diagnostics output lines * Add missing close paren * Ensure that Sort-Object always returns an array even if there's only one item * add another piece of diagnostics output * trying one more thing * remove some diag, add other * Remove the additional diagnostics, add permanent output message * Invoke java -jar on java2docfx to show the help command to ensure the install is okay * fiddling with the java -jar command * Set the working directory to the java2docfx directory before executing the mvn dependency download * Actually create the directory before trying to set location...oops * Update rex validation to verify MAVEN_HOME is set * Updates for Java PR 39875 which had changes from this PR that were more immediate * Update java2docfx version * remove check for MAVEN_HOME which was only for testing * Update the version of java2docfx to test a fix * Update version of java2docfx to 1.0.4 * revert template's ci.yml changes that were only necessary to test java2docfx * owners (#39686) * Use ClientLogger in testing output (#40010) Use ClientLogger in testing output * Fix null pointer exception and context usage (#40053) * Rename AML to AzureMachineLearning (#40056) * Fixed the Key Vault `test-resources.json` file to properly configure a deployment script for certificate creation. (#40037) * Close response body in bearer policy (#40052) * Running Prepare-Release for azure-messaging-servicebus 7.17.0 (#40058) * mgmt, TypeSpec code generation pipeline (#39963) * typespec generation pipeline echo command PR_TITLE * generation typespec Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines * remove typespec pipeline file * fix pr title * address comments * Add codeowner linter owners (#39997) * Update to ESRP task version that supports federated auth (#40059) * Increment package versions for cosmos releases (#40031) * Update azure-sdk-build-tools Repository Resource Refs in Yaml files (#39627) * Add reduced embeddings sample to azure-search-documents (#40069) * Add reduced embeddings sample * Fix cspell * Fix link * Search May Preview Regen Updates (#40057) * Search May Preview Regeneration - Still need to add varargs convenience * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * adding varargs * Additional adjustments to FieldBuilder and Search Index Customizations * Updating cspell.json * Adjust `SearchScoreThreshold` customization Re-enable code generation in CI * Updates: - Updated Cspell - Rename `maxStoragePerIndex` property to `maxStoragePerIndexInBytes` in SearchServiceLimits - Set `hybridSearch` property to be type `HybridSearch` in SearchRequest - Add `hybridSearch` to SearchOptions and `SearchAsyncClient.createSearchRequest()` * Adding Support and testing byte[] and List within field builder * Fix linting --------- Co-authored-by: alzimmermsft <48699787+alzimmermsft@users.noreply.github.com> * Preparing Search May 2024 Beta Release (#40071) * Preparing Search May 2024 Beta Release * Preparing Search May 2024 Beta Release * Resolving comments * Fixing build issues * eng, update autorest.java, improve error output in sdk automation (#40073) * improve error output * autorest.java 4.1.29 * Merge to main after spring cloud azure 4.18.0 released (#40075) * Prepare for Spring Cloud Azure 4.18.0 release (#40063) * update version client * update version/changelog/readme * update changelog * Increment versions for spring releases (#40074) * Increment package versions for spring releases * Update version_client.txt * Update pom.xml --------- Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> * Miscellaneous Core performance improvements (#39552) Miscellaneous Core performance improvements * Increment package versions for search releases (#40072) * Update io.fabric8:kubernetes-client (#40086) 5.12.3 -> 6.12.1 * Increment package versions for servicebus releases (#40094) * Emit stable auto-instrumented otel metrics (#39960) * Update otel metrics logic * add runtime metrics * adding a few metrics I forgot * small correction * Update * Fix * Update * Delete pre-stable metrics --------- Co-authored-by: Harsimar Kaur (from Dev Box) * Initial changes --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac Co-authored-by: Kushagra Thapar Co-authored-by: minwoolee-msft <77083090+minwoolee-msft@users.noreply.github.com> Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> Co-authored-by: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Co-authored-by: Liudmila Molkova Co-authored-by: Jesse Squire Co-authored-by: Harsimar Kaur Co-authored-by: vcolin7 Co-authored-by: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Co-authored-by: Wes Haggard Co-authored-by: Patrick Hallisey Co-authored-by: Jair Myree Co-authored-by: Weidong Xu Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> Co-authored-by: Helen <56097766+heyams@users.noreply.github.com> Co-authored-by: Harsimar Kaur (from Dev Box) * Resolving comments * Resolving comments * [Cosmos][VectorSearch] Non Streaming Order By Query (#40115) * Initial changes * Initial changes * Increment versions for core releases (#40003) Increment package versions for core releases * Ensure ServiceBus session idle timeout fall back to retry-options::try-timeout (#39994) * Added Alpha3 Java Media Streaming Events (#40002) * Added Alpha3 Java Media Streaming Events * updating readme to add the media streaming events to remove model --------- Co-authored-by: Vinothini Dharmaraj * Update version of github-event-processor to 1.0.0-dev.20240502.2 (#40012) Co-authored-by: James Suplizio * Prepare May 2024 Identity Release (#40006) * Prepare Identity Broker May 2024 Release (#40014) * Increment package versions for identity releases (#40015) * [JobRouter] SDK Review updates (#40011) * SDK Review updates * Update auto-generated models * Add customization * Fix customization * Update package * Update tests * Linting * FixFaultInjectionRuleFailedToApplyPerPartitionInGatewayMode (#40005) * fix fault injection rule failed to apply per partition in gateway mode --------- Co-authored-by: annie-mac * azure-cosmos-test_1.0.0.beta.7Release (#40021) * release azure-cosmos-test 1.0.0.beta.7 --------- Co-authored-by: annie-mac * Fixed existsById API in ReactiveCosmosTemplate (#40022) * Fixed existsById API in ReactiveCosmosTemplate * Added changelog * Initial changes * Initial changes * Skip Recorded test and delete Event record until test proxy to work with Event recordings (#40029) Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> * Fix invalid CODEOWNERS (#40032) * Initial changes * ServiceBus: fix session tracing (#39962) * remove additional matrix * Fix session processing and disposition instrumentation * return matrix config * review suggestions * [Automation] Generate SDK based on TypeSpec 0.15.15 (#40048) * [CODEOWNERS] Updates for org changes (#40049) * [CODEOWNERS] Updates for org changes The focus of these changes is to remove an individual who no longer is responsible for the products which their GH account is associated to. * Move from using the docker image to java2docfx for docs validation (#39744) * Move from using the docker image to java2docfx for docs validation * Temporarily turn on docs processing for template libraries for testing * Actually install the rex validation tool * Fix the if not Test-Path statement * Update java2docfx version and add a couple of diagnostics output lines * Add missing close paren * Ensure that Sort-Object always returns an array even if there's only one item * add another piece of diagnostics output * trying one more thing * remove some diag, add other * Remove the additional diagnostics, add permanent output message * Invoke java -jar on java2docfx to show the help command to ensure the install is okay * fiddling with the java -jar command * Set the working directory to the java2docfx directory before executing the mvn dependency download * Actually create the directory before trying to set location...oops * Update rex validation to verify MAVEN_HOME is set * Updates for Java PR 39875 which had changes from this PR that were more immediate * Update java2docfx version * remove check for MAVEN_HOME which was only for testing * Update the version of java2docfx to test a fix * Update version of java2docfx to 1.0.4 * revert template's ci.yml changes that were only necessary to test java2docfx * owners (#39686) * Use ClientLogger in testing output (#40010) Use ClientLogger in testing output * Fix null pointer exception and context usage (#40053) * Rename AML to AzureMachineLearning (#40056) * Fixed the Key Vault `test-resources.json` file to properly configure a deployment script for certificate creation. (#40037) * Close response body in bearer policy (#40052) * Running Prepare-Release for azure-messaging-servicebus 7.17.0 (#40058) * mgmt, TypeSpec code generation pipeline (#39963) * typespec generation pipeline echo command PR_TITLE * generation typespec Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines * remove typespec pipeline file * fix pr title * address comments * Add codeowner linter owners (#39997) * Update to ESRP task version that supports federated auth (#40059) * Increment package versions for cosmos releases (#40031) * Update azure-sdk-build-tools Repository Resource Refs in Yaml files (#39627) * Add reduced embeddings sample to azure-search-documents (#40069) * Add reduced embeddings sample * Fix cspell * Fix link * Search May Preview Regen Updates (#40057) * Search May Preview Regeneration - Still need to add varargs convenience * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * adding varargs * Additional adjustments to FieldBuilder and Search Index Customizations * Updating cspell.json * Adjust `SearchScoreThreshold` customization Re-enable code generation in CI * Updates: - Updated Cspell - Rename `maxStoragePerIndex` property to `maxStoragePerIndexInBytes` in SearchServiceLimits - Set `hybridSearch` property to be type `HybridSearch` in SearchRequest - Add `hybridSearch` to SearchOptions and `SearchAsyncClient.createSearchRequest()` * Adding Support and testing byte[] and List within field builder * Fix linting --------- Co-authored-by: alzimmermsft <48699787+alzimmermsft@users.noreply.github.com> * Preparing Search May 2024 Beta Release (#40071) * Preparing Search May 2024 Beta Release * Preparing Search May 2024 Beta Release * Resolving comments * Fixing build issues * eng, update autorest.java, improve error output in sdk automation (#40073) * improve error output * autorest.java 4.1.29 * Merge to main after spring cloud azure 4.18.0 released (#40075) * Prepare for Spring Cloud Azure 4.18.0 release (#40063) * update version client * update version/changelog/readme * update changelog * Increment versions for spring releases (#40074) * Increment package versions for spring releases * Update version_client.txt * Update pom.xml --------- Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> * Miscellaneous Core performance improvements (#39552) Miscellaneous Core performance improvements * Increment package versions for search releases (#40072) * Update io.fabric8:kubernetes-client (#40086) 5.12.3 -> 6.12.1 * Increment package versions for servicebus releases (#40094) * Emit stable auto-instrumented otel metrics (#39960) * Update otel metrics logic * add runtime metrics * adding a few metrics I forgot * small correction * Update * Fix * Update * Delete pre-stable metrics --------- Co-authored-by: Harsimar Kaur (from Dev Box) * [Key Vault] Added support for `/prerestore` and `/prebackup` endpoints in Backup clients (#39878) * Updated `autorest.md` files in all swagger folders. * Re-generated implementation code. * Updated ServiceVersion expandable enums. * Added public APIs for the new /prebacukp and /prerestore endpoints. * Added tests. * Refactored Backup client tests. * Updated tests. * Updated test recordings. * Updated documentation and samples. * Addressed PR feedback. * Initial changes * Prepare to release beta.22 (#40097) * Fix template name (#40099) * Fix template name * Also install the rex validation tool * Update partner release to use WIF (#40101) * core mgmt, `SubResource` implements `JsonSerializable` to support azure-json (#40076) * test * implementation * fix lint * spotless:apply * Update spring-reference and sync changelog (#40105) * update spring-reference.yml * update CHANGELOG.md * Support per-call response timeout in all HttpClient implementations (#40017) Support per-call response timeout in all HttpClient implementations * Change how JavaType is resolved to support JsonSerializable better (#40112) * Initial changes * Fixes --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac Co-authored-by: Kushagra Thapar Co-authored-by: minwoolee-msft <77083090+minwoolee-msft@users.noreply.github.com> Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> Co-authored-by: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Co-authored-by: Liudmila Molkova Co-authored-by: Jesse Squire Co-authored-by: Harsimar Kaur Co-authored-by: vcolin7 Co-authored-by: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Co-authored-by: Wes Haggard Co-authored-by: Patrick Hallisey Co-authored-by: Jair Myree Co-authored-by: Weidong Xu Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> Co-authored-by: Helen <56097766+heyams@users.noreply.github.com> Co-authored-by: Harsimar Kaur (from Dev Box) --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac Co-authored-by: Kushagra Thapar Co-authored-by: minwoolee-msft <77083090+minwoolee-msft@users.noreply.github.com> Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> Co-authored-by: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Co-authored-by: Liudmila Molkova Co-authored-by: Jesse Squire Co-authored-by: Harsimar Kaur Co-authored-by: vcolin7 Co-authored-by: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Co-authored-by: Wes Haggard Co-authored-by: Patrick Hallisey Co-authored-by: Jair Myree Co-authored-by: Weidong Xu Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> Co-authored-by: Helen <56097766+heyams@users.noreply.github.com> Co-authored-by: Harsimar Kaur (from Dev Box) * Users/akataria/non streaming order by (#40118) * Initial changes * Initial changes * [Cosmos][VectorIndex]Adding changes for vectorIndex and vectorEmbeddingPolicy (#40004) * Adding changes for vectorIndex and vectorEmbeddingPolicy * Adding some necessary comments * Adding test case * updating enum values * Updating test case * Updating test case * Updating test case * updating changelog * Updating test case * Resolving comments * Resolving comments * Fixing test case * Resolving comments * Resolving Comments * Fixing build issues * Resolving comments * Resolving Comments * Initial changes * Initial changes * Initial changes * Resolving comments * Fixing build issues * [Cosmos][VectorSearch] Non Streaming Order By Query (#40085) * Increment versions for core releases (#40003) Increment package versions for core releases * Ensure ServiceBus session idle timeout fall back to retry-options::try-timeout (#39994) * Added Alpha3 Java Media Streaming Events (#40002) * Added Alpha3 Java Media Streaming Events * updating readme to add the media streaming events to remove model --------- Co-authored-by: Vinothini Dharmaraj * Update version of github-event-processor to 1.0.0-dev.20240502.2 (#40012) Co-authored-by: James Suplizio * Prepare May 2024 Identity Release (#40006) * Prepare Identity Broker May 2024 Release (#40014) * Increment package versions for identity releases (#40015) * [JobRouter] SDK Review updates (#40011) * SDK Review updates * Update auto-generated models * Add customization * Fix customization * Update package * Update tests * Linting * FixFaultInjectionRuleFailedToApplyPerPartitionInGatewayMode (#40005) * fix fault injection rule failed to apply per partition in gateway mode --------- Co-authored-by: annie-mac * azure-cosmos-test_1.0.0.beta.7Release (#40021) * release azure-cosmos-test 1.0.0.beta.7 --------- Co-authored-by: annie-mac --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac * [Cosmos][VectorSearch] Non Streaming Order By Query (#40096) * Initial changes * Initial changes * Increment versions for core releases (#40003) Increment package versions for core releases * Ensure ServiceBus session idle timeout fall back to retry-options::try-timeout (#39994) * Added Alpha3 Java Media Streaming Events (#40002) * Added Alpha3 Java Media Streaming Events * updating readme to add the media streaming events to remove model --------- Co-authored-by: Vinothini Dharmaraj * Update version of github-event-processor to 1.0.0-dev.20240502.2 (#40012) Co-authored-by: James Suplizio * Prepare May 2024 Identity Release (#40006) * Prepare Identity Broker May 2024 Release (#40014) * Increment package versions for identity releases (#40015) * [JobRouter] SDK Review updates (#40011) * SDK Review updates * Update auto-generated models * Add customization * Fix customization * Update package * Update tests * Linting * FixFaultInjectionRuleFailedToApplyPerPartitionInGatewayMode (#40005) * fix fault injection rule failed to apply per partition in gateway mode --------- Co-authored-by: annie-mac * azure-cosmos-test_1.0.0.beta.7Release (#40021) * release azure-cosmos-test 1.0.0.beta.7 --------- Co-authored-by: annie-mac * Fixed existsById API in ReactiveCosmosTemplate (#40022) * Fixed existsById API in ReactiveCosmosTemplate * Added changelog * Initial changes * Initial changes * Skip Recorded test and delete Event record until test proxy to work with Event recordings (#40029) Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> * Fix invalid CODEOWNERS (#40032) * Initial changes * ServiceBus: fix session tracing (#39962) * remove additional matrix * Fix session processing and disposition instrumentation * return matrix config * review suggestions * [Automation] Generate SDK based on TypeSpec 0.15.15 (#40048) * [CODEOWNERS] Updates for org changes (#40049) * [CODEOWNERS] Updates for org changes The focus of these changes is to remove an individual who no longer is responsible for the products which their GH account is associated to. * Move from using the docker image to java2docfx for docs validation (#39744) * Move from using the docker image to java2docfx for docs validation * Temporarily turn on docs processing for template libraries for testing * Actually install the rex validation tool * Fix the if not Test-Path statement * Update java2docfx version and add a couple of diagnostics output lines * Add missing close paren * Ensure that Sort-Object always returns an array even if there's only one item * add another piece of diagnostics output * trying one more thing * remove some diag, add other * Remove the additional diagnostics, add permanent output message * Invoke java -jar on java2docfx to show the help command to ensure the install is okay * fiddling with the java -jar command * Set the working directory to the java2docfx directory before executing the mvn dependency download * Actually create the directory before trying to set location...oops * Update rex validation to verify MAVEN_HOME is set * Updates for Java PR 39875 which had changes from this PR that were more immediate * Update java2docfx version * remove check for MAVEN_HOME which was only for testing * Update the version of java2docfx to test a fix * Update version of java2docfx to 1.0.4 * revert template's ci.yml changes that were only necessary to test java2docfx * owners (#39686) * Use ClientLogger in testing output (#40010) Use ClientLogger in testing output * Fix null pointer exception and context usage (#40053) * Rename AML to AzureMachineLearning (#40056) * Fixed the Key Vault `test-resources.json` file to properly configure a deployment script for certificate creation. (#40037) * Close response body in bearer policy (#40052) * Running Prepare-Release for azure-messaging-servicebus 7.17.0 (#40058) * mgmt, TypeSpec code generation pipeline (#39963) * typespec generation pipeline echo command PR_TITLE * generation typespec Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines Update generation.yml for Azure Pipelines * remove typespec pipeline file * fix pr title * address comments * Add codeowner linter owners (#39997) * Update to ESRP task version that supports federated auth (#40059) * Increment package versions for cosmos releases (#40031) * Update azure-sdk-build-tools Repository Resource Refs in Yaml files (#39627) * Add reduced embeddings sample to azure-search-documents (#40069) * Add reduced embeddings sample * Fix cspell * Fix link * Search May Preview Regen Updates (#40057) * Search May Preview Regeneration - Still need to add varargs convenience * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * adding varargs * Additional adjustments to FieldBuilder and Search Index Customizations * Updating cspell.json * Adjust `SearchScoreThreshold` customization Re-enable code generation in CI * Updates: - Updated Cspell - Rename `maxStoragePerIndex` property to `maxStoragePerIndexInBytes` in SearchServiceLimits - Set `hybridSearch` property to be type `HybridSearch` in SearchRequest - Add `hybridSearch` to SearchOptions and `SearchAsyncClient.createSearchRequest()` * Adding Support and testing byte[] and List within field builder * Fix linting --------- Co-authored-by: alzimmermsft <48699787+alzimmermsft@users.noreply.github.com> * Preparing Search May 2024 Beta Release (#40071) * Preparing Search May 2024 Beta Release * Preparing Search May 2024 Beta Release * Resolving comments * Fixing build issues * eng, update autorest.java, improve error output in sdk automation (#40073) * improve error output * autorest.java 4.1.29 * Merge to main after spring cloud azure 4.18.0 released (#40075) * Prepare for Spring Cloud Azure 4.18.0 release (#40063) * update version client * update version/changelog/readme * update changelog * Increment versions for spring releases (#40074) * Increment package versions for spring releases * Update version_client.txt * Update pom.xml --------- Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> * Miscellaneous Core performance improvements (#39552) Miscellaneous Core performance improvements * Increment package versions for search releases (#40072) * Update io.fabric8:kubernetes-client (#40086) 5.12.3 -> 6.12.1 * Increment package versions for servicebus releases (#40094) * Emit stable auto-instrumented otel metrics (#39960) * Update otel metrics logic * add runtime metrics * adding a few metrics I forgot * small correction * Update * Fix * Update * Delete pre-stable metrics --------- Co-authored-by: Harsimar Kaur (from Dev Box) --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac Co-authored-by: Kushagra Thapar Co-authored-by: minwoolee-msft <77083090+minwoolee-msft@users.noreply.github.com> Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> Co-authored-by: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Co-authored-by: Liudmila Molkova Co-authored-by: Jesse Squire Co-authored-by: Harsimar Kaur Co-authored-by: vcolin7 Co-authored-by: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Co-authored-by: Wes Haggard Co-authored-by: Patrick Hallisey Co-authored-by: Jair Myree Co-authored-by: Weidong Xu Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> Co-authored-by: Helen <56097766+heyams@users.noreply.github.com> Co-authored-by: Harsimar Kaur (from Dev Box) * Initial changes * Initial changes * Fixes --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac Co-authored-by: Kushagra Thapar Co-authored-by: minwoolee-msft <77083090+minwoolee-msft@users.noreply.github.com> Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> Co-authored-by: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Co-authored-by: Liudmila Molkova Co-authored-by: Jesse Squire Co-authored-by: Harsimar Kaur Co-authored-by: vcolin7 Co-authored-by: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Co-authored-by: Wes Haggard Co-authored-by: Patrick Hallisey Co-authored-by: Jair Myree Co-authored-by: Weidong Xu Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> Co-authored-by: Helen <56097766+heyams@users.noreply.github.com> Co-authored-by: Harsimar Kaur (from Dev Box) * Fixing some merge issues * Fixing some merge issues * Fixing some merge issues * Resolving comments --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Anu Thomas Chandy Co-authored-by: v-durgeshs <146056835+v-durgeshs@users.noreply.github.com> Co-authored-by: Vinothini Dharmaraj Co-authored-by: James Suplizio Co-authored-by: Bill Wert Co-authored-by: williamzhao87 Co-authored-by: Annie Liang <64233642+xinlian12@users.noreply.github.com> Co-authored-by: annie-mac Co-authored-by: Kushagra Thapar Co-authored-by: minwoolee-msft <77083090+minwoolee-msft@users.noreply.github.com> Co-authored-by: Min Woo Lee 🧊 <77083090+minwoolee-ms@users.noreply.github.com> Co-authored-by: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Co-authored-by: Liudmila Molkova Co-authored-by: Jesse Squire Co-authored-by: Harsimar Kaur Co-authored-by: vcolin7 Co-authored-by: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Co-authored-by: Wes Haggard Co-authored-by: Patrick Hallisey Co-authored-by: Jair Myree Co-authored-by: Weidong Xu Co-authored-by: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> Co-authored-by: Helen <56097766+heyams@users.noreply.github.com> Co-authored-by: Harsimar Kaur (from Dev Box) --- sdk/cosmos/azure-cosmos/CHANGELOG.md | 4 + .../azure/cosmos/implementation/Configs.java | 21 ++ .../CosmosQueryRequestOptionsImpl.java | 22 ++ .../ImplementationBridgeHelpers.java | 2 + .../DocumentQueryExecutionContextFactory.java | 41 ++- ...onStreamingOrderByBadRequestException.java | 20 ++ .../NonStreamingOrderByDocumentProducer.java | 43 +++ ...gOrderByDocumentQueryExecutionContext.java | 268 ++++++++++++++++++ .../query/NonStreamingOrderByUtils.java | 114 ++++++++ ...ParallelDocumentQueryExecutionContext.java | 3 +- ...ipelinedDocumentQueryExecutionContext.java | 21 +- .../PipelinedQueryExecutionContextBase.java | 3 +- .../implementation/query/QueryFeature.java | 3 +- .../implementation/query/QueryInfo.java | 6 + .../query/QueryPlanRetriever.java | 19 +- .../models/CosmosQueryRequestOptions.java | 25 ++ .../azure/cosmos/models/IndexingPolicy.java | 1 - .../azure-messaging-servicebus/CHANGELOG.md | 2 + 18 files changed, 605 insertions(+), 13 deletions(-) create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByBadRequestException.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentProducer.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java diff --git a/sdk/cosmos/azure-cosmos/CHANGELOG.md b/sdk/cosmos/azure-cosmos/CHANGELOG.md index 16cedfc04ef2..095a348589f6 100644 --- a/sdk/cosmos/azure-cosmos/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos/CHANGELOG.md @@ -7,6 +7,10 @@ * Added support for non-streaming OrderBy query and a query feature `NonStreamingOrderBy` to support Vector Search queries. - See [PR 39897](https://github.com/Azure/azure-sdk-for-java/pull/39897/) +* Added support for non-streaming OrderBy query and a query feature `NonStreamingOrderBy` to support Vector Search queries. - See [PR 39897](https://github.com/Azure/azure-sdk-for-java/pull/39897/) + +* Added support for non-streaming OrderBy query and a query feature `NonStreamingOrderBy` to support Vector Search queries. - See [PR 39897](https://github.com/Azure/azure-sdk-for-java/pull/39897/) + #### Breaking Changes #### Bugs Fixed diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java index da368de5360d..941cc81c1b8d 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java @@ -166,6 +166,13 @@ public class Configs { public static final String MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED = "COSMOS.MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED"; private static final int DEFAULT_MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED = 1; + private static final String MAX_ITEM_COUNT_FOR_VECTOR_SEARCH = "COSMOS.MAX_ITEM_SIZE_FOR_VECTOR_SEARCH"; + private static final int DEFAULT_MAX_ITEM_COUNT_FOR_VECTOR_SEARCH = 50000; + + private static final String AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY = "COSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY"; + + private static final boolean DEFAULT_AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY = false; + public static final int MIN_MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED = 1; public static final String TCP_CONNECTION_ACQUISITION_TIMEOUT_IN_MS = "COSMOS.TCP_CONNECTION_ACQUISITION_TIMEOUT_IN_MS"; @@ -484,6 +491,20 @@ public static int getMaxRetriesInLocalRegionWhenRemoteRegionPreferred() { MIN_MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED); } + public static int getMaxItemCountForVectorSearch() { + return Integer.parseInt(System.getProperty(MAX_ITEM_COUNT_FOR_VECTOR_SEARCH, + firstNonNull( + emptyToNull(System.getenv().get(MAX_ITEM_COUNT_FOR_VECTOR_SEARCH)), + String.valueOf(DEFAULT_MAX_ITEM_COUNT_FOR_VECTOR_SEARCH)))); + } + + public static boolean getAzureCosmosNonStreamingOrderByDisabled() { + return Boolean.parseBoolean(System.getProperty(AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY, + firstNonNull( + emptyToNull(System.getenv().get(AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY)), + String.valueOf(DEFAULT_AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY)))); + } + public static Duration getMinRetryTimeInLocalRegionWhenRemoteRegionPreferred() { return Duration.ofMillis(Math.max( diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java index 4dc62089acc5..bd30ee28382e 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java @@ -25,6 +25,7 @@ public final class CosmosQueryRequestOptionsImpl extends CosmosQueryRequestOptio private boolean queryPlanRetrievalDisallowed; private boolean emptyPageDiagnosticsEnabled; private String queryName; + private Integer maxItemCountForVectorSearch; private List cancelledRequestDiagnosticsTracker = new ArrayList<>(); /** @@ -62,6 +63,7 @@ public CosmosQueryRequestOptionsImpl(CosmosQueryRequestOptionsImpl options) { this.queryName = options.queryName; this.feedRange = options.feedRange; this.cancelledRequestDiagnosticsTracker = options.cancelledRequestDiagnosticsTracker; + this.maxItemCountForVectorSearch = options.maxItemCountForVectorSearch; } /** @@ -196,6 +198,26 @@ public CosmosQueryRequestOptionsImpl setMaxItemCount(Integer maxItemCount) { return this; } + /** + * Gets the maximum item size to fetch during non-streaming order by queries. + * + * @return the max number of items for vector search. + */ + public Integer getMaxItemCountForVectorSearch() { + return this.maxItemCountForVectorSearch; + } + + /** + * Sets the maximum item size to fetch during non-streaming order by queries. + * + * @param maxItemCountForVectorSearch the max number of items for vector search. + * return the CosmosQueryRequestOptions. + */ + public CosmosQueryRequestOptionsImpl setMaxItemCountForVectorSearch(Integer maxItemCountForVectorSearch) { + this.maxItemCountForVectorSearch = maxItemCountForVectorSearch; + return this; + } + /** * Gets the request continuation token. * diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/ImplementationBridgeHelpers.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/ImplementationBridgeHelpers.java index db2bfd16f871..16b8f5ef39b5 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/ImplementationBridgeHelpers.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/ImplementationBridgeHelpers.java @@ -281,6 +281,8 @@ void setCancelledRequestDiagnosticsTracker( Integer getMaxItemCount(CosmosQueryRequestOptions options); String getRequestContinuation(CosmosQueryRequestOptions options); + + Integer getMaxItemCountForVectorSearch(CosmosQueryRequestOptions options); } } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java index c9f1c19cb126..8e5dd07bf5a9 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java @@ -50,6 +50,12 @@ */ public class DocumentQueryExecutionContextFactory { + private static final ImplementationBridgeHelpers + .CosmosQueryRequestOptionsHelper + .CosmosQueryRequestOptionsAccessor qryOptAccessor = ImplementationBridgeHelpers + .CosmosQueryRequestOptionsHelper + .getCosmosQueryRequestOptionsAccessor(); + private final static int PageSizeFactorForTop = 5; private static final Logger logger = LoggerFactory.getLogger(DocumentQueryExecutionContextFactory.class); private static Mono> resolveCollection(DiagnosticsClientContext diagnosticsClientContext, @@ -241,7 +247,8 @@ private static boolean canCacheQuery(QueryInfo queryInfo) { && !queryInfo.hasTop() && !queryInfo.hasOffset() && !queryInfo.hasDCount() - && !queryInfo.hasOrderBy(); + && !queryInfo.hasOrderBy() + && !queryInfo.hasNonStreamingOrderBy(); } private static boolean isScopedToSinglePartition(CosmosQueryRequestOptions cosmosQueryRequestOptions) { @@ -360,6 +367,38 @@ public static Flux> createSpecia boolean getLazyFeedResponse = queryInfo.hasTop(); + // We need to compute the optimal initial age size for non-streaming order-by queries + if (queryInfo.hasNonStreamingOrderBy()) { + // Validate the TOP or LIMIT for non-streaming order-by queries + if (!queryInfo.hasTop() && !queryInfo.hasLimit() && queryInfo.getTop() < 0 && queryInfo.getLimit() < 0) { + throw new NonStreamingOrderByBadRequestException(HttpConstants.StatusCodes.BADREQUEST, + "Executing a vector search query without TOP or LIMIT can consume a large number of RUs" + + "very fast and have long runtimes. Please ensure you are using one of the above two filters" + + "with you vector search query."); + } + // Validate the size of TOP or LIMIT against MaxItemSizeForVectorSearch + int maxLimit = Math.max(queryInfo.hasTop() ? queryInfo.getTop() : 0, + queryInfo.hasLimit() ? queryInfo.getLimit() : 0); + int maxItemSizeForVectorSearch = Math.max(Configs.getMaxItemCountForVectorSearch(), + qryOptAccessor.getMaxItemCountForVectorSearch(cosmosQueryRequestOptions)); + if (maxLimit > maxItemSizeForVectorSearch) { + throw new NonStreamingOrderByBadRequestException(HttpConstants.StatusCodes.BADREQUEST, + "Executing a vector search query with TOP or LIMIT larger than the maxItemSizeForVectorSearch " + + "is not allowed"); + } + // Set initialPageSize based on the smallest of TOP or LIMIT + if (queryInfo.hasTop() || queryInfo.hasLimit()) { + int pageSizeWithTopOrLimit = Math.min(queryInfo.hasTop() ? queryInfo.getTop() : Integer.MAX_VALUE, + queryInfo.hasLimit() && queryInfo.hasOffset() ? + queryInfo.getLimit() + queryInfo.getOffset() : Integer.MAX_VALUE); + if (initialPageSize > 0) { + initialPageSize = Math.min(pageSizeWithTopOrLimit, initialPageSize); + } else { + initialPageSize = pageSizeWithTopOrLimit; + } + } + } + // We need to compute the optimal initial page size for order-by queries if (queryInfo.hasOrderBy()) { int top; diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByBadRequestException.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByBadRequestException.java new file mode 100644 index 000000000000..4b3b41fbc675 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByBadRequestException.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.cosmos.implementation.query; + +import com.azure.cosmos.CosmosException; + +public class NonStreamingOrderByBadRequestException extends CosmosException { + + private static final long serialVersionUID = 1L; + + /** + * Creates a new instance of the NonStreamingOrderByBadRequestException class. + * + * @param statusCode the http status code of the response. + * @param errorMessage the error message. + */ + public NonStreamingOrderByBadRequestException(int statusCode, String errorMessage) { + super(statusCode, errorMessage); + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentProducer.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentProducer.java new file mode 100644 index 000000000000..c64ef5d1fbda --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentProducer.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.implementation.query; + +import com.azure.cosmos.implementation.Document; +import com.azure.cosmos.implementation.DocumentClientRetryPolicy; +import com.azure.cosmos.implementation.RxDocumentServiceRequest; +import com.azure.cosmos.implementation.feedranges.FeedRangeEpkImpl; +import com.azure.cosmos.implementation.query.orderbyquery.OrderbyRowComparer; +import com.azure.cosmos.models.CosmosQueryRequestOptions; +import com.azure.cosmos.models.FeedResponse; +import reactor.core.publisher.Mono; + +import java.util.UUID; +import java.util.function.Function; +import java.util.function.Supplier; + +public class NonStreamingOrderByDocumentProducer extends DocumentProducer { + private final OrderbyRowComparer consumeComparer; + + NonStreamingOrderByDocumentProducer( + OrderbyRowComparer consumeComparer, + IDocumentQueryClient client, + String collectionResourceId, + CosmosQueryRequestOptions cosmosQueryRequestOptions, + TriFunction createRequestFunc, + Function>> executeRequestFunc, + FeedRangeEpkImpl feedRange, + String collectionLink, + Supplier createRetryPolicyFunc, + Class resourceType, + UUID correlatedActivityId, + int initialPageSize, + String initialContinuationToken, + int top, + Supplier operationContextTextProvider) { + super(client, collectionResourceId, cosmosQueryRequestOptions, createRequestFunc, executeRequestFunc, + collectionLink, createRetryPolicyFunc, resourceType, correlatedActivityId, initialPageSize, + initialContinuationToken, top, feedRange, operationContextTextProvider); + this.consumeComparer = consumeComparer; + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java new file mode 100644 index 000000000000..2f3abb36e9d1 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.implementation.query; + +import com.azure.cosmos.BridgeInternal; +import com.azure.cosmos.CosmosException; +import com.azure.cosmos.implementation.ClientSideRequestStatistics; +import com.azure.cosmos.implementation.DiagnosticsClientContext; +import com.azure.cosmos.implementation.Document; +import com.azure.cosmos.implementation.DocumentClientRetryPolicy; +import com.azure.cosmos.implementation.DocumentCollection; +import com.azure.cosmos.implementation.HttpConstants; +import com.azure.cosmos.implementation.ImplementationBridgeHelpers; +import com.azure.cosmos.implementation.QueryMetrics; +import com.azure.cosmos.implementation.RequestChargeTracker; +import com.azure.cosmos.implementation.ResourceType; +import com.azure.cosmos.implementation.RxDocumentServiceRequest; +import com.azure.cosmos.implementation.Utils; +import com.azure.cosmos.implementation.feedranges.FeedRangeEpkImpl; +import com.azure.cosmos.implementation.query.orderbyquery.OrderByRowResult; +import com.azure.cosmos.implementation.query.orderbyquery.OrderbyRowComparer; +import com.azure.cosmos.models.CosmosQueryRequestOptions; +import com.azure.cosmos.models.FeedResponse; +import com.azure.cosmos.models.ModelBridgeInternal; +import com.azure.cosmos.models.SqlQuerySpec; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +public class NonStreamingOrderByDocumentQueryExecutionContext + extends ParallelDocumentQueryExecutionContextBase { + + private final static + ImplementationBridgeHelpers.CosmosDiagnosticsHelper.CosmosDiagnosticsAccessor diagnosticsAccessor = + ImplementationBridgeHelpers.CosmosDiagnosticsHelper.getCosmosDiagnosticsAccessor(); + + private static final ImplementationBridgeHelpers.FeedResponseHelper.FeedResponseAccessor feedResponseAccessor = + ImplementationBridgeHelpers.FeedResponseHelper.getFeedResponseAccessor(); + + private final static String FormatPlaceHolder = "{documentdb-formattableorderbyquery-filter}"; + private final static String True = "true"; + + private final OrderbyRowComparer consumeComparer; + private final RequestChargeTracker tracker; + private final ConcurrentMap queryMetricMap; + private final Collection clientSideRequestStatistics; + private Flux> orderByObservable; + + private int maxPageSizePerPartition; + + public NonStreamingOrderByDocumentQueryExecutionContext( + DiagnosticsClientContext diagnosticsClientContext, + IDocumentQueryClient client, + ResourceType resourceTypeEnum, + SqlQuerySpec query, + CosmosQueryRequestOptions cosmosQueryRequestOptions, + String resourceLink, + String rewrittenQuery, + OrderbyRowComparer consumeComparer, + UUID correlatedActivityId, + boolean hasSelectValue, + final AtomicBoolean isQueryCancelledOnTimeout) { + super(diagnosticsClientContext, client, resourceTypeEnum, Document.class, query, cosmosQueryRequestOptions, + resourceLink, rewrittenQuery, correlatedActivityId, hasSelectValue, isQueryCancelledOnTimeout); + this.consumeComparer = consumeComparer; + this.tracker = new RequestChargeTracker(); + this.queryMetricMap = new ConcurrentHashMap<>(); + this.clientSideRequestStatistics = ConcurrentHashMap.newKeySet(); + } + + public static Flux> createAsync( + DiagnosticsClientContext diagnosticsClientContext, + IDocumentQueryClient client, + PipelinedDocumentQueryParams initParams, + DocumentCollection collection) { + + QueryInfo queryInfo = initParams.getQueryInfo(); + + NonStreamingOrderByDocumentQueryExecutionContext context = new NonStreamingOrderByDocumentQueryExecutionContext( + diagnosticsClientContext, + client, + initParams.getResourceTypeEnum(), + initParams.getQuery(), + initParams.getCosmosQueryRequestOptions(), + initParams.getResourceLink(), + initParams.getQueryInfo().getRewrittenQuery(), + new OrderbyRowComparer<>(queryInfo.getOrderBy()), + initParams.getCorrelatedActivityId(), + queryInfo.hasSelectValue(), + initParams.isQueryCancelledOnTimeout()); + + context.setTop(initParams.getTop()); + + try { + context.initialize( + initParams.getFeedRanges(), + initParams.getQueryInfo().getOrderBy(), + initParams.getQueryInfo().getOrderByExpressions(), + initParams.getInitialPageSize(), + collection); + + return Flux.just(context); + } catch (CosmosException dce) { + return Flux.error(dce); + } + } + + private void initialize( + List feedRanges, List sortOrders, + Collection orderByExpressions, + int initialPageSize, + DocumentCollection collection) throws CosmosException { + // Since the continuation token will always be null, + // we don't need to handle any initialization based on continuationToken. + // We can directly initialize without any consideration for continuationToken. + Map partitionKeyRangeToContinuationToken = new HashMap<>(); + for (FeedRangeEpkImpl feedRangeEpk : feedRanges) { + partitionKeyRangeToContinuationToken.put(feedRangeEpk, + null); + } + super.initialize(collection, + partitionKeyRangeToContinuationToken, + initialPageSize, + new SqlQuerySpec(querySpec.getQueryText().replace(FormatPlaceHolder, True), + querySpec.getParameters())); + + orderByObservable = NonStreamingOrderByUtils.nonStreamingOrderedMerge( + consumeComparer, + tracker, + documentProducers, + initialPageSize, + queryMetricMap, + clientSideRequestStatistics); + } + + @Override + protected NonStreamingOrderByDocumentProducer createDocumentProducer( + String collectionRid, + String continuationToken, + int initialPageSize, + CosmosQueryRequestOptions cosmosQueryRequestOptions, + SqlQuerySpec querySpecForInit, + Map commonRequestHeaders, + TriFunction createRequestFunc, + Function>> executeFunc, + Supplier createRetryPolicyFunc, + FeedRangeEpkImpl feedRange) { + return new NonStreamingOrderByDocumentProducer( + consumeComparer, + client, + collectionRid, + cosmosQueryRequestOptions, + createRequestFunc, + executeFunc, + feedRange, + collectionRid, + createRetryPolicyFunc, + Document.class, + correlatedActivityId, + maxPageSizePerPartition, + continuationToken, + top, + this.getOperationContextTextProvider()); + } + + @Override + public Flux> drainAsync(int maxPageSize) { + return this.orderByObservable.transformDeferred(new ItemToPageTransformer(tracker, + maxPageSize, + this.queryMetricMap, + this.clientSideRequestStatistics)); + } + + @Override + public Flux> executeAsync() { + return drainAsync(ModelBridgeInternal.getMaxItemCountFromQueryRequestOptions(cosmosQueryRequestOptions)); + } + + private static class ItemToPageTransformer implements + Function>, Flux>> { + private final static int DEFAULT_PAGE_SIZE = 100; + private final RequestChargeTracker tracker; + private final int maxPageSize; + private final ConcurrentMap queryMetricMap; + private final Collection clientSideRequestStatistics; + + public ItemToPageTransformer(RequestChargeTracker tracker, + int maxPageSize, + ConcurrentMap queryMetricsMap, + Collection clientSideRequestStatistics) { + this.tracker = tracker; + this.maxPageSize = maxPageSize > 0 ? maxPageSize : DEFAULT_PAGE_SIZE; + this.queryMetricMap = queryMetricsMap; + this.clientSideRequestStatistics = clientSideRequestStatistics; + } + + private static Map headerResponse(double requestCharge) { + return Utils.immutableMapOf(HttpConstants.HttpHeaders.REQUEST_CHARGE, String.valueOf(requestCharge)); + } + + @Override + public Flux> apply(Flux> source) { + return source + .window(maxPageSize).map(Flux::collectList) + .flatMap(resultListObs -> resultListObs, 1) + .map(orderByRowResults -> { + // construct a page from result with request charge + FeedResponse> feedResponse = feedResponseAccessor.createFeedResponse( + orderByRowResults, + headerResponse(tracker.getAndResetCharge()), + null); + if (!queryMetricMap.isEmpty()) { + for (Map.Entry entry : queryMetricMap.entrySet()) { + BridgeInternal.putQueryMetricsIntoMap(feedResponse, + entry.getKey(), + entry.getValue()); + } + } + return feedResponse; + }) + .concatWith(Flux.defer(() -> { + return Flux.just(feedResponseAccessor.createFeedResponse(Utils.immutableListOf(), + null, null)); + })) + .map(feedOfOrderByRowResults -> { + List unwrappedResults = new ArrayList<>(); + for (OrderByRowResult orderByRowResult : feedOfOrderByRowResults.getResults()) { + unwrappedResults.add(orderByRowResult.getPayload()); + } + FeedResponse feedResponse = BridgeInternal.createFeedResponseWithQueryMetrics(unwrappedResults, + feedOfOrderByRowResults.getResponseHeaders(), + BridgeInternal.queryMetricsFromFeedResponse(feedOfOrderByRowResults), + ModelBridgeInternal.getQueryPlanDiagnosticsContext(feedOfOrderByRowResults), + false, + false, feedOfOrderByRowResults.getCosmosDiagnostics()); + diagnosticsAccessor.addClientSideDiagnosticsToFeed( + feedResponse.getCosmosDiagnostics(), clientSideRequestStatistics); + return feedResponse; + }).switchIfEmpty(Flux.defer(() -> { + // create an empty page if there is no result + FeedResponse frp = BridgeInternal.createFeedResponseWithQueryMetrics(Utils.immutableListOf(), + headerResponse( + tracker.getAndResetCharge()), + queryMetricMap, + null, + false, + false, + null); + diagnosticsAccessor.addClientSideDiagnosticsToFeed( + frp.getCosmosDiagnostics(), clientSideRequestStatistics); + return Flux.just(frp); + })); + } + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java new file mode 100644 index 000000000000..b4ac33a1dbc2 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.cosmos.implementation.query; + +import com.azure.cosmos.BridgeInternal; +import com.azure.cosmos.implementation.ClientSideRequestStatistics; +import com.azure.cosmos.implementation.Configs; +import com.azure.cosmos.implementation.Document; +import com.azure.cosmos.implementation.ImplementationBridgeHelpers; +import com.azure.cosmos.implementation.QueryMetrics; +import com.azure.cosmos.implementation.RequestChargeTracker; +import com.azure.cosmos.implementation.Resource; +import com.azure.cosmos.implementation.query.orderbyquery.OrderByRowResult; +import com.azure.cosmos.implementation.query.orderbyquery.OrderbyRowComparer; +import reactor.core.publisher.Flux; + +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.concurrent.PriorityBlockingQueue; +import java.util.function.Function; + +public class NonStreamingOrderByUtils { + private final static + ImplementationBridgeHelpers.CosmosDiagnosticsHelper.CosmosDiagnosticsAccessor diagnosticsAccessor = + ImplementationBridgeHelpers.CosmosDiagnosticsHelper.getCosmosDiagnosticsAccessor(); + + public static Flux> nonStreamingOrderedMerge(OrderbyRowComparer consumeComparer, + RequestChargeTracker tracker, + List> documentProducers, + int initialPageSize, + Map queryMetricsMap, + Collection clientSideRequestStatistics) { + @SuppressWarnings("unchecked") + Flux>[] fluxes = documentProducers + .subList(0, documentProducers.size()) + .stream() + .map(producer -> + toNonStreamingOrderByQueryResultObservable(producer, tracker, queryMetricsMap, initialPageSize, + consumeComparer, clientSideRequestStatistics)) + .toArray(Flux[]::new); + return Flux.mergeComparingDelayError(1,consumeComparer, fluxes); + } + + private static Flux> toNonStreamingOrderByQueryResultObservable(DocumentProducer producer, + RequestChargeTracker tracker, + Map queryMetricsMap, + int initialPageSize, + OrderbyRowComparer consumeComparer, + Collection clientSideRequestStatisticsList) { + return producer + .produceAsync() + .transformDeferred(new NonStreamingOrderByUtils.PageToItemTransformer(tracker, queryMetricsMap, initialPageSize, + consumeComparer, clientSideRequestStatisticsList)); + } + + private static class PageToItemTransformer implements + Function.DocumentProducerFeedResponse>, Flux>> { + private final RequestChargeTracker tracker; + private final Map queryMetricsMap; + private final Integer initialPageSize; + private final OrderbyRowComparer consumeComparer; + private final Collection clientSideRequestStatistics; + + private PageToItemTransformer(RequestChargeTracker tracker, Map queryMetricsMap, + Integer initialPageSize, OrderbyRowComparer consumeComparer, + Collection clientSideRequestStatistics) { + this.tracker = tracker; + this.queryMetricsMap = queryMetricsMap; + this.initialPageSize = initialPageSize; + this.consumeComparer = consumeComparer; + this.clientSideRequestStatistics = clientSideRequestStatistics; + } + + @Override + public Flux> apply(Flux.DocumentProducerFeedResponse> source) { + // the size of the priority queue is set to size+1, because when the pq reaches the max size we add that + // item and then remove the element. If we don't do this, then when adding this element the size of the pq + // will be increased automatically by 50% and then there would be inconsistent results for later pages. + PriorityBlockingQueue> priorityQueue = new PriorityBlockingQueue<>(initialPageSize + 1, consumeComparer); + + return source.flatMap(documentProducerFeedResponse -> { + clientSideRequestStatistics.addAll( + diagnosticsAccessor.getClientSideRequestStatisticsForQueryPipelineAggregations(documentProducerFeedResponse + .pageResult.getCosmosDiagnostics())); + + QueryMetrics.mergeQueryMetricsMap(queryMetricsMap, + BridgeInternal.queryMetricsFromFeedResponse(documentProducerFeedResponse.pageResult)); + List results = documentProducerFeedResponse.pageResult.getResults(); + results.forEach(r -> { + OrderByRowResult orderByRowResult = new OrderByRowResult( + r.toJson(), + documentProducerFeedResponse.sourceFeedRange, + null); + if (Configs.getMaxItemSizeForVectorSearchEnabled()) { + if (priorityQueue.size() < initialPageSize) { + priorityQueue.add(orderByRowResult); + } else { + priorityQueue.add(orderByRowResult); + priorityQueue.poll(); + } + } else { + priorityQueue.add(orderByRowResult); + } + + }); + tracker.addCharge(documentProducerFeedResponse.pageResult.getRequestCharge()); + // Returning an empty Flux since we are only processing and managing state here + return Flux.empty(); + }, 1) + .thenMany(Flux.defer(() -> Flux.fromIterable(priorityQueue))); + } + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/ParallelDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/ParallelDocumentQueryExecutionContext.java index 020b8633d2be..6ed30d3a7fbe 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/ParallelDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/ParallelDocumentQueryExecutionContext.java @@ -106,7 +106,8 @@ public static Flux> createAsync( || queryInfo.hasAggregates() || queryInfo.hasGroupBy() || queryInfo.hasDCount() - || queryInfo.hasDistinct()), + || queryInfo.hasDistinct() + || queryInfo.hasNonStreamingOrderBy()), initParams.isQueryCancelledOnTimeout()); context.setTop(initParams.getTop()); diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java index 3f3e1795ac6b..82746ad412b5 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java @@ -56,12 +56,21 @@ private static BiFunction, Flux { CosmosQueryRequestOptions orderByCosmosQueryRequestOptions = qryOptAccessor.clone(requestOptions); - ModelBridgeInternal.setQueryRequestOptionsContinuationToken(orderByCosmosQueryRequestOptions, continuationToken); - qryOptAccessor.getImpl(orderByCosmosQueryRequestOptions).setCustomItemSerializer(null); - - documentQueryParams.setCosmosQueryRequestOptions(orderByCosmosQueryRequestOptions); - - return OrderByDocumentQueryExecutionContext.createAsync(diagnosticsClientContext, client, documentQueryParams, collection); + if (queryInfo.hasNonStreamingOrderBy()) { + if (continuationToken != null) { + throw new NonStreamingOrderByBadRequestException( + HttpConstants.StatusCodes.BADREQUEST, + "Can not use a continuation token for a vector search query"); + } + qryOptAccessor.getImpl(orderByCosmosQueryRequestOptions).setCustomItemSerializer(null); + documentQueryParams.setCosmosQueryRequestOptions(orderByCosmosQueryRequestOptions); + return NonStreamingOrderByDocumentQueryExecutionContext.createAsync(diagnosticsClientContext, client, documentQueryParams, collection); + } else { + ModelBridgeInternal.setQueryRequestOptionsContinuationToken(orderByCosmosQueryRequestOptions, continuationToken); + qryOptAccessor.getImpl(orderByCosmosQueryRequestOptions).setCustomItemSerializer(null); + documentQueryParams.setCosmosQueryRequestOptions(orderByCosmosQueryRequestOptions); + return OrderByDocumentQueryExecutionContext.createAsync(diagnosticsClientContext, client, documentQueryParams, collection); + } }; } else { diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContextBase.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContextBase.java index 232f942b8590..39c6c27efad8 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContextBase.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedQueryExecutionContextBase.java @@ -63,7 +63,8 @@ public static Flux> createAsync( || queryInfo.hasAggregates() || queryInfo.hasGroupBy() || queryInfo.hasDCount() - || queryInfo.hasDistinct()) { + || queryInfo.hasDistinct() + || queryInfo.hasNonStreamingOrderBy()) { return PipelinedDocumentQueryExecutionContext.createAsyncCore( diagnosticsClientContext, diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryFeature.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryFeature.java index ce2b4865767c..1dd3e5928b92 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryFeature.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryFeature.java @@ -14,5 +14,6 @@ public enum QueryFeature { OrderBy, Top, NonValueAggregate, - DCount + DCount, + NonStreamingOrderBy } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryInfo.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryInfo.java index 65efb92c3325..48870a5ae52d 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryInfo.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryInfo.java @@ -36,6 +36,7 @@ public final class QueryInfo extends JsonSerializable { private DistinctQueryType distinctQueryType; private QueryPlanDiagnosticsContext queryPlanDiagnosticsContext; private DCountInfo dCountInfo; + private boolean nonStreamingOrderBy; public QueryInfo() { } @@ -160,6 +161,11 @@ public boolean hasGroupBy() { return groupByExpressions != null && !groupByExpressions.isEmpty(); } + public boolean hasNonStreamingOrderBy() { + this.nonStreamingOrderBy = Boolean.TRUE.equals(super.getBoolean("hasNonStreamingOrderBy")); + return this.nonStreamingOrderBy; + } + public Map getGroupByAliasToAggregateType(){ Map groupByAliasToAggregateMap; groupByAliasToAggregateMap = super.getMap("groupByAliasToAggregateType"); diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryPlanRetriever.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryPlanRetriever.java index ce91ff2029e9..fb79a316c445 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryPlanRetriever.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryPlanRetriever.java @@ -5,6 +5,7 @@ import com.azure.cosmos.BridgeInternal; import com.azure.cosmos.CosmosEndToEndOperationLatencyPolicyConfig; +import com.azure.cosmos.implementation.Configs; import com.azure.cosmos.implementation.DiagnosticsClientContext; import com.azure.cosmos.implementation.ImplementationBridgeHelpers; import com.azure.cosmos.implementation.routing.PartitionKeyInternal; @@ -43,7 +44,20 @@ class QueryPlanRetriever { QueryFeature.GroupBy.name() + ", " + QueryFeature.Top.name() + ", " + QueryFeature.DCount.name() + ", " + - QueryFeature.NonValueAggregate.name(); + QueryFeature.NonValueAggregate.name() + ", " + + QueryFeature.NonStreamingOrderBy.name(); + + private static final String OLD_SUPPORTED_QUERY_FEATURES = QueryFeature.Aggregate.name() + ", " + + QueryFeature.CompositeAggregate.name() + ", " + + QueryFeature.MultipleOrderBy.name() + ", " + + QueryFeature.MultipleAggregates.name() + ", " + + QueryFeature.OrderBy.name() + ", " + + QueryFeature.OffsetAndLimit.name() + ", " + + QueryFeature.Distinct.name() + ", " + + QueryFeature.GroupBy.name() + ", " + + QueryFeature.Top.name() + ", " + + QueryFeature.DCount.name() + ", " + + QueryFeature.NonValueAggregate.name(); static Mono getQueryPlanThroughGatewayAsync(DiagnosticsClientContext diagnosticsClientContext, IDocumentQueryClient queryClient, @@ -61,7 +75,8 @@ static Mono getQueryPlanThroughGatewayAsync(Diagn final Map requestHeaders = new HashMap<>(); requestHeaders.put(HttpConstants.HttpHeaders.CONTENT_TYPE, RuntimeConstants.MediaTypes.JSON); requestHeaders.put(HttpConstants.HttpHeaders.IS_QUERY_PLAN_REQUEST, TRUE); - requestHeaders.put(HttpConstants.HttpHeaders.SUPPORTED_QUERY_FEATURES, SUPPORTED_QUERY_FEATURES); + requestHeaders.put(HttpConstants.HttpHeaders.SUPPORTED_QUERY_FEATURES, + Configs.getAzureCosmosNonStreamingOrderByDisabled() ? OLD_SUPPORTED_QUERY_FEATURES : SUPPORTED_QUERY_FEATURES); requestHeaders.put(HttpConstants.HttpHeaders.QUERY_VERSION, HttpConstants.Versions.QUERY_VERSION); if (partitionKey != null && partitionKey != PartitionKey.NONE) { diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java index c9bf3909fd5d..856dee68b563 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java @@ -256,6 +256,26 @@ CosmosQueryRequestOptions setMaxItemCount(Integer maxItemCount) { return this; } + /** + * Gets the maximum item size to fetch during non-streaming order by queries. + * + * @return the max number of items for vector search. + */ + Integer getMaxItemCountForVectorSearch() { + return this.actualRequestOptions.getMaxItemCountForVectorSearch(); + } + + /** + * Sets the maximum item size to fetch during non-streaming order by queries. + * + * @param maxItemCountForVectorSearch the max number of items for vector search. + * @return the CosmosQueryRequestOptions. + */ + CosmosQueryRequestOptions setMaxItemCountForVectorSearch(Integer maxItemCountForVectorSearch) { + this.actualRequestOptions.setMaxItemCountForVectorSearch(maxItemCountForVectorSearch); + return this; + } + /** * Gets the request continuation token. * @@ -603,6 +623,11 @@ public Integer getMaxItemCount(CosmosQueryRequestOptions options) { public String getRequestContinuation(CosmosQueryRequestOptions options) { return options.getRequestContinuation(); } + + @Override + public Integer getMaxItemCountForVectorSearch(CosmosQueryRequestOptions options) { + return options.getMaxItemCountForVectorSearch(); + } }); } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java index 530557cad90f..3077fb67f3ab 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java @@ -20,7 +20,6 @@ */ public final class IndexingPolicy { private static final String DEFAULT_PATH = "/*"; - private List includedPaths; private List excludedPaths; private List> compositeIndexes; diff --git a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md index 6d699b6e17bd..34f6139030e7 100644 --- a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md @@ -7,6 +7,8 @@ ### Breaking Changes ### Bugs Fixed +- Fixes the session message disposition to use management node as fall back. ([#39913](https://github.com/Azure/azure-sdk-for-java/issues/ 39913)) +- Fixes the session processor idle timeout to fall back to RetryOptions::tryTimeout. ([#39993](https://github.com/Azure/azure-sdk-for-java/issues/39993)) ### Other Changes From dd9d13baf2285c420e8894a2c67a833d302f4c99 Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Tue, 14 May 2024 15:21:13 -0700 Subject: [PATCH 22/33] Fixing build issue --- .../cosmos/implementation/query/NonStreamingOrderByUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java index b4ac33a1dbc2..b0010d1fac54 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java @@ -92,7 +92,7 @@ public Flux> apply(Flux.Do r.toJson(), documentProducerFeedResponse.sourceFeedRange, null); - if (Configs.getMaxItemSizeForVectorSearchEnabled()) { + if (!Configs.getAzureCosmosNonStreamingOrderByDisabled()) { if (priorityQueue.size() < initialPageSize) { priorityQueue.add(orderByRowResult); } else { From 9eb9208a49d555528ee209966eae03da0887f1dc Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Tue, 14 May 2024 15:44:51 -0700 Subject: [PATCH 23/33] Fixing build issue --- .../src/main/java/com/azure/cosmos/implementation/Configs.java | 2 +- .../cosmos/implementation/CosmosQueryRequestOptionsImpl.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java index 941cc81c1b8d..cccc438017b7 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java @@ -167,7 +167,7 @@ public class Configs { private static final int DEFAULT_MAX_RETRIES_IN_LOCAL_REGION_WHEN_REMOTE_REGION_PREFERRED = 1; private static final String MAX_ITEM_COUNT_FOR_VECTOR_SEARCH = "COSMOS.MAX_ITEM_SIZE_FOR_VECTOR_SEARCH"; - private static final int DEFAULT_MAX_ITEM_COUNT_FOR_VECTOR_SEARCH = 50000; + public static final int DEFAULT_MAX_ITEM_COUNT_FOR_VECTOR_SEARCH = 50000; private static final String AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY = "COSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY"; diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java index bd30ee28382e..b3e28b32617b 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosQueryRequestOptionsImpl.java @@ -204,6 +204,9 @@ public CosmosQueryRequestOptionsImpl setMaxItemCount(Integer maxItemCount) { * @return the max number of items for vector search. */ public Integer getMaxItemCountForVectorSearch() { + if (this.maxItemCountForVectorSearch == null) { + this.maxItemCountForVectorSearch = Configs.DEFAULT_MAX_ITEM_COUNT_FOR_VECTOR_SEARCH; + } return this.maxItemCountForVectorSearch; } From 943cc4cd0c846b65233dc6e186a31499374e96d4 Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Wed, 15 May 2024 21:07:02 -0700 Subject: [PATCH 24/33] Adding tests --- ...StreamingOrderByQueryVectorSearchTest.java | 296 ++++++++++++++++++ ...ipelinedDocumentQueryExecutionContext.java | 2 - .../models/CosmosQueryRequestOptions.java | 7 +- .../azure/cosmos/models/IndexingPolicy.java | 1 + .../azure-messaging-servicebus/CHANGELOG.md | 2 - 5 files changed, 301 insertions(+), 7 deletions(-) create mode 100644 sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/NonStreamingOrderByQueryVectorSearchTest.java diff --git a/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/NonStreamingOrderByQueryVectorSearchTest.java b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/NonStreamingOrderByQueryVectorSearchTest.java new file mode 100644 index 000000000000..d7afd19d06fd --- /dev/null +++ b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/NonStreamingOrderByQueryVectorSearchTest.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.rx; + +import com.azure.cosmos.ConsistencyLevel; +import com.azure.cosmos.CosmosAsyncClient; +import com.azure.cosmos.CosmosAsyncContainer; +import com.azure.cosmos.CosmosAsyncDatabase; +import com.azure.cosmos.CosmosClientBuilder; +import com.azure.cosmos.CosmosDatabaseForTest; +import com.azure.cosmos.DirectConnectionConfig; +import com.azure.cosmos.implementation.TestConfigurations; +import com.azure.cosmos.models.CosmosContainerProperties; +import com.azure.cosmos.models.CosmosQueryRequestOptions; +import com.azure.cosmos.models.CosmosVectorDataType; +import com.azure.cosmos.models.CosmosVectorDistanceFunction; +import com.azure.cosmos.models.CosmosVectorEmbedding; +import com.azure.cosmos.models.CosmosVectorEmbeddingPolicy; +import com.azure.cosmos.models.CosmosVectorIndexSpec; +import com.azure.cosmos.models.CosmosVectorIndexType; +import com.azure.cosmos.models.IncludedPath; +import com.azure.cosmos.models.IndexingMode; +import com.azure.cosmos.models.IndexingPolicy; +import com.azure.cosmos.models.PartitionKeyDefinition; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import reactor.core.publisher.Flux; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.UUID; + +import static com.azure.cosmos.rx.TestSuiteBase.createDatabase; +import static com.azure.cosmos.rx.TestSuiteBase.safeClose; +import static com.azure.cosmos.rx.TestSuiteBase.safeDeleteDatabase; +import static org.assertj.core.api.Assertions.assertThat; + +//@Ignore("TODO: Ignore these test cases until the public emulator with vector indexes is released.") +public class NonStreamingOrderByQueryVectorSearchTest { + protected static final int TIMEOUT = 30000; + protected static final int SETUP_TIMEOUT = 20000; + protected static final int SHUTDOWN_TIMEOUT = 20000; + + protected static Logger logger = LoggerFactory.getLogger(NonStreamingOrderByQueryVectorSearchTest.class.getSimpleName()); + + private final String databaseId = CosmosDatabaseForTest.generateId(); + private final String flatContainerId = "flat_" + UUID.randomUUID(); + private final String quantizedContainerId = "quantized_" + UUID.randomUUID(); + private final String largeDataContainerId = "large_data_" + UUID.randomUUID(); + private CosmosAsyncClient client; + private CosmosAsyncDatabase database; + private CosmosAsyncContainer flatIndexContainer; + private CosmosAsyncContainer quantizedIndexContainer; + private CosmosAsyncContainer largeDataContainer; + + @BeforeClass(groups = {"emulator"}, timeOut = SETUP_TIMEOUT) + public void before_NonStreamingOrderByQueryVectorSearchTest() { + // set up the client + client = new CosmosClientBuilder() + .endpoint(TestConfigurations.HOST) + .key(TestConfigurations.MASTER_KEY) + .directMode(DirectConnectionConfig.getDefaultConfig()) + .consistencyLevel(ConsistencyLevel.SESSION) + .contentResponseOnWriteEnabled(true) + .buildAsyncClient(); + + database = createDatabase(client, databaseId); + + PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); + ArrayList paths = new ArrayList(); + paths.add("/pk"); + partitionKeyDef.setPaths(paths); + + CosmosContainerProperties containerProperties = new CosmosContainerProperties(flatContainerId, partitionKeyDef); + containerProperties.setIndexingPolicy(populateIndexingPolicy(CosmosVectorIndexType.FLAT)); + containerProperties.setVectorEmbeddingPolicy(populateVectorEmbeddingPolicy(128L)); + database.createContainer(containerProperties).block(); + flatIndexContainer = database.getContainer(flatContainerId); + + containerProperties = new CosmosContainerProperties(quantizedContainerId, partitionKeyDef); + containerProperties.setIndexingPolicy(populateIndexingPolicy(CosmosVectorIndexType.QUANTIZED_FLAT)); + containerProperties.setVectorEmbeddingPolicy(populateVectorEmbeddingPolicy(128L)); + database.createContainer(containerProperties).block(); + quantizedIndexContainer = database.getContainer(quantizedContainerId); + + containerProperties = new CosmosContainerProperties(largeDataContainerId, partitionKeyDef); + containerProperties.setIndexingPolicy(populateIndexingPolicy(CosmosVectorIndexType.QUANTIZED_FLAT)); + containerProperties.setVectorEmbeddingPolicy(populateVectorEmbeddingPolicy(2L)); + database.createContainer(containerProperties).block(); + largeDataContainer = database.getContainer(largeDataContainerId); + + for (Document doc: getVectorDocs()) { + flatIndexContainer.createItem(doc).block(); + quantizedIndexContainer.createItem(doc).block(); + } + } + + @AfterClass(groups = {"emulator"}, timeOut = SHUTDOWN_TIMEOUT, alwaysRun = true) + public void afterClass() { + safeDeleteDatabase(database); + safeClose(client); + } + + @Test(groups = {"emulator"}, timeOut = TIMEOUT) + public void flatIndexVectorSearch() { + String queryVector = getQueryVector(); + + String vanilla_query = String.format("SELECT DISTINCT TOP 6 c.text, VectorDistance(c.embedding, [%s]) AS " + + "score FROM c ORDER BY VectorDistance(c.embedding, [%s])", queryVector, queryVector); + List resultDocs = flatIndexContainer.queryItems(vanilla_query, new CosmosQueryRequestOptions(), Document.class).byPage() + .flatMap(feedResponse -> Flux.fromIterable(feedResponse.getResults())) + .collectList().block(); + validateOrdering(6, resultDocs, false); + + String euclideanSpecsQuery = String.format("SELECT DISTINCT TOP 6 c.text, VectorDistance(c.embedding, [%s], {'distanceFunction': 'euclidean'}) AS " + + "score FROM c ORDER BY VectorDistance(c.embedding, [%s], false, {'distanceFunction': 'euclidean'})", queryVector, queryVector); + resultDocs = flatIndexContainer.queryItems(euclideanSpecsQuery, new CosmosQueryRequestOptions(), Document.class).byPage() + .flatMap(feedResponse -> Flux.fromIterable(feedResponse.getResults())) + .collectList().block(); + validateOrdering(6, resultDocs, false); + + String dotproductSpecsQuery = String.format("SELECT DISTINCT TOP 6 c.text, VectorDistance(c.embedding, [%s], {'distanceFunction': 'dotproduct'}) AS " + + "score FROM c ORDER BY VectorDistance(c.embedding, [%s], false, {'distanceFunction': 'dotproduct'})", queryVector, queryVector); + resultDocs = flatIndexContainer.queryItems(dotproductSpecsQuery, new CosmosQueryRequestOptions(), Document.class).byPage() + .flatMap(feedResponse -> Flux.fromIterable(feedResponse.getResults())) + .collectList().block(); + validateOrdering(6, resultDocs, false); + } + + @Test(groups = {"emulator"}, timeOut = TIMEOUT) + public void quantizedIndexVectorSearch() { + String queryVector = getQueryVector(); + + String vanillaQuery = String.format("SELECT DISTINCT TOP 6 c.text, VectorDistance(c.embedding, [%s]) AS " + + "score FROM c ORDER BY VectorDistance(c.embedding, [%s])", queryVector, queryVector); + List resultDocs = quantizedIndexContainer.queryItems(vanillaQuery, new CosmosQueryRequestOptions(), Document.class).byPage() + .flatMap(feedResponse -> Flux.fromIterable(feedResponse.getResults())) + .collectList().block(); + validateOrdering(6, resultDocs, false); + + String euclideanSpecsQuery = String.format("SELECT DISTINCT TOP 6 c.text, VectorDistance(c.embedding, [%s], false, {'distanceFunction': 'euclidean'}) AS " + + "score FROM c ORDER BY VectorDistance(c.embedding, [%s], false, {'distanceFunction': 'euclidean'})", queryVector, queryVector); + resultDocs = quantizedIndexContainer.queryItems(euclideanSpecsQuery, new CosmosQueryRequestOptions(), Document.class).byPage() + .flatMap(feedResponse -> Flux.fromIterable(feedResponse.getResults())) + .collectList().block(); + validateOrdering(6, resultDocs, true); + + String dotproduct_specs_query = String.format("SELECT DISTINCT TOP 6 c.text, VectorDistance(c.embedding, [%s], {'distanceFunction': 'dotproduct'}) AS " + + "score FROM c ORDER BY VectorDistance(c.embedding, [%s], false, {'distanceFunction': 'dotproduct'})", queryVector, queryVector); + resultDocs = quantizedIndexContainer.queryItems(dotproduct_specs_query, new CosmosQueryRequestOptions(), Document.class).byPage() + .flatMap(feedResponse -> Flux.fromIterable(feedResponse.getResults())) + .collectList().block(); + validateOrdering(6, resultDocs, false); + } + + @Test(groups = {"emulator"}, timeOut = TIMEOUT*1000) + public void largeDataVectorSearch() { + double embeddingValue = 0.0001; + for (int i=1;i<=2000;i++) { + Document doc = new Document(String.valueOf(i), String.valueOf(i%2), "text" + i, new double[] {embeddingValue, embeddingValue}); + largeDataContainer.createItem(doc).block(); + embeddingValue = 0.0001 * (i+1); + } + + String query = String.format("SELECT c.id, VectorDistance(c.embedding, [0.0001, 0.0001]) AS score FROM c ORDER BY" + + " VectorDistance(c.embedding, [0.0001, 0.0001]) OFFSET 0 LIMIT 1000"); + List resultDocs = largeDataContainer.queryItems(query, new CosmosQueryRequestOptions(), Document.class).byPage() + .flatMap(feedResponse -> Flux.fromIterable(feedResponse.getResults())) + .collectList().block(); + validateOrdering(1000, resultDocs, false); + + query = String.format("SELECT DISTINCT c.id, VectorDistance(c.embedding, [0.0001, 0.0001]) AS score FROM c ORDER BY" + + " VectorDistance(c.embedding, [0.0001, 0.0001]) OFFSET 0 LIMIT 1000"); + resultDocs = largeDataContainer.queryItems(query, new CosmosQueryRequestOptions(), Document.class).byPage() + .flatMap(feedResponse -> Flux.fromIterable(feedResponse.getResults())) + .collectList().block(); + validateOrdering(1000, resultDocs, false); + + query = String.format("SELECT c.id, VectorDistance(c.embedding, [0.0001, 0.0001]) AS score FROM c ORDER BY" + + " VectorDistance(c.embedding, [0.0001, 0.0001]) OFFSET 1000 LIMIT 500"); + resultDocs = largeDataContainer.queryItems(query, new CosmosQueryRequestOptions(), Document.class).byPage() + .flatMap(feedResponse -> Flux.fromIterable(feedResponse.getResults())) + .collectList().block(); + validateOrdering(500, resultDocs, false); + + query = String.format("SELECT DISTINCT c.id, VectorDistance(c.embedding, [0.0001, 0.0001]) AS score FROM c ORDER BY" + + " VectorDistance(c.embedding, [0.0001, 0.0001]) OFFSET 1000 LIMIT 500"); + resultDocs = largeDataContainer.queryItems(query, new CosmosQueryRequestOptions(), Document.class).byPage() + .flatMap(feedResponse -> Flux.fromIterable(feedResponse.getResults())) + .collectList().block(); + validateOrdering(500, resultDocs, false); + + query = String.format("SELECT TOP 1000 c.id, VectorDistance(c.embedding, [0.0001, 0.0001]) AS score FROM c ORDER BY" + + " VectorDistance(c.embedding, [0.0001, 0.0001])"); + resultDocs = largeDataContainer.queryItems(query, new CosmosQueryRequestOptions(), Document.class).byPage() + .flatMap(feedResponse -> Flux.fromIterable(feedResponse.getResults())) + .collectList().block(); + validateOrdering(1000, resultDocs, false); + + query = String.format("SELECT DISTINCT TOP 1000 c.id, VectorDistance(c.embedding, [0.0001, 0.0001]) AS score FROM c ORDER BY" + + " VectorDistance(c.embedding, [0.0001, 0.0001])"); + resultDocs = largeDataContainer.queryItems(query, new CosmosQueryRequestOptions(), Document.class).byPage() + .flatMap(feedResponse -> Flux.fromIterable(feedResponse.getResults())) + .collectList().block(); + validateOrdering(1000, resultDocs, false); + } + + private void validateOrdering(int top, List docs, boolean isEucledian) { + assertThat(docs.size()).isEqualTo(top); + if (isEucledian) { + for (int i=0;i getVectorDocs() { + List docs = new ArrayList<>(); + docs.add(new Document("item0", "1", "Good morning!", new double[] {-0.008334724, -0.05993167, -0.0903545, -0.04791922, -0.01825805, -0.053011455, 0.120733805, 0.017714009, 0.07346743, 0.11559805, 0.03262076, 0.074512, 0.015864266, 0.01981401, 0.007850527, 0.076296456, -0.08539284, 0.016593281, -0.05423011, 0.07520837, 0.074250855, 0.056754466, -0.022098986, 0.03155444, 0.04334927, 0.024655985, -0.02109795, 0.044023883, -0.027550288, -0.11350893, -0.022806242, 0.08608921, 0.009221513, 0.06659074, 0.09087678, 0.024830079, 0.0075513036, 0.036472578, 0.015418151, 0.060497474, 0.010940685, -0.059365865, 0.043566886, 0.00427073, -0.023546139, 0.030357545, -0.03403527, 0.1182965, 0.1115939, -0.018954424, 0.0032452107, 0.10297628, 0.15328929, -0.016952349, -0.04530782, 0.04674409, -8.351895e-05, -0.19376601, -0.025091218, -0.03664667, -0.011860116, -0.10454312, -0.13109237, -0.049268447, 0.17557324, 0.044872586, 0.046787616, 0.15337633, -0.019509347, 0.0077743605, 0.04556896, -0.08413066, -0.028681897, 0.1209079, 0.1357929, -0.09314, 0.12534729, -0.065546185, 0.12212656, 0.04892026, 0.07394619, -0.08134516, -0.004493787, 0.08138869, 0.028573086, 0.12290998, -0.16477945, -0.29839617, -0.08090993, 0.12256179, 0.16591106, -0.08173688, -0.034383457, -0.1076768, -0.043022845, -0.07655759, 0.2021225, 0.03923631, 0.07703635, -0.08587159, 0.06498038, -0.08330371, 0.16486649, -0.14040637, 0.02070624, -0.069855, 0.052880887, 0.016136287, 0.00024294876, -0.19968519, 0.06933272, 0.013241983, 0.0004002109, 0.14998151, 0.07516485, 0.18610589, -0.07895138, -0.108982496, -0.03494926, -0.027637335, -0.032925423, -0.009509855, 0.1182965, -0.075513035, -0.08665501, 0.019629037, 0.2583547, 0.00983084})); + docs.add(new Document("item1", "2", "Good afternoon!", new double[] {-0.04136167, -0.047741424, -0.08737179, -3.0502639e-05, 0.054595508, -0.11298566, 0.0906921, 0.108052626, 0.04729081, 0.21287979, -0.06588459, -0.052793052, -0.05568647, 0.017384235, -0.02518698, 0.021665072, -0.19238868, 0.03379609, 0.0075359354, -0.04989963, 0.055449303, 0.03282371, 0.026064493, 0.042096883, -0.007192045, 0.0786441, -0.09012291, 0.094012424, -0.0031483725, -0.0318039, -0.034721036, 0.10255038, 0.08851018, 0.11327027, 0.031614166, 0.006035863, 0.021321183, 0.0703433, 0.14201473, 0.058674756, -0.007986549, 0.03329804, 0.08884221, -0.09505595, -0.015522485, -0.068161376, 0.072572656, 0.049235567, 0.2263508, 0.029574543, -0.050563693, 0.050516263, 0.04660303, 0.08376687, 0.017514676, 0.0706279, 0.007921329, -0.1353741, -0.054358345, -0.1628853, -0.097617336, -0.123326086, -0.0489984, -0.0693472, 0.15396787, 0.027368903, 0.06042978, 0.22862759, -0.016293272, 0.033582643, 0.06697555, -0.10302471, -0.12104929, 0.18034068, 0.068303674, 0.003468546, 0.07480201, -0.1204801, 0.06787678, -0.042926963, 0.15785739, -0.034531303, -0.028934196, 0.022933908, -0.012012435, 0.004248228, -0.19172463, -0.31837103, -0.099230066, 0.02071641, 0.18546346, 0.06299117, -0.047053643, -0.09206767, 0.049472734, -0.046365865, 0.18214314, 0.0051079527, 0.105680965, -0.026443958, 0.072714955, -0.08073115, 0.09429702, -0.113744594, 0.02092986, -0.013625161, -0.07390078, 0.020550394, 0.011787128, -0.13499463, 0.015107445, -0.0015223064, 0.040104695, 0.094961084, 0.13404597, 0.082486175, -0.07428025, -0.026847139, -0.025163265, -0.09818654, 0.010043961, 0.013601444, 0.077932596, 0.016056107, -0.026965722, 0.045606934, 0.085047565, -0.005878741})); + docs.add(new Document("item2", "1", "Great weather today!", new double[] {0.07557184, -0.047335204, -0.054325826, 0.011354052, 0.07698824, -0.025358144, -0.07927276, 0.1510523, 0.022251202, 0.026249107, -0.021725763, 0.062047496, 0.14556946, -0.0006071819, -0.107098185, 0.021394506, -0.13771072, -0.10527057, 0.115048304, -0.048842985, -0.059443146, 0.060585406, -0.014940745, 0.18075103, 0.053777542, -0.022057017, 0.08493836, 0.1198001, 0.041555375, -0.066525154, 0.054280136, 0.107646465, 0.023359193, -0.0046632714, -0.1017981, 0.04105278, 0.11376897, 0.016437104, 0.067393266, 0.0961325, -0.017727856, -0.03333111, -0.020492123, -0.041943744, 0.0031040881, -0.028053876, 0.053640474, -0.02215982, 0.08205987, 0.015100661, -0.17133881, -0.05843796, 0.0895074, -0.04064157, -0.10225501, 0.11367759, -0.03593546, -0.010999952, -0.14273666, -0.010383132, 0.026112035, -0.14200561, -0.0634639, -0.04029889, 0.07383561, 0.116784535, 0.0805064, 0.13241065, -0.100884296, -0.10216363, -0.030384084, -0.07657703, -0.06323545, -0.013101708, 0.15233164, -0.009880538, 0.16448526, -0.11148446, -0.05606206, -0.11587073, 0.084892675, -0.1397211, -0.04948265, 0.006470896, 0.015637523, 0.09051259, -0.12665366, -0.28583884, -0.16046451, 0.055833608, 0.100244634, 0.013535767, -0.07155109, -0.10051877, 0.08662891, -0.0729218, 0.15818, 0.025449526, 0.05053353, -0.015740326, -0.0767141, -0.056381892, 0.091517776, -0.075114936, -0.04621579, -0.040458806, 0.03947646, 0.10901718, 0.0076417113, -0.34487078, 0.024375802, -0.072419204, 0.053000808, 0.04057303, -0.08434439, 0.027185759, 0.03403931, -0.06332683, 0.051858548, 0.011993717, 0.10728095, -0.09887392, 0.07593736, -0.0025172527, 0.1089258, -0.048934367, 0.051264573, 0.017008234})); + docs.add(new Document("item3", "2", "Hope you're doing well.", new double[] {-0.016385807, 0.16914073, -0.062722616, 0.009645036, 0.06367876, -0.10871283, -0.034588274, 0.0038275379, 0.107661076, 0.069654614, 0.036404934, -0.037910853, 0.08872956, 0.14571536, -0.082227826, 0.034731694, -0.07405285, 0.050340638, -0.16569862, -0.20671692, -0.0834708, 0.0043175584, -0.017234378, 0.052683175, 0.013863994, 0.12142946, -0.002630872, 0.069702424, 0.095804974, -0.10020321, 0.0793116, 0.028970966, 0.13940485, 0.15814514, 0.11597948, -0.03795866, -0.018178564, 0.14753202, -0.10670494, -0.055455975, 0.058037546, -0.04457991, -0.0046014115, -0.018704439, 0.07902476, -0.07902476, 0.031026661, -0.017855868, 0.098769, 0.118847884, -0.051488005, 0.009017572, 0.15068726, 0.044962365, 0.18233542, -0.0006853563, 0.11205931, -0.2602606, 0.09848216, 0.08681728, -0.077638365, -0.008664995, 0.010314333, -0.0361659, 0.047185384, 0.09202823, 0.004359389, -0.008545479, -0.08815587, 0.0765388, 0.012262463, 0.0542608, -0.10813915, 0.11722245, 0.013744476, -0.08265808, 0.008055458, 0.12085578, 0.056364305, -0.12907855, -0.05311344, -0.060666922, 0.117031224, 0.029233903, -0.148775, 0.017879771, -0.081558526, -0.26332027, -0.22029407, -0.07410065, 0.0059340284, -0.11234615, -0.06898532, 0.046516087, 0.06798138, -0.049193274, -0.04687464, -0.049002044, -0.03145692, 0.0065614935, -0.021274058, -0.060188852, -0.04584679, -0.015979448, 0.08949447, -0.050197218, -0.051440194, -0.1341461, 0.08557431, -0.08261028, -0.104314595, -0.016134819, 0.057320442, -0.022421423, 0.012501498, 0.055503782, 0.020568907, -0.095183484, 0.0049450235, -0.03525757, 0.17688543, -0.06888971, -0.005694994, 0.05622088, -0.04250031, 0.050053798, 0.16063109, 0.06353533})); + docs.add(new Document("item4", "1", "Excuse me please.", new double[] {-0.19188246, 0.018719073, -0.032395326, 0.09734556, 0.021671357, -0.11751684, -0.078514785, 0.16507255, -0.0012956136, 0.117006175, -0.065492816, 0.106282204, -0.009750514, -0.006008296, 0.021799022, 0.04643862, -0.046023704, -0.023442727, 0.12868765, -0.1466886, -0.085089594, -0.046885453, -0.0067742937, 0.048162118, -0.04739612, 0.021687314, -0.025581138, 0.04841745, -0.10519704, -0.039129723, -0.09747323, 0.10532471, 0.04375763, 0.09536674, 0.0145938555, -0.0060681393, 0.26171595, 0.1815415, -0.03833181, 0.012487361, -0.027192924, -0.12281499, 0.017937116, -0.02173519, 0.07308897, -0.06913131, 0.07417413, -0.01884674, 0.049023863, -0.049949445, 0.081068106, 0.22060739, -0.031645287, -0.024735348, -0.041108552, 0.1823075, -0.06230116, -0.119048834, -0.07813178, -0.0841321, -0.007711843, 0.039576557, -0.07589762, 0.028198296, 0.003087929, 0.047970615, 0.0845151, 0.08208944, 0.07423796, 0.01259907, 0.00046179298, 0.024671515, 0.10302671, 0.12160216, 0.1353263, -0.16251922, 0.069195144, -0.09160058, 0.033320908, -0.06341824, -0.06402466, -0.048864283, -0.10053722, -0.019341446, 0.027033342, -0.19354212, -0.011146865, -0.31329313, 0.054513514, -0.0098861605, 0.10277138, 0.059237167, 0.021495815, -0.0704718, 0.14285861, 0.042672466, 0.057769008, 0.054353934, -0.041363884, 0.07819562, 0.1085802, -0.0047874865, 0.0035626881, 0.025405597, 0.0032953867, 0.13430496, -0.084451266, -0.10883553, 0.115601845, -0.072259136, -0.06976964, -0.1081972, 0.08515343, 0.044715125, 0.05725834, -0.06759931, -0.0421618, -0.06185433, -0.068939805, -0.13673063, -0.032874074, -0.121538326, -0.010157451, -0.048608948, 0.049949445, 0.031310163, 0.13238996, 0.06855681})); + docs.add(new Document("item5", "2", "Is this the right place?", new double[] {-0.05695127, 0.07729321, -0.07253956, 0.054049686, -0.084886715, -0.1677979, -0.020681491, -0.010765179, -0.05312365, 0.10964277, -0.1724898, -0.0139754405, -0.019446775, -0.009877727, 0.10902541, 0.06599557, -0.20224646, -0.008658445, -0.11698933, -0.00034678154, 0.059760246, 0.023660243, 0.014523345, 0.058340326, -0.116927594, -0.0011546522, 0.035991967, 0.017857078, -0.21261807, -0.07568809, -0.007250097, 0.09525833, 0.073033445, -0.078157514, -0.14816591, -0.089578636, -0.006030815, 0.08519539, 0.059852853, 0.12328638, 0.08544234, -0.017656436, -0.03901702, 0.036238912, -0.09482618, 0.007215371, 0.15742627, 0.014183799, 0.107914165, 0.014245534, -0.011907292, 0.025188204, 0.057630364, -0.057321683, 0.0024366346, 0.034695517, 0.11766842, -0.16520499, 0.065193, 0.10822285, -0.06834152, -0.048925616, -0.078836605, 0.05161112, 0.07235435, 0.07636718, -0.075996764, 0.13902901, 0.023860885, 0.07846619, 0.02665443, -0.026870504, -0.0084115015, 0.07550287, 0.07500899, -0.07395948, 0.05062335, 0.05621044, -0.031531557, -0.001280053, 0.06908235, 0.078280985, -0.060068928, 0.14236274, 0.14236274, 0.06358787, -0.042474225, -0.38053942, 0.062785305, 0.050870296, 0.038677476, -0.078157514, 0.029309068, -0.07809578, 0.07439163, -0.06772417, 0.11896487, 0.073589064, 0.05238282, 0.018196626, 0.116371974, 0.0033067234, -0.020264775, -0.006304768, -0.10686466, 0.08408415, -0.04386328, -0.0068681072, 0.08994905, -0.059513304, 0.021823604, 0.049419504, -0.012817894, -0.093221046, 0.02802805, 0.089578636, 0.07124311, -0.26694557, 0.024833223, -0.03802925, -0.18483697, -0.1103836, 0.11877967, 0.07000839, -0.018860284, -0.044974525, -0.034016423, 0.022780508})); + docs.add(new Document("item6", "1", "Awful weather today.", new double[] {0.002305239, -0.02629875, 0.009952777, 0.026884208, -0.0067561795, -0.1118458, 0.07432968, 0.0999493, 0.02177902, -0.047726493, 0.042059265, 0.1583077, 0.11175212, 0.07685886, -0.14060347, 0.005084698, -0.19277944, -0.05606341, 0.082619764, -0.04241054, 0.09620237, 0.011832096, -0.023301208, 0.28214368, 0.02451896, 0.02793803, 0.03358184, 0.044424515, 0.11006601, 0.038101573, 0.0077982936, 0.045572013, 0.075922124, 0.016369391, -0.0039986745, 0.22781321, 0.062854715, 0.048054352, 0.010251361, 0.07170683, -0.018816603, 0.027329156, -0.08482108, -0.079481706, 0.042785235, 0.024120849, 0.17413847, 0.035431888, 0.12439801, 0.10641275, -0.14828467, -0.024425287, 0.083415985, 0.1184966, 0.0026799317, 0.15399873, -0.010304051, 0.009742012, -0.10781785, -0.019472316, 0.061777476, -0.09798217, 0.028804509, -0.023371464, 0.015491205, 0.07521958, 0.024003757, 0.013465522, -0.089692086, -0.097794816, 0.021193562, -0.0592483, -0.056438103, -0.10987866, 0.11802823, -0.06440032, 0.07704621, -0.040138967, -0.13891736, -0.16027485, 0.08631986, -0.16786237, -0.085757814, 0.015491205, -0.013243048, 0.09133137, -0.16196096, -0.2313728, -0.083134964, 0.12308659, 0.07559427, 0.09723278, 0.048663225, -0.13339064, 0.016345974, -0.13189186, 0.11025336, 0.03346475, -0.00688498, -0.059435643, 0.0056877197, 0.014999421, 0.063650936, -0.15053283, -0.017481761, 0.05194179, 0.061402783, 0.0077924393, 0.19971126, -0.07713988, 0.06425981, 0.0021369199, 0.12158781, -0.024331613, -0.008571098, 0.03264511, -0.0020242194, -0.05507984, -0.00805004, -0.03304322, 0.050630365, -0.1475353, -0.003735219, -0.0202217, 0.16271034, -0.059435643, 0.06023187, 0.06660164})); + docs.add(new Document("item7", "2", "Dinosaurs were huge.", new double[] {0.09842033, -0.025395654, -0.03831241, 0.037825905, 0.17008278, -0.022269849, -0.05935383, 0.032668933, -0.022148222, 0.08178179, -0.062710725, 0.164342, -0.024021273, -0.052640036, 0.027366007, 0.18098053, -0.18487258, -0.008903074, 0.16346629, 0.009407825, 0.110339746, -0.046315446, 0.08046822, 0.12512955, -0.06635953, 0.0070239417, 0.055753678, -0.0005336371, -0.012326866, 0.1578228, -0.023668556, -0.035904203, 0.05988899, -0.08032227, -0.11520481, 0.08499274, 0.05093726, -0.09248494, -0.011128843, -0.07064079, 0.01466818, 0.082073696, -0.040574666, -0.07292737, 0.03539337, 0.05025615, -0.1145237, 0.09584184, 0.04186391, -0.034833886, -0.18234275, -0.090441614, -0.09194978, -0.031331036, -0.13106494, 0.068208255, 0.03220675, -0.031233737, -0.04337208, 0.1289243, 0.1363192, 0.052494083, 0.03074723, -0.000113359885, 0.07681943, 0.03962598, 0.016529068, -0.04191256, -0.03612313, 0.023084749, 0.10917213, 0.09477153, -0.09652295, -0.0999285, 0.11685894, -0.012649177, 0.043688312, -0.10333405, -0.060521446, -0.042034186, 0.0483831, 0.0028141378, -0.17270991, 0.05424551, 0.25570798, 0.09511208, -0.08504139, -0.1570444, -0.084262975, -0.13291366, -0.023741532, -0.14857918, 0.09190113, -0.08041958, -0.019837314, 0.09569589, -0.053029243, -0.030722905, -0.05239678, -0.15091442, -0.05872137, -0.056045584, 0.11831845, -0.1145237, -0.08761988, -0.0035727844, -0.05570503, 0.19285129, 0.011761302, 0.087717175, 0.107712604, -0.11277228, -0.042423394, 0.13048112, -0.03356897, 0.056775343, 0.08640361, -0.11831845, -0.10868562, 0.0410855, 0.12036178, -0.09477153, -0.017611546, 0.0075043673, -0.12668636, -0.006391483, 0.0012185475, -0.05161837})); + docs.add(new Document("item8", "1", "The hero saves the day again.", new double[] {0.11208976, 0.058739875, -0.017022463, 0.15080968, -0.0031057745, -0.048069898, -0.059069872, 0.09861479, 0.11626975, 0.12935972, 0.008882481, 0.08766981, -0.00940498, -0.077164836, 0.0015795279, 0.06297486, -0.06313986, 0.0931698, -0.17247963, -0.12077974, -0.044797402, -0.1404697, -0.050077394, 0.020432455, 0.07897983, 0.022632452, -0.046914898, 0.0031212433, -0.059399873, 0.03321993, -0.07237984, 0.10119978, 0.19612958, -0.086349815, 0.038252417, 0.084094815, 0.16257966, 0.15520966, 0.063304864, -0.08761481, 0.06132487, -0.08486482, -0.09789979, 0.06935485, -0.04160741, 0.05585238, -0.13485971, 0.105544776, -0.08084983, 0.103344776, 0.053817384, -0.0923998, -0.052607387, 0.015537467, 0.025299946, -0.05961987, 0.08090483, -0.25453946, 0.01894746, -0.026344944, -0.14552969, 0.014341219, 0.14409968, 0.12264974, -0.0456224, -0.13529971, -0.0466674, 0.006166862, 0.02776119, -0.020184956, 0.093939796, 0.054779883, -0.09635979, -0.016334964, -0.029177437, -0.06863985, 0.19139959, -0.08794481, -0.08464482, -0.013413096, 0.022109952, -0.122099735, -0.0458149, -0.019676207, 0.10785477, -0.109119765, -0.09690979, -0.28423938, 0.050709892, 0.12803972, 0.10620477, 0.12110974, -0.006658423, -0.052304886, -0.07798983, -0.035667423, -0.07507484, 0.02745869, 0.07237984, -0.0230862, -0.03684992, -0.067539856, -0.052387387, -0.05202989, 0.14244969, 0.080684826, -0.038472418, 0.112639755, 0.03242243, -0.07501984, 0.10631477, -0.024076197, -0.07754983, 0.06610986, -0.12671973, -0.044082403, 0.006001862, 0.037454918, 0.054504883, -0.03679492, 0.076669835, 0.02271495, 0.14794968, 0.06440486, -0.006850923, -0.06984985, 0.035639923, -0.009143731})); + docs.add(new Document("item9", "2", "Don't worry about it.", new double[] {-0.051598575, 0.22204931, -0.017881807, 0.11678282, 0.18426134, -0.03713568, -0.016847137, 0.06549915, 0.057626653, 0.032569632, 0.00076827104, -0.04489571, -0.07530603, 0.10778569, 0.030477798, 0.050338972, -0.21053298, -0.04341118, -0.097708896, -0.13432723, 0.1438642, 0.059606023, -0.12299085, -0.036820777, -0.026699001, 0.18381149, -0.02861089, 0.08259371, -0.14962237, -0.07373153, 0.02321261, 0.085607745, -0.13810603, 0.065139264, -0.12685962, 0.14098512, 0.17112552, -0.035921063, -0.008536032, -0.09680918, 0.04435588, -0.16086878, -0.035718627, 0.09689915, -0.0007956842, 0.034256592, -0.00234769, 0.04577293, 0.06725359, 0.015958669, -0.06486935, 0.124160476, 0.09887852, -0.050518915, -0.07080746, -0.078859895, 0.17013584, -0.22078972, -0.10103783, 0.06873812, 0.0370682, 0.04563797, -0.060235824, -0.056816913, -0.064689405, 0.11273411, 0.16572724, 0.108415484, 0.07921978, 0.05569227, -0.11210431, -0.05848138, -0.008361713, 0.07458626, -0.08992637, -0.07557594, -0.0020102975, -0.07080746, -0.0092614265, 0.06626391, -0.05848138, -0.078545, 0.08362838, -0.031737395, -0.047549862, -0.15367107, 0.093930095, -0.087182246, 0.06401462, 0.09006133, 0.10886534, 0.013338254, 0.025551865, -0.027553728, 0.14206477, -0.09060115, -0.07818511, -0.001209693, 0.017893054, -0.069367915, 0.0709874, 0.050249003, -0.13396735, -0.056681953, -0.022166694, -0.02170559, 0.08277365, -0.101667635, 0.09096104, 0.049529232, -0.095819496, -0.08974643, 0.054477658, -0.037967913, -0.08682236, 0.077690266, 0.03828281, -0.04136433, -0.14431405, -0.060505737, 0.025619343, -0.019400073, 0.11075474, 0.066893704, 0.07494614, 0.03684327, 0.03929499, -0.017353225})); + return docs; + } + + public String getQueryVector() { + return "0.13481648, 0.022579897, -0.038054377, 0.035029914, 0.15404047, -0.012947189, 0.013434003, 0.0328755,0.0859279, 0.090071, 0.07391291, 0.10896354, 0.04085097, 0.019876525, 0.013806882, 0.03799223,-0.097528584, -0.10324606, -0.07863604, -0.01846787, -0.0018139011, 0.09686569, 0.0065512774,0.014107257, 0.0004389097, 0.07432722, 0.012698603, 0.09404838, 0.11592395, -0.08290344, -0.023802113,0.0771031, 0.15578057, 0.17152436, 0.06732538, 0.04408259, 0.04163816, 0.03196402, 0.08451925,0.05365315, -0.10473758, 0.054730356, -0.0686926, 0.12412729, 0.1910798, -0.048971448, -0.007649199,-0.059122045, -0.005241022, 0.021440545, -0.1014231, 0.08282058, -0.057671957, -0.024755025, -0.07619162,0.0966171, 0.047272775, -0.20384054, -0.024319999, -0.014739079, 0.03681145, -0.03331053, 0.09172824,-0.09744572, 0.08584504, 0.13440217, -0.019234344, 0.19605151, 0.030389642, -0.0646738, 0.08447782,-0.107969195, -0.19058262, -0.05369458, 0.071675636, -0.095871344, 0.030141056, 0.025107188, 0.06309942,-0.09951727, 0.031446133, -0.07888463, -0.08182623, -0.063762315, -0.0955399, -0.03948375, -0.031073254,-0.29979473, -0.06711823, 0.07743455, 0.0074161496, 0.01248109, -0.0812462, -0.0676154, 3.0668652e-05,-0.17931339, 0.2008575, 0.026950868, 0.11111795, 0.07507298, -0.00898017, 0.038800135, -0.015267325,-0.13788238, -0.010740988, -0.00870569, -0.037743647, -0.12445874, 0.014676933, -0.27344462, -0.05738194,0.07101274, -0.023615673, 0.0040369336, -0.039028008, 0.06546099, -0.072421394, -0.17119291,-0.019358637, -0.05489608, 0.006199114, 0.0515816, 0.050048653, -0.034843475, 0.07847032, -0.13315925,0.025335059, -0.0432954"; + } + + static class Document { + @JsonProperty("id") + String id; + @JsonProperty("pk") + String pk; + @JsonProperty("text") + String text; + @JsonProperty("embedding") + double[] embedding; + @JsonProperty("score") + double score; + + public Document(String id, String pk, String text, double[] embedding) { + this.id = id; + this.pk = pk; + this.text = text; + this.embedding = embedding; + } + + public Document() {} + + public String getId() { return id; } + public double getScore() { + return score; + } + } + +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java index 82746ad412b5..e29c231a9469 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java @@ -16,8 +16,6 @@ import java.util.function.BiFunction; -import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; - /** * While this class is public, but it is not part of our published public APIs. * This is meant to be internally used only by our sdk. diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java index 44746920a343..d15e76716862 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java @@ -636,8 +636,9 @@ public String getRequestContinuation(CosmosQueryRequestOptions options) { @Override public Integer getMaxItemCountForVectorSearch(CosmosQueryRequestOptions options) { return options.getMaxItemCountForVectorSearch(); - - @Override + } + + @Override public void setPartitionKeyDefinition(CosmosQueryRequestOptions options, PartitionKeyDefinition partitionKeyDefinition) { options.setPartitionKeyDefinition(partitionKeyDefinition); } @@ -645,7 +646,7 @@ public void setPartitionKeyDefinition(CosmosQueryRequestOptions options, Partiti @Override public PartitionKeyDefinition getPartitionKeyDefinition(CosmosQueryRequestOptions options) { return options.getPartitionKeyDefinition(); - + } }); } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java index 3077fb67f3ab..530557cad90f 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/IndexingPolicy.java @@ -20,6 +20,7 @@ */ public final class IndexingPolicy { private static final String DEFAULT_PATH = "/*"; + private List includedPaths; private List excludedPaths; private List> compositeIndexes; diff --git a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md index 34f6139030e7..6d699b6e17bd 100644 --- a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md @@ -7,8 +7,6 @@ ### Breaking Changes ### Bugs Fixed -- Fixes the session message disposition to use management node as fall back. ([#39913](https://github.com/Azure/azure-sdk-for-java/issues/ 39913)) -- Fixes the session processor idle timeout to fall back to RetryOptions::tryTimeout. ([#39993](https://github.com/Azure/azure-sdk-for-java/issues/39993)) ### Other Changes From 1db9b3191ec684a168a59040f2fbeb75096f0b47 Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Thu, 16 May 2024 14:43:36 -0700 Subject: [PATCH 25/33] Adding capability for CI pipeline --- .../NonStreamingOrderByQueryVectorSearchTest.java | 11 +++++------ sdk/cosmos/test-resources.json | 13 +++++++++---- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/NonStreamingOrderByQueryVectorSearchTest.java b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/NonStreamingOrderByQueryVectorSearchTest.java index d7afd19d06fd..391031518b76 100644 --- a/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/NonStreamingOrderByQueryVectorSearchTest.java +++ b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/NonStreamingOrderByQueryVectorSearchTest.java @@ -41,7 +41,6 @@ import static com.azure.cosmos.rx.TestSuiteBase.safeDeleteDatabase; import static org.assertj.core.api.Assertions.assertThat; -//@Ignore("TODO: Ignore these test cases until the public emulator with vector indexes is released.") public class NonStreamingOrderByQueryVectorSearchTest { protected static final int TIMEOUT = 30000; protected static final int SETUP_TIMEOUT = 20000; @@ -59,7 +58,7 @@ public class NonStreamingOrderByQueryVectorSearchTest { private CosmosAsyncContainer quantizedIndexContainer; private CosmosAsyncContainer largeDataContainer; - @BeforeClass(groups = {"emulator"}, timeOut = SETUP_TIMEOUT) + @BeforeClass(groups = {"query"}, timeOut = SETUP_TIMEOUT) public void before_NonStreamingOrderByQueryVectorSearchTest() { // set up the client client = new CosmosClientBuilder() @@ -101,13 +100,13 @@ public void before_NonStreamingOrderByQueryVectorSearchTest() { } } - @AfterClass(groups = {"emulator"}, timeOut = SHUTDOWN_TIMEOUT, alwaysRun = true) + @AfterClass(groups = {"query"}, timeOut = SHUTDOWN_TIMEOUT, alwaysRun = true) public void afterClass() { safeDeleteDatabase(database); safeClose(client); } - @Test(groups = {"emulator"}, timeOut = TIMEOUT) + @Test(groups = {"query"}, timeOut = TIMEOUT) public void flatIndexVectorSearch() { String queryVector = getQueryVector(); @@ -133,7 +132,7 @@ public void flatIndexVectorSearch() { validateOrdering(6, resultDocs, false); } - @Test(groups = {"emulator"}, timeOut = TIMEOUT) + @Test(groups = {"query"}, timeOut = TIMEOUT) public void quantizedIndexVectorSearch() { String queryVector = getQueryVector(); @@ -159,7 +158,7 @@ public void quantizedIndexVectorSearch() { validateOrdering(6, resultDocs, false); } - @Test(groups = {"emulator"}, timeOut = TIMEOUT*1000) + @Test(groups = {"query"}, timeOut = TIMEOUT*1000) public void largeDataVectorSearch() { double embeddingValue = 0.0001; for (int i=1;i<=2000;i++) { diff --git a/sdk/cosmos/test-resources.json b/sdk/cosmos/test-resources.json index 1447b7fa00b7..ff45d17cda27 100644 --- a/sdk/cosmos/test-resources.json +++ b/sdk/cosmos/test-resources.json @@ -5,7 +5,7 @@ "baseName": { "type": "string" }, - "enableMultipleWriteLocations" : { + "enableMultipleWriteLocations": { "type": "bool", "metadata": { "description": "Flag to enable or disable multiple write locations on CosmosDB Account" @@ -44,8 +44,9 @@ "provisioningState": "Succeeded", "failoverPriority": 0, "isZoneRedundant": false - }], - "multiRegionConfiguration": [ + } + ], + "multiRegionConfiguration": [ { "locationName": "West Central US", "provisioningState": "Succeeded", @@ -85,7 +86,11 @@ "maxStalenessPrefix": 100 }, "locations": "[variables('locationsConfiguration')]", - "capabilities": [], + "capabilities": [ + { + "name": "EnableNoSQLVectorSearch" + } + ], "ipRules": [] } }, From 2770b0f6a87b4f1b75aef50a8eae88f5a5da4e30 Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Thu, 16 May 2024 23:29:33 -0700 Subject: [PATCH 26/33] Updating the PQ logic --- .../DocumentQueryExecutionContextFactory.java | 6 +----- ...gOrderByDocumentQueryExecutionContext.java | 4 ---- .../query/NonStreamingOrderByUtils.java | 20 +++++++++---------- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java index fa87f265a628..4e9d077ba473 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java @@ -395,11 +395,7 @@ public static Flux> createSpecia int pageSizeWithTopOrLimit = Math.min(queryInfo.hasTop() ? queryInfo.getTop() : Integer.MAX_VALUE, queryInfo.hasLimit() && queryInfo.hasOffset() ? queryInfo.getLimit() + queryInfo.getOffset() : Integer.MAX_VALUE); - if (initialPageSize > 0) { - initialPageSize = Math.min(pageSizeWithTopOrLimit, initialPageSize); - } else { - initialPageSize = pageSizeWithTopOrLimit; - } + initialPageSize = pageSizeWithTopOrLimit; } } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java index 2f3abb36e9d1..59669f89c309 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java @@ -231,10 +231,6 @@ public Flux> apply(Flux> sourc } return feedResponse; }) - .concatWith(Flux.defer(() -> { - return Flux.just(feedResponseAccessor.createFeedResponse(Utils.immutableListOf(), - null, null)); - })) .map(feedOfOrderByRowResults -> { List unwrappedResults = new ArrayList<>(); for (OrderByRowResult orderByRowResult : feedOfOrderByRowResults.getResults()) { diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java index b0010d1fac54..0b2d5909dfe8 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java @@ -39,7 +39,7 @@ public static Flux> nonStreaming toNonStreamingOrderByQueryResultObservable(producer, tracker, queryMetricsMap, initialPageSize, consumeComparer, clientSideRequestStatistics)) .toArray(Flux[]::new); - return Flux.mergeComparingDelayError(1,consumeComparer, fluxes); + return Flux.mergeComparingDelayError(1, consumeComparer, fluxes); } private static Flux> toNonStreamingOrderByQueryResultObservable(DocumentProducer producer, @@ -92,23 +92,21 @@ public Flux> apply(Flux.Do r.toJson(), documentProducerFeedResponse.sourceFeedRange, null); - if (!Configs.getAzureCosmosNonStreamingOrderByDisabled()) { - if (priorityQueue.size() < initialPageSize) { - priorityQueue.add(orderByRowResult); - } else { - priorityQueue.add(orderByRowResult); - priorityQueue.poll(); + priorityQueue.add(orderByRowResult); + if (priorityQueue.size() > initialPageSize) { + PriorityBlockingQueue> resultPriorityQueue = new PriorityBlockingQueue<>(initialPageSize + 1, consumeComparer); + for (int i=0;i Flux.fromIterable(priorityQueue))); + .thenMany(Flux.defer(()-> Flux.fromIterable(priorityQueue))); } } } From 7002362cedd42ffef2a9a52cdc5bf450421907cf Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Fri, 17 May 2024 08:49:42 -0700 Subject: [PATCH 27/33] Resolving comments, adding new test cases --- ...StreamingOrderByQueryVectorSearchTest.java | 135 +++++++++++++----- ...gOrderByDocumentQueryExecutionContext.java | 4 +- .../query/NonStreamingOrderByUtils.java | 11 +- .../query/QueryPlanRetriever.java | 5 + .../models/CosmosQueryRequestOptions.java | 11 -- sdk/cosmos/test-resources.json | 6 +- 6 files changed, 116 insertions(+), 56 deletions(-) diff --git a/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/NonStreamingOrderByQueryVectorSearchTest.java b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/NonStreamingOrderByQueryVectorSearchTest.java index 391031518b76..13187b97c0d1 100644 --- a/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/NonStreamingOrderByQueryVectorSearchTest.java +++ b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx/NonStreamingOrderByQueryVectorSearchTest.java @@ -3,6 +3,7 @@ package com.azure.cosmos.rx; +import com.azure.cosmos.BridgeInternal; import com.azure.cosmos.ConsistencyLevel; import com.azure.cosmos.CosmosAsyncClient; import com.azure.cosmos.CosmosAsyncContainer; @@ -10,6 +11,8 @@ import com.azure.cosmos.CosmosClientBuilder; import com.azure.cosmos.CosmosDatabaseForTest; import com.azure.cosmos.DirectConnectionConfig; +import com.azure.cosmos.implementation.AsyncDocumentClient; +import com.azure.cosmos.implementation.PartitionKeyRange; import com.azure.cosmos.implementation.TestConfigurations; import com.azure.cosmos.models.CosmosContainerProperties; import com.azure.cosmos.models.CosmosQueryRequestOptions; @@ -19,10 +22,13 @@ import com.azure.cosmos.models.CosmosVectorEmbeddingPolicy; import com.azure.cosmos.models.CosmosVectorIndexSpec; import com.azure.cosmos.models.CosmosVectorIndexType; +import com.azure.cosmos.models.FeedResponse; import com.azure.cosmos.models.IncludedPath; import com.azure.cosmos.models.IndexingMode; import com.azure.cosmos.models.IndexingPolicy; import com.azure.cosmos.models.PartitionKeyDefinition; +import com.azure.cosmos.models.ThroughputProperties; +import com.azure.cosmos.models.ThroughputResponse; import com.fasterxml.jackson.annotation.JsonProperty; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -58,7 +64,7 @@ public class NonStreamingOrderByQueryVectorSearchTest { private CosmosAsyncContainer quantizedIndexContainer; private CosmosAsyncContainer largeDataContainer; - @BeforeClass(groups = {"query"}, timeOut = SETUP_TIMEOUT) + @BeforeClass(groups = {"query", "split"}, timeOut = SETUP_TIMEOUT) public void before_NonStreamingOrderByQueryVectorSearchTest() { // set up the client client = new CosmosClientBuilder() @@ -85,7 +91,7 @@ public void before_NonStreamingOrderByQueryVectorSearchTest() { containerProperties = new CosmosContainerProperties(quantizedContainerId, partitionKeyDef); containerProperties.setIndexingPolicy(populateIndexingPolicy(CosmosVectorIndexType.QUANTIZED_FLAT)); containerProperties.setVectorEmbeddingPolicy(populateVectorEmbeddingPolicy(128L)); - database.createContainer(containerProperties).block(); + database.createContainer(containerProperties, ThroughputProperties.createManualThroughput(20000)).block(); quantizedIndexContainer = database.getContainer(quantizedContainerId); containerProperties = new CosmosContainerProperties(largeDataContainerId, partitionKeyDef); @@ -94,7 +100,7 @@ public void before_NonStreamingOrderByQueryVectorSearchTest() { database.createContainer(containerProperties).block(); largeDataContainer = database.getContainer(largeDataContainerId); - for (Document doc: getVectorDocs()) { + for (Document doc : getVectorDocs()) { flatIndexContainer.createItem(doc).block(); quantizedIndexContainer.createItem(doc).block(); } @@ -158,67 +164,122 @@ public void quantizedIndexVectorSearch() { validateOrdering(6, resultDocs, false); } - @Test(groups = {"query"}, timeOut = TIMEOUT*1000) + @Test(groups = {"query"}, timeOut = TIMEOUT * 40) public void largeDataVectorSearch() { double embeddingValue = 0.0001; - for (int i=1;i<=2000;i++) { - Document doc = new Document(String.valueOf(i), String.valueOf(i%2), "text" + i, new double[] {embeddingValue, embeddingValue}); + for (int i = 1; i <= 2000; i++) { + Document doc = new Document(String.valueOf(i), String.valueOf(i % 2), "text" + i, new double[]{embeddingValue, embeddingValue}); largeDataContainer.createItem(doc).block(); - embeddingValue = 0.0001 * (i+1); + embeddingValue = 0.0001 * (i + 1); } - String query = String.format("SELECT c.id, VectorDistance(c.embedding, [0.0001, 0.0001]) AS score FROM c ORDER BY" + - " VectorDistance(c.embedding, [0.0001, 0.0001]) OFFSET 0 LIMIT 1000"); + String query = "SELECT c.id, VectorDistance(c.embedding, [0.0001, 0.0001]) AS score FROM c ORDER BY" + + " VectorDistance(c.embedding, [0.0001, 0.0001]) OFFSET 0 LIMIT 1000"; List resultDocs = largeDataContainer.queryItems(query, new CosmosQueryRequestOptions(), Document.class).byPage() .flatMap(feedResponse -> Flux.fromIterable(feedResponse.getResults())) .collectList().block(); validateOrdering(1000, resultDocs, false); - query = String.format("SELECT DISTINCT c.id, VectorDistance(c.embedding, [0.0001, 0.0001]) AS score FROM c ORDER BY" + - " VectorDistance(c.embedding, [0.0001, 0.0001]) OFFSET 0 LIMIT 1000"); + query = "SELECT DISTINCT c.id, VectorDistance(c.embedding, [0.0001, 0.0001]) AS score FROM c ORDER BY" + + " VectorDistance(c.embedding, [0.0001, 0.0001]) OFFSET 0 LIMIT 1000"; resultDocs = largeDataContainer.queryItems(query, new CosmosQueryRequestOptions(), Document.class).byPage() .flatMap(feedResponse -> Flux.fromIterable(feedResponse.getResults())) .collectList().block(); validateOrdering(1000, resultDocs, false); - query = String.format("SELECT c.id, VectorDistance(c.embedding, [0.0001, 0.0001]) AS score FROM c ORDER BY" + - " VectorDistance(c.embedding, [0.0001, 0.0001]) OFFSET 1000 LIMIT 500"); + query = "SELECT c.id, VectorDistance(c.embedding, [0.0001, 0.0001]) AS score FROM c ORDER BY" + + " VectorDistance(c.embedding, [0.0001, 0.0001]) OFFSET 1000 LIMIT 500"; resultDocs = largeDataContainer.queryItems(query, new CosmosQueryRequestOptions(), Document.class).byPage() .flatMap(feedResponse -> Flux.fromIterable(feedResponse.getResults())) .collectList().block(); validateOrdering(500, resultDocs, false); - query = String.format("SELECT DISTINCT c.id, VectorDistance(c.embedding, [0.0001, 0.0001]) AS score FROM c ORDER BY" + - " VectorDistance(c.embedding, [0.0001, 0.0001]) OFFSET 1000 LIMIT 500"); + query = "SELECT DISTINCT c.id, VectorDistance(c.embedding, [0.0001, 0.0001]) AS score FROM c ORDER BY" + + " VectorDistance(c.embedding, [0.0001, 0.0001]) OFFSET 1000 LIMIT 500"; resultDocs = largeDataContainer.queryItems(query, new CosmosQueryRequestOptions(), Document.class).byPage() .flatMap(feedResponse -> Flux.fromIterable(feedResponse.getResults())) .collectList().block(); validateOrdering(500, resultDocs, false); - query = String.format("SELECT TOP 1000 c.id, VectorDistance(c.embedding, [0.0001, 0.0001]) AS score FROM c ORDER BY" + - " VectorDistance(c.embedding, [0.0001, 0.0001])"); + query = "SELECT TOP 1000 c.id, VectorDistance(c.embedding, [0.0001, 0.0001]) AS score FROM c ORDER BY" + + " VectorDistance(c.embedding, [0.0001, 0.0001])"; resultDocs = largeDataContainer.queryItems(query, new CosmosQueryRequestOptions(), Document.class).byPage() .flatMap(feedResponse -> Flux.fromIterable(feedResponse.getResults())) .collectList().block(); validateOrdering(1000, resultDocs, false); - query = String.format("SELECT DISTINCT TOP 1000 c.id, VectorDistance(c.embedding, [0.0001, 0.0001]) AS score FROM c ORDER BY" + - " VectorDistance(c.embedding, [0.0001, 0.0001])"); + query = "SELECT DISTINCT TOP 1000 c.id, VectorDistance(c.embedding, [0.0001, 0.0001]) AS score FROM c ORDER BY" + + " VectorDistance(c.embedding, [0.0001, 0.0001])"; resultDocs = largeDataContainer.queryItems(query, new CosmosQueryRequestOptions(), Document.class).byPage() .flatMap(feedResponse -> Flux.fromIterable(feedResponse.getResults())) .collectList().block(); validateOrdering(1000, resultDocs, false); } + @Test(groups = {"split"}, timeOut = TIMEOUT * 40) + public void splitHandlingVectorSearch() throws Exception { + AsyncDocumentClient asyncDocumentClient = BridgeInternal.getContextClient(this.client); + List partitionKeyRanges = getPartitionKeyRanges(flatContainerId, asyncDocumentClient); + String queryVector = getQueryVector(); + + String vanillaQuery = String.format("SELECT DISTINCT TOP 6 c.text, VectorDistance(c.embedding, [%s]) AS " + + "score FROM c ORDER BY VectorDistance(c.embedding, [%s])", queryVector, queryVector); + List resultDocs = flatIndexContainer.queryItems(vanillaQuery, new CosmosQueryRequestOptions(), Document.class).byPage() + .flatMap(feedResponse -> Flux.fromIterable(feedResponse.getResults())) + .collectList().block(); + validateOrdering(6, resultDocs, false); + + // Scale up the throughput for a split + logger.info("Scaling up throughput for split"); + ThroughputProperties throughputProperties = ThroughputProperties.createManualThroughput(16000); + ThroughputResponse throughputResponse = flatIndexContainer.replaceThroughput(throughputProperties).block(); + logger.info("Throughput replace request submitted for {} ", + throughputResponse.getProperties().getManualThroughput()); + throughputResponse = flatIndexContainer.readThroughput().block(); + + // Wait for the throughput update to complete so that we get the partition split + while (true) { + assert throughputResponse != null; + if (!throughputResponse.isReplacePending()) { + break; + } + logger.info("Waiting for split to complete"); + Thread.sleep(10 * 1000); + throughputResponse = flatIndexContainer.readThroughput().block(); + } + + List partitionKeyRangesAfterSplit = getPartitionKeyRanges(flatContainerId, asyncDocumentClient); + assertThat(partitionKeyRangesAfterSplit.size()).isGreaterThan(partitionKeyRanges.size()) + .as("Partition ranges should increase after split"); + logger.info("After split num partitions = {}", partitionKeyRangesAfterSplit.size()); + + resultDocs = flatIndexContainer.queryItems(vanillaQuery, new CosmosQueryRequestOptions(), Document.class).byPage() + .flatMap(feedResponse -> Flux.fromIterable(feedResponse.getResults())) + .collectList().block(); + validateOrdering(6, resultDocs, false); + } + + private List getPartitionKeyRanges( + String containerId, AsyncDocumentClient asyncDocumentClient) { + List partitionKeyRanges = new ArrayList<>(); + List> partitionFeedResponseList = asyncDocumentClient + .readPartitionKeyRanges("/dbs/" + database.getId() + + "/colls/" + containerId, + new CosmosQueryRequestOptions()) + .collectList().block(); + partitionFeedResponseList.forEach(f -> partitionKeyRanges.addAll(f.getResults())); + return partitionKeyRanges; + } + private void validateOrdering(int top, List docs, boolean isEucledian) { assertThat(docs.size()).isEqualTo(top); if (isEucledian) { - for (int i=0;i getVectorDocs() { List docs = new ArrayList<>(); - docs.add(new Document("item0", "1", "Good morning!", new double[] {-0.008334724, -0.05993167, -0.0903545, -0.04791922, -0.01825805, -0.053011455, 0.120733805, 0.017714009, 0.07346743, 0.11559805, 0.03262076, 0.074512, 0.015864266, 0.01981401, 0.007850527, 0.076296456, -0.08539284, 0.016593281, -0.05423011, 0.07520837, 0.074250855, 0.056754466, -0.022098986, 0.03155444, 0.04334927, 0.024655985, -0.02109795, 0.044023883, -0.027550288, -0.11350893, -0.022806242, 0.08608921, 0.009221513, 0.06659074, 0.09087678, 0.024830079, 0.0075513036, 0.036472578, 0.015418151, 0.060497474, 0.010940685, -0.059365865, 0.043566886, 0.00427073, -0.023546139, 0.030357545, -0.03403527, 0.1182965, 0.1115939, -0.018954424, 0.0032452107, 0.10297628, 0.15328929, -0.016952349, -0.04530782, 0.04674409, -8.351895e-05, -0.19376601, -0.025091218, -0.03664667, -0.011860116, -0.10454312, -0.13109237, -0.049268447, 0.17557324, 0.044872586, 0.046787616, 0.15337633, -0.019509347, 0.0077743605, 0.04556896, -0.08413066, -0.028681897, 0.1209079, 0.1357929, -0.09314, 0.12534729, -0.065546185, 0.12212656, 0.04892026, 0.07394619, -0.08134516, -0.004493787, 0.08138869, 0.028573086, 0.12290998, -0.16477945, -0.29839617, -0.08090993, 0.12256179, 0.16591106, -0.08173688, -0.034383457, -0.1076768, -0.043022845, -0.07655759, 0.2021225, 0.03923631, 0.07703635, -0.08587159, 0.06498038, -0.08330371, 0.16486649, -0.14040637, 0.02070624, -0.069855, 0.052880887, 0.016136287, 0.00024294876, -0.19968519, 0.06933272, 0.013241983, 0.0004002109, 0.14998151, 0.07516485, 0.18610589, -0.07895138, -0.108982496, -0.03494926, -0.027637335, -0.032925423, -0.009509855, 0.1182965, -0.075513035, -0.08665501, 0.019629037, 0.2583547, 0.00983084})); - docs.add(new Document("item1", "2", "Good afternoon!", new double[] {-0.04136167, -0.047741424, -0.08737179, -3.0502639e-05, 0.054595508, -0.11298566, 0.0906921, 0.108052626, 0.04729081, 0.21287979, -0.06588459, -0.052793052, -0.05568647, 0.017384235, -0.02518698, 0.021665072, -0.19238868, 0.03379609, 0.0075359354, -0.04989963, 0.055449303, 0.03282371, 0.026064493, 0.042096883, -0.007192045, 0.0786441, -0.09012291, 0.094012424, -0.0031483725, -0.0318039, -0.034721036, 0.10255038, 0.08851018, 0.11327027, 0.031614166, 0.006035863, 0.021321183, 0.0703433, 0.14201473, 0.058674756, -0.007986549, 0.03329804, 0.08884221, -0.09505595, -0.015522485, -0.068161376, 0.072572656, 0.049235567, 0.2263508, 0.029574543, -0.050563693, 0.050516263, 0.04660303, 0.08376687, 0.017514676, 0.0706279, 0.007921329, -0.1353741, -0.054358345, -0.1628853, -0.097617336, -0.123326086, -0.0489984, -0.0693472, 0.15396787, 0.027368903, 0.06042978, 0.22862759, -0.016293272, 0.033582643, 0.06697555, -0.10302471, -0.12104929, 0.18034068, 0.068303674, 0.003468546, 0.07480201, -0.1204801, 0.06787678, -0.042926963, 0.15785739, -0.034531303, -0.028934196, 0.022933908, -0.012012435, 0.004248228, -0.19172463, -0.31837103, -0.099230066, 0.02071641, 0.18546346, 0.06299117, -0.047053643, -0.09206767, 0.049472734, -0.046365865, 0.18214314, 0.0051079527, 0.105680965, -0.026443958, 0.072714955, -0.08073115, 0.09429702, -0.113744594, 0.02092986, -0.013625161, -0.07390078, 0.020550394, 0.011787128, -0.13499463, 0.015107445, -0.0015223064, 0.040104695, 0.094961084, 0.13404597, 0.082486175, -0.07428025, -0.026847139, -0.025163265, -0.09818654, 0.010043961, 0.013601444, 0.077932596, 0.016056107, -0.026965722, 0.045606934, 0.085047565, -0.005878741})); - docs.add(new Document("item2", "1", "Great weather today!", new double[] {0.07557184, -0.047335204, -0.054325826, 0.011354052, 0.07698824, -0.025358144, -0.07927276, 0.1510523, 0.022251202, 0.026249107, -0.021725763, 0.062047496, 0.14556946, -0.0006071819, -0.107098185, 0.021394506, -0.13771072, -0.10527057, 0.115048304, -0.048842985, -0.059443146, 0.060585406, -0.014940745, 0.18075103, 0.053777542, -0.022057017, 0.08493836, 0.1198001, 0.041555375, -0.066525154, 0.054280136, 0.107646465, 0.023359193, -0.0046632714, -0.1017981, 0.04105278, 0.11376897, 0.016437104, 0.067393266, 0.0961325, -0.017727856, -0.03333111, -0.020492123, -0.041943744, 0.0031040881, -0.028053876, 0.053640474, -0.02215982, 0.08205987, 0.015100661, -0.17133881, -0.05843796, 0.0895074, -0.04064157, -0.10225501, 0.11367759, -0.03593546, -0.010999952, -0.14273666, -0.010383132, 0.026112035, -0.14200561, -0.0634639, -0.04029889, 0.07383561, 0.116784535, 0.0805064, 0.13241065, -0.100884296, -0.10216363, -0.030384084, -0.07657703, -0.06323545, -0.013101708, 0.15233164, -0.009880538, 0.16448526, -0.11148446, -0.05606206, -0.11587073, 0.084892675, -0.1397211, -0.04948265, 0.006470896, 0.015637523, 0.09051259, -0.12665366, -0.28583884, -0.16046451, 0.055833608, 0.100244634, 0.013535767, -0.07155109, -0.10051877, 0.08662891, -0.0729218, 0.15818, 0.025449526, 0.05053353, -0.015740326, -0.0767141, -0.056381892, 0.091517776, -0.075114936, -0.04621579, -0.040458806, 0.03947646, 0.10901718, 0.0076417113, -0.34487078, 0.024375802, -0.072419204, 0.053000808, 0.04057303, -0.08434439, 0.027185759, 0.03403931, -0.06332683, 0.051858548, 0.011993717, 0.10728095, -0.09887392, 0.07593736, -0.0025172527, 0.1089258, -0.048934367, 0.051264573, 0.017008234})); - docs.add(new Document("item3", "2", "Hope you're doing well.", new double[] {-0.016385807, 0.16914073, -0.062722616, 0.009645036, 0.06367876, -0.10871283, -0.034588274, 0.0038275379, 0.107661076, 0.069654614, 0.036404934, -0.037910853, 0.08872956, 0.14571536, -0.082227826, 0.034731694, -0.07405285, 0.050340638, -0.16569862, -0.20671692, -0.0834708, 0.0043175584, -0.017234378, 0.052683175, 0.013863994, 0.12142946, -0.002630872, 0.069702424, 0.095804974, -0.10020321, 0.0793116, 0.028970966, 0.13940485, 0.15814514, 0.11597948, -0.03795866, -0.018178564, 0.14753202, -0.10670494, -0.055455975, 0.058037546, -0.04457991, -0.0046014115, -0.018704439, 0.07902476, -0.07902476, 0.031026661, -0.017855868, 0.098769, 0.118847884, -0.051488005, 0.009017572, 0.15068726, 0.044962365, 0.18233542, -0.0006853563, 0.11205931, -0.2602606, 0.09848216, 0.08681728, -0.077638365, -0.008664995, 0.010314333, -0.0361659, 0.047185384, 0.09202823, 0.004359389, -0.008545479, -0.08815587, 0.0765388, 0.012262463, 0.0542608, -0.10813915, 0.11722245, 0.013744476, -0.08265808, 0.008055458, 0.12085578, 0.056364305, -0.12907855, -0.05311344, -0.060666922, 0.117031224, 0.029233903, -0.148775, 0.017879771, -0.081558526, -0.26332027, -0.22029407, -0.07410065, 0.0059340284, -0.11234615, -0.06898532, 0.046516087, 0.06798138, -0.049193274, -0.04687464, -0.049002044, -0.03145692, 0.0065614935, -0.021274058, -0.060188852, -0.04584679, -0.015979448, 0.08949447, -0.050197218, -0.051440194, -0.1341461, 0.08557431, -0.08261028, -0.104314595, -0.016134819, 0.057320442, -0.022421423, 0.012501498, 0.055503782, 0.020568907, -0.095183484, 0.0049450235, -0.03525757, 0.17688543, -0.06888971, -0.005694994, 0.05622088, -0.04250031, 0.050053798, 0.16063109, 0.06353533})); - docs.add(new Document("item4", "1", "Excuse me please.", new double[] {-0.19188246, 0.018719073, -0.032395326, 0.09734556, 0.021671357, -0.11751684, -0.078514785, 0.16507255, -0.0012956136, 0.117006175, -0.065492816, 0.106282204, -0.009750514, -0.006008296, 0.021799022, 0.04643862, -0.046023704, -0.023442727, 0.12868765, -0.1466886, -0.085089594, -0.046885453, -0.0067742937, 0.048162118, -0.04739612, 0.021687314, -0.025581138, 0.04841745, -0.10519704, -0.039129723, -0.09747323, 0.10532471, 0.04375763, 0.09536674, 0.0145938555, -0.0060681393, 0.26171595, 0.1815415, -0.03833181, 0.012487361, -0.027192924, -0.12281499, 0.017937116, -0.02173519, 0.07308897, -0.06913131, 0.07417413, -0.01884674, 0.049023863, -0.049949445, 0.081068106, 0.22060739, -0.031645287, -0.024735348, -0.041108552, 0.1823075, -0.06230116, -0.119048834, -0.07813178, -0.0841321, -0.007711843, 0.039576557, -0.07589762, 0.028198296, 0.003087929, 0.047970615, 0.0845151, 0.08208944, 0.07423796, 0.01259907, 0.00046179298, 0.024671515, 0.10302671, 0.12160216, 0.1353263, -0.16251922, 0.069195144, -0.09160058, 0.033320908, -0.06341824, -0.06402466, -0.048864283, -0.10053722, -0.019341446, 0.027033342, -0.19354212, -0.011146865, -0.31329313, 0.054513514, -0.0098861605, 0.10277138, 0.059237167, 0.021495815, -0.0704718, 0.14285861, 0.042672466, 0.057769008, 0.054353934, -0.041363884, 0.07819562, 0.1085802, -0.0047874865, 0.0035626881, 0.025405597, 0.0032953867, 0.13430496, -0.084451266, -0.10883553, 0.115601845, -0.072259136, -0.06976964, -0.1081972, 0.08515343, 0.044715125, 0.05725834, -0.06759931, -0.0421618, -0.06185433, -0.068939805, -0.13673063, -0.032874074, -0.121538326, -0.010157451, -0.048608948, 0.049949445, 0.031310163, 0.13238996, 0.06855681})); - docs.add(new Document("item5", "2", "Is this the right place?", new double[] {-0.05695127, 0.07729321, -0.07253956, 0.054049686, -0.084886715, -0.1677979, -0.020681491, -0.010765179, -0.05312365, 0.10964277, -0.1724898, -0.0139754405, -0.019446775, -0.009877727, 0.10902541, 0.06599557, -0.20224646, -0.008658445, -0.11698933, -0.00034678154, 0.059760246, 0.023660243, 0.014523345, 0.058340326, -0.116927594, -0.0011546522, 0.035991967, 0.017857078, -0.21261807, -0.07568809, -0.007250097, 0.09525833, 0.073033445, -0.078157514, -0.14816591, -0.089578636, -0.006030815, 0.08519539, 0.059852853, 0.12328638, 0.08544234, -0.017656436, -0.03901702, 0.036238912, -0.09482618, 0.007215371, 0.15742627, 0.014183799, 0.107914165, 0.014245534, -0.011907292, 0.025188204, 0.057630364, -0.057321683, 0.0024366346, 0.034695517, 0.11766842, -0.16520499, 0.065193, 0.10822285, -0.06834152, -0.048925616, -0.078836605, 0.05161112, 0.07235435, 0.07636718, -0.075996764, 0.13902901, 0.023860885, 0.07846619, 0.02665443, -0.026870504, -0.0084115015, 0.07550287, 0.07500899, -0.07395948, 0.05062335, 0.05621044, -0.031531557, -0.001280053, 0.06908235, 0.078280985, -0.060068928, 0.14236274, 0.14236274, 0.06358787, -0.042474225, -0.38053942, 0.062785305, 0.050870296, 0.038677476, -0.078157514, 0.029309068, -0.07809578, 0.07439163, -0.06772417, 0.11896487, 0.073589064, 0.05238282, 0.018196626, 0.116371974, 0.0033067234, -0.020264775, -0.006304768, -0.10686466, 0.08408415, -0.04386328, -0.0068681072, 0.08994905, -0.059513304, 0.021823604, 0.049419504, -0.012817894, -0.093221046, 0.02802805, 0.089578636, 0.07124311, -0.26694557, 0.024833223, -0.03802925, -0.18483697, -0.1103836, 0.11877967, 0.07000839, -0.018860284, -0.044974525, -0.034016423, 0.022780508})); - docs.add(new Document("item6", "1", "Awful weather today.", new double[] {0.002305239, -0.02629875, 0.009952777, 0.026884208, -0.0067561795, -0.1118458, 0.07432968, 0.0999493, 0.02177902, -0.047726493, 0.042059265, 0.1583077, 0.11175212, 0.07685886, -0.14060347, 0.005084698, -0.19277944, -0.05606341, 0.082619764, -0.04241054, 0.09620237, 0.011832096, -0.023301208, 0.28214368, 0.02451896, 0.02793803, 0.03358184, 0.044424515, 0.11006601, 0.038101573, 0.0077982936, 0.045572013, 0.075922124, 0.016369391, -0.0039986745, 0.22781321, 0.062854715, 0.048054352, 0.010251361, 0.07170683, -0.018816603, 0.027329156, -0.08482108, -0.079481706, 0.042785235, 0.024120849, 0.17413847, 0.035431888, 0.12439801, 0.10641275, -0.14828467, -0.024425287, 0.083415985, 0.1184966, 0.0026799317, 0.15399873, -0.010304051, 0.009742012, -0.10781785, -0.019472316, 0.061777476, -0.09798217, 0.028804509, -0.023371464, 0.015491205, 0.07521958, 0.024003757, 0.013465522, -0.089692086, -0.097794816, 0.021193562, -0.0592483, -0.056438103, -0.10987866, 0.11802823, -0.06440032, 0.07704621, -0.040138967, -0.13891736, -0.16027485, 0.08631986, -0.16786237, -0.085757814, 0.015491205, -0.013243048, 0.09133137, -0.16196096, -0.2313728, -0.083134964, 0.12308659, 0.07559427, 0.09723278, 0.048663225, -0.13339064, 0.016345974, -0.13189186, 0.11025336, 0.03346475, -0.00688498, -0.059435643, 0.0056877197, 0.014999421, 0.063650936, -0.15053283, -0.017481761, 0.05194179, 0.061402783, 0.0077924393, 0.19971126, -0.07713988, 0.06425981, 0.0021369199, 0.12158781, -0.024331613, -0.008571098, 0.03264511, -0.0020242194, -0.05507984, -0.00805004, -0.03304322, 0.050630365, -0.1475353, -0.003735219, -0.0202217, 0.16271034, -0.059435643, 0.06023187, 0.06660164})); - docs.add(new Document("item7", "2", "Dinosaurs were huge.", new double[] {0.09842033, -0.025395654, -0.03831241, 0.037825905, 0.17008278, -0.022269849, -0.05935383, 0.032668933, -0.022148222, 0.08178179, -0.062710725, 0.164342, -0.024021273, -0.052640036, 0.027366007, 0.18098053, -0.18487258, -0.008903074, 0.16346629, 0.009407825, 0.110339746, -0.046315446, 0.08046822, 0.12512955, -0.06635953, 0.0070239417, 0.055753678, -0.0005336371, -0.012326866, 0.1578228, -0.023668556, -0.035904203, 0.05988899, -0.08032227, -0.11520481, 0.08499274, 0.05093726, -0.09248494, -0.011128843, -0.07064079, 0.01466818, 0.082073696, -0.040574666, -0.07292737, 0.03539337, 0.05025615, -0.1145237, 0.09584184, 0.04186391, -0.034833886, -0.18234275, -0.090441614, -0.09194978, -0.031331036, -0.13106494, 0.068208255, 0.03220675, -0.031233737, -0.04337208, 0.1289243, 0.1363192, 0.052494083, 0.03074723, -0.000113359885, 0.07681943, 0.03962598, 0.016529068, -0.04191256, -0.03612313, 0.023084749, 0.10917213, 0.09477153, -0.09652295, -0.0999285, 0.11685894, -0.012649177, 0.043688312, -0.10333405, -0.060521446, -0.042034186, 0.0483831, 0.0028141378, -0.17270991, 0.05424551, 0.25570798, 0.09511208, -0.08504139, -0.1570444, -0.084262975, -0.13291366, -0.023741532, -0.14857918, 0.09190113, -0.08041958, -0.019837314, 0.09569589, -0.053029243, -0.030722905, -0.05239678, -0.15091442, -0.05872137, -0.056045584, 0.11831845, -0.1145237, -0.08761988, -0.0035727844, -0.05570503, 0.19285129, 0.011761302, 0.087717175, 0.107712604, -0.11277228, -0.042423394, 0.13048112, -0.03356897, 0.056775343, 0.08640361, -0.11831845, -0.10868562, 0.0410855, 0.12036178, -0.09477153, -0.017611546, 0.0075043673, -0.12668636, -0.006391483, 0.0012185475, -0.05161837})); - docs.add(new Document("item8", "1", "The hero saves the day again.", new double[] {0.11208976, 0.058739875, -0.017022463, 0.15080968, -0.0031057745, -0.048069898, -0.059069872, 0.09861479, 0.11626975, 0.12935972, 0.008882481, 0.08766981, -0.00940498, -0.077164836, 0.0015795279, 0.06297486, -0.06313986, 0.0931698, -0.17247963, -0.12077974, -0.044797402, -0.1404697, -0.050077394, 0.020432455, 0.07897983, 0.022632452, -0.046914898, 0.0031212433, -0.059399873, 0.03321993, -0.07237984, 0.10119978, 0.19612958, -0.086349815, 0.038252417, 0.084094815, 0.16257966, 0.15520966, 0.063304864, -0.08761481, 0.06132487, -0.08486482, -0.09789979, 0.06935485, -0.04160741, 0.05585238, -0.13485971, 0.105544776, -0.08084983, 0.103344776, 0.053817384, -0.0923998, -0.052607387, 0.015537467, 0.025299946, -0.05961987, 0.08090483, -0.25453946, 0.01894746, -0.026344944, -0.14552969, 0.014341219, 0.14409968, 0.12264974, -0.0456224, -0.13529971, -0.0466674, 0.006166862, 0.02776119, -0.020184956, 0.093939796, 0.054779883, -0.09635979, -0.016334964, -0.029177437, -0.06863985, 0.19139959, -0.08794481, -0.08464482, -0.013413096, 0.022109952, -0.122099735, -0.0458149, -0.019676207, 0.10785477, -0.109119765, -0.09690979, -0.28423938, 0.050709892, 0.12803972, 0.10620477, 0.12110974, -0.006658423, -0.052304886, -0.07798983, -0.035667423, -0.07507484, 0.02745869, 0.07237984, -0.0230862, -0.03684992, -0.067539856, -0.052387387, -0.05202989, 0.14244969, 0.080684826, -0.038472418, 0.112639755, 0.03242243, -0.07501984, 0.10631477, -0.024076197, -0.07754983, 0.06610986, -0.12671973, -0.044082403, 0.006001862, 0.037454918, 0.054504883, -0.03679492, 0.076669835, 0.02271495, 0.14794968, 0.06440486, -0.006850923, -0.06984985, 0.035639923, -0.009143731})); - docs.add(new Document("item9", "2", "Don't worry about it.", new double[] {-0.051598575, 0.22204931, -0.017881807, 0.11678282, 0.18426134, -0.03713568, -0.016847137, 0.06549915, 0.057626653, 0.032569632, 0.00076827104, -0.04489571, -0.07530603, 0.10778569, 0.030477798, 0.050338972, -0.21053298, -0.04341118, -0.097708896, -0.13432723, 0.1438642, 0.059606023, -0.12299085, -0.036820777, -0.026699001, 0.18381149, -0.02861089, 0.08259371, -0.14962237, -0.07373153, 0.02321261, 0.085607745, -0.13810603, 0.065139264, -0.12685962, 0.14098512, 0.17112552, -0.035921063, -0.008536032, -0.09680918, 0.04435588, -0.16086878, -0.035718627, 0.09689915, -0.0007956842, 0.034256592, -0.00234769, 0.04577293, 0.06725359, 0.015958669, -0.06486935, 0.124160476, 0.09887852, -0.050518915, -0.07080746, -0.078859895, 0.17013584, -0.22078972, -0.10103783, 0.06873812, 0.0370682, 0.04563797, -0.060235824, -0.056816913, -0.064689405, 0.11273411, 0.16572724, 0.108415484, 0.07921978, 0.05569227, -0.11210431, -0.05848138, -0.008361713, 0.07458626, -0.08992637, -0.07557594, -0.0020102975, -0.07080746, -0.0092614265, 0.06626391, -0.05848138, -0.078545, 0.08362838, -0.031737395, -0.047549862, -0.15367107, 0.093930095, -0.087182246, 0.06401462, 0.09006133, 0.10886534, 0.013338254, 0.025551865, -0.027553728, 0.14206477, -0.09060115, -0.07818511, -0.001209693, 0.017893054, -0.069367915, 0.0709874, 0.050249003, -0.13396735, -0.056681953, -0.022166694, -0.02170559, 0.08277365, -0.101667635, 0.09096104, 0.049529232, -0.095819496, -0.08974643, 0.054477658, -0.037967913, -0.08682236, 0.077690266, 0.03828281, -0.04136433, -0.14431405, -0.060505737, 0.025619343, -0.019400073, 0.11075474, 0.066893704, 0.07494614, 0.03684327, 0.03929499, -0.017353225})); + docs.add(new Document("item0", "1", "Good morning!", new double[]{-0.008334724, -0.05993167, -0.0903545, -0.04791922, -0.01825805, -0.053011455, 0.120733805, 0.017714009, 0.07346743, 0.11559805, 0.03262076, 0.074512, 0.015864266, 0.01981401, 0.007850527, 0.076296456, -0.08539284, 0.016593281, -0.05423011, 0.07520837, 0.074250855, 0.056754466, -0.022098986, 0.03155444, 0.04334927, 0.024655985, -0.02109795, 0.044023883, -0.027550288, -0.11350893, -0.022806242, 0.08608921, 0.009221513, 0.06659074, 0.09087678, 0.024830079, 0.0075513036, 0.036472578, 0.015418151, 0.060497474, 0.010940685, -0.059365865, 0.043566886, 0.00427073, -0.023546139, 0.030357545, -0.03403527, 0.1182965, 0.1115939, -0.018954424, 0.0032452107, 0.10297628, 0.15328929, -0.016952349, -0.04530782, 0.04674409, -8.351895e-05, -0.19376601, -0.025091218, -0.03664667, -0.011860116, -0.10454312, -0.13109237, -0.049268447, 0.17557324, 0.044872586, 0.046787616, 0.15337633, -0.019509347, 0.0077743605, 0.04556896, -0.08413066, -0.028681897, 0.1209079, 0.1357929, -0.09314, 0.12534729, -0.065546185, 0.12212656, 0.04892026, 0.07394619, -0.08134516, -0.004493787, 0.08138869, 0.028573086, 0.12290998, -0.16477945, -0.29839617, -0.08090993, 0.12256179, 0.16591106, -0.08173688, -0.034383457, -0.1076768, -0.043022845, -0.07655759, 0.2021225, 0.03923631, 0.07703635, -0.08587159, 0.06498038, -0.08330371, 0.16486649, -0.14040637, 0.02070624, -0.069855, 0.052880887, 0.016136287, 0.00024294876, -0.19968519, 0.06933272, 0.013241983, 0.0004002109, 0.14998151, 0.07516485, 0.18610589, -0.07895138, -0.108982496, -0.03494926, -0.027637335, -0.032925423, -0.009509855, 0.1182965, -0.075513035, -0.08665501, 0.019629037, 0.2583547, 0.00983084})); + docs.add(new Document("item1", "2", "Good afternoon!", new double[]{-0.04136167, -0.047741424, -0.08737179, -3.0502639e-05, 0.054595508, -0.11298566, 0.0906921, 0.108052626, 0.04729081, 0.21287979, -0.06588459, -0.052793052, -0.05568647, 0.017384235, -0.02518698, 0.021665072, -0.19238868, 0.03379609, 0.0075359354, -0.04989963, 0.055449303, 0.03282371, 0.026064493, 0.042096883, -0.007192045, 0.0786441, -0.09012291, 0.094012424, -0.0031483725, -0.0318039, -0.034721036, 0.10255038, 0.08851018, 0.11327027, 0.031614166, 0.006035863, 0.021321183, 0.0703433, 0.14201473, 0.058674756, -0.007986549, 0.03329804, 0.08884221, -0.09505595, -0.015522485, -0.068161376, 0.072572656, 0.049235567, 0.2263508, 0.029574543, -0.050563693, 0.050516263, 0.04660303, 0.08376687, 0.017514676, 0.0706279, 0.007921329, -0.1353741, -0.054358345, -0.1628853, -0.097617336, -0.123326086, -0.0489984, -0.0693472, 0.15396787, 0.027368903, 0.06042978, 0.22862759, -0.016293272, 0.033582643, 0.06697555, -0.10302471, -0.12104929, 0.18034068, 0.068303674, 0.003468546, 0.07480201, -0.1204801, 0.06787678, -0.042926963, 0.15785739, -0.034531303, -0.028934196, 0.022933908, -0.012012435, 0.004248228, -0.19172463, -0.31837103, -0.099230066, 0.02071641, 0.18546346, 0.06299117, -0.047053643, -0.09206767, 0.049472734, -0.046365865, 0.18214314, 0.0051079527, 0.105680965, -0.026443958, 0.072714955, -0.08073115, 0.09429702, -0.113744594, 0.02092986, -0.013625161, -0.07390078, 0.020550394, 0.011787128, -0.13499463, 0.015107445, -0.0015223064, 0.040104695, 0.094961084, 0.13404597, 0.082486175, -0.07428025, -0.026847139, -0.025163265, -0.09818654, 0.010043961, 0.013601444, 0.077932596, 0.016056107, -0.026965722, 0.045606934, 0.085047565, -0.005878741})); + docs.add(new Document("item2", "1", "Great weather today!", new double[]{0.07557184, -0.047335204, -0.054325826, 0.011354052, 0.07698824, -0.025358144, -0.07927276, 0.1510523, 0.022251202, 0.026249107, -0.021725763, 0.062047496, 0.14556946, -0.0006071819, -0.107098185, 0.021394506, -0.13771072, -0.10527057, 0.115048304, -0.048842985, -0.059443146, 0.060585406, -0.014940745, 0.18075103, 0.053777542, -0.022057017, 0.08493836, 0.1198001, 0.041555375, -0.066525154, 0.054280136, 0.107646465, 0.023359193, -0.0046632714, -0.1017981, 0.04105278, 0.11376897, 0.016437104, 0.067393266, 0.0961325, -0.017727856, -0.03333111, -0.020492123, -0.041943744, 0.0031040881, -0.028053876, 0.053640474, -0.02215982, 0.08205987, 0.015100661, -0.17133881, -0.05843796, 0.0895074, -0.04064157, -0.10225501, 0.11367759, -0.03593546, -0.010999952, -0.14273666, -0.010383132, 0.026112035, -0.14200561, -0.0634639, -0.04029889, 0.07383561, 0.116784535, 0.0805064, 0.13241065, -0.100884296, -0.10216363, -0.030384084, -0.07657703, -0.06323545, -0.013101708, 0.15233164, -0.009880538, 0.16448526, -0.11148446, -0.05606206, -0.11587073, 0.084892675, -0.1397211, -0.04948265, 0.006470896, 0.015637523, 0.09051259, -0.12665366, -0.28583884, -0.16046451, 0.055833608, 0.100244634, 0.013535767, -0.07155109, -0.10051877, 0.08662891, -0.0729218, 0.15818, 0.025449526, 0.05053353, -0.015740326, -0.0767141, -0.056381892, 0.091517776, -0.075114936, -0.04621579, -0.040458806, 0.03947646, 0.10901718, 0.0076417113, -0.34487078, 0.024375802, -0.072419204, 0.053000808, 0.04057303, -0.08434439, 0.027185759, 0.03403931, -0.06332683, 0.051858548, 0.011993717, 0.10728095, -0.09887392, 0.07593736, -0.0025172527, 0.1089258, -0.048934367, 0.051264573, 0.017008234})); + docs.add(new Document("item3", "2", "Hope you're doing well.", new double[]{-0.016385807, 0.16914073, -0.062722616, 0.009645036, 0.06367876, -0.10871283, -0.034588274, 0.0038275379, 0.107661076, 0.069654614, 0.036404934, -0.037910853, 0.08872956, 0.14571536, -0.082227826, 0.034731694, -0.07405285, 0.050340638, -0.16569862, -0.20671692, -0.0834708, 0.0043175584, -0.017234378, 0.052683175, 0.013863994, 0.12142946, -0.002630872, 0.069702424, 0.095804974, -0.10020321, 0.0793116, 0.028970966, 0.13940485, 0.15814514, 0.11597948, -0.03795866, -0.018178564, 0.14753202, -0.10670494, -0.055455975, 0.058037546, -0.04457991, -0.0046014115, -0.018704439, 0.07902476, -0.07902476, 0.031026661, -0.017855868, 0.098769, 0.118847884, -0.051488005, 0.009017572, 0.15068726, 0.044962365, 0.18233542, -0.0006853563, 0.11205931, -0.2602606, 0.09848216, 0.08681728, -0.077638365, -0.008664995, 0.010314333, -0.0361659, 0.047185384, 0.09202823, 0.004359389, -0.008545479, -0.08815587, 0.0765388, 0.012262463, 0.0542608, -0.10813915, 0.11722245, 0.013744476, -0.08265808, 0.008055458, 0.12085578, 0.056364305, -0.12907855, -0.05311344, -0.060666922, 0.117031224, 0.029233903, -0.148775, 0.017879771, -0.081558526, -0.26332027, -0.22029407, -0.07410065, 0.0059340284, -0.11234615, -0.06898532, 0.046516087, 0.06798138, -0.049193274, -0.04687464, -0.049002044, -0.03145692, 0.0065614935, -0.021274058, -0.060188852, -0.04584679, -0.015979448, 0.08949447, -0.050197218, -0.051440194, -0.1341461, 0.08557431, -0.08261028, -0.104314595, -0.016134819, 0.057320442, -0.022421423, 0.012501498, 0.055503782, 0.020568907, -0.095183484, 0.0049450235, -0.03525757, 0.17688543, -0.06888971, -0.005694994, 0.05622088, -0.04250031, 0.050053798, 0.16063109, 0.06353533})); + docs.add(new Document("item4", "1", "Excuse me please.", new double[]{-0.19188246, 0.018719073, -0.032395326, 0.09734556, 0.021671357, -0.11751684, -0.078514785, 0.16507255, -0.0012956136, 0.117006175, -0.065492816, 0.106282204, -0.009750514, -0.006008296, 0.021799022, 0.04643862, -0.046023704, -0.023442727, 0.12868765, -0.1466886, -0.085089594, -0.046885453, -0.0067742937, 0.048162118, -0.04739612, 0.021687314, -0.025581138, 0.04841745, -0.10519704, -0.039129723, -0.09747323, 0.10532471, 0.04375763, 0.09536674, 0.0145938555, -0.0060681393, 0.26171595, 0.1815415, -0.03833181, 0.012487361, -0.027192924, -0.12281499, 0.017937116, -0.02173519, 0.07308897, -0.06913131, 0.07417413, -0.01884674, 0.049023863, -0.049949445, 0.081068106, 0.22060739, -0.031645287, -0.024735348, -0.041108552, 0.1823075, -0.06230116, -0.119048834, -0.07813178, -0.0841321, -0.007711843, 0.039576557, -0.07589762, 0.028198296, 0.003087929, 0.047970615, 0.0845151, 0.08208944, 0.07423796, 0.01259907, 0.00046179298, 0.024671515, 0.10302671, 0.12160216, 0.1353263, -0.16251922, 0.069195144, -0.09160058, 0.033320908, -0.06341824, -0.06402466, -0.048864283, -0.10053722, -0.019341446, 0.027033342, -0.19354212, -0.011146865, -0.31329313, 0.054513514, -0.0098861605, 0.10277138, 0.059237167, 0.021495815, -0.0704718, 0.14285861, 0.042672466, 0.057769008, 0.054353934, -0.041363884, 0.07819562, 0.1085802, -0.0047874865, 0.0035626881, 0.025405597, 0.0032953867, 0.13430496, -0.084451266, -0.10883553, 0.115601845, -0.072259136, -0.06976964, -0.1081972, 0.08515343, 0.044715125, 0.05725834, -0.06759931, -0.0421618, -0.06185433, -0.068939805, -0.13673063, -0.032874074, -0.121538326, -0.010157451, -0.048608948, 0.049949445, 0.031310163, 0.13238996, 0.06855681})); + docs.add(new Document("item5", "2", "Is this the right place?", new double[]{-0.05695127, 0.07729321, -0.07253956, 0.054049686, -0.084886715, -0.1677979, -0.020681491, -0.010765179, -0.05312365, 0.10964277, -0.1724898, -0.0139754405, -0.019446775, -0.009877727, 0.10902541, 0.06599557, -0.20224646, -0.008658445, -0.11698933, -0.00034678154, 0.059760246, 0.023660243, 0.014523345, 0.058340326, -0.116927594, -0.0011546522, 0.035991967, 0.017857078, -0.21261807, -0.07568809, -0.007250097, 0.09525833, 0.073033445, -0.078157514, -0.14816591, -0.089578636, -0.006030815, 0.08519539, 0.059852853, 0.12328638, 0.08544234, -0.017656436, -0.03901702, 0.036238912, -0.09482618, 0.007215371, 0.15742627, 0.014183799, 0.107914165, 0.014245534, -0.011907292, 0.025188204, 0.057630364, -0.057321683, 0.0024366346, 0.034695517, 0.11766842, -0.16520499, 0.065193, 0.10822285, -0.06834152, -0.048925616, -0.078836605, 0.05161112, 0.07235435, 0.07636718, -0.075996764, 0.13902901, 0.023860885, 0.07846619, 0.02665443, -0.026870504, -0.0084115015, 0.07550287, 0.07500899, -0.07395948, 0.05062335, 0.05621044, -0.031531557, -0.001280053, 0.06908235, 0.078280985, -0.060068928, 0.14236274, 0.14236274, 0.06358787, -0.042474225, -0.38053942, 0.062785305, 0.050870296, 0.038677476, -0.078157514, 0.029309068, -0.07809578, 0.07439163, -0.06772417, 0.11896487, 0.073589064, 0.05238282, 0.018196626, 0.116371974, 0.0033067234, -0.020264775, -0.006304768, -0.10686466, 0.08408415, -0.04386328, -0.0068681072, 0.08994905, -0.059513304, 0.021823604, 0.049419504, -0.012817894, -0.093221046, 0.02802805, 0.089578636, 0.07124311, -0.26694557, 0.024833223, -0.03802925, -0.18483697, -0.1103836, 0.11877967, 0.07000839, -0.018860284, -0.044974525, -0.034016423, 0.022780508})); + docs.add(new Document("item6", "1", "Awful weather today.", new double[]{0.002305239, -0.02629875, 0.009952777, 0.026884208, -0.0067561795, -0.1118458, 0.07432968, 0.0999493, 0.02177902, -0.047726493, 0.042059265, 0.1583077, 0.11175212, 0.07685886, -0.14060347, 0.005084698, -0.19277944, -0.05606341, 0.082619764, -0.04241054, 0.09620237, 0.011832096, -0.023301208, 0.28214368, 0.02451896, 0.02793803, 0.03358184, 0.044424515, 0.11006601, 0.038101573, 0.0077982936, 0.045572013, 0.075922124, 0.016369391, -0.0039986745, 0.22781321, 0.062854715, 0.048054352, 0.010251361, 0.07170683, -0.018816603, 0.027329156, -0.08482108, -0.079481706, 0.042785235, 0.024120849, 0.17413847, 0.035431888, 0.12439801, 0.10641275, -0.14828467, -0.024425287, 0.083415985, 0.1184966, 0.0026799317, 0.15399873, -0.010304051, 0.009742012, -0.10781785, -0.019472316, 0.061777476, -0.09798217, 0.028804509, -0.023371464, 0.015491205, 0.07521958, 0.024003757, 0.013465522, -0.089692086, -0.097794816, 0.021193562, -0.0592483, -0.056438103, -0.10987866, 0.11802823, -0.06440032, 0.07704621, -0.040138967, -0.13891736, -0.16027485, 0.08631986, -0.16786237, -0.085757814, 0.015491205, -0.013243048, 0.09133137, -0.16196096, -0.2313728, -0.083134964, 0.12308659, 0.07559427, 0.09723278, 0.048663225, -0.13339064, 0.016345974, -0.13189186, 0.11025336, 0.03346475, -0.00688498, -0.059435643, 0.0056877197, 0.014999421, 0.063650936, -0.15053283, -0.017481761, 0.05194179, 0.061402783, 0.0077924393, 0.19971126, -0.07713988, 0.06425981, 0.0021369199, 0.12158781, -0.024331613, -0.008571098, 0.03264511, -0.0020242194, -0.05507984, -0.00805004, -0.03304322, 0.050630365, -0.1475353, -0.003735219, -0.0202217, 0.16271034, -0.059435643, 0.06023187, 0.06660164})); + docs.add(new Document("item7", "2", "Dinosaurs were huge.", new double[]{0.09842033, -0.025395654, -0.03831241, 0.037825905, 0.17008278, -0.022269849, -0.05935383, 0.032668933, -0.022148222, 0.08178179, -0.062710725, 0.164342, -0.024021273, -0.052640036, 0.027366007, 0.18098053, -0.18487258, -0.008903074, 0.16346629, 0.009407825, 0.110339746, -0.046315446, 0.08046822, 0.12512955, -0.06635953, 0.0070239417, 0.055753678, -0.0005336371, -0.012326866, 0.1578228, -0.023668556, -0.035904203, 0.05988899, -0.08032227, -0.11520481, 0.08499274, 0.05093726, -0.09248494, -0.011128843, -0.07064079, 0.01466818, 0.082073696, -0.040574666, -0.07292737, 0.03539337, 0.05025615, -0.1145237, 0.09584184, 0.04186391, -0.034833886, -0.18234275, -0.090441614, -0.09194978, -0.031331036, -0.13106494, 0.068208255, 0.03220675, -0.031233737, -0.04337208, 0.1289243, 0.1363192, 0.052494083, 0.03074723, -0.000113359885, 0.07681943, 0.03962598, 0.016529068, -0.04191256, -0.03612313, 0.023084749, 0.10917213, 0.09477153, -0.09652295, -0.0999285, 0.11685894, -0.012649177, 0.043688312, -0.10333405, -0.060521446, -0.042034186, 0.0483831, 0.0028141378, -0.17270991, 0.05424551, 0.25570798, 0.09511208, -0.08504139, -0.1570444, -0.084262975, -0.13291366, -0.023741532, -0.14857918, 0.09190113, -0.08041958, -0.019837314, 0.09569589, -0.053029243, -0.030722905, -0.05239678, -0.15091442, -0.05872137, -0.056045584, 0.11831845, -0.1145237, -0.08761988, -0.0035727844, -0.05570503, 0.19285129, 0.011761302, 0.087717175, 0.107712604, -0.11277228, -0.042423394, 0.13048112, -0.03356897, 0.056775343, 0.08640361, -0.11831845, -0.10868562, 0.0410855, 0.12036178, -0.09477153, -0.017611546, 0.0075043673, -0.12668636, -0.006391483, 0.0012185475, -0.05161837})); + docs.add(new Document("item8", "1", "The hero saves the day again.", new double[]{0.11208976, 0.058739875, -0.017022463, 0.15080968, -0.0031057745, -0.048069898, -0.059069872, 0.09861479, 0.11626975, 0.12935972, 0.008882481, 0.08766981, -0.00940498, -0.077164836, 0.0015795279, 0.06297486, -0.06313986, 0.0931698, -0.17247963, -0.12077974, -0.044797402, -0.1404697, -0.050077394, 0.020432455, 0.07897983, 0.022632452, -0.046914898, 0.0031212433, -0.059399873, 0.03321993, -0.07237984, 0.10119978, 0.19612958, -0.086349815, 0.038252417, 0.084094815, 0.16257966, 0.15520966, 0.063304864, -0.08761481, 0.06132487, -0.08486482, -0.09789979, 0.06935485, -0.04160741, 0.05585238, -0.13485971, 0.105544776, -0.08084983, 0.103344776, 0.053817384, -0.0923998, -0.052607387, 0.015537467, 0.025299946, -0.05961987, 0.08090483, -0.25453946, 0.01894746, -0.026344944, -0.14552969, 0.014341219, 0.14409968, 0.12264974, -0.0456224, -0.13529971, -0.0466674, 0.006166862, 0.02776119, -0.020184956, 0.093939796, 0.054779883, -0.09635979, -0.016334964, -0.029177437, -0.06863985, 0.19139959, -0.08794481, -0.08464482, -0.013413096, 0.022109952, -0.122099735, -0.0458149, -0.019676207, 0.10785477, -0.109119765, -0.09690979, -0.28423938, 0.050709892, 0.12803972, 0.10620477, 0.12110974, -0.006658423, -0.052304886, -0.07798983, -0.035667423, -0.07507484, 0.02745869, 0.07237984, -0.0230862, -0.03684992, -0.067539856, -0.052387387, -0.05202989, 0.14244969, 0.080684826, -0.038472418, 0.112639755, 0.03242243, -0.07501984, 0.10631477, -0.024076197, -0.07754983, 0.06610986, -0.12671973, -0.044082403, 0.006001862, 0.037454918, 0.054504883, -0.03679492, 0.076669835, 0.02271495, 0.14794968, 0.06440486, -0.006850923, -0.06984985, 0.035639923, -0.009143731})); + docs.add(new Document("item9", "2", "Don't worry about it.", new double[]{-0.051598575, 0.22204931, -0.017881807, 0.11678282, 0.18426134, -0.03713568, -0.016847137, 0.06549915, 0.057626653, 0.032569632, 0.00076827104, -0.04489571, -0.07530603, 0.10778569, 0.030477798, 0.050338972, -0.21053298, -0.04341118, -0.097708896, -0.13432723, 0.1438642, 0.059606023, -0.12299085, -0.036820777, -0.026699001, 0.18381149, -0.02861089, 0.08259371, -0.14962237, -0.07373153, 0.02321261, 0.085607745, -0.13810603, 0.065139264, -0.12685962, 0.14098512, 0.17112552, -0.035921063, -0.008536032, -0.09680918, 0.04435588, -0.16086878, -0.035718627, 0.09689915, -0.0007956842, 0.034256592, -0.00234769, 0.04577293, 0.06725359, 0.015958669, -0.06486935, 0.124160476, 0.09887852, -0.050518915, -0.07080746, -0.078859895, 0.17013584, -0.22078972, -0.10103783, 0.06873812, 0.0370682, 0.04563797, -0.060235824, -0.056816913, -0.064689405, 0.11273411, 0.16572724, 0.108415484, 0.07921978, 0.05569227, -0.11210431, -0.05848138, -0.008361713, 0.07458626, -0.08992637, -0.07557594, -0.0020102975, -0.07080746, -0.0092614265, 0.06626391, -0.05848138, -0.078545, 0.08362838, -0.031737395, -0.047549862, -0.15367107, 0.093930095, -0.087182246, 0.06401462, 0.09006133, 0.10886534, 0.013338254, 0.025551865, -0.027553728, 0.14206477, -0.09060115, -0.07818511, -0.001209693, 0.017893054, -0.069367915, 0.0709874, 0.050249003, -0.13396735, -0.056681953, -0.022166694, -0.02170559, 0.08277365, -0.101667635, 0.09096104, 0.049529232, -0.095819496, -0.08974643, 0.054477658, -0.037967913, -0.08682236, 0.077690266, 0.03828281, -0.04136433, -0.14431405, -0.060505737, 0.025619343, -0.019400073, 0.11075474, 0.066893704, 0.07494614, 0.03684327, 0.03929499, -0.017353225})); return docs; } @@ -284,9 +345,13 @@ public Document(String id, String pk, String text, double[] embedding) { this.embedding = embedding; } - public Document() {} + public Document() { + } + + public String getId() { + return id; + } - public String getId() { return id; } public double getScore() { return score; } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java index 59669f89c309..0596e77dd2cd 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByDocumentQueryExecutionContext.java @@ -59,8 +59,6 @@ public class NonStreamingOrderByDocumentQueryExecutionContext private final Collection clientSideRequestStatistics; private Flux> orderByObservable; - private int maxPageSizePerPartition; - public NonStreamingOrderByDocumentQueryExecutionContext( DiagnosticsClientContext diagnosticsClientContext, IDocumentQueryClient client, @@ -170,7 +168,7 @@ protected NonStreamingOrderByDocumentProducer createDocumentProducer( createRetryPolicyFunc, Document.class, correlatedActivityId, - maxPageSizePerPartition, + initialPageSize, continuationToken, top, this.getOperationContextTextProvider()); diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java index 0b2d5909dfe8..54170761f765 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/NonStreamingOrderByUtils.java @@ -78,7 +78,6 @@ public Flux> apply(Flux.Do // item and then remove the element. If we don't do this, then when adding this element the size of the pq // will be increased automatically by 50% and then there would be inconsistent results for later pages. PriorityBlockingQueue> priorityQueue = new PriorityBlockingQueue<>(initialPageSize + 1, consumeComparer); - return source.flatMap(documentProducerFeedResponse -> { clientSideRequestStatistics.addAll( diagnosticsAccessor.getClientSideRequestStatisticsForQueryPipelineAggregations(documentProducerFeedResponse @@ -94,19 +93,19 @@ public Flux> apply(Flux.Do null); priorityQueue.add(orderByRowResult); if (priorityQueue.size() > initialPageSize) { - PriorityBlockingQueue> resultPriorityQueue = new PriorityBlockingQueue<>(initialPageSize + 1, consumeComparer); - for (int i=0;i> tempPriorityQueue = new PriorityBlockingQueue<>(initialPageSize + 1, consumeComparer); + for (int i = 0; i < initialPageSize; i++) { + tempPriorityQueue.add(priorityQueue.poll()); } priorityQueue.clear(); - priorityQueue.addAll(resultPriorityQueue); + priorityQueue.addAll(tempPriorityQueue); } }); tracker.addCharge(documentProducerFeedResponse.pageResult.getRequestCharge()); // Returning an empty Flux since we are only processing and managing state here return Flux.empty(); }, 1) - .thenMany(Flux.defer(()-> Flux.fromIterable(priorityQueue))); + .thenMany(Flux.defer(() -> Flux.fromIterable(priorityQueue))); } } } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryPlanRetriever.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryPlanRetriever.java index fb79a316c445..4b54dac0f462 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryPlanRetriever.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/QueryPlanRetriever.java @@ -34,6 +34,11 @@ class QueryPlanRetriever { ImplementationBridgeHelpers.CosmosQueryRequestOptionsHelper.getCosmosQueryRequestOptionsAccessor(); private static final String TRUE = "True"; + + // For a limited time, if the query runs against a region or emulator that has not yet been updated with the + // new NonStreamingOrderBy query feature the client might run into some issue of not being able to recognize this, + // and throw a 400 exception. If the environment variable `AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY` is set to + // True to opt out of this new query feature, we will return the OLD query features to operate correctly. private static final String SUPPORTED_QUERY_FEATURES = QueryFeature.Aggregate.name() + ", " + QueryFeature.CompositeAggregate.name() + ", " + QueryFeature.MultipleOrderBy.name() + ", " + diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java index d15e76716862..b9c5a729b546 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosQueryRequestOptions.java @@ -265,17 +265,6 @@ Integer getMaxItemCountForVectorSearch() { return this.actualRequestOptions.getMaxItemCountForVectorSearch(); } - /** - * Sets the maximum item size to fetch during non-streaming order by queries. - * - * @param maxItemCountForVectorSearch the max number of items for vector search. - * @return the CosmosQueryRequestOptions. - */ - CosmosQueryRequestOptions setMaxItemCountForVectorSearch(Integer maxItemCountForVectorSearch) { - this.actualRequestOptions.setMaxItemCountForVectorSearch(maxItemCountForVectorSearch); - return this; - } - /** * Gets the request continuation token. * diff --git a/sdk/cosmos/test-resources.json b/sdk/cosmos/test-resources.json index ff45d17cda27..764c3e49b5c8 100644 --- a/sdk/cosmos/test-resources.json +++ b/sdk/cosmos/test-resources.json @@ -117,7 +117,11 @@ "maxStalenessPrefix": 100 }, "locations": "[variables('locationsConfiguration')]", - "capabilities": [], + "capabilities": [ + { + "name": "EnableNoSQLVectorSearch" + } + ], "ipRules": [] } } From 508e94a6e891e3ff7024b16cdf5662a6bb8b07e2 Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Fri, 17 May 2024 12:34:51 -0700 Subject: [PATCH 28/33] Adding argument to run emulator tests --- .../stages/cosmos-emulator-matrix.json | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/eng/pipelines/templates/stages/cosmos-emulator-matrix.json b/eng/pipelines/templates/stages/cosmos-emulator-matrix.json index 740299ba70ae..61ec2fc70073 100644 --- a/eng/pipelines/templates/stages/cosmos-emulator-matrix.json +++ b/eng/pipelines/templates/stages/cosmos-emulator-matrix.json @@ -9,14 +9,14 @@ "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Strong\", \"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Emulator Only Integration Tests Tcp - Java 17": { "ProfileFlag": "-Pemulator", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Strong\", \"Session\"]", "JavaTestVersion": "1.17", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Spring Emulator Only Integration Tests - Java 8": { "ProfileFlag": "-Pintegration-test-emulator", @@ -28,7 +28,7 @@ "NEW_ACCOUNT_KEY": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==", "NEW_SECONDARY_ACCOUNT_KEY": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==", "TestFromSource": true, - "AdditionalArgs": "-Dspring-e2e", + "AdditionalArgs": "-Dspring-e2e -argline=\"-DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"", "Language": "Spring" }, "Spring Emulator Only Integration Tests - Java 17": { @@ -41,7 +41,7 @@ "NEW_ACCOUNT_KEY": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==", "NEW_SECONDARY_ACCOUNT_KEY": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==", "TestFromSource": true, - "AdditionalArgs": "-Dspring-e2e", + "AdditionalArgs": "-Dspring-e2e -argline=\"-DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"", "Language": "Spring" }, "Encryption Emulator Only Integration Tests": { @@ -49,84 +49,84 @@ "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-Dencryption-e2e -DargLine=\"-DACCOUNT_HOST=https://localhost:8081/\"" + "AdditionalArgs": "-Dencryption-e2e -DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Spark 3.1 Integration Tests targeting Cosmos Emulator - Java 8'": { "ProfileFlag": "-Dspark-e2e_3-1", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Spark 3.2 Integration Tests targeting Cosmos Emulator - Java 8'": { "ProfileFlag": "-Dspark-e2e_3-2", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Spark 3.2 Integration Tests targeting Cosmos Emulator - Java 11'": { "ProfileFlag": "-Dspark-e2e_3-2", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.11", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Spark 3.3 Integration Tests targeting Cosmos Emulator - Java 8'": { "ProfileFlag": "-Dspark-e2e_3-3", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Spark 3.3 Integration Tests targeting Cosmos Emulator - Java 11'": { "ProfileFlag": "-Dspark-e2e_3-3", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.11", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Spark 3.4 Integration Tests targeting Cosmos Emulator - Java 8'": { "ProfileFlag": "-Dspark-e2e_3-4", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Spark 3.4 Integration Tests targeting Cosmos Emulator - Java 11'": { "ProfileFlag": "-Dspark-e2e_3-4", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.11", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Spark 3.5 Integration Tests targeting Cosmos Emulator - Java 8'": { "ProfileFlag": "-Dspark-e2e_3-5", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Spark 3.5 Integration Tests targeting Cosmos Emulator - Java 11'": { "ProfileFlag": "-Dspark-e2e_3-5", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.11", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Kafka Integration Tests targeting Cosmos Emulator - Java 11": { "ProfileFlag": "-Pkafka-emulator", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.11", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Kafka Integration Tests targeting Cosmos Emulator - Java 17": { "ProfileFlag": "-Pkafka-emulator", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.17", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" } } } From 822bd67086a23cbc858266d615a87b130bce6875 Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Fri, 17 May 2024 13:08:58 -0700 Subject: [PATCH 29/33] fixing emulator test pipeline --- eng/pipelines/templates/stages/cosmos-emulator-matrix.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/templates/stages/cosmos-emulator-matrix.json b/eng/pipelines/templates/stages/cosmos-emulator-matrix.json index 61ec2fc70073..67b6cba776c3 100644 --- a/eng/pipelines/templates/stages/cosmos-emulator-matrix.json +++ b/eng/pipelines/templates/stages/cosmos-emulator-matrix.json @@ -28,7 +28,7 @@ "NEW_ACCOUNT_KEY": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==", "NEW_SECONDARY_ACCOUNT_KEY": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==", "TestFromSource": true, - "AdditionalArgs": "-Dspring-e2e -argline=\"-DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"", + "AdditionalArgs": "-Dspring-e2e -Dargline=\"-DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"", "Language": "Spring" }, "Spring Emulator Only Integration Tests - Java 17": { @@ -41,7 +41,7 @@ "NEW_ACCOUNT_KEY": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==", "NEW_SECONDARY_ACCOUNT_KEY": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==", "TestFromSource": true, - "AdditionalArgs": "-Dspring-e2e -argline=\"-DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"", + "AdditionalArgs": "-Dspring-e2e -Dargline=\"-DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"", "Language": "Spring" }, "Encryption Emulator Only Integration Tests": { From 46fe7cb1351b22f41eb58f563dce51c98ccb650d Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Fri, 17 May 2024 15:23:38 -0700 Subject: [PATCH 30/33] fixing emulator test pipeline --- .../stages/cosmos-emulator-matrix.json | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/eng/pipelines/templates/stages/cosmos-emulator-matrix.json b/eng/pipelines/templates/stages/cosmos-emulator-matrix.json index 67b6cba776c3..3381ba76d361 100644 --- a/eng/pipelines/templates/stages/cosmos-emulator-matrix.json +++ b/eng/pipelines/templates/stages/cosmos-emulator-matrix.json @@ -9,14 +9,14 @@ "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Strong\", \"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Emulator Only Integration Tests Tcp - Java 17": { "ProfileFlag": "-Pemulator", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Strong\", \"Session\"]", "JavaTestVersion": "1.17", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Spring Emulator Only Integration Tests - Java 8": { "ProfileFlag": "-Pintegration-test-emulator", @@ -28,7 +28,7 @@ "NEW_ACCOUNT_KEY": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==", "NEW_SECONDARY_ACCOUNT_KEY": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==", "TestFromSource": true, - "AdditionalArgs": "-Dspring-e2e -Dargline=\"-DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"", + "AdditionalArgs": "-Dspring-e2e -Dargline=\"-DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"", "Language": "Spring" }, "Spring Emulator Only Integration Tests - Java 17": { @@ -41,7 +41,7 @@ "NEW_ACCOUNT_KEY": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==", "NEW_SECONDARY_ACCOUNT_KEY": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==", "TestFromSource": true, - "AdditionalArgs": "-Dspring-e2e -Dargline=\"-DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"", + "AdditionalArgs": "-Dspring-e2e -Dargline=\"-DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"", "Language": "Spring" }, "Encryption Emulator Only Integration Tests": { @@ -49,84 +49,84 @@ "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-Dencryption-e2e -DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" + "AdditionalArgs": "-Dencryption-e2e -DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Spark 3.1 Integration Tests targeting Cosmos Emulator - Java 8'": { "ProfileFlag": "-Dspark-e2e_3-1", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Spark 3.2 Integration Tests targeting Cosmos Emulator - Java 8'": { "ProfileFlag": "-Dspark-e2e_3-2", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Spark 3.2 Integration Tests targeting Cosmos Emulator - Java 11'": { "ProfileFlag": "-Dspark-e2e_3-2", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.11", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Spark 3.3 Integration Tests targeting Cosmos Emulator - Java 8'": { "ProfileFlag": "-Dspark-e2e_3-3", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Spark 3.3 Integration Tests targeting Cosmos Emulator - Java 11'": { "ProfileFlag": "-Dspark-e2e_3-3", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.11", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Spark 3.4 Integration Tests targeting Cosmos Emulator - Java 8'": { "ProfileFlag": "-Dspark-e2e_3-4", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Spark 3.4 Integration Tests targeting Cosmos Emulator - Java 11'": { "ProfileFlag": "-Dspark-e2e_3-4", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.11", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Spark 3.5 Integration Tests targeting Cosmos Emulator - Java 8'": { "ProfileFlag": "-Dspark-e2e_3-5", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Spark 3.5 Integration Tests targeting Cosmos Emulator - Java 11'": { "ProfileFlag": "-Dspark-e2e_3-5", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.11", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Kafka Integration Tests targeting Cosmos Emulator - Java 11": { "ProfileFlag": "-Pkafka-emulator", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.11", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" }, "Kafka Integration Tests targeting Cosmos Emulator - Java 17": { "ProfileFlag": "-Pkafka-emulator", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.17", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -DAZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" + "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" } } } From 5657b7593e5c67b4e69d5671753437820e305a6e Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Fri, 17 May 2024 16:46:58 -0700 Subject: [PATCH 31/33] Adding logging for variable AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY --- .../src/main/java/com/azure/cosmos/implementation/Configs.java | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java index c565436ca4f9..845a46fd59b3 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java @@ -508,6 +508,7 @@ public static int getMaxItemCountForVectorSearch() { } public static boolean getAzureCosmosNonStreamingOrderByDisabled() { + logger.info("AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY is: {}", System.getProperty(AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY)); return Boolean.parseBoolean(System.getProperty(AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY, firstNonNull( emptyToNull(System.getenv().get(AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY)), From 015a77c861cf7eefd388ead82f3eeba665d467b8 Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Fri, 17 May 2024 16:54:11 -0700 Subject: [PATCH 32/33] Adding logging for variable AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY --- .../src/main/java/com/azure/cosmos/implementation/Configs.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java index 845a46fd59b3..38ff724b3fa8 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java @@ -508,7 +508,8 @@ public static int getMaxItemCountForVectorSearch() { } public static boolean getAzureCosmosNonStreamingOrderByDisabled() { - logger.info("AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY is: {}", System.getProperty(AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY)); + logger.info("AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY property is: {}", System.getProperty(AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY)); + logger.info("AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY env variable is: {}", System.getenv().get(AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY)); return Boolean.parseBoolean(System.getProperty(AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY, firstNonNull( emptyToNull(System.getenv().get(AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY)), From f87be4503116a18a1b19f783df3c1af5ed6c35e3 Mon Sep 17 00:00:00 2001 From: Aayush Kataria Date: Fri, 17 May 2024 19:49:24 -0700 Subject: [PATCH 33/33] fixing emulator test pipeline --- eng/pipelines/templates/stages/cosmos-emulator-matrix.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/templates/stages/cosmos-emulator-matrix.json b/eng/pipelines/templates/stages/cosmos-emulator-matrix.json index 3381ba76d361..c9f2961355d8 100644 --- a/eng/pipelines/templates/stages/cosmos-emulator-matrix.json +++ b/eng/pipelines/templates/stages/cosmos-emulator-matrix.json @@ -49,7 +49,7 @@ "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", - "AdditionalArgs": "-Dencryption-e2e -DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" + "AdditionalArgs": "-Dencryption-e2e -DargLine=-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true" }, "Spark 3.1 Integration Tests targeting Cosmos Emulator - Java 8'": { "ProfileFlag": "-Dspark-e2e_3-1", @@ -119,14 +119,14 @@ "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.11", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" + "AdditionalArgs": "-DargLine=-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true" }, "Kafka Integration Tests targeting Cosmos Emulator - Java 17": { "ProfileFlag": "-Pkafka-emulator", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.17", - "AdditionalArgs": "-DargLine=\"-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true\"" + "AdditionalArgs": "-DargLine=-DACCOUNT_HOST=https://localhost:8081/ -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true" } } }