List<List<Object>> keys = getKeys("ted", "mary", "jason", "tom", "chuck");
name_to_age.multiPut(keys, ImmutableList.of(32, 21, 45, 52, 18));
return name_to_age;
}
};
TridentState nameToAge =
topology.newStaticState(stateFactory);
// Let's setup another state that keeps track of actor's appearance counts per location
TridentState countState =
topology
.newStream("spout", spout)
.groupBy(new Fields("actor","location"))
.persistentAggregate(new MemoryMapState.Factory(), new Count(), new Fields("count"));