Package

com.twitter.finagle.memcached

replication

Permalink

package replication

Package replication implements a base cache client that can manage multiple cache replicas.

The base replication client will forward cache command to all replicas, as well as collect and aggregate each replica's response into a ReplicationStatus object representing the replication consistency. The BaseReplicationClient will not handle the consistency between replicas in anyway, but only to report its view of the replication state. For instance, BaseReplicationClient provides interfaces similar to generic memcache client but always returns ReplicationStatus object which can be one of these three forms:

By checking the returned ReplicationStatus object, one can tell the cache replication status and then handle it with application specific logic.

In addition to a base replication client, a simple replication client wrapper that's compatible with generic cache client interface is also provided. The SimpleReplicationClient only supports a subset of all memcached commands for now, and will succeed only if the command succeed on all cache replicas. In a more complicate caching scenario, this simple/naive replication client may not be applicable.

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

Type Members

  1. class BaseReplicationClient extends AnyRef

    Permalink

    Base replication client.

    Base replication client. This client manages a list of base memcached clients representing cache replicas. All replication API returns ReplicationStatus object indicating the underlying replicas consistency state.

  2. case class ConsistentReplication[T](result: T) extends ReplicationStatus[T] with Product with Serializable

    Permalink

    Indicating a consistent state across all replicas, which comes with the agreed consistent result;

  3. case class FailedReplication[T](failureSeq: Seq[Throw[T]]) extends ReplicationStatus[T] with Product with Serializable

    Permalink

    indicating a failed state from all replicas, which comes with a sequence of failures from all replicas;

  4. case class InconsistentReplication[T](resultSeq: Seq[Try[T]]) extends ReplicationStatus[T] with Product with Serializable

    Permalink

    Indicating an inconsistent state across all replicas, which comes with a sequence of result from all replicas; each replica's result can be either Return[T] or Throw[T]

  5. case class RCasUnique(uniques: Seq[Buf]) extends ReplicaCasUnique with Product with Serializable

    Permalink
  6. trait ReplicaCasUnique extends AnyRef

    Permalink

    Wrapping underlying replicas cas unique values for replication purpose.

  7. sealed trait ReplicationStatus[T] extends AnyRef

    Permalink
  8. case class SCasUnique(casUnique: Buf) extends ReplicaCasUnique with Product with Serializable

    Permalink
  9. class SimpleReplicationClient extends Client

    Permalink
  10. case class SimpleReplicationFailure(msg: String) extends Throwable with Product with Serializable

    Permalink

    Simple replication client wrapper that's compatible with base memcached client.

    Simple replication client wrapper that's compatible with base memcached client. This simple replication client handles inconsistent state across underlying replicas in a naive way: - operation would succeed only if it succeeds on all replicas - inconsistent data across replicas will be treated as key missing - any replica's failure will make the operation throw

Value Members

  1. object ReplicationClient

    Permalink

    Replication client helper

Inherited from AnyRef

Inherited from Any

Ungrouped