CosmosBulkOperations Class

  • java.lang.Object
    • com.azure.cosmos.models.CosmosBulkOperations

public final class CosmosBulkOperations

Utility for creating bulk operations which can be executed by calling executeBulkOperations(Flux<CosmosItemOperation> operations, CosmosBulkExecutionOptions bulkOptions) . Also while creating these operation, if some options which are only for individual operation can be provided by passing a CosmosBulkItemRequestOptions while creating the bulk operation. See also CosmosBulkExecutionOptions.

Constructor Summary

Constructor Description
CosmosBulkOperations()

Method Summary

Modifier and Type Method and Description
static CosmosItemOperation <T,TContext>getCreateItemOperation(T item, PartitionKey partitionKey, TContext context)

Instantiate an operation for Creating item in Bulk execution.

static CosmosItemOperation <T,TContext>getCreateItemOperation(T item, PartitionKey partitionKey, CosmosBulkItemRequestOptions requestOptions, TContext context)

Instantiate an operation for Creating item in Bulk execution.

static CosmosItemOperation <T,TContext>getReplaceItemOperation(String id, T item, PartitionKey partitionKey, TContext context)

Instantiate an operation for replace item in Bulk execution.

static CosmosItemOperation <T,TContext>getReplaceItemOperation(String id, T item, PartitionKey partitionKey, CosmosBulkItemRequestOptions requestOptions, TContext context)

Instantiate an operation for replace item in Bulk execution.

static CosmosItemOperation <T,TContext>getUpsertItemOperation(T item, PartitionKey partitionKey, TContext context)

Instantiate an operation for upsert item in Bulk execution.

static CosmosItemOperation <T,TContext>getUpsertItemOperation(T item, PartitionKey partitionKey, CosmosBulkItemRequestOptions requestOptions, TContext context)

Instantiate an operation for upsert item in Bulk execution.

static CosmosItemOperation getCreateItemOperation(T item, PartitionKey partitionKey)

Instantiate an operation for Creating item in Bulk execution.

static CosmosItemOperation getCreateItemOperation(T item, PartitionKey partitionKey, CosmosBulkItemRequestOptions requestOptions)

Instantiate an operation for Creating item in Bulk execution.

static CosmosItemOperation getReplaceItemOperation(String id, T item, PartitionKey partitionKey)

Instantiate an operation for replace item in Bulk execution.

static CosmosItemOperation getReplaceItemOperation(String id, T item, PartitionKey partitionKey, CosmosBulkItemRequestOptions requestOptions)

Instantiate an operation for replace item in Bulk execution.

static CosmosItemOperation getUpsertItemOperation(T item, PartitionKey partitionKey)

Instantiate an operation for upsert item in Bulk execution.

static CosmosItemOperation getUpsertItemOperation(T item, PartitionKey partitionKey, CosmosBulkItemRequestOptions requestOptions)

Instantiate an operation for upsert item in Bulk execution.

static CosmosItemOperation getDeleteItemOperation(String id, PartitionKey partitionKey, TContext context)

Instantiate an operation for deleting item in Bulk execution.

static CosmosItemOperation getDeleteItemOperation(String id, PartitionKey partitionKey, CosmosBulkItemRequestOptions requestOptions, TContext context)

Instantiate an operation for deleting item in Bulk execution.

static CosmosItemOperation getPatchItemOperation(String id, PartitionKey partitionKey, CosmosPatchOperations cosmosPatchOperations, TContext context)

Instantiate an operation for a patch in Bulk execution.

static CosmosItemOperation getPatchItemOperation(String id, PartitionKey partitionKey, CosmosPatchOperations cosmosPatchOperations, CosmosBulkPatchItemRequestOptions requestOptions, TContext context)

Instantiate an operation for a patch in Bulk execution.

static CosmosItemOperation getReadItemOperation(String id, PartitionKey partitionKey, TContext context)

Instantiate an operation for read item in Bulk execution.

static CosmosItemOperation getReadItemOperation(String id, PartitionKey partitionKey, CosmosBulkItemRequestOptions requestOptions, TContext context)

Instantiate an operation for read item in Bulk execution.

static CosmosItemOperation getDeleteItemOperation(String id, PartitionKey partitionKey)

Instantiate an operation for deleting item in Bulk execution.

static CosmosItemOperation getDeleteItemOperation(String id, PartitionKey partitionKey, CosmosBulkItemRequestOptions requestOptions)

Instantiate an operation for deleting item in Bulk execution.

static CosmosItemOperation getPatchItemOperation(String id, PartitionKey partitionKey, CosmosPatchOperations cosmosPatchOperations)

Instantiate an operation for a patch in Bulk execution.

static CosmosItemOperation getPatchItemOperation(String id, PartitionKey partitionKey, CosmosPatchOperations cosmosPatchOperations, CosmosBulkPatchItemRequestOptions requestOptions)

Instantiate an operation for a patch in Bulk execution.

static CosmosItemOperation getReadItemOperation(String id, PartitionKey partitionKey)

