Search in sources :

Example 1 with ObjectDefinition

use of org.apache.heron.eco.definition.ObjectDefinition in project heron by twitter.

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(org.apache.heron.eco.definition.ObjectDefinition) EcoTopologyDefinition(org.apache.heron.eco.definition.EcoTopologyDefinition)

Example 2 with ObjectDefinition

use of org.apache.heron.eco.definition.ObjectDefinition in project heron by twitter.

the class BoltBuilder method buildBolts.

public 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(org.apache.heron.eco.definition.ObjectDefinition) EcoTopologyDefinition(org.apache.heron.eco.definition.EcoTopologyDefinition)

Example 3 with ObjectDefinition

use of org.apache.heron.eco.definition.ObjectDefinition in project heron by twitter.

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(org.apache.heron.eco.definition.ObjectDefinition) EcoTopologyDefinition(org.apache.heron.eco.definition.EcoTopologyDefinition)

Aggregations

EcoTopologyDefinition (org.apache.heron.eco.definition.EcoTopologyDefinition)3 ObjectDefinition (org.apache.heron.eco.definition.ObjectDefinition)3