Packages

  • package root
    Definition Classes
    root
  • package com
    Definition Classes
    root
  • package twitter

    Start with com.twitter.finagle.

    Definition Classes
    com
  • package finagle

    Finagle is an extensible RPC system.

    Finagle is an extensible RPC system.

    Services are represented by class com.twitter.finagle.Service. Clients make use of com.twitter.finagle.Service objects while servers implement them.

    Finagle contains a number of protocol implementations; each of these implement Client and/or com.twitter.finagle.Server. For example, Finagle's HTTP implementation, com.twitter.finagle.Http (in package finagle-http), exposes both.

    Thus a simple HTTP server is built like this:

    import com.twitter.finagle.{Http, Service}
    import com.twitter.finagle.http.{Request, Response}
    import com.twitter.util.{Await, Future}
    
    val service = new Service[Request, Response] {
      def apply(req: Request): Future[Response] =
        Future.value(Response())
    }
    val server = Http.server.serve(":8080", service)
    Await.ready(server)

    We first define a service to which requests are dispatched. In this case, the service returns immediately with a HTTP 200 OK response, and with no content.

    This service is then served via the Http protocol on TCP port 8080. Finally we wait for the server to stop serving.

    We can now query our web server:

    % curl -D - localhost:8080
    HTTP/1.1 200 OK

    Building an HTTP client is also simple. (Note that type annotations are added for illustration.)

    import com.twitter.finagle.{Http, Service}
    import com.twitter.finagle.http.{Request, Response}
    import com.twitter.util.{Future, Return, Throw}
    
    val client: Service[Request, Response] = Http.client.newService("localhost:8080")
    val f: Future[Response] = client(Request()).respond {
      case Return(rep) =>
        printf("Got HTTP response %s\n", rep)
      case Throw(exc) =>
        printf("Got error %s\n", exc)
    }

    Http.client.newService("localhost:8080") constructs a new com.twitter.finagle.Service instance connected to localhost TCP port 8080. We then issue a HTTP/1.1 GET request to URI "/". The service returns a com.twitter.util.Future representing the result of the operation. We listen to this future, printing an appropriate message when the response arrives.

    The Finagle homepage contains useful documentation and resources for using Finagle.

    Definition Classes
    twitter
  • package redis
    Definition Classes
    finagle
  • package exp
    Definition Classes
    redis
  • package protocol
    Definition Classes
    redis
  • package util
    Definition Classes
    redis
  • BaseClient
  • Client
  • ClientError
  • ConnectionCommands
  • NormalCommands
  • ReplyCastFailure
  • ScriptCommands
  • SentinelClient
  • ServerCommands
  • ServerError
  • TransactionalClient
  • Transactions

class SentinelClient extends BaseClient with SentinelCommands with ServerCommands

Linear Supertypes
ServerCommands, BasicServerCommands, SentinelCommands, BaseClient, Closable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SentinelClient
  2. ServerCommands
  3. BasicServerCommands
  4. SentinelCommands
  5. BaseClient
  6. Closable
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SentinelClient(factory: ServiceFactory[Command, Reply])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def ckQuorum(name: String): Future[String]

    Check if the current Sentinel configuration is able to reach the quorum needed to failover a master, and the majority needed to authorize the failover.

    Check if the current Sentinel configuration is able to reach the quorum needed to failover a master, and the majority needed to authorize the failover.

    Definition Classes
    SentinelCommands
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  7. def close(deadline: Time): Future[Unit]

    Releases underlying service factory object

    Releases underlying service factory object

    Definition Classes
    BaseClient → Closable
  8. def close(after: Duration): Future[Unit]
    Definition Classes
    Closable
  9. final def close(): Future[Unit]
    Definition Classes
    Closable
  10. def dbSize(): Future[Long]
    Definition Classes
    ServerCommands
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  13. val factory: ServiceFactory[Command, Reply]
    Attributes
    protected
    Definition Classes
    BaseClient
  14. def failover(name: String): Future[Unit]

    Force a failover.

    Force a failover.

    Definition Classes
    SentinelCommands
  15. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def flushAll(): Future[Unit]

    Deletes all keys in all databases

    Deletes all keys in all databases

    Definition Classes
    ServerCommands
  17. def flushConfig(): Future[Unit]

    Force Sentinel to rewrite its configuration on disk, including the current Sentinel state.

    Force Sentinel to rewrite its configuration on disk, including the current Sentinel state.

    Definition Classes
    SentinelCommands
  18. def flushDB(): Future[Unit]

    Deletes all keys in current DB

    Deletes all keys in current DB

    Definition Classes
    ServerCommands
  19. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. def getMasterAddrByName(name: String): Future[Option[InetSocketAddress]]

    Return the ip and port number of the master with that name.

    Return the ip and port number of the master with that name. If a failover is in progress or terminated successfully for this master it returns the address and port of the promoted slave.

    Definition Classes
    SentinelCommands
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. def info(section: Buf): Future[Option[Buf]]

    Returns information and statistics about the server

    Returns information and statistics about the server

    section

    used to select a specific section of information.

    returns

    a collection of \r\n terminated lines if server has info on the section

    Definition Classes
    BasicServerCommands
  23. def info(): Future[Option[Buf]]

    Returns information and statistics about the server

    Returns information and statistics about the server

    returns

    Buf with collection of \r\n terminated lines of the default info section

    Definition Classes
    BasicServerCommands
  24. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  25. def master(name: String): Future[MasterNode]

    Show the state and info of the specified master.

    Show the state and info of the specified master.

    Definition Classes
    SentinelCommands
  26. def masters(): Future[Seq[MasterNode]]

    Show a list of monitored masters and their state.

    Show a list of monitored masters and their state.

    Definition Classes
    SentinelCommands
  27. def monitor(name: String, ip: String, port: Int, quorum: Int): Future[Unit]

    Tells the Sentinel to start monitoring a new master with the specified name, ip, port, and quorum.

    Tells the Sentinel to start monitoring a new master with the specified name, ip, port, and quorum.

    Definition Classes
    SentinelCommands
  28. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  29. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  30. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  31. def remove(name: String): Future[Unit]

    Remove the specified master.

    Remove the specified master.

    Definition Classes
    SentinelCommands
  32. def reset(pattern: String): Future[Unit]

    Reset all the masters with matching name.

    Reset all the masters with matching name.

    Definition Classes
    SentinelCommands
  33. def sentinels(name: String): Future[List[SentinelNode]]

    Show a list of sentinel instances for this master, and their state.

    Show a list of sentinel instances for this master, and their state.

    Definition Classes
    SentinelCommands
  34. def set(name: String, option: String, value: String): Future[Unit]

    Change configuration parameters of a specific master.

    Change configuration parameters of a specific master.

    Definition Classes
    SentinelCommands
  35. def slaveOf(host: Buf, port: Buf): Future[Unit]
    Definition Classes
    ServerCommands
  36. def slaves(name: String): Future[List[SlaveNode]]

    Show a list of slaves for this master, and their state.

    Show a list of slaves for this master, and their state.

    Definition Classes
    SentinelCommands
  37. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  38. def toString(): String
    Definition Classes
    AnyRef → Any
  39. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from ServerCommands

Inherited from BasicServerCommands

Inherited from SentinelCommands

Inherited from BaseClient

Inherited from Closable

Inherited from AnyRef

Inherited from Any

Ungrouped