use of com.twitter.heron.api.tuple.Fields in project heron by twitter.
the class GeneralTopologyContextImpl method getOutputToComponentsFields.
public static Map<String, Map<String, Fields>> getOutputToComponentsFields(List<TopologyAPI.OutputStream> outputs) {
Map<String, Map<String, Fields>> outputFields = new HashMap<>();
for (TopologyAPI.OutputStream outputStream : outputs) {
String componentName = outputStream.getStream().getComponentName();
String streamId = outputStream.getStream().getId();
Map<String, Fields> componentFields = outputFields.get(componentName);
if (componentFields == null) {
componentFields = new HashMap<>();
}
// Get the fields of a particular OutputStream
List<String> retval = new ArrayList<>();
for (TopologyAPI.StreamSchema.KeyType kt : outputStream.getSchema().getKeysList()) {
retval.add(kt.getKey());
}
// Put it into the map
componentFields.put(streamId, new Fields(retval));
outputFields.put(componentName, componentFields);
}
return outputFields;
}
use of com.twitter.heron.api.tuple.Fields in project heron by twitter.
the class MultiSpoutsMultiTasks method buildTopology.
@Override
protected TestTopologyBuilder buildTopology(TestTopologyBuilder builder) {
builder.setSpout("ab-spout-1", new ABSpout(), 3);
builder.setSpout("ab-spout-2", new ABSpout(), 3);
builder.setBolt("identity-bolt", new IdentityBolt(new Fields("word")), 1).shuffleGrouping("ab-spout-1").shuffleGrouping("ab-spout-2");
return builder;
}
use of com.twitter.heron.api.tuple.Fields in project heron by twitter.
the class NonGrouping method buildTopology.
@Override
protected TestTopologyBuilder buildTopology(TestTopologyBuilder builder) {
builder.setSpout("ab-spout", new ABSpout(), 1);
builder.setBolt("identity-bolt", new IdentityBolt(new Fields("word")), 3).noneGrouping("ab-spout");
return builder;
}
use of com.twitter.heron.api.tuple.Fields in project heron by twitter.
the class OneSpoutBoltMultiTasks method buildTopology.
@Override
protected TestTopologyBuilder buildTopology(TestTopologyBuilder builder) {
builder.setSpout("ab-spout", new ABSpout(), 3);
builder.setBolt("identity-bolt", new IdentityBolt(new Fields("word")), 3).shuffleGrouping("ab-spout");
return builder;
}
use of com.twitter.heron.api.tuple.Fields in project heron by twitter.
the class AllGrouping method buildTopology.
@Override
protected TestTopologyBuilder buildTopology(TestTopologyBuilder builder) {
builder.setSpout("ab-spout", new ABSpout(), 1);
builder.setBolt("identity-bolt", new IdentityBolt(new Fields("word")), 2).allGrouping("ab-spout");
return builder;
}
Aggregations