Partilhar via


DocumentBulkExecutor.Builder Class

  • java.lang.Object
    • com.microsoft.azure.documentdb.bulkexecutor.DocumentBulkExecutor.Builder

public static class DocumentBulkExecutor.Builder

Method Summary

Modifier and Type Method and Description
DocumentBulkExecutor build()

Instantiates DocumentBulkExecutor given the configured Builder.

Builder from(DocumentClient client, String databaseName, String collectionName, PartitionKeyDefinition partitionKeyDef, int offerThroughput)

Use the instance of DocumentClient to perform bulk operations in target DocumentCollection instance at specified allocated throughput.

Builder withInitializationRetryOptions(RetryOptions options)

Use the given retry options to apply to DocumentClient used in initialization of DocumentBulkExecutor.

Builder withMaxMiniBatchSize(int size)

Use the given size to configure max mini-batch size (specific to bulk import API).

Builder withMaxUpdateMiniBatchCount(int count)

Use the given count to configure max update mini-batch count (specific to bulk update API).

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Method Details

build

public DocumentBulkExecutor build()

Instantiates DocumentBulkExecutor given the configured Builder.

Returns:

the newly instantiated instance of DocumentBulkExecutor

Throws:

java.lang.Exception - if there is any failure

from

public DocumentBulkExecutor.Builder from(DocumentClient client, String databaseName, String collectionName, PartitionKeyDefinition partitionKeyDef, int offerThroughput)

Use the instance of DocumentClient to perform bulk operations in target DocumentCollection instance at specified allocated throughput.

Parameters:

client - an instance of DocumentClient
databaseName - name of the database
collectionName - name of the collection
partitionKeyDef - specifies the PartitionKeyDefinition of the collection
offerThroughput - specifies the throughput allocated for bulk operations out of the collection's total throughput

Returns:

an instance of Builder

withInitializationRetryOptions

public DocumentBulkExecutor.Builder withInitializationRetryOptions(RetryOptions options)

Use the given retry options to apply to DocumentClient used in initialization of DocumentBulkExecutor.

Parameters:

options - an instance of RetryOptions

Returns:

Builder

withMaxMiniBatchSize

public DocumentBulkExecutor.Builder withMaxMiniBatchSize(int size)

Use the given size to configure max mini-batch size (specific to bulk import API). If not specified will use the default value of 220200 bytes.

Parameters:

size - specifies the size of a mini-batch used in bulk import API.

Returns:

Builder

withMaxUpdateMiniBatchCount

public DocumentBulkExecutor.Builder withMaxUpdateMiniBatchCount(int count)

Use the given count to configure max update mini-batch count (specific to bulk update API). If not specified will use the default value of 500.

Parameters:

count - specifies the maximum count of update items in a mini-batch used in bulk import API.

Returns:

Builder

Applies to