public async Task <IDocumentContainer> CreateDocumentContainerAsync( int numItems, FlakyDocumentContainer.FailureConfigs failureConfigs = default) { PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition() { Paths = new System.Collections.ObjectModel.Collection <string>() { "/pk" }, Kind = PartitionKind.Hash, Version = PartitionKeyDefinitionVersion.V2, }; IMonadicDocumentContainer monadicDocumentContainer = new InMemoryContainer(partitionKeyDefinition); if (failureConfigs != null) { monadicDocumentContainer = new FlakyDocumentContainer(monadicDocumentContainer, failureConfigs); } DocumentContainer documentContainer = new DocumentContainer(monadicDocumentContainer); if (!this.singlePartition) { for (int i = 0; i < 3; i++) { IReadOnlyList <FeedRangeInternal> ranges = await documentContainer.GetFeedRangesAsync( trace : NoOpTrace.Singleton, cancellationToken : default);
public async Task <IDocumentContainer> CreateDocumentContainerAsync( int numItems, FlakyDocumentContainer.FailureConfigs failureConfigs = default) { PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition() { Paths = new System.Collections.ObjectModel.Collection <string>() { "/pk" }, Kind = PartitionKind.Hash, Version = PartitionKeyDefinitionVersion.V2, }; IMonadicDocumentContainer monadicDocumentContainer = new InMemoryContainer(partitionKeyDefinition); if (failureConfigs != null) { monadicDocumentContainer = new FlakyDocumentContainer(monadicDocumentContainer, failureConfigs); } DocumentContainer documentContainer = new DocumentContainer(monadicDocumentContainer); if (!this.singlePartition) { await documentContainer.SplitAsync(partitionKeyRangeId : 0, cancellationToken : default);
internal static Task <IDocumentContainer> CreateDocumentContainerAsync( IReadOnlyList <CosmosObject> documents, int numPartitions = 3, FlakyDocumentContainer.FailureConfigs failureConfigs = null) { IMonadicDocumentContainer monadicDocumentContainer = CreateMonadicDocumentContainerAsync(failureConfigs); return(CreateDocumentContainerAsync(documents, monadicDocumentContainer, numPartitions)); }
internal override IDocumentContainer CreateDocumentContainer( PartitionKeyDefinition partitionKeyDefinition, FlakyDocumentContainer.FailureConfigs failureConfigs = null) { IMonadicDocumentContainer monadicDocumentContainer = new InMemoryContainer(partitionKeyDefinition); if (failureConfigs != null) { monadicDocumentContainer = new FlakyDocumentContainer(monadicDocumentContainer, failureConfigs); } return new DocumentContainer(monadicDocumentContainer); }
private static async Task <IDocumentContainer> CreateDocumentContainerAsync( IReadOnlyList <CosmosObject> documents, FlakyDocumentContainer.FailureConfigs failureConfigs = null) { IMonadicDocumentContainer monadicDocumentContainer = new InMemoryContainer(partitionKeyDefinition); if (failureConfigs != null) { monadicDocumentContainer = new FlakyDocumentContainer(monadicDocumentContainer, failureConfigs); } DocumentContainer documentContainer = new DocumentContainer(monadicDocumentContainer); await documentContainer.SplitAsync(partitionKeyRangeId : 0, cancellationToken : default);
private static async Task <IDocumentContainer> CreateDocumentContainerAsync( IReadOnlyList <CosmosObject> documents, FlakyDocumentContainer.FailureConfigs failureConfigs = null) { IMonadicDocumentContainer monadicDocumentContainer = new InMemoryContainer(partitionKeyDefinition); if (failureConfigs != null) { monadicDocumentContainer = new FlakyDocumentContainer(monadicDocumentContainer, failureConfigs); } DocumentContainer documentContainer = new DocumentContainer(monadicDocumentContainer); for (int i = 0; i < 3; i++) { IReadOnlyList <FeedRangeInternal> ranges = await documentContainer.GetFeedRangesAsync(cancellationToken : default);
internal override IDocumentContainer CreateDocumentContainer( PartitionKeyDefinition partitionKeyDefinition, int numItems = 0, FlakyDocumentContainer.FailureConfigs failureConfigs = null) { IMonadicDocumentContainer monadicDocumentContainer = new InMemoryContainer(partitionKeyDefinition); if (failureConfigs != null) { monadicDocumentContainer = new FlakyDocumentContainer(monadicDocumentContainer, failureConfigs); } DocumentContainer documentContainer = new DocumentContainer(monadicDocumentContainer); for (int i = 0; i < numItems; i++) { // Insert an item CosmosObject item = CosmosObject.Parse($"{{\"pk\" : {i} }}"); documentContainer.CreateItemAsync(item, cancellationToken: default).Wait(); } return(documentContainer); }
internal abstract IDocumentContainer CreateDocumentContainer( PartitionKeyDefinition partitionKeyDefinition, FlakyDocumentContainer.FailureConfigs failureConfigs = default);
internal static IMonadicDocumentContainer CreateMonadicDocumentContainerAsync(FlakyDocumentContainer.FailureConfigs failureConfigs) { IMonadicDocumentContainer monadicDocumentContainer = new InMemoryContainer(partitionKeyDefinition); if (failureConfigs != null) { monadicDocumentContainer = new FlakyDocumentContainer(monadicDocumentContainer, failureConfigs); } return(monadicDocumentContainer); }
internal abstract Task <IDocumentContainer> CreateDocumentContainerAsync( int numItems, FlakyDocumentContainer.FailureConfigs failureConfigs = default);