202203204205206207208209210211212
channel.put(e); } tx.commit(); tx.close(); int count = 0; Status status = Status.READY; while(status != Status.BACKOFF){ count++; status = sink.process(); } sink.stop();
869870871872873874875876877878879
} txn.commit(); txn.close(); // execute sink to process the events Status satus = sink.process(); // verify that the append returned backoff due to timeotu Assert.assertEquals(satus, Status.BACKOFF); }
140141142143144145146147148149150
selector.stop(); } @Override public Status process() throws EventDeliveryException { Status status = null; Iterator<Sink> sinkIterator = selector.createSinkIterator(); while (sinkIterator.hasNext()) { Sink sink = sinkIterator.next(); try {
8788899091929394959697
sinks.add(s2); sinks.add(s3); LoadBalancingSinkProcessor lbsp = getProcessor(sinks, new Context()); Status s = Status.READY; while (s != Status.BACKOFF) { s = lbsp.process(); } Assert.assertTrue(s1.getEvents().size() == n);
168169170171172173174175176177178
sinks.add(s2); sinks.add(s3); LoadBalancingSinkProcessor lbsp = getProcessor("random",sinks); Status s = Status.READY; while (s != Status.BACKOFF) { s = lbsp.process(); } Assert.assertTrue(s2.getEvents().size() == 0);
231232233234235236237238239240241
sinks.add(s9); sinks.add(s0); LoadBalancingSinkProcessor lbsp = getProcessor("random",sinks); Status s = Status.READY; while (s != Status.BACKOFF) { s = lbsp.process(); } Set<Integer> sizeSet = new HashSet<Integer>();
327328329330331332333334335336337
sinks.add(s2); sinks.add(s3); LoadBalancingSinkProcessor lbsp = getProcessor("round_robin",sinks); Status s = Status.READY; while (s != Status.BACKOFF) { s = lbsp.process(); } Assert.assertTrue(s1.getEvents().size() == n);
363364365366367368369370371372373
243244245246247248249250251252253
channel.put(e); } tx.commit(); tx.close(); int count = 0; Status status = Status.READY; while(status != Status.BACKOFF){ count++; status = sink.process(); } Assert.assertFalse(sink.isConfNull());
316317318319320321322323324325326
} } tx.commit(); tx.close(); int count = 0; Status status = Status.READY; while (status != Status.BACKOFF) { count++; status = sink.process(); } Assert.assertFalse(sink.isConfNull());