Package com.netflix.suro.queue

Examples of com.netflix.suro.queue.FileQueue4Sink.drain()


    @Test
    public void test() throws IOException {
        FileQueue4Sink queue = new FileQueue4Sink(folder.newFolder().getAbsolutePath(), "testqueue", "PT1m", 1024 * 1024 * 1024);
        assertEquals(queue.size(), 0);
        assertEquals(queue.isEmpty(), true);
        assertEquals(queue.drain(100, new LinkedList<Message>()), 0);

        for (int i = 0; i < 100; ++i) {
            queue.offer(new Message("routingkey" + i, ("value" + i).getBytes()));
        }

View Full Code Here


        assertEquals(queue.size(), 100);
        assertEquals(queue.isEmpty(), false);

        List<Message> msgList = new LinkedList<Message>();
        assertEquals(queue.drain(100, msgList), 100);
        int i = 0;
        for (Message m : msgList) {
            assertEquals(m.getRoutingKey(), "routingkey" + i);
            assertEquals(new String(m.getPayload()), "value" + i);
            ++i;
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.