Class

com.twitter.finagle.loadbalancer

RoundRobinBalancer

Related Doc: package loadbalancer

Permalink

class RoundRobinBalancer[Req, Rep] extends ServiceFactory[Req, Rep] with Balancer[Req, Rep] with Updating[Req, Rep]

A simple round robin balancer that chooses the next backend in the list for each request.

Linear Supertypes
Updating[Req, Rep], OnReady, Balancer[Req, Rep], ServiceFactory[Req, Rep], Closable, (ClientConnection) ⇒ Future[Service[Req, Rep]], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RoundRobinBalancer
  2. Updating
  3. OnReady
  4. Balancer
  5. ServiceFactory
  6. Closable
  7. Function1
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RoundRobinBalancer(activity: Activity[Traversable[ServiceFactory[Req, Rep]]], statsReceiver: StatsReceiver, emptyException: NoBrokersAvailableException, maxEffort: Int = 5)

    Permalink

Type Members

  1. class Distributor extends DistributorT[Node]

    Permalink

    A simple round robin distributor.

    A simple round robin distributor.

    Attributes
    protected
  2. case class Invoke extends Update with Product with Serializable

    Permalink
    Attributes
    protected
    Definition Classes
    Balancer
  3. case class NewList extends Update with Product with Serializable

    Permalink
    Attributes
    protected
    Definition Classes
    Balancer
  4. class Node extends ServiceFactoryProxy[Req, Rep] with NodeT[Req, Rep]

    Permalink
    Attributes
    protected
  5. case class Rebuild extends Update with Product with Serializable

    Permalink
    Attributes
    protected
    Definition Classes
    Balancer
  6. sealed trait Update extends AnyRef

    Permalink
    Attributes
    protected
    Definition Classes
    Balancer

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val activity: Activity[Traversable[ServiceFactory[Req, Rep]]]

    Permalink

    An activity representing the active set of ServiceFactories.

    An activity representing the active set of ServiceFactories.

    Definition Classes
    RoundRobinBalancer → Updating
  5. def andThen[A](g: (Future[Service[Req, Rep]]) ⇒ A): (ClientConnection) ⇒ A

    Permalink
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  6. def apply(conn: ClientConnection): Future[Service[Req, Rep]]

    Permalink

    Reserve the use of a given service instance.

    Reserve the use of a given service instance. This pins the underlying channel and the returned service has exclusive use of its underlying connection. To relinquish the use of the reserved Service, the user must call Service.close().

    Definition Classes
    Balancer → ServiceFactory → Function1
  7. final def apply(): Future[Service[Req, Rep]]

    Permalink
    Definition Classes
    ServiceFactory
  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def close(deadline: Time): Future[Unit]

    Permalink
    Definition Classes
    Updating → Balancer → Closable
  11. def close(after: Duration): Future[Unit]

    Permalink
    Definition Classes
    Closable
  12. final def close(): Future[Unit]

    Permalink
    Definition Classes
    Closable
  13. def compose[A](g: (A) ⇒ ClientConnection): (A) ⇒ Future[Service[Req, Rep]]

    Permalink
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  14. var dist: Distributor

    Permalink
    Attributes
    protected
    Definition Classes
    Balancer
  15. lazy val empty: Future[Nothing]

    Permalink
    Attributes
    protected
    Definition Classes
    Balancer
  16. val emptyException: NoBrokersAvailableException

    Permalink

    The throwable to use when the load balancer is empty.

    The throwable to use when the load balancer is empty.

    Definition Classes
    RoundRobinBalancer → Balancer
  17. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  19. def failingNode(cause: Throwable): Node

    Permalink

    Create a node whose sole purpose it is to endlessly fail with the given cause.

    Create a node whose sole purpose it is to endlessly fail with the given cause.

    Attributes
    protected
    Definition Classes
    RoundRobinBalancer → Balancer
  20. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. def flatMap[Req1, Rep1](f: (Service[Req, Rep]) ⇒ Future[Service[Req1, Rep1]]): ServiceFactory[Req1, Rep1]

    Permalink

    Apply f on created services, returning the resulting Future in their stead.

    Apply f on created services, returning the resulting Future in their stead. This is useful for implementing common factory wrappers that only need to modify or operate on the underlying service.

    Definition Classes
    ServiceFactory
  22. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  23. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  24. def initDistributor(): Distributor

    Permalink

    Create an initial distributor.

    Create an initial distributor.

    Attributes
    protected
    Definition Classes
    RoundRobinBalancer → Balancer
  25. def invoke(fn: (Distributor) ⇒ Unit): Unit

    Permalink

    Invoke fn on the current distributor.

    Invoke fn on the current distributor. This is done through the updater and is serialized with distributor updates and other invocations.

    Attributes
    protected
    Definition Classes
    Balancer
  26. final def isAvailable: Boolean

    Permalink
    Definition Classes
    ServiceFactory
  27. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  28. def map[Req1, Rep1](f: (Service[Req, Rep]) ⇒ Service[Req1, Rep1]): ServiceFactory[Req1, Rep1]

    Permalink

    Map created services.

    Map created services. Useful for implementing common styles of factory wrappers.

    Definition Classes
    ServiceFactory
  29. val maxEffort: Int

    Permalink

    The maximum number of balancing tries (yielding unavailable factories) until we give up.

    The maximum number of balancing tries (yielding unavailable factories) until we give up.

    Definition Classes
    RoundRobinBalancer → Balancer
  30. val maxEffortExhausted: Counter

    Permalink
    Attributes
    protected[this]
    Definition Classes
    RoundRobinBalancer → Balancer
  31. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  32. def newNode(factory: ServiceFactory[Req, Rep], statsReceiver: StatsReceiver): Node

    Permalink

    Create a new node representing the given factory, with the given weight.

    Create a new node representing the given factory, with the given weight. Report node-related stats to the given StatsReceiver.

    Attributes
    protected
    Definition Classes
    RoundRobinBalancer → Balancer
  33. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  34. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  35. def onReady: Future[Unit]

    Permalink
    Definition Classes
    RoundRobinBalancer → Updating → OnReady
  36. def rebuild(): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Balancer
  37. val statsReceiver: StatsReceiver

    Permalink

    Balancer reports stats here.

    Balancer reports stats here.

    Definition Classes
    RoundRobinBalancer → Balancer
  38. def status: Status

    Permalink

    Balancer status is the best of its constituent nodes.

    Balancer status is the best of its constituent nodes.

    Definition Classes
    Balancer → ServiceFactory
  39. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  40. final def toService: Service[Req, Rep]

    Permalink

    Make a service that after dispatching a request on that service, releases the service.

    Make a service that after dispatching a request on that service, releases the service.

    Definition Classes
    ServiceFactory
  41. def toString(): String

    Permalink
    Definition Classes
    Function1 → AnyRef → Any
  42. def update(factories: Traversable[ServiceFactory[Req, Rep]]): Unit

    Permalink

    Update the load balancer's service list.

    Update the load balancer's service list. After the update, which may run asynchronously, is completed, the load balancer balances across these factories and no others.

    Definition Classes
    Balancer
  43. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Updating[Req, Rep]

Inherited from OnReady

Inherited from Balancer[Req, Rep]

Inherited from ServiceFactory[Req, Rep]

Inherited from Closable

Inherited from (ClientConnection) ⇒ Future[Service[Req, Rep]]

Inherited from AnyRef

Inherited from Any

Ungrouped