bb.put((byte) StoreOperationImpl.EXTRA_LEN); // extralen bb.put((byte) 0); // data type bb.putShort(((VBucketAware) so).getVBucket(k)); // vbucket bb.putInt(keyBytes.length + data.length + StoreOperationImpl.EXTRA_LEN); bb.putInt(myOpaque);
@Override public void addOperations(final Map<MemcachedNode, Operation> ops) { for (Map.Entry<MemcachedNode, Operation> me : ops.entrySet()) { final MemcachedNode node = me.getKey(); if (!node.isActive()) { cf.checkConfigUpdate(); } Operation o = me.getValue(); // add the vbucketIndex to the operation if (locator instanceof VBucketNodeLocator) { if (o instanceof KeyedOperation && o instanceof VBucketAware) { Collection<String> keys = ((KeyedOperation) o).getKeys(); VBucketNodeLocator vbucketLocator = (VBucketNodeLocator) locator; for (String key : keys) { short vbucketIndex = (short) vbucketLocator.getVBucketIndex(key); VBucketAware vbucketAwareOp = (VBucketAware) o; vbucketAwareOp.setVBucket(key, vbucketIndex); } } } o.setHandlingNode(node); o.initialize(); node.addOp(o); addedQueue.offer(node); } updateLastWrite(); Selector s = selector.wakeup(); assert s == selector : "Wakeup returned the wrong selector."; }
if (!vop.getNotMyVbucketNodes().isEmpty()) { for (Operation operation : rv) { if (operation instanceof VBucketAware) { Collection<MemcachedNode> notMyVbucketNodes = vop.getNotMyVbucketNodes(); ((VBucketAware) operation).setNotMyVbucketNodes(notMyVbucketNodes);
if (o instanceof VBucketAware) { VBucketAware vbucketAwareOp = (VBucketAware) o; vbucketAwareOp.setVBucket(key, vbucketIndex); Collection<MemcachedNode> notMyVbucketNodes = vbucketAwareOp.getNotMyVbucketNodes(); if (!notMyVbucketNodes.isEmpty()) { cf.checkConfigUpdate();
getLogger().debug("Reschedule read op due to NOT_MY_VBUCKET error: " + "%s ", currentOp); ((VBucketAware) currentOp).addNotMyVbucketNode( currentOp.getHandlingNode()); Operation op = qa.removeCurrentReadOp();
if (!vop.getNotMyVbucketNodes().isEmpty()) { for (Operation operation : rv) { if (operation instanceof VBucketAware) { Collection<MemcachedNode> notMyVbucketNodes = vop.getNotMyVbucketNodes(); ((VBucketAware) operation).setNotMyVbucketNodes(notMyVbucketNodes);
getLogger().debug("Reschedule read op due to NOT_MY_VBUCKET error: " + "%s ", currentOp); ((VBucketAware) currentOp).addNotMyVbucketNode( currentOp.getHandlingNode()); Operation op = node.removeCurrentReadOp();
if (!vop.getNotMyVbucketNodes().isEmpty()) { for (Operation operation : rv) { if (operation instanceof VBucketAware) { Collection<MemcachedNode> notMyVbucketNodes = vop.getNotMyVbucketNodes(); ((VBucketAware) operation).setNotMyVbucketNodes(notMyVbucketNodes);
bb.put((byte) StoreOperationImpl.EXTRA_LEN); // extralen bb.put((byte) 0); // data type bb.putShort(((VBucketAware) so).getVBucket(k)); // vbucket bb.putInt(keyBytes.length + data.length + StoreOperationImpl.EXTRA_LEN); bb.putInt(myOpaque);
getLogger().debug("Reschedule read op due to NOT_MY_VBUCKET error: " + "%s ", currentOp); ((VBucketAware) currentOp).addNotMyVbucketNode( currentOp.getHandlingNode()); Operation op = node.removeCurrentReadOp();
bb.put((byte) StoreOperationImpl.EXTRA_LEN); // extralen bb.put((byte) 0); // data type bb.putShort(((VBucketAware) so).getVBucket(k)); // vbucket bb.putInt(keyBytes.length + data.length + StoreOperationImpl.EXTRA_LEN); bb.putInt(myOpaque);
/** * Add a new GetOperation to get. */ public void addOperation(GetOperation o) { pcb.addCallbacks(o); for (String k : o.getKeys()) { addKey(k); setVBucket(k, ((VBucketAware) o).getVBucket(k)); } }
/** * Add a new GetOperation to get. */ public void addOperation(GetOperation o) { pcb.addCallbacks(o); for (String k : o.getKeys()) { addKey(k); setVBucket(k, ((VBucketAware) o).getVBucket(k)); } }
/** * Add a new GetOperation to get. */ public void addOperation(GetOperation o) { pcb.addCallbacks(o); for (String k : o.getKeys()) { addKey(k); setVBucket(k, ((VBucketAware) o).getVBucket(k)); } }