Package net.spy.memcached.ops

Examples of net.spy.memcached.ops.Operation


        bucketName, pwd);
    final TapStream ts = new TapStream();
    conn.broadcastOp(new BroadcastOpFactory() {
      public Operation newOp(final MemcachedNode n,
          final CountDownLatch latch) {
        Operation op =  conn.getOpFactory().tapCustom(id, message,
            new TapOperation.Callback() {
            public void receivedStatus(OperationStatus status) {
            }
            public void gotData(ResponseMessage tapMessage) {
              rqueue.add(tapMessage);
View Full Code Here


        bucketName, pwd);
    final TapStream ts = new TapStream();
    conn.broadcastOp(new BroadcastOpFactory() {
      public Operation newOp(final MemcachedNode n,
          final CountDownLatch latch) {
        Operation op =  conn.getOpFactory().tapBackfill(id, date,
              new TapOperation.Callback() {
            public void receivedStatus(OperationStatus status) {
            }
            public void gotData(ResponseMessage tapMessage) {
              if (!conn.isPrimaryForKey(n, tapMessage.getKey())) {
View Full Code Here

        bucketName, pwd);
    final TapStream ts = new TapStream();
    conn.broadcastOp(new BroadcastOpFactory() {
      public Operation newOp(final MemcachedNode n,
          final CountDownLatch latch) {
        Operation op =  conn.getOpFactory().tapDump(id,
              new TapOperation.Callback() {
            public void receivedStatus(OperationStatus status) {
            }
            public void gotData(ResponseMessage tapMessage) {
              rqueue.add(tapMessage);
View Full Code Here

    return ts;
  }

  private void tapAck(TapConnectionProvider conn, MemcachedNode node,
      TapOpcode opcode, int opaque, OperationCallback cb) {
    final Operation op = conn.getOpFactory().tapAck(opcode, opaque, cb);
    conn.addTapAckOp(node, op);
  }
View Full Code Here

      String key, int exp, T value, Transcoder<T> tc) {
    CachedData co = tc.encode(value);
    final CountDownLatch latch = new CountDownLatch(1);
    final OperationFuture<Boolean> rv =
        new OperationFuture<Boolean>(key, latch, operationTimeout);
    Operation op = opFact.store(storeType, key, co.getFlags(), exp,
        co.getData(), new OperationCallback() {
            public void receivedStatus(OperationStatus val) {
              rv.set(val.isSuccess(), val);
            }
View Full Code Here

      long cas, String key, T value, Transcoder<T> tc) {
    CachedData co = tc.encode(value);
    final CountDownLatch latch = new CountDownLatch(1);
    final OperationFuture<Boolean> rv = new OperationFuture<Boolean>(key,
        latch, operationTimeout);
    Operation op = opFact.cat(catType, cas, key, co.getData(),
        new OperationCallback() {
          public void receivedStatus(OperationStatus val) {
            rv.set(val.isSuccess(), val);
          }
View Full Code Here

      final Transcoder<T> tc) {
    final CountDownLatch latch = new CountDownLatch(1);
    final OperationFuture<Boolean> rv =
        new OperationFuture<Boolean>(key, latch, operationTimeout);

    Operation op = opFact.touch(key, exp, new OperationCallback() {
      public void receivedStatus(OperationStatus status) {
        rv.set(status.isSuccess(), status);
      }

      public void complete() {
View Full Code Here

      T value, Transcoder<T> tc) {
    CachedData co = tc.encode(value);
    final CountDownLatch latch = new CountDownLatch(1);
    final OperationFuture<CASResponse> rv =
      new OperationFuture<CASResponse>(key, latch, operationTimeout);
    Operation op = opFact.cas(StoreType.set, key, casId, co.getFlags(), exp,
        co.getData(), new OperationCallback() {
            public void receivedStatus(OperationStatus val) {
              if (val instanceof CASOperationStatus) {
                rv.set(((CASOperationStatus) val).getCASResponse(), val);
              } else if (val instanceof CancelledOperationStatus) {
View Full Code Here

   */
  public <T> GetFuture<T> asyncGet(final String key, final Transcoder<T> tc) {

    final CountDownLatch latch = new CountDownLatch(1);
    final GetFuture<T> rv = new GetFuture<T>(latch, operationTimeout, key);
    Operation op = opFact.get(key, new GetOperation.Callback() {
      private Future<T> val = null;

      public void receivedStatus(OperationStatus status) {
        rv.set(val, status);
      }
View Full Code Here

   */
  <T> GetFuture<T> asyncGet(InetSocketAddress sa, final String key, final Transcoder<T> tc) {

    final CountDownLatch latch = new CountDownLatch(1);
    final GetFuture<T> rv = new GetFuture<T>(latch, operationTimeout, key);
    Operation op = opFact.get(key, new GetOperation.Callback() {
      private Future<T> val = null;

      public void receivedStatus(OperationStatus status) {
        rv.set(val, status);
      }
View Full Code Here

TOP

Related Classes of net.spy.memcached.ops.Operation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.