SearchClientBuilder.SearchIndexingBufferedSenderBuilder<T> Class
- java.
lang. Object - com.
azure. search. documents. SearchClientBuilder. SearchIndexingBufferedSenderBuilder<T>
- com.
Type Parameters
- T
The type of the document that the buffered sender will use.
public final class SearchClientBuilder.SearchIndexingBufferedSenderBuilder<T>
This class provides a fluent builder API to help aid the configuration and instantiation of SearchIndexingBufferedSender<T> and SearchIndexingBufferedAsyncSender<T>. Call buildSender() and buildAsyncSender() respectively to construct an instance of the desired sender.
Method Summary
Methods inherited from java.lang.Object
Method Details
autoFlush
public SearchClientBuilder.SearchIndexingBufferedSenderBuilder<T> autoFlush(boolean autoFlush)
Sets the flag determining whether a buffered sender will automatically flush its document batch based on the configurations of autoFlushInterval(Duration autoFlushInterval) and initialBatchActionCount(int initialBatchActionCount).
Parameters:
Returns:
autoFlushInterval
public SearchClientBuilder.SearchIndexingBufferedSenderBuilder<T> autoFlushInterval(Duration autoFlushInterval)
Sets the duration between a buffered sender sending documents to be indexed.
The buffered sender will reset the duration when documents are sent for indexing, either by reaching initialBatchActionCount(int initialBatchActionCount) or by a manual trigger.
If autoFlushInterval
is negative or zero and autoFlush(boolean autoFlush) is enabled the buffered sender will only flush when initialBatchActionCount(int initialBatchActionCount) is met.
Parameters:
Returns:
buildAsyncSender
public SearchIndexingBufferedAsyncSender<T> buildAsyncSender()
Creates a SearchIndexingBufferedAsyncSender<T> based on options set in the builder. Every time this is called a new instance of SearchIndexingBufferedAsyncSender<T> is created.
Returns:
buildSender
public SearchIndexingBufferedSender<T> buildSender()
Creates a SearchIndexingBufferedSender<T> based on options set in the builder. Every time this is called a new instance of SearchIndexingBufferedSender<T> is created.
Returns:
documentKeyRetriever
public SearchClientBuilder.SearchIndexingBufferedSenderBuilder<T> documentKeyRetriever(Function<T,String> documentKeyRetriever)
Sets the function that retrieves the key value from a document.
Parameters:
Returns:
initialBatchActionCount
public SearchClientBuilder.SearchIndexingBufferedSenderBuilder<T> initialBatchActionCount(int initialBatchActionCount)
Sets the number of documents before a buffered sender will send the batch to be indexed.
This will only trigger a batch to be sent automatically if #autoFlushInterval is configured. Default value is 512
.
Parameters:
Returns:
maxRetriesPerAction
public SearchClientBuilder.SearchIndexingBufferedSenderBuilder<T> maxRetriesPerAction(int maxRetriesPerAction)
Sets the number of times an action will retry indexing before it is considered failed.
Documents are only retried on retryable status codes.
Default value is 3
.
Parameters:
Returns:
maxThrottlingDelay
public SearchClientBuilder.SearchIndexingBufferedSenderBuilder<T> maxThrottlingDelay(Duration maxThrottlingDelay)
Sets the maximum duration that requests will be delayed when the service is throttling.
If maxThrottlingDelay
is less than throttlingDelay(Duration throttlingDelay) then throttlingDelay(Duration throttlingDelay) will be used as the maximum delay.
Default value is Duration.ofMinutes(1)
.
Parameters:
Returns:
onActionAdded
public SearchClientBuilder.SearchIndexingBufferedSenderBuilder<T> onActionAdded(Consumer<OnActionAddedOptions<T>> onActionAddedConsumer)
Callback hook for when a document indexing action has been added to a batch queued.
Parameters:
Returns:
onActionError
public SearchClientBuilder.SearchIndexingBufferedSenderBuilder<T> onActionError(Consumer<OnActionErrorOptions<T>> onActionErrorConsumer)
Sets the callback hook for when a document indexing action has failed to index and isn't retryable.
Parameters:
Returns:
onActionSent
public SearchClientBuilder.SearchIndexingBufferedSenderBuilder<T> onActionSent(Consumer<OnActionSentOptions<T>> onActionSentConsumer)
Sets the callback hook for when a document indexing has been sent in a batching request.
Parameters:
Returns:
onActionSucceeded
public SearchClientBuilder.SearchIndexingBufferedSenderBuilder<T> onActionSucceeded(Consumer<OnActionSucceededOptions<T>> onActionSucceededConsumer)
Sets the callback hook for when a document indexing action has successfully completed indexing.
Parameters:
Returns:
throttlingDelay
public SearchClientBuilder.SearchIndexingBufferedSenderBuilder<T> throttlingDelay(Duration throttlingDelay)
Sets the initial duration that requests will be delayed when the service is throttling.
Default value is Duration.ofMillis(800)
.
Parameters:
Returns: