Search Results for

    Show / Hide Table of Contents

    Class BulkAllDescriptor<T>

    Inheritance
    object
    DescriptorBase<BulkAllDescriptor<T>, IBulkAllRequest<T>>
    BulkAllDescriptor<T>
    Implements
    IDescriptor
    IBulkAllRequest<T>
    Inherited Members
    DescriptorBase<BulkAllDescriptor<T>, IBulkAllRequest<T>>.Self
    DescriptorBase<BulkAllDescriptor<T>, IBulkAllRequest<T>>.Assign<TValue>(TValue, Action<IBulkAllRequest<T>, TValue>)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: OpenSearch.Client
    Assembly: OpenSearch.Client.dll
    Syntax
    public class BulkAllDescriptor<T> : DescriptorBase<BulkAllDescriptor<T>, IBulkAllRequest<T>>, IDescriptor, IBulkAllRequest<T> where T : class
    Type Parameters
    Name Description
    T

    Constructors

    | Edit this page View Source

    BulkAllDescriptor(IEnumerable<T>)

    Declaration
    public BulkAllDescriptor(IEnumerable<T> documents)
    Parameters
    Type Name Description
    IEnumerable<T> documents

    Methods

    | Edit this page View Source

    BackOffRetries(int?)

    In case of a HTTP 429 (Too Many Requests) response status code, how many times should we automatically back off before failing

    Declaration
    public BulkAllDescriptor<T> BackOffRetries(int? backoffs)
    Parameters
    Type Name Description
    int? backoffs
    Returns
    Type Description
    BulkAllDescriptor<T>
    | Edit this page View Source

    BackOffTime(Time)

    In case of a HTTP 429 (Too Many Requests) response status code, how long should we wait before retrying

    Declaration
    public BulkAllDescriptor<T> BackOffTime(Time time)
    Parameters
    Type Name Description
    Time time
    Returns
    Type Description
    BulkAllDescriptor<T>
    | Edit this page View Source

    BackPressure(int, int?)

    Simple back pressure implementation that makes sure the minimum max concurrency between producer and consumer is not amplified by the greedier of the two by more then a given back pressure factor When set each scroll request will additionally wait on WaitAsync(CancellationToken) as well as MaxDegreeOfParallelism(int?) if set. Not that the consumer has to call Release() on the same instance every time it is done.

    Declaration
    public BulkAllDescriptor<T> BackPressure(int maxConcurrency, int? backPressureFactor = null)
    Parameters
    Type Name Description
    int maxConcurrency

    The minimum maximum concurrency which would be the bottleneck of the producer consumer pipeline

    int? backPressureFactor

    The maximum amplification back pressure of the greedier part of the producer consumer pipeline

    Returns
    Type Description
    BulkAllDescriptor<T>
    | Edit this page View Source

    BufferToBulk(Action<BulkDescriptor, IList<T>>)

    By default, BulkAllObservable<T> calls IndexMany<T>(IEnumerable<T>, Func<BulkIndexDescriptor<T>, T, IBulkIndexOperation<T>>) on the buffer. There might be case where you'd like more control over the bulk operation. By setting this callback, you are in complete control of describing how the buffer should be translated to a bulk operation.

    Declaration
    public BulkAllDescriptor<T> BufferToBulk(Action<BulkDescriptor, IList<T>> modifier)
    Parameters
    Type Name Description
    Action<BulkDescriptor, IList<T>> modifier
    Returns
    Type Description
    BulkAllDescriptor<T>
    | Edit this page View Source

    BulkResponseCallback(Action<BulkResponse>)

    Be notified every time a bulk response returns, this includes retries. OnNext(T) is only called for successful batches.

    Declaration
    public BulkAllDescriptor<T> BulkResponseCallback(Action<BulkResponse> callback)
    Parameters
    Type Name Description
    Action<BulkResponse> callback
    Returns
    Type Description
    BulkAllDescriptor<T>
    | Edit this page View Source

    ContinueAfterDroppedDocuments(bool)

    Halt the bulk all request if any of the documents returned is a failure that can not be retried. When true, will feed dropped documents to DroppedDocumentCallback

    Declaration
    public BulkAllDescriptor<T> ContinueAfterDroppedDocuments(bool proceed = true)
    Parameters
    Type Name Description
    bool proceed
    Returns
    Type Description
    BulkAllDescriptor<T>
    | Edit this page View Source

    DocumentAffinityKey(Func<T, string>)

    Optional per-document affinity key. When set, documents sharing a key are routed to the same worker and that worker dispatches its batches strictly in order with at most one batch in flight, preserving on-the-wire ordering for operations that share a key. A slow or retrying worker holds up only its own key, not the others. When null (the default) batches are dispatched round-robin with no ordering guarantee.

    Declaration
    public BulkAllDescriptor<T> DocumentAffinityKey(Func<T, string> keySelector)
    Parameters
    Type Name Description
    Func<T, string> keySelector
    Returns
    Type Description
    BulkAllDescriptor<T>
    | Edit this page View Source

    DocumentId(Func<T, string>)

    Optional function that computes the _id of each document from the document itself, applied to the default bulk operation. When set, each document is indexed with Id(DocumentId(document)) instead of relying on id inference. The function can return any string — a single field, or a value computed from the document (for example d => $"{d.Region}-{d.Key}").

    This is ignored when BufferToBulk is set: BufferToBulk gives you complete control over how the buffer is translated to a bulk operation, so you are responsible for setting the id yourself in that callback.

    Declaration
    public BulkAllDescriptor<T> DocumentId(Func<T, string> documentId)
    Parameters
    Type Name Description
    Func<T, string> documentId
    Returns
    Type Description
    BulkAllDescriptor<T>
    | Edit this page View Source

    DroppedDocumentCallback(Action<BulkResponseItemBase, T>)

    If a bulk operation fails because it receives documents it can not retry they will be fed to this callback. If ContinueAfterDroppedDocuments is set to true processing will continue, so this callback can be used to feed into a dead letter queue. Otherwise bulk all indexing will be halted.

    Declaration
    public BulkAllDescriptor<T> DroppedDocumentCallback(Action<BulkResponseItemBase, T> callback)
    Parameters
    Type Name Description
    Action<BulkResponseItemBase, T> callback
    Returns
    Type Description
    BulkAllDescriptor<T>
    | Edit this page View Source

    Index(IndexName)

    The index to use for items that don't specify one. By default, will be inferred from T. If no default index has been mapped for T using DefaultMappingFor<TDocument>(Func<ClrTypeMappingDescriptor<TDocument>, IClrTypeMapping<TDocument>>) on ConnectionSettings, an exception will be thrown.

    Declaration
    public BulkAllDescriptor<T> Index(IndexName index)
    Parameters
    Type Name Description
    IndexName index
    Returns
    Type Description
    BulkAllDescriptor<T>
    | Edit this page View Source

    Index<TOther>()

    The index to use for items that don't specify one. By default, will be inferred from T. If no default index has been mapped for T using DefaultMappingFor<TDocument>(Func<ClrTypeMappingDescriptor<TDocument>, IClrTypeMapping<TDocument>>) on ConnectionSettings, an exception will be thrown.

    Declaration
    public BulkAllDescriptor<T> Index<TOther>() where TOther : class
    Returns
    Type Description
    BulkAllDescriptor<T>
    Type Parameters
    Name Description
    TOther
    | Edit this page View Source

    MaxDegreeOfParallelism(int?)

    The maximum number of bulk operations we want to have in flight at a time

    Declaration
    public BulkAllDescriptor<T> MaxDegreeOfParallelism(int? parallelism)
    Parameters
    Type Name Description
    int? parallelism
    Returns
    Type Description
    BulkAllDescriptor<T>
    | Edit this page View Source

    Pipeline(string)

    The pipeline id to preprocess all the incoming documents with

    Declaration
    public BulkAllDescriptor<T> Pipeline(string pipeline)
    Parameters
    Type Name Description
    string pipeline
    Returns
    Type Description
    BulkAllDescriptor<T>
    | Edit this page View Source

    RefreshIndices(Indices)

    The indices you wish to refresh after the bulk all completes, defaults to Index

    Declaration
    public BulkAllDescriptor<T> RefreshIndices(Indices indicesToRefresh)
    Parameters
    Type Name Description
    Indices indicesToRefresh
    Returns
    Type Description
    BulkAllDescriptor<T>
    | Edit this page View Source

    RefreshOnCompleted(bool)

    Refresh the index after performing ALL the bulk operations (NOTE this is an additional request)

    Declaration
    public BulkAllDescriptor<T> RefreshOnCompleted(bool refresh = true)
    Parameters
    Type Name Description
    bool refresh
    Returns
    Type Description
    BulkAllDescriptor<T>
    | Edit this page View Source

    RetryBaseDelay(TimeSpan?)

    When set, retries use exponential backoff with jitter starting from this base delay (doubling per attempt, randomized, capped by RetryMaxDelay) instead of the fixed BackOffTime.

    Declaration
    public BulkAllDescriptor<T> RetryBaseDelay(TimeSpan? delay)
    Parameters
    Type Name Description
    TimeSpan? delay
    Returns
    Type Description
    BulkAllDescriptor<T>
    | Edit this page View Source

    RetryDocumentPredicate(Func<BulkResponseItemBase, T, bool>)

    A predicate to control which documents should be retried. Defaults to failed bulk items with a HTTP 429 (Too Many Requests) response status code.

    Declaration
    public BulkAllDescriptor<T> RetryDocumentPredicate(Func<BulkResponseItemBase, T, bool> predicate)
    Parameters
    Type Name Description
    Func<BulkResponseItemBase, T, bool> predicate
    Returns
    Type Description
    BulkAllDescriptor<T>
    | Edit this page View Source

    RetryMaxDelay(TimeSpan?)

    The maximum delay between retries when RetryBaseDelay is set. Ignored when RetryBaseDelay is not set (the fixed BackOffTime is used instead).

    Declaration
    public BulkAllDescriptor<T> RetryMaxDelay(TimeSpan? delay)
    Parameters
    Type Name Description
    TimeSpan? delay
    Returns
    Type Description
    BulkAllDescriptor<T>
    | Edit this page View Source

    Routing(Routing)

    Specific per bulk operation routing value

    Declaration
    public BulkAllDescriptor<T> Routing(Routing routing)
    Parameters
    Type Name Description
    Routing routing
    Returns
    Type Description
    BulkAllDescriptor<T>
    | Edit this page View Source

    Size(int?)

    The number of documents to send per bulk

    Declaration
    public BulkAllDescriptor<T> Size(int? size)
    Parameters
    Type Name Description
    int? size
    Returns
    Type Description
    BulkAllDescriptor<T>
    | Edit this page View Source

    Timeout(Time)

    Explicit per operation timeout

    Declaration
    public BulkAllDescriptor<T> Timeout(Time timeout)
    Parameters
    Type Name Description
    Time timeout
    Returns
    Type Description
    BulkAllDescriptor<T>
    | Edit this page View Source

    WaitForActiveShards(int?)

    Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to all for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)

    Declaration
    public BulkAllDescriptor<T> WaitForActiveShards(int? shards)
    Parameters
    Type Name Description
    int? shards
    Returns
    Type Description
    BulkAllDescriptor<T>

    Implements

    IDescriptor
    IBulkAllRequest<T>

    Extension Methods

    SuffixExtensions.Suffix(object, string)
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX