com.sksamuel.elastic4s.streams

Members list

Type members

Classlikes

object BulkActor

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
BulkActor.type
class BulkActor[T](client: ElasticClient, subscription: Subscription, builder: RequestBuilder[T], config: SubscriberConfig[T]) extends Actor

Attributes

Companion
object
Supertypes
trait Actor
class Object
trait Matchable
class Any
class BulkIndexingSubscriber[T] extends Subscriber[T]

An implementation of the reactive API Subscriber. This subscriber will bulk index received elements. The bulk nature means that the elasticsearch index operations are performed as a bulk call, the size of which are controlled by the batchSize param.

An implementation of the reactive API Subscriber. This subscriber will bulk index received elements. The bulk nature means that the elasticsearch index operations are performed as a bulk call, the size of which are controlled by the batchSize param.

The received elements must be converted into an elastic4s bulk compatible definition, such as index or delete. This is done by the RequestBuilder.

Type parameters

T

the type of element provided by the publisher this subscriber will subscribe with

Value parameters

builder

used to turn elements of T into IndexDefinitions so they can be used in the bulk indexer

client

used to connect to the cluster

Attributes

Supertypes
trait Subscriber[T]
class Object
trait Matchable
class Any
object PublishActor

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class PublishActor(client: ElasticClient, query: SearchRequest, s: Subscriber[_ >: SearchHit], max: Long) extends Actor, Stash

Attributes

Companion
object
Supertypes
trait Stash
trait RequiresMessageQueue[DequeBasedMessageQueueSemantics]
trait UnrestrictedStash
trait Actor
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
trait RequestBuilder[T]

An implementation of this typeclass must provide a bulk compatible request for the given instance of T. The bulk compatible request will then be sent to elastic.

An implementation of this typeclass must provide a bulk compatible request for the given instance of T. The bulk compatible request will then be sent to elastic.

A bulk compatible request can be either an index, update, or delete.

Type parameters

T

the type of elements this builder supports

Attributes

Supertypes
class Object
trait Matchable
class Any
trait ResponseListener[-T]

Notified on each acknowledgement

Notified on each acknowledgement

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
class ScrollPublisher extends Publisher[SearchHit]

An implementation of the reactive API Publisher, that publishes documents using an elasticsearch scroll cursor. The initial query must be provided to the publisher, and there are helpers to create a query for all documents in an index (and type).

An implementation of the reactive API Publisher, that publishes documents using an elasticsearch scroll cursor. The initial query must be provided to the publisher, and there are helpers to create a query for all documents in an index (and type).

Value parameters

actorRefFactory

an Actor reference factory required by the publisher

client

a client for the cluster

maxItems

the maximum number of elements to return

search

the initial search query to execute

Attributes

Supertypes
trait Publisher[SearchHit]
class Object
trait Matchable
class Any
class ScrollSubscription(client: ElasticClient, query: SearchRequest, s: Subscriber[_ >: SearchHit], max: Long)(implicit actorRefFactory: ActorRefFactory) extends Subscription

Attributes

Supertypes
trait Subscription
class Object
trait Matchable
class Any
case class SubscriberConfig[T](batchSize: Int, concurrentRequests: Int, refreshAfterOp: Boolean, listener: ResponseListener[T], completionFn: () => Unit, successFn: () => Unit, errorFn: Throwable => Unit, failureWait: FiniteDuration, retryFailure: (BulkResponseItem, T) => Boolean, maxAttempts: Int, flushInterval: Option[FiniteDuration], flushAfter: Option[FiniteDuration])

Value parameters

batchSize

the number of elements to group together per batch aside from the last batch

completionFn

a function which is invoked when all sent requests have been acknowledged and the publisher has completed Note: this function is executed regardless of whether there was an error or not, that is, this function is always invoked regardless of the state

concurrentRequests

the number of concurrent batch operations

errorFn

a function which is invoked after there is an error

failureWait

the timeout before re-trying failed requests. Usually a failed request is elasticsearch's way of indicating backpressure, so this parameter determines how long to wait between requests.

flushAfter

used to schedule an index if no document has been received within the given duration. Once an index is performed (either by this flush value or because docs arrived in time) the flush after schedule is reset.

flushInterval

used to schedule periodic bulk indexing. This can be set to avoid waiting for a complete batch for a long period of time. It also is used if the publisher will never complete. This ensures that all elements are indexed, even if the last batch size is lower than batch size.

listener

a listener which is notified on each acknowledge batch item

maxAttempts

the max number of times to try a request. If it fails too many times it probably isn't back pressure but an error with the document.

refreshAfterOp

if the index should be refreshed after each bulk operation

retryFailure

a function which is invoked for every failure in a bulk request, and returns true if the failure should be retried or false if it should not.

successFn

a function will is only invoked when all operations have completed successfully

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all