Trait

com.twitter.finagle.memcached

BaseClient

Related Doc: package memcached

Permalink

trait BaseClient[T] extends AnyRef

A friendly client to talk to a Memcached server.

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BaseClient
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def add(key: String, flags: Int, expiry: Time, value: T): Future[Boolean]

    Permalink

    Store a key but only if it doesn't already exist on the server.

    Store a key but only if it doesn't already exist on the server.

    returns

    true if stored, false if not stored

  2. abstract def append(key: String, flags: Int, expiry: Time, value: T): Future[Boolean]

    Permalink

    Append bytes to the end of an existing key.

    Append bytes to the end of an existing key. If the key doesn't exist, the operation has no effect.

    returns

    true if stored, false if not stored

  3. abstract def bufferToType(a: Buf): T

    Permalink
  4. abstract def checkAndSet(key: String, flags: Int, expiry: Time, value: T, casUnique: Buf): Future[CasResult]

    Permalink

    Perform a CAS operation on the key, only if the value has not changed since the value was last retrieved, and casUnique extracted from a gets command.

    Perform a CAS operation on the key, only if the value has not changed since the value was last retrieved, and casUnique extracted from a gets command. We treat the "cas unique" token opaquely, but in reality it is a string-encoded u64.

    returns

    Stored if the operation was successful, Exists if the operation failed because someone else had changed the value, or NotFound if the key was not found in the cache.

  5. abstract def decr(key: String, delta: Long): Future[Option[Long]]

    Permalink

    Decrement a key.

    Decrement a key. Interpret the value as an JLong if it is parseable. This operation has no effect if there is no value there already.

  6. abstract def delete(key: String): Future[Boolean]

    Permalink

    Remove a key.

    Remove a key.

    returns

    true if deleted, false if not found

  7. abstract def getResult(keys: Iterable[String]): Future[GetResult]

    Permalink

    Get a set of keys from the server.

    Get a set of keys from the server. Returns a Future[GetResult] that encapsulates hits, misses and failures.

  8. abstract def getsResult(keys: Iterable[String]): Future[GetsResult]

    Permalink

    Get a set of keys from the server.

    Get a set of keys from the server. Returns a Future[GetsResult] that encapsulates hits, misses and failures. This variant includes the casToken from memcached.

  9. abstract def incr(key: String, delta: Long): Future[Option[Long]]

    Permalink

    Increment a key.

    Increment a key. Interpret the value as an Long if it is parseable. This operation has no effect if there is no value there already.

  10. abstract def prepend(key: String, flags: Int, expiry: Time, value: T): Future[Boolean]

    Permalink

    Prepend bytes to the beginning of an existing key.

    Prepend bytes to the beginning of an existing key. If the key doesn't exist, the operation has no effect.

    returns

    true if stored, false if not stored

  11. abstract def release(): Unit

    Permalink

    release the underlying service(s)

  12. abstract def replace(key: String, flags: Int, expiry: Time, value: T): Future[Boolean]

    Permalink

    Replace bytes on an existing key.

    Replace bytes on an existing key. If the key doesn't exist, the operation has no effect.

    returns

    true if stored, false if not stored

  13. abstract def set(key: String, flags: Int, expiry: Time, value: T): Future[Unit]

    Permalink

    Store a key.

    Store a key. Override an existing value.

    returns

    true

  14. abstract def stats(args: Option[String]): Future[Seq[String]]

    Permalink

    Send a stats command with optional arguments to the server

    Send a stats command with optional arguments to the server

    returns

    a sequence of strings, each of which is a line of output

