Skip to content

Commit 22f6da7

Browse files
authored
Merge pull request #114134 from SnehaGunda/tabbedconceptual
Adding tabs
2 parents 36a6317 + cc6556e commit 22f6da7

File tree

3 files changed

+52
-22
lines changed

3 files changed

+52
-22
lines changed

articles/cosmos-db/how-to-manage-conflicts.md

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ With multi-region writes, when multiple clients write to the same item, conflict
1616

1717
These samples show how to set up a container with a last-writer-wins conflict resolution policy. The default path for last-writer-wins is the timestamp field or the `_ts` property. For SQL API, this may also be set to a user-defined path with a numeric type. In a conflict, the highest value wins. If the path isn't set or it's invalid, it defaults to `_ts`. Conflicts resolved with this policy do not show up in the conflict feed. This policy can be used by all APIs.
1818

19-
### <a id="create-custom-conflict-resolution-policy-lww-dotnet"></a>.NET SDK V2
19+
### <a id="create-custom-conflict-resolution-policy-lww-dotnet"></a>.NET SDK
20+
21+
# [.NET SDK V2](#tab/dotnetv2)
2022

2123
```csharp
2224
DocumentCollection lwwCollection = await createClient.CreateDocumentCollectionIfNotExistsAsync(
@@ -31,7 +33,7 @@ DocumentCollection lwwCollection = await createClient.CreateDocumentCollectionIf
3133
});
3234
```
3335

34-
### <a id="create-custom-conflict-resolution-policy-lww-dotnet-v3"></a>.NET SDK V3
36+
# [.NET SDK V3](#tab/dotnetv3)
3537

3638
```csharp
3739
Container container = await createClient.GetDatabase(this.databaseName)
@@ -44,8 +46,11 @@ Container container = await createClient.GetDatabase(this.databaseName)
4446
}
4547
});
4648
```
49+
---
50+
51+
### <a id="create-custom-conflict-resolution-policy-lww-java"></a>Java SDK
4752

48-
### <a id="create-custom-conflict-resolution-policy-lww-java-async"></a>Java Async SDK
53+
# [Java Async SDK](#tab/async)
4954

5055
```java
5156
DocumentCollection collection = new DocumentCollection();
@@ -55,7 +60,7 @@ collection.setConflictResolutionPolicy(policy);
5560
DocumentCollection createdCollection = client.createCollection(databaseUri, collection, null).toBlocking().value();
5661
```
5762

58-
### <a id="create-custom-conflict-resolution-policy-lww-java-sync"></a>Java Sync SDK
63+
# [Java sync SDK](#tab/sync)
5964

6065
```java
6166
DocumentCollection lwwCollection = new DocumentCollection();
@@ -64,6 +69,7 @@ ConflictResolutionPolicy lwwPolicy = ConflictResolutionPolicy.createLastWriterWi
6469
lwwCollection.setConflictResolutionPolicy(lwwPolicy);
6570
DocumentCollection createdCollection = this.tryCreateDocumentCollection(createClient, database, lwwCollection);
6671
```
72+
---
6773

6874
### <a id="create-custom-conflict-resolution-policy-lww-javascript"></a>Node.js/JavaScript/TypeScript SDK
6975

