Search in sources :

Example 1 with ObjectDefinition

use of com.twitter.heron.eco.definition.ObjectDefinition in project incubator-heron by apache.

the class BoltBuilder method buildBolts.

protected void buildBolts(EcoExecutionContext executionContext, ObjectBuilder objectBuilder) throws IllegalAccessException, InstantiationException, ClassNotFoundException, NoSuchFieldException, InvocationTargetException {
    EcoTopologyDefinition topologyDefinition = executionContext.getTopologyDefinition();
    for (ObjectDefinition def : topologyDefinition.getBolts()) {
        Object obj = objectBuilder.buildObject(def, executionContext);
        executionContext.addBolt(def.getId(), obj);
    }
}
Also used : ObjectDefinition(com.twitter.heron.eco.definition.ObjectDefinition) EcoTopologyDefinition(com.twitter.heron.eco.definition.EcoTopologyDefinition)

Example 2 with ObjectDefinition

use of com.twitter.heron.eco.definition.ObjectDefinition in project incubator-heron by apache.

the class SpoutBuilder method buildSpouts.

protected void buildSpouts(EcoExecutionContext executionContext, TopologyBuilder builder, ObjectBuilder objectBuilder) throws ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchFieldException, InvocationTargetException {
    EcoTopologyDefinition topologyDefinition = executionContext.getTopologyDefinition();
    for (ObjectDefinition def : topologyDefinition.getSpouts()) {
        Object obj = objectBuilder.buildObject(def, executionContext);
        builder.setSpout(def.getId(), (IRichSpout) obj, def.getParallelism());
        executionContext.addSpout(def.getId(), obj);
    }
}
Also used : ObjectDefinition(com.twitter.heron.eco.definition.ObjectDefinition) EcoTopologyDefinition(com.twitter.heron.eco.definition.EcoTopologyDefinition)

Aggregations

EcoTopologyDefinition (com.twitter.heron.eco.definition.EcoTopologyDefinition)2 ObjectDefinition (com.twitter.heron.eco.definition.ObjectDefinition)2