Examples of CASResponse


Examples of net.spy.memcached.CASResponse

          }
          return future;
        } else {
          OperationFuture<CASResponse> casFuture = client.asyncCas(converted.getId(), version,
            converted.getExpiration(), translateEncode(converted), persistTo, replicateTo);
          CASResponse cas = casFuture.get();
          if (cas == CASResponse.EXISTS) {
            throw new OptimisticLockingFailureException("Saving document with version value failed: " + cas);
          } else {
            long newCas = casFuture.getCas();
            beanWrapper.setProperty(versionProperty, newCas);
View Full Code Here

Examples of net.spy.memcached.CASResponse

          return client.replace(converted.getId(), converted.getExpiration(), translateEncode(converted), persistTo,
            replicateTo).get();
        } else {
          OperationFuture<CASResponse> casFuture = client.asyncCas(converted.getId(), version,
            converted.getExpiration(), translateEncode(converted), persistTo, replicateTo);
          CASResponse cas = casFuture.get();

          if (cas == CASResponse.EXISTS) {
            throw new OptimisticLockingFailureException("Updating document with version value failed: " + cas);
          } else {
            long newCas = casFuture.getCas();
View Full Code Here

Examples of net.spy.memcached.CASResponse

                    return;

                } else {
                    ByteArrayOutputStream bos = new ByteArrayOutputStream();
                    serializer.writeTo(updatedEntry, bos);
                    CASResponse casResult = client.cas(url, v.getCas(),
                            bos.toByteArray());
                    if (casResult != CASResponse.OK) {
                        numRetries++;
                    } else return;
                }
View Full Code Here

Examples of net.spy.memcached.CASResponse

        + " on memcached type buckets.");
    }

    OperationFuture<CASResponse> casOp =
      asyncCAS(key, cas, exp, value, transcoder);
    CASResponse casr = null;
    try {
      casr = casOp.get();
    } catch (InterruptedException e) {
      casr = CASResponse.EXISTS;
    } catch (ExecutionException e) {
View Full Code Here

Examples of net.spy.memcached.CASResponse

                    putEntry(url, updatedEntry);
                    return;

                } else {
                    byte[] updatedBytes = serializeEntry(url, updatedEntry);
                    CASResponse casResult = client.cas(key, v.getCas(),
                            updatedBytes);
                    if (casResult != CASResponse.OK) {
                        numRetries++;
                    } else return;
                }
View Full Code Here

Examples of net.spy.memcached.CASResponse

                    putEntry(url, updatedEntry);
                    return;

                } else {
                    final byte[] updatedBytes = serializeEntry(url, updatedEntry);
                    final CASResponse casResult = client.cas(key, v.getCas(),
                            updatedBytes);
                    if (casResult != CASResponse.OK) {
                        numRetries++;
                    } else {
                        return;
View Full Code Here

Examples of net.spy.memcached.CASResponse

  }

  @Override
  public CASResponse cas(String key, long cas, int exp,
          Object value, PersistTo req, ReplicateTo rep) {
    CASResponse casr = null;

    try {
      OperationFuture<CASResponse> casOp = asyncCas(key, cas, exp, value, req,
        rep);
View Full Code Here

Examples of net.spy.memcached.CASResponse

        executorService);

    casOp.addListener(new OperationCompletionListener() {
      @Override
      public void onComplete(OperationFuture<?> future) throws Exception {
        CASResponse casr;

        try {
          casr = (CASResponse) future.get();
          observeFuture.set(casr, future.getStatus());
          if (future.getCas() != null) {
View Full Code Here

Examples of net.spy.memcached.CASResponse

            return;

        } else {
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            serializer.writeTo(updatedEntry, bos);
            CASResponse casResult = client.cas(url, v.getCas(), bos.toByteArray());
            if (casResult != CASResponse.OK) {
                 numRetries++;
            }
            else return;
        }
View Full Code Here

Examples of net.spy.memcached.CASResponse

  }

  @Override
  public CASResponse cas(String key, long cas, int exp,
          Object value, PersistTo req, ReplicateTo rep) {
    CASResponse casr = null;

    try {
      OperationFuture<CASResponse> casOp = asyncCas(key, cas, exp, value, req,
        rep);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.