trait TwemcacheClient extends Client
- Alphabetic
- By Inheritance
- TwemcacheClient
- Client
- BaseClient
- Closable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def add(key: String, flags: Int, expiry: Time, value: Buf): Future[Boolean]
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.
flags
is an arbitrary integer that the server stores along with the data and sends back when the item is retrieved. Clients may use this as a bit field to store data-specific information; this field is opaque to the server.expiry
is the expiration time for entries. If it is Time.epoch,
Time.Top,
Time.Bottomor
Time.Undefinedthen the item never expires, although it may be deleted from the cache to make room for other items. This is also the case for values where the number of seconds is larger than
Long.MaxValue. Otherwise, clients will not be able to retrieve this item after the expiration time arrives (measured on the cache server).
- returns
true if stored, false if not stored
- Definition Classes
- BaseClient
- abstract def append(key: String, flags: Int, expiry: Time, value: Buf): Future[Boolean]
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.
flags
is an arbitrary integer that the server stores along with the data and sends back when the item is retrieved. Clients may use this as a bit field to store data-specific information; this field is opaque to the server.expiry
is the expiration time for entries. If it is Time.epoch,
Time.Top,
Time.Bottomor
Time.Undefinedthen the item never expires, although it may be deleted from the cache to make room for other items. This is also the case for values where the number of seconds is larger than
Long.MaxValue. Otherwise, clients will not be able to retrieve this item after the expiration time arrives (measured on the cache server).
- returns
true if stored, false if not stored
- Definition Classes
- BaseClient
- abstract def checkAndSet(key: String, flags: Int, expiry: Time, value: Buf, casUnique: Buf): Future[CasResult]
Perform a CAS operation on the key, only if the value has not changed since the value was last retrieved, and
casUnique
extracted from agets
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 agets
command. We treat the "cas unique" token opaquely, but in reality it is a string-encoded u64.flags
is an arbitrary integer that the server stores along with the data and sends back when the item is retrieved. Clients may use this as a bit field to store data-specific information; this field is opaque to the server.expiry
is the expiration time for entries. If it is Time.epoch,
Time.Top,
Time.Bottomor
Time.Undefinedthen the item never expires, although it may be deleted from the cache to make room for other items. This is also the case for values where the number of seconds is larger than
Long.MaxValue. Otherwise, clients will not be able to retrieve this item after the expiration time arrives (measured on the cache server).
- 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.
- Definition Classes
- BaseClient
- See also
gets and getsResult for retreiving the cas token.
- abstract def close(deadline: Time): Future[Unit]
Close the underlying resources.
Close the underlying resources.
- Definition Classes
- BaseClient → Closable
- abstract def decr(key: String, delta: Long): Future[Option[Long]]
Decrement the
key
byn
.Decrement the
key
byn
.Interprets the stored value for
key
as a Long if it is parseable as a decimal representation of a 64-bit unsigned integer.This operation has no effect if there is no value there already.
- Definition Classes
- BaseClient
- abstract def delete(key: String): Future[Boolean]
Remove a key.
- abstract def getResult(keys: Iterable[String]): Future[GetResult]
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.
- Definition Classes
- BaseClient
- See also
getsResult if you need "cas unique" tokens.
- abstract def getsResult(keys: Iterable[String]): Future[GetsResult]
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.
- Definition Classes
- BaseClient
- See also
getResult if you do not need "cas unique" tokens.
checkAndSet for using the token.
- abstract def getvResult(keys: Iterable[String]): Future[GetsResult]
Get the server returned value for a set of keys for getv operation, in the format of GetsResult since the data format for gets and getv are identical
- abstract def incr(key: String, delta: Long): Future[Option[Long]]
Increment the
key
bydelta
.Increment the
key
bydelta
.Interprets the stored value for
key
as a Long if it is parseable as a decimal representation of a 64-bit unsigned integer.This operation has no effect if there is no value there already.
- Definition Classes
- BaseClient
- abstract def prepend(key: String, flags: Int, expiry: Time, value: Buf): Future[Boolean]
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.
flags
is an arbitrary integer that the server stores along with the data and sends back when the item is retrieved. Clients may use this as a bit field to store data-specific information; this field is opaque to the server.expiry
is the expiration time for entries. If it is Time.epoch,
Time.Top,
Time.Bottomor
Time.Undefinedthen the item never expires, although it may be deleted from the cache to make room for other items. This is also the case for values where the number of seconds is larger than
Long.MaxValue. Otherwise, clients will not be able to retrieve this item after the expiration time arrives (measured on the cache server).
- returns
true if stored, false if not stored
- Definition Classes
- BaseClient
- abstract def replace(key: String, flags: Int, expiry: Time, value: Buf): Future[Boolean]
Replace bytes on an existing key.
Replace bytes on an existing key. If the key doesn't exist, the operation has no effect.
flags
is an arbitrary integer that the server stores along with the data and sends back when the item is retrieved. Clients may use this as a bit field to store data-specific information; this field is opaque to the server.expiry
is the expiration time for entries. If it is Time.epoch,
Time.Top,
Time.Bottomor
Time.Undefinedthen the item never expires, although it may be deleted from the cache to make room for other items. This is also the case for values where the number of seconds is larger than
Long.MaxValue. Otherwise, clients will not be able to retrieve this item after the expiration time arrives (measured on the cache server).
- returns
true if stored, false if not stored
- Definition Classes
- BaseClient
- abstract def set(key: String, flags: Int, expiry: Time, value: Buf): Future[Unit]
Store a key.
Store a key. Override an existing value.
flags
is an arbitrary integer that the server stores along with the data and sends back when the item is retrieved. Clients may use this as a bit field to store data-specific information; this field is opaque to the server.expiry
is the expiration time for entries. If it is Time.epoch,
Time.Top,
Time.Bottomor
Time.Undefinedthen the item never expires, although it may be deleted from the cache to make room for other items. This is also the case for values where the number of seconds is larger than
Long.MaxValue. Otherwise, clients will not be able to retrieve this item after the expiration time arrives (measured on the cache server).
- Definition Classes
- BaseClient
- abstract def stats(args: Option[String]): Future[Seq[String]]
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
- Definition Classes
- BaseClient
- abstract def upsert(key: String, flags: Int, expiry: Time, value: Buf, version: Buf): Future[Boolean]
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def adapt[T](bijection: Bijection[Buf, T]): BaseClient[T]
- Definition Classes
- Client
- def add(key: String, value: Buf): Future[Boolean]
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.
Neither flags nor expiry are supplied.
- returns
true if stored, false if not stored
- Definition Classes
- BaseClient
- def append(key: String, value: Buf): Future[Boolean]
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
- Definition Classes
- BaseClient
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def bufferToType(v: Buf): Buf
Deserialize from the bytes in a
Buf
into the client's type,T
.Deserialize from the bytes in a
Buf
into the client's type,T
.- Definition Classes
- Client → BaseClient
- def checkAndSet(key: String, value: Buf, casUnique: Buf): Future[CasResult]
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 agets
command. If thecasUnique
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.Neither flags nor expiry are supplied.
- 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.
- Definition Classes
- BaseClient
- See also
gets and getsResult for retreiving the cas token.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def close(after: Duration): Future[Unit]
- Definition Classes
- Closable
- final def close(): Future[Unit]
- Definition Classes
- Closable
- def decr(key: String): Future[Option[Long]]
Decrement the
key
by 1.Decrement the
key
by 1.Interprets the stored value for
key
as a Long if it is parseable as a decimal representation of a 64-bit unsigned integer.This operation has no effect if there is no value there already.
- Definition Classes
- BaseClient
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def get(keys: Iterable[String]): Future[Map[String, Buf]]
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.
- Definition Classes
- BaseClient
- See also
gets if you need a "cas unique" token.
- def get(key: String): Future[Option[Buf]]
Get a key from the server.
Get a key from the server.
- returns
None
if there is no value stored forkey
.
- Definition Classes
- BaseClient
- See also
gets if you need a "cas unique" token.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getWithFlag(keys: Iterable[String]): Future[Map[String, (Buf, Buf)]]
Get a set of keys from the server, together with their flags
Get a set of keys from the server, together with their flags
- returns
a Map[String, (T, Buf)] of all the keys the server had, together with their flags
- Definition Classes
- BaseClient
- See also
get if you do not need the flags
- def getWithFlag(key: String): Future[Option[(Buf, Buf)]]
Get a key from the server along with its flags
Get a key from the server along with its flags
- returns
None
if there is no value stored forkey
.
- Definition Classes
- BaseClient
- See also
get if you do not need the flags.
- def gets(keys: Iterable[String]): Future[Map[String, (Buf, Buf)]]
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
- Definition Classes
- BaseClient
- See also
get if you do not need a "cas unique" token.
checkAndSet for using the token.
- def gets(key: String): Future[Option[(Buf, Buf)]]
Get a key from the server along with a "cas unique" token.
Get a key from the server along with a "cas unique" token. The token is treated opaquely by the memcache client but is in reality a string-encoded u64.
- returns
None
if there is no value stored forkey
.
- Definition Classes
- BaseClient
- See also
get if you do not need a "cas unique" token.
checkAndSet for using the token.
- def getsWithFlag(keys: Iterable[String]): Future[Map[String, (Buf, Buf, Buf)]]
Get a set of keys from the server, together with a "cas unique" token and flags.
Get a set of keys from the server, together with a "cas unique" token and flags. The token is treated opaquely by the memcache client but is in reality a string-encoded u64.
- returns
a Map[String, (T, Buf, Buf)] of all the keys the server had, together with their "cas unique" token and flags
- Definition Classes
- BaseClient
- See also
get if you do not need the token or the flags.
gets if you do not need the flag.
getWithFlag if you do not need the token.
checkAndSet for using the token.
- def getsWithFlag(key: String): Future[Option[(Buf, Buf, Buf)]]
Get a key from the server along with its flags and a "cas unique" token.
Get a key from the server along with its flags and a "cas unique" token.
- returns
None
if there is no value stored forkey
.
- Definition Classes
- BaseClient
- See also
get if you do not need the flags or the token.
gets if you do not need the flags.
getWithFlag if you do not need the token.
- def getv(keys: Iterable[String]): Future[Map[String, (Buf, Buf)]]
- def getv(key: String): Future[Option[(Buf, Buf)]]
Get a set of keys from the server, together with a "version" token.
Get a set of keys from the server, together with a "version" token.
- returns
a Map[String, (Buf, Buf)] of all the keys the server had, together with their "version" token
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def incr(key: String): Future[Option[Long]]
Increment the
key
by1
.Increment the
key
by1
.Interprets the stored value for
key
as a Long if it is parseable as a decimal representation of a 64-bit unsigned integer.This operation has no effect if there is no value there already.
- Definition Classes
- BaseClient
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def prepend(key: String, value: Buf): Future[Boolean]
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.
Neither flags nor expiry are supplied.
- returns
true if stored, false if not stored
- Definition Classes
- BaseClient
- def quit(): Future[Unit]
Send a quit command to the server.
Send a quit command to the server. Alternative to release, for protocol compatibility.
- Definition Classes
- BaseClient
- def replace(key: String, value: Buf): Future[Boolean]
Replace an item if it exists.
Replace an item if it exists. If it doesn't exist, the operation has no effect.
Neither flags nor expiry are supplied.
- returns
true if stored, false if not stored
- Definition Classes
- BaseClient
- def set(key: String, value: Buf): Future[Unit]
Store a key.
Store a key. Override an existing values.
Neither flags nor expiry are supplied.
- Definition Classes
- BaseClient
- def stats(): Future[Seq[String]]
Send a stats command to the server.
Send a stats command to the server.
- returns
a sequence of strings, each of which is a line of output
- Definition Classes
- BaseClient
- def stats(args: String): Future[Seq[String]]
Send a stats command with the given
args
to the server.Send a stats command with the given
args
to the server.- returns
a sequence of strings, each of which is a line of output
- Definition Classes
- BaseClient
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def upsert(key: String, value: Buf, version: Buf): Future[Boolean]
Perform a UPSERT operation on the key, only if the value 'version' is not newer than the provided one.
Perform a UPSERT operation on the key, only if the value 'version' is not newer than the provided one.
- returns
true if replaced, false if not
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def withBytes: BaseClient[Array[Byte]]
Adaptor to use Array[Byte] as values
Adaptor to use Array[Byte] as values
- Definition Classes
- Client
- def withStrings: BaseClient[String]
Adaptor to use String as values
Adaptor to use String as values
- Definition Classes
- Client