Package net.spy.memcached.ops

Examples of net.spy.memcached.ops.OperationStatus


      exception = new OperationException(eType, line);
      break;
    default:
      assert false;
    }
    callback.receivedStatus(new OperationStatus(false,
        exception.getMessage()));
    transitionState(OperationState.COMPLETE);
    throw exception;
  }
View Full Code Here


  public OperationStatus getStatus() {
    if (status == null) {
      try {
        get();
      } catch (InterruptedException e) {
        status = new OperationStatus(false, "Interrupted");
        Thread.currentThread().isInterrupted();
      } catch (ExecutionException e) {
        getLogger().warn("Error getting status of operation", e);
      }
    }
View Full Code Here

  @Override
  public void handleLine(String line) {
    assert line.startsWith("VERSION ");
    getCallback().receivedStatus(
        new OperationStatus(true, line.substring("VERSION ".length())));
    transitionState(OperationState.COMPLETE);
  }
View Full Code Here

    }
    for (Future<T> v : rvMap.values()) {
      v.cancel(ign);
    }
    cancelled = true;
    status = new OperationStatus(false, "Cancelled");
    return rv;
  }
View Full Code Here

  public OperationStatus getStatus() {
    if (status == null) {
      try {
        get();
      } catch (InterruptedException e) {
        status = new OperationStatus(false, "Interrupted");
        Thread.currentThread().interrupt();
      } catch (ExecutionException e) {
        return status;
      }
    }
View Full Code Here

      transitionState(OperationState.COMPLETE);
    } else {
      OperationCallback cb = callbacks.remove(responseOpaque);
      assert cb != null : "No callback for " + responseOpaque;
      assert errorCode != 0 : "Got no error on a quiet mutation.";
      OperationStatus status = getStatusForErrorCode(errorCode, pl);
      assert status != null : "Got no status for a quiet mutation error";
      cb.receivedStatus(status);
      cb.complete();
    }
    resetInput();
View Full Code Here

    prepareBuffer("", 0, EMPTY_BYTES);
  }

  @Override
  protected void decodePayload(byte[] pl) {
    getCallback().receivedStatus(new OperationStatus(true, new String(pl)));
  }
View Full Code Here

    prepareBuffer("", 0, EMPTY_BYTES);
  }

  @Override
  protected void decodePayload(byte[] pl) {
    getCallback().receivedStatus(new OperationStatus(true, new String(pl)));
  }
View Full Code Here

   * @param statii several status objects
   * @return the appropriate status object
   */
  protected final OperationStatus matchStatus(String line,
      OperationStatus... statii) {
    OperationStatus rv = null;
    for (OperationStatus status : statii) {
      if (line.equals(status.getMessage())) {
        rv = status;
      }
    }
    if (rv == null) {
      rv = new OperationStatus(false, line);
    }
    return rv;
  }
View Full Code Here

    }

  }

  protected void finishedPayload(byte[] pl) throws IOException {
    OperationStatus status = getStatusForErrorCode(errorCode, pl);

    if (status == null) {
      handleError(OperationErrorType.SERVER, new String(pl));
    } else if (errorCode == SUCCESS) {
      decodePayload(pl);
View Full Code Here

TOP

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

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.