Search in sources :

Example 11 with TupleWindow

use of org.apache.storm.windowing.TupleWindow in project storm by apache.

the class TestJoinBolt method testNestedKeys.

@Test
public void testNestedKeys() throws Exception {
    ArrayList<Tuple> userStream = makeNestedEventsStream("users", userFields, users);
    TupleWindow window = makeTupleWindow(userStream);
    JoinBolt bolt = new JoinBolt(JoinBolt.Selector.STREAM, "users", "outer.userId").select("outer.name, outer.city");
    MockCollector collector = new MockCollector();
    bolt.prepare(null, null, collector);
    bolt.execute(window);
    printResults(collector);
    Assert.assertEquals(userStream.size(), collector.actualResults.size());
}
Also used : TupleWindow(org.apache.storm.windowing.TupleWindow) Tuple(org.apache.storm.tuple.Tuple) Test(org.junit.Test)

Aggregations

TupleWindow (org.apache.storm.windowing.TupleWindow)11 Test (org.junit.Test)10 Tuple (org.apache.storm.tuple.Tuple)9 Fields (org.apache.storm.tuple.Fields)1 Values (org.apache.storm.tuple.Values)1