Package net.spy.memcached

Examples of net.spy.memcached.CachedData


  public boolean asyncDecode(CachedData d) {
    return false;
  }

  public CachedData encode(java.lang.Integer l) {
    return new CachedData(flags, tu.encodeInt(l), getMaxSize());
  }
View Full Code Here


  public boolean asyncDecode(CachedData d) {
    return false;
  }

  public CachedData encode(java.lang.Long l) {
    return new CachedData(flags, tu.encodeLong(l), getMaxSize());
  }
View Full Code Here

        getLogger().info(
            "Compression increased the size of %s from %d to %d",
            o.getClass().getName(), b.length, compressed.length);
      }
    }
    return new CachedData(flags, b, getMaxSize());
  }
View Full Code Here

        getLogger().info(
          "Compression increased the size of %s from %d to %d",
          o.getClass().getName(), b.length, compressed.length);
      }
    }
    return new CachedData(flags, b, getMaxSize());
  }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public CachedData encode( final Object object ) {
        final CachedData result = _delegate.encode( object );
        _statistics.register( StatsType.CACHED_DATA_SIZE, result.getData().length );
        return result;
    }
View Full Code Here

      public void gotData(String k, int flags, long cas, byte[] data) {
        assert key.equals(k) : "Wrong key returned";
        assert cas > 0 : "CAS was less than zero:  " + cas;
        val =
            new CASValue<T>(cas, tc.decode(new CachedData(flags, data, tc
                .getMaxSize())));
      }

      public void complete() {
        latch.countDown();
View Full Code Here

          }

          @Override
          public void gotData(String k, int flags, byte[] data) {
            assert key.equals(k) : "Wrong key returned";
            val = tcService.decode(tc, new CachedData(flags, data,
              tc.getMaxSize()));
          }

          @Override
          public void complete() {
            latch.countDown();
            if (usedFuture) {
              replicaFuture.signalComplete();
            }
          }
        });
    } else {
      return opFact.get(key, new GetOperation.Callback() {
        private Future<T> val = null;
        private boolean usedFuture;

        @Override
        public void receivedStatus(OperationStatus status) {
          future.set(val, status);
          if (!replicaFuture.isDone() && status.isSuccess()) {
            usedFuture = replicaFuture.setCompletedFuture(future);
          }
        }

        @Override
        public void gotData(String k, int flags, byte[] data) {
          assert key.equals(k) : "Wrong key returned";
          val = tcService.decode(tc, new CachedData(flags, data,
            tc.getMaxSize()));
        }

        @Override
        public void complete() {
View Full Code Here

          }

          @Override
          public void gotData(String key, int flags, long cas, byte[] data) {
            assert key.equals(key) : "Wrong key returned";
            val = new CASValue<T>(cas, tc.decode(new CachedData(flags, data,
              tc.getMaxSize())));
          }

          @Override
          public void complete() {
            latch.countDown();
            if (usedFuture) {
              replicaFuture.signalComplete();
            }
          }
        });
    } else {
      return opFact.gets(key, new GetsOperation.Callback() {
        private CASValue<T> val = null;
        private boolean usedFuture;

        @Override
        public void receivedStatus(OperationStatus status) {
          future.set(val, status);
          if (!replicaFuture.isDone() && status.isSuccess()) {
            usedFuture = replicaFuture.setCompletedFuture(future);
          }
        }

        @Override
        public void gotData(String key, int flags, long cas, byte[] data) {
          assert key.equals(key) : "Wrong key returned";
          val = new CASValue<T>(cas, tc.decode(new CachedData(flags, data,
            tc.getMaxSize())));
        }

        @Override
        public void complete() {
View Full Code Here

                rv.set((Future<T>) val, status);
            }

            public void gotData(String k, int flags, byte[] data) {
                assert key.equals(k) : "Wrong key returned";
                val = (Future<T>) tcService.decode(tc, new CachedData(flags, data, tc.getMaxSize()));
            }

            public void complete() {
                latch.countDown();
                if (callback != null) {
View Full Code Here

      public void gotData(String k, int flags, long cas, byte[] data) {
        assert key.equals(k) : "Wrong key returned";
        assert cas > 0 : "CAS was less than zero:  " + cas;
        val =
            new CASValue<T>(cas, tc.decode(new CachedData(flags, data, tc
                .getMaxSize())));
      }

      public void complete() {
        latch.countDown();
View Full Code Here

TOP

Related Classes of net.spy.memcached.CachedData

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.