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);