Instantiate an operation for read item in Bulk execution.

static CosmosItemOperation getReadItemOperation(String id, PartitionKey partitionKey, CosmosBulkItemRequestOptions requestOptions)

Instantiate an operation for read item in Bulk execution.

Methods inherited from java.lang.Object

Constructor Details

CosmosBulkOperations

public CosmosBulkOperations()

Method Details

<T,TContext>getCreateItemOperation

public static CosmosItemOperation getCreateItemOperation(T item, PartitionKey partitionKey, TContext context)

Instantiate an operation for Creating item in Bulk execution.

Parameters:

item - A JSON serializable object that must contain an id property.
partitionKey - the partition key for the operation
context - The caller provided context for this operation.

Returns:

the bulk operation.

<T,TContext>getCreateItemOperation

public static CosmosItemOperation getCreateItemOperation(T item, PartitionKey partitionKey, CosmosBulkItemRequestOptions requestOptions, TContext context)

Instantiate an operation for Creating item in Bulk execution.

Parameters:

item - A JSON serializable object that must contain an id property.
partitionKey - the partition key for the operation.
requestOptions - The options for the item request.
context - The caller provided context for this operation.

Returns:

the bulk operation.

<T,TContext>getReplaceItemOperation

public static CosmosItemOperation getReplaceItemOperation(String id, T item, PartitionKey partitionKey, TContext context)

Instantiate an operation for replace item in Bulk execution.

Parameters:

id - The unique id of the item.
item - A JSON serializable object that must contain an id property.
partitionKey - the partition key for the operation.
context - The caller provided context for this operation.

Returns:

the bulk operation.

<T,TContext>getReplaceItemOperation

public static CosmosItemOperation getReplaceItemOperation(String id, T item, PartitionKey partitionKey, CosmosBulkItemRequestOptions requestOptions, TContext context)

Instantiate an operation for replace item in Bulk execution.

Parameters:

id - The unique id of the item..
item - A JSON serializable object that must contain an id property.
partitionKey - the partition key for the operation.
requestOptions - The options for the item request.
context - The caller provided context for this operation.

Returns:

the bulk operation.

<T,TContext>getUpsertItemOperation

public static CosmosItemOperation getUpsertItemOperation(T item, PartitionKey partitionKey, TContext context)

Instantiate an operation for upsert item in Bulk execution.

Parameters:

item - A JSON serializable object that must contain an id property.
partitionKey - the partition key for the operation.
context - The caller provided context for this operation.

Returns:

the bulk operation.

<T,TContext>getUpsertItemOperation

public static CosmosItemOperation getUpsertItemOperation(T item, PartitionKey partitionKey, CosmosBulkItemRequestOptions requestOptions, TContext context)

Instantiate an operation for upsert item in Bulk execution.

Parameters:

item - A JSON serializable object that must contain an id property.
partitionKey - the partition key for the operation.
requestOptions - The options for the item request.
context - The caller provided context for this operation.

Returns:

the bulk operation.

getCreateItemOperation

public static CosmosItemOperation getCreateItemOperation(T item, PartitionKey partitionKey)

Instantiate an operation for Creating item in Bulk execution.

Parameters:

item - A JSON serializable object that must contain an id property.
partitionKey - the partition key for the operation

Returns:

the bulk operation.

getCreateItemOperation

public static CosmosItemOperation getCreateItemOperation(T item, PartitionKey partitionKey, CosmosBulkItemRequestOptions requestOptions)

Instantiate an operation for Creating item in Bulk execution.

Parameters:

item - A JSON serializable object that must contain an id property.
partitionKey - the partition key for the operation.
requestOptions - The options for the item request.

Returns:

the bulk operation.

getReplaceItemOperation

public static CosmosItemOperation getReplaceItemOperation(String id, T item, PartitionKey partitionKey)

Instantiate an operation for replace item in Bulk execution.

Parameters:

id - The unique id of the item.
item - A JSON serializable object that must contain an id property.
partitionKey - the partition key for the operation.

Returns:

the bulk operation.

getReplaceItemOperation

public static CosmosItemOperation getReplaceItemOperation(String id, T item, PartitionKey partitionKey, CosmosBulkItemRequestOptions requestOptions)

Instantiate an operation for replace item in Bulk execution.

Parameters:

id - The unique id of the item..
item - A JSON serializable object that must contain an id property.
partitionKey - the partition key for the operation.
requestOptions - The options for the item request.

Returns:

the bulk operation.

getUpsertItemOperation

public static CosmosItemOperation getUpsertItemOperation(T item, PartitionKey partitionKey)

Instantiate an operation for upsert item in Bulk execution.

Parameters:

item - A JSON serializable object that must contain an id property.
partitionKey - the partition key for the operation.

Returns:

the bulk operation.

getUpsertItemOperation

public static CosmosItemOperation getUpsertItemOperation(T item, PartitionKey partitionKey, CosmosBulkItemRequestOptions requestOptions)

Instantiate an operation for upsert item in Bulk execution.

Parameters:

