Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PartitionKeyDelete: Adds API to delete all items in a partition key #1490

Merged
merged 27 commits into from
Jan 7, 2021

Conversation

Shaleen-Kalsi
Copy link
Contributor

@Shaleen-Kalsi Shaleen-Kalsi commented May 11, 2020

PartitionKeyDelete: Add API to delete all items in a partition key

Description

  1. Added DeleteItemsInPartitionKeyAsync API
  2. Changes in GetStoreProxy in DocumentClient.cs, GetHttpMethod in RequestInvokerHandler.cs, PrepareRequestMessageAsync in GatewayStoreClient.cs for GatewayMode of PkDeletePurger to work.
class Container
{
        /// <summary>
        /// Deletes all items in the Container with the specified <see cref="PartitionKey"/> value.
        /// </summary>
        /// <param name="partitionKey">The <see cref="PartitionKey"/> of the items to be deleted.</param>
        /// <param name="requestOptions">(Optional) The options for the Partition Key Delete request.</param>
        /// <param name="cancellationToken">(Optional) <see cref="CancellationToken"/> representing request cancellation.</param>
        /// <returns>
        /// A <see cref="Task"/> containing a <see cref="ResponseMessage"/>.
        /// </returns>
        public abstract Task<ResponseMessage> DeleteAllItemsByPartitionKeyAsync(
               Cosmos.PartitionKey partitionKey,
               ItemRequestOptions requestOptions = null,
               CancellationToken cancellationToken = default(CancellationToken));
}

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow the required format: "[Internal] Category: (Add|Fix|Refactor) Description"

Examples:
Diagnostics: Add GetElapsedClientLatency to CosmosDiagnostics
PartitionKey: Fix null reference when using default(PartitionKey)
[v4] Client Encryption: Refactor code to external project
[Internal] Query: Add code generator for CosmosNumbers for easy additions in the future.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow the required format: "[Internal] Category: (Add|Fix|Refactor) Description"

Examples:
Diagnostics: Add GetElapsedClientLatency to CosmosDiagnostics
PartitionKey: Fix null reference when using default(PartitionKey)
[v4] Client Encryption: Refactor code to external project
[Internal] Query: Add code generator for CosmosNumbers for easy additions in the future.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow the required format: "[Internal] Category: (Add|Fix|Refactor) Description"

Examples:
Diagnostics: Add GetElapsedClientLatency to CosmosDiagnostics
PartitionKey: Fix null reference when using default(PartitionKey)
[v4] Client Encryption: Refactor code to external project
[Internal] Query: Add code generator for CosmosNumbers for easy additions in the future.

@Shaleen-Kalsi Shaleen-Kalsi changed the title Users/shkalsi/pkdeletev3sdkchanges PartitionKeyDeletePurger: Add API and changes for always using GatewayMode May 11, 2020
@github-actions github-actions bot dismissed stale reviews from themself May 11, 2020 06:43

All good!

@abhijitpai abhijitpai changed the title PartitionKeyDeletePurger: Add API and changes for always using GatewayMode PartitionKeyDelete: Add API to delete all items in a partition key May 11, 2020
abhijitpai
abhijitpai previously approved these changes May 11, 2020
abhijitpai
abhijitpai previously approved these changes Dec 17, 2020
abhijitpai
abhijitpai previously approved these changes Dec 17, 2020
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow the required format: "[Internal] Category: (Adds|Fixes|Refactors) Description"

Examples:
Diagnostics: Adds GetElapsedClientLatency to CosmosDiagnostics
PartitionKey: Fixes null reference when using default(PartitionKey)
[v4] Client Encryption: Refactors code to external project
[Internal] Query: Adds code generator for CosmosNumbers for easy additions in the future.

@abhijitpai abhijitpai changed the title PartitionKeyDelete: Add API to delete all items in a partition key PartitionKeyDelete: Adds API to delete all items in a partition key Dec 23, 2020
@Shaleen-Kalsi Shaleen-Kalsi changed the title PartitionKeyDelete: Adds API to delete all items in a partition key PartitionKeyDelete: Add API to delete all items in a partition key Jan 5, 2021
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow the required format: "[Internal] Category: (Adds|Fixes|Refactors) Description"

Examples:
Diagnostics: Adds GetElapsedClientLatency to CosmosDiagnostics
PartitionKey: Fixes null reference when using default(PartitionKey)
[v4] Client Encryption: Refactors code to external project
[Internal] Query: Adds code generator for CosmosNumbers for easy additions in the future.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow the required format: "[Internal] Category: (Adds|Fixes|Refactors) Description"

Examples:
Diagnostics: Adds GetElapsedClientLatency to CosmosDiagnostics
PartitionKey: Fixes null reference when using default(PartitionKey)
[v4] Client Encryption: Refactors code to external project
[Internal] Query: Adds code generator for CosmosNumbers for easy additions in the future.

@abhijitpai abhijitpai changed the title PartitionKeyDelete: Add API to delete all items in a partition key PartitionKeyDelete: Adds API to delete all items in a partition key Jan 5, 2021
@j82w j82w changed the title PartitionKeyDelete: Adds API to delete all items in a partition key Partition Key Delete: Adds API to delete all items in a partition key Jan 7, 2021
@j82w j82w dismissed GitHub Actions’s stale review January 7, 2021 19:50

Bot is passing. Not sure why it is still requesting a change.

@j82w j82w changed the title Partition Key Delete: Adds API to delete all items in a partition key PartitionKeyDelete: Adds API to delete all items in a partition key Jan 7, 2021
@j82w j82w merged commit 0e338b7 into master Jan 7, 2021
@j82w j82w deleted the users/shkalsi/PKDeleteV3SDKchanges branch January 7, 2021 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants