Skip to content

Commit 68fdcf4

Browse files
Cosmos: Diagnostic improvements (Azure#33209)
* Initial DRAFT for public API review Initial DRAFT for public API review * Update DiagnosticsProvider.java * Adding comments * Iterate on comments * Merging main into PR * Implementing CosmosDiagnosticsContext.toString (including caching) * Iterating on implementation * Fixing SpotBug issues * Fixing SpotBug violations * Fixing java doc violation * Fixing unit test failures * Fixing test failures * Refactoring to allow specifying thresholds on config and requestOptions * Update CosmosDiagnosticsThresholds.java * Update CosmosItemRequestOptions.java * Update DiagnosticsProvider.java * Allowing configuration of status code handling * Update CosmosDiagnosticsThresholds.java * Update CosmosClientTelemetryConfig.java * Allowing to configure log levels * Temp * Update ImplementationBridgeHelpers.java * Removing TracerProvider and starting to switch to DiagnosticsProvider * Iterating on DiagnosticsProvider * Addressing SpotBug failures * Update CosmosDiagnosticsThresholds.java * Update CosmosPagedFlux.java * Update CosmosDiagnosticsContext.java * Fixing test regressions * Adding transport level traces * Update spotbugs-exclude.xml * Iterating on tests * Update BridgeInternal.java * Iterating on tests * Update ClientTelemetryDiagnosticsHandler.java * Iterating on tests * Iterating on tests * Iterating on tests * Iterating on tests * Iterating on tests * Iterating on tests * Update CosmosTracerTest.java * CosmosTracerTest finished * Update CosmosTracerTest.java * Update CosmosTracerTest.java * Addressing Linting issues * Delete TracerProviderTest.java * Update AsyncBenchmark.java * Update ClientTelemetry.java * Update ClientTelemetry.java * Update ClientTelemetry.java * Updating tests * Fixing test * Changed ClientSideRequestStatistics to Set from List in FeedResponseDiagnostics * Update CosmosDiagnosticsContext.java * Pushing query diagnostics duplication ifx * Update CosmosDiagnosticsContext.java * Fixing regression that changed the order of diagnostics in Feed operations * Fixing build break regarding haddop/winutils * Update cosmos-sdk-client.yml * Prettifying code * Fixing unit test failures * Reverting public surface area changes to BridgeInternal * More BridgeInternal cleanup * More BridgeInternal cleanup * Fixing build breaks * Another Build break fix * Update Utils.java * Cleaning up CosmosAsyncClient * Fixing build regression and more clean-up * More cleanup * <p> -> <br/> in javadoc * Update DistinctClientSideRequestStatisticsCollection.java * Update CosmosAsyncContainer.java * Addressing linitng error in RxDoucmentClinetImpl * Moving to latest semantic profile attributes * Update DiagnosticsProvider.java * Update CosmosTracerTest.java * Update CosmosDiagnosticsContext.java * Fixes unit test failures * Adding test to validate InjectedFailureId in request trace * Pushing tests into its own module * Update ci.yml * Update cosmos-sdk-client.yml * Update version_client.txt * Update pom.xml * Update pom.xml * Update README.md * Update AzureCosmosPropertiesTest.java * Adding back test resources to azure-cosmos * Update HttpPipelineBuilder.java * Extending Tracer test coverage * Extending test coverage * Prettifying code * Adding unit test for tracing with retries * Extending Benchmark to also allow logging * Adding switch to disable tracing in benchmark * Revert "Adding switch to disable tracing in benchmark" This reverts commit e9c4337. * Adding User Agent suffix * Update AsyncBenchmark.java * Update AsyncBenchmark.java * Update AsyncBenchmark.java * Update AsyncBenchmark.java * Update AsyncBenchmark.java * Update AsyncBenchmark.java * Update AsyncBenchmark.java * Update AsyncBenchmark.java * Update CosmosTracerTest.java * Update CosmosTracerTest.java * Update CosmosTracerTest.java * Update TestSuiteBase.java * Update CosmosDiagnosticsContext.java * Update TestSuiteBase.java * Update CosmosItemIdEncodingTest.java * Update TestSuiteBase.java * Update TestSuiteBase.java * Reacting to API review board feedback * Update AsyncBenchmark.java * Update CosmosDiagnosticsE2ETest.java * Update SyncBenchmark.java * Fixing JavaDoc issues * Fixing test failures * Addressing code review feedback * Update ThroughputControlTests.java * Update CosmosItemIdEncodingTest.java --------- Co-authored-by: Kushagra Thapar <[email protected]>
1 parent 26cf94d commit 68fdcf4

File tree

80 files changed

+7868
-3438
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+7868
-3438
lines changed

eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml

100755100644
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2061,6 +2061,7 @@
20612061
<Match>
20622062
<Or>
20632063
<Class name="~com.azure.cosmos.implementation.ImplementationBridgeHelpers(\$.*)?"/>
2064+
<Class name="~com.azure.cosmos.implementation.DiagnosticsProvider(\$.*)?"/>
20642065
<Class name="~com.azure.cosmos.test.implementation.ImplementationBridgeHelpers(\$.*)?"/>
20652066
</Or>
20662067
<Bug pattern="DM_EXIT"/>

sdk/cosmos/azure-cosmos-benchmark/src/main/java/com/azure/cosmos/benchmark/AsyncBenchmark.java

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,19 @@
33

44
package com.azure.cosmos.benchmark;
55

6+
import com.azure.cosmos.BridgeInternal;
67
import com.azure.cosmos.ConnectionMode;
78
import com.azure.cosmos.CosmosAsyncClient;
89
import com.azure.cosmos.CosmosAsyncContainer;
910
import com.azure.cosmos.CosmosAsyncDatabase;
1011
import com.azure.cosmos.CosmosClientBuilder;
12+
import com.azure.cosmos.CosmosDiagnosticsHandler;
13+
import com.azure.cosmos.CosmosDiagnosticsThresholds;
1114
import com.azure.cosmos.CosmosException;
1215
import com.azure.cosmos.DirectConnectionConfig;
1316
import com.azure.cosmos.GatewayConnectionConfig;
1417
import com.azure.cosmos.implementation.HttpConstants;
18+
import com.azure.cosmos.implementation.ImplementationBridgeHelpers;
1519
import com.azure.cosmos.models.CosmosClientTelemetryConfig;
1620
import com.azure.cosmos.models.CosmosMicrometerMetricsOptions;
1721
import com.azure.cosmos.models.PartitionKey;
@@ -52,7 +56,7 @@
5256

5357
abstract class AsyncBenchmark<T> {
5458
private final MetricRegistry metricsRegistry = new MetricRegistry();
55-
private ScheduledReporter reporter;
59+
private final ScheduledReporter reporter;
5660

5761
private volatile Meter successMeter;
5862
private volatile Meter failureMeter;
@@ -81,40 +85,45 @@ abstract class AsyncBenchmark<T> {
8185
logger = LoggerFactory.getLogger(this.getClass());
8286
configuration = cfg;
8387

84-
8588
CosmosClientBuilder cosmosClientBuilder = new CosmosClientBuilder()
8689
.endpoint(cfg.getServiceEndpoint())
8790
.key(cfg.getMasterKey())
8891
.preferredRegions(cfg.getPreferredRegionsList())
8992
.consistencyLevel(cfg.getConsistencyLevel())
90-
.contentResponseOnWriteEnabled(cfg.isContentResponseOnWriteEnabled())
91-
.clientTelemetryEnabled(cfg.isClientTelemetryEnabled());
93+
.userAgentSuffix(configuration.getApplicationName())
94+
.contentResponseOnWriteEnabled(cfg.isContentResponseOnWriteEnabled());
95+
96+
CosmosClientTelemetryConfig telemetryConfig = new CosmosClientTelemetryConfig()
97+
.sendClientTelemetryToService(cfg.isClientTelemetryEnabled())
98+
.diagnosticsThresholds(
99+
new CosmosDiagnosticsThresholds()
100+
.setPointOperationLatencyThreshold(cfg.getPointOperationThreshold())
101+
.setNonPointOperationLatencyThreshold(cfg.getNonPointOperationThreshold())
102+
);
103+
104+
if (configuration.isDefaultLog4jLoggerEnabled()) {
105+
telemetryConfig.diagnosticsHandler(CosmosDiagnosticsHandler.DEFAULT_LOGGING_HANDLER);
106+
}
92107

93108
MeterRegistry registry = configuration.getAzureMonitorMeterRegistry();
94109
if (registry != null) {
95-
logger.info("USING AZURE METRIC REGISTRY");
96-
CosmosClientTelemetryConfig telemetryConfig = new CosmosClientTelemetryConfig()
97-
.metricsOptions(new CosmosMicrometerMetricsOptions().meterRegistry(registry))
98-
.sendClientTelemetryToService(cfg.isClientTelemetryEnabled());
99-
cosmosClientBuilder.clientTelemetryConfig(telemetryConfig);
110+
logger.info("USING AZURE METRIC REGISTRY - isClientTelemetryEnabled {}", cfg.isClientTelemetryEnabled());
111+
telemetryConfig.metricsOptions(new CosmosMicrometerMetricsOptions().meterRegistry(registry));
100112
} else {
101113
registry = configuration.getGraphiteMeterRegistry();
102114

103115
if (registry != null) {
104-
logger.info("USING GRAPHITE METRIC REGISTRY");
105-
CosmosClientTelemetryConfig telemetryConfig = new CosmosClientTelemetryConfig()
106-
.metricsOptions(new CosmosMicrometerMetricsOptions().meterRegistry(registry))
107-
.sendClientTelemetryToService(cfg.isClientTelemetryEnabled());
108-
cosmosClientBuilder.clientTelemetryConfig(telemetryConfig);
116+
logger.info("USING GRAPHITE METRIC REGISTRY - isClientTelemetryEnabled {}", cfg.isClientTelemetryEnabled());
117+
telemetryConfig.metricsOptions(new CosmosMicrometerMetricsOptions().meterRegistry(registry));
109118
} else {
110-
logger.info("USING DEFAULT/GLOBAL METRIC REGISTRY");
111-
CosmosClientTelemetryConfig telemetryConfig = new CosmosClientTelemetryConfig()
112-
.metricsOptions(new CosmosMicrometerMetricsOptions().meterRegistry(null))
113-
.sendClientTelemetryToService(cfg.isClientTelemetryEnabled());
114-
cosmosClientBuilder.clientTelemetryConfig(telemetryConfig);
119+
logger.info("USING DEFAULT/GLOBAL METRIC REGISTRY - isClientTelemetryEnabled {}", cfg.isClientTelemetryEnabled());
120+
telemetryConfig.metricsOptions(
121+
new CosmosMicrometerMetricsOptions().meterRegistry(null));
115122
}
116123
}
117124

125+
cosmosClientBuilder.clientTelemetryConfig(telemetryConfig);
126+
118127
if (cfg.getConnectionMode().equals(ConnectionMode.DIRECT)) {
119128
cosmosClientBuilder = cosmosClientBuilder.directMode(DirectConnectionConfig.getDefaultConfig());
120129
} else {

sdk/cosmos/azure-cosmos-benchmark/src/main/java/com/azure/cosmos/benchmark/Configuration.java

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ public class Configuration {
109109
@Parameter(names = "-encryptionEnabled", description = "Control switch to enable the encryption operation")
110110
private boolean encryptionEnabled = false;
111111

112+
@Parameter(names = "-defaultLog4jLoggerEnabled", description = "Control switch to enable the default log4j logger in 4.42 and above")
113+
private String defaultLog4jLoggerEnabled = String.valueOf(false);
114+
115+
112116
@Parameter(names = "-tupleSize", description = "Number of cosmos identity tuples to be queried using readMany")
113117
private int tupleSize = 1;
114118

@@ -189,6 +193,9 @@ public Duration convert(String value) {
189193
@Parameter(names = "-testScenario", description = "The test scenario (GET, QUERY) for the LinkedInCtlWorkload")
190194
private String testScenario = "GET";
191195

196+
@Parameter(names = "-applicationName", description = "The application name suffix in the user agent header")
197+
private String applicationName = "";
198+
192199
@Parameter(names = "-accountNameInGraphiteReporter", description = "if set, account name with be appended in graphite reporter")
193200
private boolean accountNameInGraphiteReporter = false;
194201

@@ -201,6 +208,12 @@ public Duration convert(String value) {
201208
@Parameter(names = "-clientTelemetryEndpoint", description = "Client Telemetry Juno endpoint")
202209
private String clientTelemetryEndpoint;
203210

211+
@Parameter(names = "-pointLatencyThresholdMs", description = "Latency threshold for point operations")
212+
private int pointLatencyThresholdMs = -1;
213+
214+
@Parameter(names = "-nonPointLatencyThresholdMs", description = "Latency threshold for non-point operations")
215+
private int nonPointLatencyThresholdMs = -1;
216+
204217
public enum Environment {
205218
Daily, // This is the CTL environment where we run the workload for a fixed number of hours
206219
Staging; // This is the CTL environment where the worload runs as a long running job
@@ -348,6 +361,10 @@ public String getMasterKey() {
348361
return masterKey;
349362
}
350363

364+
public String getApplicationName() {
365+
return applicationName;
366+
}
367+
351368
public boolean isHelp() {
352369
return help;
353370
}
@@ -510,6 +527,10 @@ public boolean isClientTelemetryEnabled() {
510527
return Boolean.parseBoolean(clientTelemetryEnabled);
511528
}
512529

530+
public boolean isDefaultLog4jLoggerEnabled() {
531+
return Boolean.parseBoolean(defaultLog4jLoggerEnabled);
532+
}
533+
513534
public String getClientTelemetryEndpoint() {
514535
return clientTelemetryEndpoint;
515536
}
@@ -522,6 +543,22 @@ public Integer getTupleSize() {
522543
return tupleSize;
523544
}
524545

546+
public Duration getPointOperationThreshold() {
547+
if (this.pointLatencyThresholdMs < 0) {
548+
return Duration.ofDays(300);
549+
}
550+
551+
return Duration.ofMillis(this.pointLatencyThresholdMs);
552+
}
553+
554+
public Duration getNonPointOperationThreshold() {
555+
if (this.nonPointLatencyThresholdMs < 0) {
556+
return Duration.ofDays(300);
557+
}
558+
559+
return Duration.ofMillis(this.nonPointLatencyThresholdMs);
560+
}
561+
525562
public void tryGetValuesFromSystem() {
526563
serviceEndpoint = StringUtils.defaultString(Strings.emptyToNull(System.getenv().get("SERVICE_END_POINT")),
527564
serviceEndpoint);

sdk/cosmos/azure-cosmos-benchmark/src/main/java/com/azure/cosmos/benchmark/SyncBenchmark.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@
99
import com.azure.cosmos.CosmosClientBuilder;
1010
import com.azure.cosmos.CosmosContainer;
1111
import com.azure.cosmos.CosmosDatabase;
12+
import com.azure.cosmos.CosmosDiagnosticsHandler;
13+
import com.azure.cosmos.CosmosDiagnosticsThresholds;
1214
import com.azure.cosmos.CosmosException;
1315
import com.azure.cosmos.DirectConnectionConfig;
1416
import com.azure.cosmos.GatewayConnectionConfig;
1517
import com.azure.cosmos.implementation.HttpConstants;
18+
import com.azure.cosmos.models.CosmosClientTelemetryConfig;
1619
import com.azure.cosmos.models.CosmosItemResponse;
1720
import com.azure.cosmos.models.ThroughputProperties;
1821
import com.codahale.metrics.ConsoleReporter;
@@ -108,6 +111,7 @@ public T apply(T o, Throwable throwable) {
108111
.endpoint(cfg.getServiceEndpoint())
109112
.preferredRegions(cfg.getPreferredRegionsList())
110113
.key(cfg.getMasterKey())
114+
.userAgentSuffix(configuration.getApplicationName())
111115
.consistencyLevel(cfg.getConsistencyLevel())
112116
.contentResponseOnWriteEnabled(cfg.isContentResponseOnWriteEnabled())
113117
.clientTelemetryEnabled(cfg.isClientTelemetryEnabled());
@@ -119,6 +123,19 @@ public T apply(T o, Throwable throwable) {
119123
gatewayConnectionConfig.setMaxConnectionPoolSize(cfg.getMaxConnectionPoolSize());
120124
cosmosClientBuilder = cosmosClientBuilder.gatewayMode(gatewayConnectionConfig);
121125
}
126+
127+
CosmosClientTelemetryConfig telemetryConfig = new CosmosClientTelemetryConfig()
128+
.sendClientTelemetryToService(cfg.isClientTelemetryEnabled())
129+
.diagnosticsThresholds(
130+
new CosmosDiagnosticsThresholds()
131+
.setPointOperationLatencyThreshold(cfg.getPointOperationThreshold())
132+
.setNonPointOperationLatencyThreshold(cfg.getNonPointOperationThreshold())
133+
);
134+
135+
if (configuration.isDefaultLog4jLoggerEnabled()) {
136+
telemetryConfig.diagnosticsHandler(CosmosDiagnosticsHandler.DEFAULT_LOGGING_HANDLER);
137+
}
138+
122139
cosmosClient = cosmosClientBuilder.buildClient();
123140
try {
124141
cosmosDatabase = cosmosClient.getDatabase(this.configuration.getDatabaseId());

sdk/cosmos/azure-cosmos-encryption/src/test/java/com/azure/cosmos/encryption/TestSuiteBase.java

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -272,80 +272,80 @@ protected static void truncateCollection(CosmosAsyncContainer cosmosContainer) {
272272
logger.info("Truncating collection {} documents ...", cosmosContainer.getId());
273273

274274
cosmosContainer.queryItems("SELECT * FROM root", options, InternalObjectNode.class)
275-
.byPage(maxItemCount)
276-
.publishOn(Schedulers.parallel())
277-
.flatMap(page -> Flux.fromIterable(page.getResults()))
278-
.flatMap(doc -> {
279-
280-
PartitionKey partitionKey = null;
281-
282-
Object propertyValue = null;
283-
if (paths != null && !paths.isEmpty()) {
284-
List<String> pkPath = PathParser.getPathParts(paths.get(0));
285-
propertyValue = ModelBridgeInternal.getObjectByPathFromJsonSerializable(doc, pkPath);
286-
if (propertyValue == null) {
287-
partitionKey = PartitionKey.NONE;
288-
} else {
289-
partitionKey = new PartitionKey(propertyValue);
290-
}
291-
} else {
292-
partitionKey = new PartitionKey(null);
293-
}
294-
295-
return cosmosContainer.deleteItem(doc.getId(), partitionKey);
296-
}).then().block();
275+
.byPage(maxItemCount)
276+
.publishOn(Schedulers.parallel())
277+
.flatMap(page -> Flux.fromIterable(page.getResults()))
278+
.flatMap(doc -> {
279+
280+
PartitionKey partitionKey = null;
281+
282+
Object propertyValue = null;
283+
if (paths != null && !paths.isEmpty()) {
284+
List<String> pkPath = PathParser.getPathParts(paths.get(0));
285+
propertyValue = ModelBridgeInternal.getObjectByPathFromJsonSerializable(doc, pkPath);
286+
if (propertyValue == null) {
287+
partitionKey = PartitionKey.NONE;
288+
} else {
289+
partitionKey = new PartitionKey(propertyValue);
290+
}
291+
} else {
292+
partitionKey = new PartitionKey(null);
293+
}
294+
295+
return cosmosContainer.deleteItem(doc.getId(), partitionKey);
296+
}).then().block();
297297
logger.info("Truncating collection {} triggers ...", cosmosContainerId);
298298

299299
cosmosContainer.getScripts().queryTriggers("SELECT * FROM root", options)
300-
.byPage(maxItemCount)
301-
.publishOn(Schedulers.parallel())
302-
.flatMap(page -> Flux.fromIterable(page.getResults()))
303-
.flatMap(trigger -> {
304-
// if (paths != null && !paths.isEmpty()) {
305-
// Object propertyValue = trigger.getObjectByPath(PathParser.getPathParts(paths.get(0)));
306-
// requestOptions.partitionKey(new PartitionKey(propertyValue));
307-
// Object propertyValue = getTrigger.getObjectByPath(PathParser.getPathParts(getPaths.get(0)));
308-
// requestOptions.getPartitionKey(new PartitionKey(propertyValue));
309-
// }
310-
311-
return cosmosContainer.getScripts().getTrigger(trigger.getId()).delete();
312-
}).then().block();
300+
.byPage(maxItemCount)
301+
.publishOn(Schedulers.parallel())
302+
.flatMap(page -> Flux.fromIterable(page.getResults()))
303+
.flatMap(trigger -> {
304+
// if (paths != null && !paths.isEmpty()) {
305+
// Object propertyValue = trigger.getObjectByPath(PathParser.getPathParts(paths.get(0)));
306+
// requestOptions.partitionKey(new PartitionKey(propertyValue));
307+
// Object propertyValue = getTrigger.getObjectByPath(PathParser.getPathParts(getPaths.get(0)));
308+
// requestOptions.getPartitionKey(new PartitionKey(propertyValue));
309+
// }
310+
311+
return cosmosContainer.getScripts().getTrigger(trigger.getId()).delete();
312+
}).then().block();
313313

314314
logger.info("Truncating collection {} storedProcedures ...", cosmosContainerId);
315315

316316
cosmosContainer.getScripts().queryStoredProcedures("SELECT * FROM root", options)
317-
.byPage(maxItemCount)
318-
.publishOn(Schedulers.parallel())
319-
.flatMap(page -> Flux.fromIterable(page.getResults()))
320-
.flatMap(storedProcedure -> {
317+
.byPage(maxItemCount)
318+
.publishOn(Schedulers.parallel())
319+
.flatMap(page -> Flux.fromIterable(page.getResults()))
320+
.flatMap(storedProcedure -> {
321321

322-
// if (getPaths != null && !getPaths.isEmpty()) {
323-
// if (paths != null && !paths.isEmpty()) {
324-
// Object propertyValue = storedProcedure.getObjectByPath(PathParser.getPathParts(paths.get(0)));
325-
// requestOptions.partitionKey(new PartitionKey(propertyValue));
326-
// requestOptions.getPartitionKey(new PartitionKey(propertyValue));
327-
// }
322+
// if (getPaths != null && !getPaths.isEmpty()) {
323+
// if (paths != null && !paths.isEmpty()) {
324+
// Object propertyValue = storedProcedure.getObjectByPath(PathParser.getPathParts(paths.get(0)));
325+
// requestOptions.partitionKey(new PartitionKey(propertyValue));
326+
// requestOptions.getPartitionKey(new PartitionKey(propertyValue));
327+
// }
328328

329-
return cosmosContainer.getScripts().getStoredProcedure(storedProcedure.getId()).delete(new CosmosStoredProcedureRequestOptions());
330-
}).then().block();
329+
return cosmosContainer.getScripts().getStoredProcedure(storedProcedure.getId()).delete(new CosmosStoredProcedureRequestOptions());
330+
}).then().block();
331331

332332
logger.info("Truncating collection {} udfs ...", cosmosContainerId);
333333

334334
cosmosContainer.getScripts().queryUserDefinedFunctions("SELECT * FROM root", options)
335-
.byPage(maxItemCount)
336-
.publishOn(Schedulers.parallel())
337-
.flatMap(page -> Flux.fromIterable(page.getResults()))
338-
.flatMap(udf -> {
339-
340-
// if (getPaths != null && !getPaths.isEmpty()) {
341-
// if (paths != null && !paths.isEmpty()) {
342-
// Object propertyValue = udf.getObjectByPath(PathParser.getPathParts(paths.get(0)));
343-
// requestOptions.partitionKey(new PartitionKey(propertyValue));
344-
// requestOptions.getPartitionKey(new PartitionKey(propertyValue));
345-
// }
346-
347-
return cosmosContainer.getScripts().getUserDefinedFunction(udf.getId()).delete();
348-
}).then().block();
335+
.byPage(maxItemCount)
336+
.publishOn(Schedulers.parallel())
337+
.flatMap(page -> Flux.fromIterable(page.getResults()))
338+
.flatMap(udf -> {
339+
340+
// if (getPaths != null && !getPaths.isEmpty()) {
341+
// if (paths != null && !paths.isEmpty()) {
342+
// Object propertyValue = udf.getObjectByPath(PathParser.getPathParts(paths.get(0)));
343+
// requestOptions.partitionKey(new PartitionKey(propertyValue));
344+
// requestOptions.getPartitionKey(new PartitionKey(propertyValue));
345+
// }
346+
347+
return cosmosContainer.getScripts().getUserDefinedFunction(udf.getId()).delete();
348+
}).then().block();
349349

350350
logger.info("Finished truncating collection {}.", cosmosContainerId);
351351
}

sdk/cosmos/azure-cosmos-spark_3_2-12/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@
230230
<include>com.fasterxml.jackson.module:jackson-module-scala_2.12:[2.13.5]</include> <!-- {x-include-update;com.fasterxml.jackson.module:jackson-module-scala_2.12;external_dependency} -->
231231
<include>io.micrometer:micrometer-registry-azure-monitor:[1.9.8]</include> <!-- {x-include-update;io.micrometer:micrometer-registry-azure-monitor;external_dependency} -->
232232
<include>com.microsoft.azure:applicationinsights-core:[2.6.4]</include> <!-- {x-include-update;cosmos_com.microsoft.azure:applicationinsights-core;external_dependency} -->
233+
<include>com.globalmentor:hadoop-bare-naked-local-fs:[0.1.0]</include> <!-- {x-include-update;cosmos_com.globalmentor:hadoop-bare-naked-local-fs;external_dependency} -->
233234
</includes>
234235
</bannedDependencies>
235236
</rules>

0 commit comments

Comments
 (0)