Package com.mapr.storm.streamparser

Examples of com.mapr.storm.streamparser.StreamParser.nextRecord()


        StreamParser parser = factory.createParser(new FileInputStream(file));

        assertTrue(file.length() > 30);

        assertEquals(0, parser.currentOffset());
        List<Object> t = parser.nextRecord();

        assertEquals(2, t.size());
        assertEquals("test", t.get(0));
        assertEquals("1", t.get(1));
View Full Code Here


        assertEquals(2, t.size());
        assertEquals("test", t.get(0));
        assertEquals("1", t.get(1));

        t = parser.nextRecord();

        assertEquals(2, t.size());
        assertEquals("test", t.get(0));
        assertEquals("2", t.get(1));
View Full Code Here

        assertEquals("2", t.get(1));

        // time critical section starts here ... delay > 50ms can cause failure

        // first read doesn't see a full record and thus returns null
        t = parser.nextRecord();
        assertNull(t);

        // write the remainder now
        out.write(bytes, 6, bytes.length - 6);
View Full Code Here

        // write the remainder now
        out.write(bytes, 6, bytes.length - 6);

        // so that the repeated read succeeds
        t = parser.nextRecord();
        // end of time critical section

        assertEquals(2, t.size());
        assertEquals("test", t.get(0));
        assertEquals("3", t.get(1));
View Full Code Here

        assertEquals(2, t.size());
        assertEquals("test", t.get(0));
        assertEquals("3", t.get(1));

        assertNull(parser.nextRecord());

        out.close();
    }

    @Test
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.