public void addOperations(final Map<MemcachedNode, Operation> ops) { for(Map.Entry<MemcachedNode, Operation> me : ops.entrySet()) { final MemcachedNode node=me.getKey(); Operation o=me.getValue(); o.setHandlingNode(node); o.initialize(); node.addOp(o); addedQueue.offer(node); } Selector s=selector.wakeup(); assert s == selector : "Wakeup returned the wrong selector."; }
public void addOperations(final Map<MemcachedNode, Operation> ops) { for (Map.Entry<MemcachedNode, Operation> me : ops.entrySet()) { final MemcachedNode node = me.getKey(); Operation o = me.getValue(); o.setHandlingNode(node); o.initialize(); node.addOp(o); addedQueue.offer(node); } Selector s = selector.wakeup(); assert s == selector : "Wakeup returned the wrong selector."; }
public void addOperations(final Map<MemcachedNode, Operation> ops) { for(Map.Entry<MemcachedNode, Operation> me : ops.entrySet()) { final MemcachedNode node=me.getKey(); Operation o=me.getValue(); o.setHandlingNode(node); o.initialize(); node.addOp(o); addedQueue.offer(node); } Selector s=selector.wakeup(); assert s == selector : "Wakeup returned the wrong selector."; }
public void addOperations(final Map<MemcachedNode, Operation> ops) { for (Map.Entry<MemcachedNode, Operation> me : ops.entrySet()) { final MemcachedNode node = me.getKey(); Operation o = me.getValue(); o.setHandlingNode(node); o.initialize(); node.addOp(o); addedQueue.offer(node); } Selector s = selector.wakeup(); assert s == selector : "Wakeup returned the wrong selector."; }
protected void addOperation(final MemcachedNode node, final Operation o) { o.setHandlingNode(node); o.initialize(); node.addOp(o); addedQueue.offer(node); Selector s = selector.wakeup(); assert s == selector : "Wakeup returned the wrong selector."; getLogger().debug("Added %s to %s", o, node); }
public void insertOperation(final MemcachedNode node, final Operation o) { o.setHandlingNode(node); o.initialize(); node.insertOp(o); addedQueue.offer(node); Selector s = selector.wakeup(); assert s == selector : "Wakeup returned the wrong selector."; getLogger().debug("Added %s to %s", o, node); }
public void addOperation(final MemcachedNode node, final Operation o) { o.setHandlingNode(node); o.initialize(); node.addOp(o); addedQueue.offer(node); Selector s=selector.wakeup(); assert s == selector : "Wakeup returned the wrong selector."; getLogger().debug("Added %s to %s", o, node); }
/** * Broadcast an operation to a specific collection of nodes. */ public CountDownLatch broadcastOperation(final BroadcastOpFactory of, Collection<MemcachedNode> nodes) { final CountDownLatch latch=new CountDownLatch(locator.getAll().size()); for(MemcachedNode node : nodes) { Operation op = of.newOp(node, latch); op.initialize(); node.addOp(op); op.setHandlingNode(node); addedQueue.offer(node); } Selector s=selector.wakeup(); assert s == selector : "Wakeup returned the wrong selector."; return latch; }
/** * Broadcast an operation to a specific collection of nodes. */ public CountDownLatch broadcastOperation(final BroadcastOpFactory of, Collection<MemcachedNode> nodes) { final CountDownLatch latch = new CountDownLatch(locator.getAll().size()); for (MemcachedNode node : nodes) { Operation op = of.newOp(node, latch); op.setHandlingNode(node); op.initialize(); node.addOp(op); addedQueue.offer(node); } Selector s = selector.wakeup(); assert s == selector : "Wakeup returned the wrong selector."; return latch; }
public void insertOperation(final MemcachedNode node, final Operation o) { o.setHandlingNode(node); o.initialize(); node.insertOp(o); addedQueue.offer(node); Selector s = selector.wakeup(); assert s == selector : "Wakeup returned the wrong selector."; getLogger().debug("Added %s to %s", o, node); }
public void insertOperation(final MemcachedNode node, final Operation o) { o.setHandlingNode(node); o.initialize(); node.insertOp(o); addedQueue.offer(node); Selector s=selector.wakeup(); assert s == selector : "Wakeup returned the wrong selector."; getLogger().debug("Added %s to %s", o, node); }
public void addOperation(final MemcachedNode node, final Operation o) { o.setHandlingNode(node); o.initialize(); node.addOp(o); addedQueue.offer(node); Selector s=selector.wakeup(); assert s == selector : "Wakeup returned the wrong selector."; getLogger().debug("Added %s to %s", o, node); }
public void addOperation(final MemcachedNode node, final Operation o) { o.setHandlingNode(node); o.initialize(); node.addOp(o); addedQueue.offer(node); Selector s = selector.wakeup(); assert s == selector : "Wakeup returned the wrong selector."; getLogger().debug("Added %s to %s", o, node); }
/** * Broadcast an operation to all nodes. */ public CountDownLatch broadcastOperation(final BroadcastOpFactory of) { final CountDownLatch latch=new CountDownLatch(locator.getAll().size()); for(MemcachedNode node : locator.getAll()) { Operation op = of.newOp(node, latch); op.initialize(); node.addOp(op); op.setHandlingNode(node); addedQueue.offer(node); } Selector s=selector.wakeup(); assert s == selector : "Wakeup returned the wrong selector."; return latch; }
/** * Broadcast an operation to a specific collection of nodes. */ public CountDownLatch broadcastOperation(final BroadcastOpFactory of, Collection<MemcachedNode> nodes) { final CountDownLatch latch = new CountDownLatch(locator.getAll().size()); for (MemcachedNode node : nodes) { getLogger().debug("broadcast Operation: node = " + node); Operation op = of.newOp(node, latch); op.initialize(); node.addOp(op); op.setHandlingNode(node); addedQueue.offer(node); } Selector s = selector.wakeup(); assert s == selector : "Wakeup returned the wrong selector."; return latch; }
public void addAllOpToInputQ(BlockingQueue<Operation> allOp) { for (Operation op : allOp) { op.setHandlingNode(this); if (op.getState() == OperationState.WRITING && op.getBuffer() != null) { op.getBuffer().reset(); // buffer offset reset } else { op.initialize(); // write completed or not yet initialized op.resetState(); // reset operation state } op.setMoved(true); } addOpCount += allOp.size(); allOp.drainTo(inputQueue); }
/** * Insert an operation on the given node to the beginning of the queue. * * @param node the node where to insert the {@link Operation}. * @param o the operation to insert. */ public void insertOperation(final MemcachedNode node, final Operation o) { o.setHandlingNode(node); o.initialize(); node.insertOp(o); addedQueue.offer(node); metrics.markMeter(OVERALL_REQUEST_METRIC); Selector s = selector.wakeup(); assert s == selector : "Wakeup returned the wrong selector."; getLogger().debug("Added %s to %s", o, node); }
/** * Insert an operation on the given node to the beginning of the queue. * * @param node the node where to insert the {@link Operation}. * @param o the operation to insert. */ public void insertOperation(final MemcachedNode node, final Operation o) { o.setHandlingNode(node); o.initialize(); node.insertOp(o); addedQueue.offer(node); metrics.markMeter(OVERALL_REQUEST_METRIC); Selector s = selector.wakeup(); assert s == selector : "Wakeup returned the wrong selector."; getLogger().debug("Added %s to %s", o, node); }
/** * Enqueue an operation on the given node. * * @param node the node where to enqueue the {@link Operation}. * @param o the operation to add. */ protected void addOperation(final MemcachedNode node, final Operation o) { if (!node.isAuthenticated()) { retryOperation(o); return; } o.setHandlingNode(node); o.initialize(); node.addOp(o); addedQueue.offer(node); metrics.markMeter(OVERALL_REQUEST_METRIC); Selector s = selector.wakeup(); assert s == selector : "Wakeup returned the wrong selector."; getLogger().debug("Added %s to %s", o, node); }
/** * Enqueue an operation on the given node. * * @param node the node where to enqueue the {@link Operation}. * @param o the operation to add. */ protected void addOperation(final MemcachedNode node, final Operation o) { if (!node.isAuthenticated()) { retryOperation(o); return; } o.setHandlingNode(node); o.initialize(); node.addOp(o); addedQueue.offer(node); metrics.markMeter(OVERALL_REQUEST_METRIC); Selector s = selector.wakeup(); assert s == selector : "Wakeup returned the wrong selector."; getLogger().debug("Added %s to %s", o, node); }