@@ -166,7 +172,9 @@ function resolver(incomingItem, existingItem, isTombstone, conflictingItems) {
166172
}
167173
```
168174

169-
### <a id="create-custom-conflict-resolution-policy-stored-proc-dotnet"></a>.NET SDK V2
175+
### <a id="create-custom-conflict-resolution-policy-stored-proc-dotnet"></a>.NET SDK
176+
177+
# [.NET SDK V2](#tab/dotnetv2)
170178

171179
```csharp
172180
DocumentCollection udpCollection = await createClient.CreateDocumentCollectionIfNotExistsAsync(
@@ -189,7 +197,7 @@ UriFactory.CreateStoredProcedureUri(this.databaseName, this.udpCollectionName, "
189197
});
190198
```
191199

192-
### <a id="create-custom-conflict-resolution-policy-stored-proc-dotnet-v3"></a>.NET SDK V3
200+
# [.NET SDK V3](#tab/dotnetv3)
193201

194202
```csharp
195203
Container container = await createClient.GetDatabase(this.databaseName)
@@ -206,8 +214,11 @@ await container.Scripts.CreateStoredProcedureAsync(
206214
new StoredProcedureProperties("resolver", File.ReadAllText(@"resolver.js"))
207215
);
208216
```
217+
---
218+
219+
### <a id="create-custom-conflict-resolution-policy-stored-proc-java"></a>Java SDK
209220

210-
### <a id="create-custom-conflict-resolution-policy-stored-proc-java-async"></a>Java Async SDK
221+
# [Java Async SDK](#tab/async)
211222

212223
```java
213224
DocumentCollection collection = new DocumentCollection();
@@ -219,7 +230,7 @@ DocumentCollection createdCollection = client.createCollection(databaseUri, coll
219230

220231
After your container is created, you must create the `resolver` stored procedure.
221232

222-
### <a id="create-custom-conflict-resolution-policy-stored-proc-java-sync"></a>Java Sync SDK
233+
# [Java sync SDK](#tab/sync)
223234

224235
```java
225236
DocumentCollection udpCollection = new DocumentCollection();
@@ -229,6 +240,7 @@ ConflictResolutionPolicy udpPolicy = ConflictResolutionPolicy.createCustomPolicy
229240
udpCollection.setConflictResolutionPolicy(udpPolicy);
230241
DocumentCollection createdCollection = this.tryCreateDocumentCollection(createClient, database, udpCollection);
231242
```
243+
---
232244

233245
After your container is created, you must create the `resolver` stored procedure.
234246

@@ -271,7 +283,9 @@ After your container is created, you must create the `resolver` stored procedure
271283

272284
These samples show how to set up a container with a custom conflict resolution policy. These conflicts show up in the conflict feed.
273285

274-
### <a id="create-custom-conflict-resolution-policy-dotnet"></a>.NET SDK V2
286+
### <a id="create-custom-conflict-resolution-policy-dotnet"></a>.NET SDK
287+
288+
# [.NET SDK V2](#tab/dotnetv2)
275289

276290
```csharp
277291
DocumentCollection manualCollection = await createClient.CreateDocumentCollectionIfNotExistsAsync(
@@ -285,7 +299,7 @@ DocumentCollection manualCollection = await createClient.CreateDocumentCollectio
285299
});
286300
```
287301

288-
### <a id="create-custom-conflict-resolution-policy-dotnet-v3"></a>.NET SDK V3
302+
# [.NET SDK V3](#tab/dotnetv3)
289303

290304
```csharp
291305
Container container = await createClient.GetDatabase(this.databaseName)
@@ -297,8 +311,11 @@ Container container = await createClient.GetDatabase(this.databaseName)
297311
}
298312
});
299313
```
314+
---
315+
316+
### <a id="create-custom-conflict-resolution-policy-java"></a>Java SDK
300317

301-
### <a id="create-custom-conflict-resolution-policy-java-async"></a>Java Async SDK
318+
# [Java Async SDK](#tab/async)
302319

303320
```java
304321
DocumentCollection collection = new DocumentCollection();
@@ -308,7 +325,7 @@ collection.setConflictResolutionPolicy(policy);
308325
DocumentCollection createdCollection = client.createCollection(databaseUri, collection, null).toBlocking().value();
309326
```
310327

311-
### <a id="create-custom-conflict-resolution-policy-java-sync"></a>Java Sync SDK
328+
# [Java sync SDK](#tab/sync)
312329

313330
```java
314331
DocumentCollection manualCollection = new DocumentCollection();
@@ -317,6 +334,7 @@ ConflictResolutionPolicy customPolicy = ConflictResolutionPolicy.createCustomPol
317334
manualCollection.setConflictResolutionPolicy(customPolicy);
318335
DocumentCollection createdCollection = client.createCollection(database.getSelfLink(), collection, null).getResource();
319336
```
337+
---
320338

321339
### <a id="create-custom-conflict-resolution-policy-javascript"></a>Node.js/JavaScript/TypeScript SDK
322340

@@ -349,13 +367,15 @@ manual_collection = client.CreateContainer(database['_self'], collection)
349367

350368
These samples show how to read from a container's conflict feed. Conflicts show up in the conflict feed only if they weren't resolved automatically or if using a custom conflict policy.
351369

352-
### <a id="read-from-conflict-feed-dotnet"></a>.NET SDK V2
370+
### <a id="read-from-conflict-feed-dotnet"></a>.NET SDK
371+
372+
# [.NET SDK V2](#tab/dotnetv2)
353373

354374
```csharp
355375
FeedResponse<Conflict> conflicts = await delClient.ReadConflictFeedAsync(this.collectionUri);
356376
```
357377

358-
### <a id="read-from-conflict-feed-dotnet-v3"></a>.NET SDK V3
378+
# [.NET SDK V3](#tab/dotnetv3)
359379

360380
```csharp
361381
FeedIterator<ConflictProperties> conflictFeed = container.Conflicts.GetConflictQueryIterator();
@@ -376,8 +396,11 @@ while (conflictFeed.HasMoreResults)
376396
}
377397
}
378398
```
399+
---
400+
401+
### <a id="read-from-conflict-feed-java"></a>Java SDK
379402

380-
### <a id="read-from-conflict-feed-java-async"></a>Java Async SDK
403+
# [Java Async SDK](#tab/async)
381404

382405
```java
383406
FeedResponse<Conflict> response = client.readConflicts(this.manualCollectionUri, null)
@@ -386,8 +409,7 @@ for (Conflict conflict : response.getResults()) {
386409
/* Do something with conflict */
387410
}
388411
```
389-
390-
### <a id="read-from-conflict-feed-java-sync"></a>Java Sync SDK
412+
# [Java Async SDK](#tab/sync)
391413

392414
```java
393415
Iterator<Conflict> conflictsIterator = client.readConflicts(this.collectionLink, null).getQueryIterator();
@@ -396,6 +418,7 @@ while (conflictsIterator.hasNext()) {
396418
/* Do something with conflict */
397419
}
398420
```
421+
---
399422

400423
### <a id="read-from-conflict-feed-javascript"></a>Node.js/JavaScript/TypeScript SDK
401424

articles/cosmos-db/how-to-provision-container-throughput.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ To create a container with dedicated throughput see,
4444
> Use the Cosmos SDKs for SQL API to provision throughput for all Cosmos DB APIs, except Cassandra API.
4545
4646
### <a id="dotnet-most"></a>SQL, MongoDB, Gremlin, and Table APIs
47-
### .Net V2 SDK
47+
48+
# [.NET SDK V2](#tab/dotnetv2)
4849

4950
```csharp
5051
// Create a container with a partition key and provision throughput of 400 RU/s
@@ -58,10 +59,12 @@ await client.CreateDocumentCollectionAsync(
5859
new RequestOptions { OfferThroughput = 400 });
5960
```
6061

61-
### .Net V3 SDK
62+
# [.NET SDK V3](#tab/dotnetv3)
6263

6364
[!code-csharp[](~/samples-cosmosdb-dotnet-v3/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/SampleCodeForDocs/ContainerDocsSampleCode.cs?name=ContainerCreateWithThroughput)]
6465

66+
---
67+
6568
## JavaScript SDK
6669

6770
```javascript

articles/cosmos-db/how-to-provision-database-throughput.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ To create a database with shared throughput see,
4343
4444
### <a id="dotnet-all"></a>All APIs
4545

46-
### .Net V2 SDK
46+
# [.NET SDK V2](#tab/dotnetv2)
4747

4848
```csharp
4949
//set the throughput for the database
@@ -58,12 +58,16 @@ await client.CreateDatabaseIfNotExistsAsync(
5858
options);
5959
```
6060

61-
### .Net V3 SDK
61+
# [.NET SDK V3](#tab/dotnetv3)
6262

6363
[!code-csharp[](~/samples-cosmosdb-dotnet-v3/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/SampleCodeForDocs/DatabaseDocsSampleCode.cs?name=DatabaseCreateWithThroughput)]
6464

65+
---
66+
6567
### <a id="dotnet-cassandra"></a>Cassandra API
66-
Similar command can be executed through any CQL compliant driver.
68+
69+
Similar command can be executed through any CQL compliant driver.
70+
6771
```csharp
6872
// Create a Cassandra keyspace and provision throughput of 400 RU/s
6973
session.Execute("CREATE KEYSPACE IF NOT EXISTS myKeySpace WITH cosmosdb_provisioned_throughput=400");

0 commit comments

Comments
 (0)