Concrete 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. def add(key: String, value: T): Future[Boolean]

    Permalink

    Store a key but only if it doesn't already exist on the server.

    Store a key but only if it doesn't already exist on the server.

    returns

    true if stored, false if not stored

  5. def append(key: String, value: T): Future[Boolean]

    Permalink

    Append a set of bytes to the end of an existing key.

    Append a set of bytes to the end of an existing key. If the key doesn't exist, the operation has no effect.

    returns

    true if stored, false if not stored

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def checkAndSet(key: String, value: T, casUnique: Buf): Future[CasResult]

    Permalink

    Perform a CAS operation on the key, only if the value has not changed since the value was last retrieved.

    Perform a CAS operation on the key, only if the value has not changed since the value was last retrieved. This is enforced by passing a casUnique token extracted from a gets command. If the casUnique token matches the one on the server, the value is replaced. We treat the "cas unique" token opaquely, but in reality it is a string-encoded u64.

    returns

    Stored if the operation was successful, Exists if the operation failed because someone else had changed the value, or NotFound if the key was not found in the cache.

  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def decr(key: String): Future[Option[Long]]

    Permalink
  10. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. def get(keys: Iterable[String]): Future[Map[String, T]]

    Permalink

    Get a set of keys from the server.

    Get a set of keys from the server.

    returns

    a Map[String, T] of all of the keys that the server had.

  14. def get(key: String): Future[Option[T]]

    Permalink

    Get a key from the server.

  15. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  16. def gets(keys: Iterable[String]): Future[Map[String, (T, Buf)]]

    Permalink

    Get a set of keys from the server, together with a "cas unique" token.

    Get a set of keys from the server, together with a "cas unique" token. The token is treated opaquely by the memcache client but is in reality a string-encoded u64.

    returns

    a Map[String, (T, Buf)] of all the keys the server had, together with their "cas unique" token

  17. def gets(key: String): Future[Option[(T, Buf)]]

    Permalink

    Get a key from the server, with a "cas unique" token.

    Get a key from the server, with a "cas unique" token. The token is treated opaquely by the memcache client but is in reality a string-encoded u64.

  18. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  19. def incr(key: String): Future[Option[Long]]

    Permalink
  20. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  21. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  24. def prepend(key: String, value: T): Future[Boolean]

    Permalink

    Prepend a set of bytes to the beginning of an existing key.

    Prepend a set of bytes to the beginning of an existing key. If the key doesn't exist, the operation has no effect.

    returns

    true if stored, false if not stored

  25. def quit(): Future[Unit]

    Permalink

    Send a quit command to the server.

    Send a quit command to the server. Alternative to release, for protocol compatability.

    returns

    none

  26. def replace(key: String, value: T): Future[Boolean]

    Permalink

    Replace an item if it exists.

    Replace an item if it exists. If it doesn't exist, the operation has no effect.

    returns

    true if stored, false if not stored

  27. def set(key: String, value: T): Future[Unit]

    Permalink

    Store a key.

    Store a key. Override an existing values.

    returns

    true

  28. def stats(): Future[Seq[String]]

    Permalink
  29. def stats(args: String): Future[Seq[String]]

    Permalink
  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  31. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  32. final def wait(): Unit

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

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

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

Deprecated Value Members

  1. final def cas(key: String, value: T, casUnique: Buf): Future[Boolean]

    Permalink

    Perform a CAS operation on the key, only if the value has not changed since the value was last retrieved, and casUnique extracted from a gets command.

    Perform a CAS operation on the key, only if the value has not changed since the value was last retrieved, and casUnique extracted from a gets command. We treat the "cas unique" token opaquely, but in reality it is a string-encoded u64.

    returns

    true if replaced, false if not

    Annotations
    @deprecated
    Deprecated

    (Since version 2015-12-10) BaseClient.cas deprecated in favor of checkAndSet

    Note

    this is superceded by checkAndSet which returns a higher fidelity return value

  2. final def cas(key: String, flags: Int, expiry: Time, value: T, casUnique: Buf): Future[Boolean]

    Permalink

    Perform a CAS operation on the key, only if the value has not changed since the value was last retrieved, and casUnique extracted from a gets command.

    Perform a CAS operation on the key, only if the value has not changed since the value was last retrieved, and casUnique extracted from a gets command. We treat the "cas unique" token opaquely, but in reality it is a string-encoded u64.

    returns

    true if replaced, false if not

    Annotations
    @deprecated
    Deprecated

    (Since version 2015-12-10) BaseClient.cas deprecated in favor of checkAndSet

    Note

    this is superceded by checkAndSet which returns a higher fidelity return value

Inherited from AnyRef

Inherited from Any

Ungrouped