Package net.spy.memcached.vbucket

Examples of net.spy.memcached.vbucket.VBucketNodeLocator


          case ARRAY_MOD:
            return new ArrayModNodeLocator(nodes, getHashAlg());
          case CONSISTENT:
            return new KetamaNodeLocator(nodes, getHashAlg());
                    case VBUCKET:
                        return new VBucketNodeLocator(nodes, getVBucketConfig());
          default: throw new IllegalStateException(
              "Unhandled locator type: " + locator);
        }
      }
View Full Code Here


    assert o.isCancelled() || placeIn != null
      : "No node found for key " + key;
    if(placeIn != null) {
      // add the vbucketIndex to the operation
      if (locator instanceof VBucketNodeLocator) {
        VBucketNodeLocator vbucketLocator = (VBucketNodeLocator) locator;
        int vbucketIndex = vbucketLocator.getVBucketIndex(key);
        if (o instanceof VBucketAware) {
          VBucketAware vbucketAwareOp = (VBucketAware) o;
          vbucketAwareOp.setVBucket(vbucketIndex);
          if (!vbucketAwareOp.getNotMyVbucketNodes().isEmpty()) {
            MemcachedNode alternative = vbucketLocator.
            getAlternative(key, vbucketAwareOp.getNotMyVbucketNodes());
              if (alternative != null) {
                placeIn = alternative;
              }
          }
View Full Code Here

TOP

Related Classes of net.spy.memcached.vbucket.VBucketNodeLocator

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.