item - A JSON serializable object that must contain an id property.
partitionKey - the partition key for the operation.
requestOptions - The options for the item request.

Returns:

the bulk operation.

getDeleteItemOperation

public static CosmosItemOperation getDeleteItemOperation(String id, PartitionKey partitionKey, TContext context)

Instantiate an operation for deleting item in Bulk execution.

Parameters:

id - The unique id of the item.
partitionKey - the partition key for the operation.
context - The caller provided context for this operation.

Returns:

the bulk operation.

getDeleteItemOperation

public static CosmosItemOperation getDeleteItemOperation(String id, PartitionKey partitionKey, CosmosBulkItemRequestOptions requestOptions, TContext context)

Instantiate an operation for deleting item in Bulk execution.

Parameters:

id - The unique id of the item.
partitionKey - the partition key for the operation..
requestOptions - The options for the item request.
context - The caller provided context for this operation.

Returns:

the bulk operation.

getPatchItemOperation

public static CosmosItemOperation getPatchItemOperation(String id, PartitionKey partitionKey, CosmosPatchOperations cosmosPatchOperations, TContext context)

Instantiate an operation for a patch in Bulk execution.

Parameters:

id - the item id.
partitionKey - the partition key for the operation.
cosmosPatchOperations - Represents a container having list of operations to be sequentially applied to the referred Cosmos item.
context - The caller provided context for this operation.

Returns:

the bulk operation.

getPatchItemOperation

public static CosmosItemOperation getPatchItemOperation(String id, PartitionKey partitionKey, CosmosPatchOperations cosmosPatchOperations, CosmosBulkPatchItemRequestOptions requestOptions, TContext context)

Instantiate an operation for a patch in Bulk execution.

Parameters:

id - the item id.
partitionKey - the partition key for the operation.
cosmosPatchOperations - Represents a container having list of operations to be sequentially applied to the referred Cosmos item.
requestOptions - The options for the item request.
context - The caller provided context for this operation.

Returns:

the bulk operation.

getReadItemOperation

public static CosmosItemOperation getReadItemOperation(String id, PartitionKey partitionKey, TContext context)

Instantiate an operation for read item in Bulk execution.

Parameters:

id - The unique id of the item.
partitionKey - the partition key for the operation.
context - The caller provided context for this operation.

Returns:

the bulk operation.

getReadItemOperation

public static CosmosItemOperation getReadItemOperation(String id, PartitionKey partitionKey, CosmosBulkItemRequestOptions requestOptions, TContext context)

Instantiate an operation for read item in Bulk execution.

Parameters:

id - The unique id of the item.
partitionKey - the partition key for the operation..
requestOptions - The options for the item request.
context - The caller provided context for this operation.

Returns:

the bulk operation.

getDeleteItemOperation

public static CosmosItemOperation getDeleteItemOperation(String id, PartitionKey partitionKey)

Instantiate an operation for deleting item in Bulk execution.

Parameters:

id - The unique id of the item.
partitionKey - the partition key for the operation.

Returns:

the bulk operation.

getDeleteItemOperation

public static CosmosItemOperation getDeleteItemOperation(String id, PartitionKey partitionKey, CosmosBulkItemRequestOptions requestOptions)

Instantiate an operation for deleting item in Bulk execution.

Parameters:

id - The unique id of the item.
partitionKey - the partition key for the operation..
requestOptions - The options for the item request.

Returns:

the bulk operation.

getPatchItemOperation

public static CosmosItemOperation getPatchItemOperation(String id, PartitionKey partitionKey, CosmosPatchOperations cosmosPatchOperations)

Instantiate an operation for a patch in Bulk execution.

Parameters:

id - the item id.
partitionKey - the partition key for the operation.
cosmosPatchOperations - Represents a container having list of operations to be sequentially applied to the referred Cosmos item.

Returns:

the bulk operation.

getPatchItemOperation

public static CosmosItemOperation getPatchItemOperation(String id, PartitionKey partitionKey, CosmosPatchOperations cosmosPatchOperations, CosmosBulkPatchItemRequestOptions requestOptions)

Instantiate an operation for a patch in Bulk execution.

Parameters:

id - the item id.
partitionKey - the partition key for the operation.
cosmosPatchOperations - Represents a container having list of operations to be sequentially applied to the referred Cosmos item.
requestOptions - The options for the item request.

Returns:

the bulk operation.

getReadItemOperation

public static CosmosItemOperation getReadItemOperation(String id, PartitionKey partitionKey)

Instantiate an operation for read item in Bulk execution.

Parameters:

id - The unique id of the item.
partitionKey - the partition key for the operation.

Returns:

the bulk operation.

getReadItemOperation

public static CosmosItemOperation getReadItemOperation(String id, PartitionKey partitionKey, CosmosBulkItemRequestOptions requestOptions)

Instantiate an operation for read item in Bulk execution.

Parameters:

id - The unique id of the item.
partitionKey - the partition key for the operation..
requestOptions - The options for the item request.

Returns:

the bulk operation.

Applies to