Examples of TapStream


Examples of net.spy.memcached.tapmessage.TapStream

      return true;
    } else {
      synchronized (omap) {
        Iterator<TapStream> itr = omap.keySet().iterator();
        while (itr.hasNext()) {
          TapStream op = itr.next();
          if (op.isCompleted() || op.isCancelled()
              || op.hasErrored()) {
            omap.get(op).shutdown();
            omap.remove(op);
          }
        }
        if (omap.size() > 0) {
View Full Code Here

Examples of net.spy.memcached.tapmessage.TapStream

   */
  public TapStream tapCustom(final String id, final RequestMessage message)
    throws ConfigurationException, IOException {
    final TapConnectionProvider conn = new TapConnectionProvider(baseList,
        bucketName, pwd);
    final TapStream ts = new TapStream();
    conn.broadcastOp(new BroadcastOpFactory() {
      public Operation newOp(final MemcachedNode n,
          final CountDownLatch latch) {
        Operation op =  conn.getOpFactory().tapCustom(id, message,
            new TapOperation.Callback() {
            public void receivedStatus(OperationStatus status) {
            }
            public void gotData(ResponseMessage tapMessage) {
              rqueue.add(tapMessage);
              messagesRead++;
            }
            public void gotAck(MemcachedNode node, TapOpcode opcode,
                int opaque) {
              rqueue.add(new TapAck(conn, node, opcode, opaque, this));
            }
            public void complete() {
              latch.countDown();
            }
          });
        ts.addOp((TapOperation)op);
        return op;
      }
    });
    synchronized (omap) {
      omap.put(ts, conn);
View Full Code Here

Examples of net.spy.memcached.tapmessage.TapStream

  public TapStream tapBackfill(final String id, final long date,
      final int runTime, final TimeUnit timeunit) throws IOException,
      ConfigurationException {
    final TapConnectionProvider conn = new TapConnectionProvider(baseList,
        bucketName, pwd);
    final TapStream ts = new TapStream();
    conn.broadcastOp(new BroadcastOpFactory() {
      public Operation newOp(final MemcachedNode n,
          final CountDownLatch latch) {
        Operation op =  conn.getOpFactory().tapBackfill(id, date,
              new TapOperation.Callback() {
            public void receivedStatus(OperationStatus status) {
            }
            public void gotData(ResponseMessage tapMessage) {
              if (!conn.isPrimaryForKey(n, tapMessage.getKey())) {
                return;
              }
              rqueue.add(tapMessage);
              messagesRead++;
            }
            public void gotAck(MemcachedNode node, TapOpcode opcode,
                int opaque) {
              rqueue.add(new TapAck(conn, node, opcode, opaque, this));
            }
            public void complete() {
              latch.countDown();
            }
          });
        ts.addOp((TapOperation)op);
        return op;
      }
    });
    synchronized (omap) {
      omap.put(ts, conn);
View Full Code Here

Examples of net.spy.memcached.tapmessage.TapStream

   */
  public TapStream tapDump(final String id) throws IOException,
      ConfigurationException {
    final TapConnectionProvider conn = new TapConnectionProvider(baseList,
        bucketName, pwd);
    final TapStream ts = new TapStream();
    conn.broadcastOp(new BroadcastOpFactory() {
      public Operation newOp(final MemcachedNode n,
          final CountDownLatch latch) {
        Operation op =  conn.getOpFactory().tapDump(id,
              new TapOperation.Callback() {
            public void receivedStatus(OperationStatus status) {
            }
            public void gotData(ResponseMessage tapMessage) {
              rqueue.add(tapMessage);
              messagesRead++;
            }
            public void gotAck(MemcachedNode node, TapOpcode opcode,
                int opaque) {
              rqueue.add(new TapAck(conn, node, opcode, opaque, this));
            }
            public void complete() {
              latch.countDown();
            }
          });
        ts.addOp((TapOperation)op);
        return op;
      }
    });
    synchronized (omap) {
      omap.put(ts, conn);
View Full Code Here

Examples of net.spy.memcached.tapmessage.TapStream

      return true;
    } else {
      synchronized (omap) {
        Iterator<TapStream> itr = omap.keySet().iterator();
        while (itr.hasNext()) {
          TapStream ts = itr.next();
          if (ts.isCompleted() || ts.isCancelled() || ts.hasErrored()) {
            omap.get(ts).shutdown();
            omap.remove(ts);
          }
        }
        if (omap.size() > 0) {
View Full Code Here

Examples of net.spy.memcached.tapmessage.TapStream

   * @throws IOException if there are errors connecting to the cluster.
   */
  public TapStream tapCustom(final String id, final RequestMessage message)
    throws ConfigurationException, IOException {
    final TapConnectionProvider conn = new TapConnectionProvider(addrs);
    final TapStream ts = new TapStream();
    conn.broadcastOp(new BroadcastOpFactory() {
      public Operation newOp(final MemcachedNode n,
          final CountDownLatch latch) {
        Operation op =  conn.getOpFactory().tapCustom(id, message,
            new TapOperation.Callback() {
            public void receivedStatus(OperationStatus status) {
            }
            public void gotData(ResponseMessage tapMessage) {
              rqueue.add(tapMessage);
              messagesRead++;
            }
            public void gotAck(MemcachedNode node, TapOpcode opcode,
                int opaque) {
              rqueue.add(new TapAck(conn, node, opcode, opaque, this));
            }
            public void complete() {
              latch.countDown();
            }
          });
        ts.addOp((TapOperation)op);
        return op;
      }
    });
    synchronized (omap) {
      omap.put(ts, conn);
View Full Code Here

Examples of net.spy.memcached.tapmessage.TapStream

   * @throws IOException If there are errors connecting to the cluster.
   */
  public TapStream tapDump(final String id) throws IOException,
      ConfigurationException {
    final TapConnectionProvider conn = new TapConnectionProvider(addrs);
    final TapStream ts = new TapStream();
    conn.broadcastOp(new BroadcastOpFactory() {
      public Operation newOp(final MemcachedNode n,
          final CountDownLatch latch) {
        Operation op =  conn.getOpFactory().tapDump(id,
            new TapOperation.Callback() {
            public void receivedStatus(OperationStatus status) {
            }
            public void gotData(ResponseMessage tapMessage) {
              rqueue.add(tapMessage);
              messagesRead++;
            }
            public void gotAck(MemcachedNode node, TapOpcode opcode,
                int opaque) {
              rqueue.add(new TapAck(conn, node, opcode, opaque, this));
            }
            public void complete() {
              latch.countDown();
            }
          });
        ts.addOp((TapOperation)op);
        return op;
      }
    });
    synchronized (omap) {
      omap.put(ts, conn);
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.