Search in sources :

Example 6 with PackingPlanProtoDeserializer

use of org.apache.heron.spi.packing.PackingPlanProtoDeserializer in project heron by twitter.

the class RuntimeManagerRunner method getCurrentContainerNumber.

private int getCurrentContainerNumber(String topologyName) {
    SchedulerStateManagerAdaptor manager = Runtime.schedulerStateManagerAdaptor(runtime);
    PackingPlans.PackingPlan currentPlan = manager.getPackingPlan(topologyName);
    PackingPlanProtoDeserializer deserializer = new PackingPlanProtoDeserializer();
    PackingPlan cPlan = deserializer.fromProto(currentPlan);
    return cPlan.getContainers().size();
}
Also used : PackingPlans(org.apache.heron.proto.system.PackingPlans) PackingPlanProtoDeserializer(org.apache.heron.spi.packing.PackingPlanProtoDeserializer) PackingPlan(org.apache.heron.spi.packing.PackingPlan) SchedulerStateManagerAdaptor(org.apache.heron.spi.statemgr.SchedulerStateManagerAdaptor)

Example 7 with PackingPlanProtoDeserializer

use of org.apache.heron.spi.packing.PackingPlanProtoDeserializer in project heron by twitter.

the class RuntimeManagerRunner method containersNumChangeDetected.

private static boolean containersNumChangeDetected(PackingPlans.PackingPlan currentProtoPlan, int numContainers) {
    PackingPlanProtoDeserializer deserializer = new PackingPlanProtoDeserializer();
    PackingPlan currentPlan = deserializer.fromProto(currentProtoPlan);
    return currentPlan.getContainers().size() != numContainers;
}
Also used : PackingPlanProtoDeserializer(org.apache.heron.spi.packing.PackingPlanProtoDeserializer) PackingPlan(org.apache.heron.spi.packing.PackingPlan)

Aggregations

PackingPlanProtoDeserializer (org.apache.heron.spi.packing.PackingPlanProtoDeserializer)7 PackingPlan (org.apache.heron.spi.packing.PackingPlan)6 PackingPlans (org.apache.heron.proto.system.PackingPlans)3 SchedulerStateManagerAdaptor (org.apache.heron.spi.statemgr.SchedulerStateManagerAdaptor)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 IOException (java.io.IOException)1 SystemConfig (org.apache.heron.common.config.SystemConfig)1 Scheduler (org.apache.heron.proto.scheduler.Scheduler)1 UpdateDryRunResponse (org.apache.heron.scheduler.dryrun.UpdateDryRunResponse)1 SchedulerServer (org.apache.heron.scheduler.server.SchedulerServer)1 LauncherUtils (org.apache.heron.scheduler.utils.LauncherUtils)1 Config (org.apache.heron.spi.common.Config)1 IRepacking (org.apache.heron.spi.packing.IRepacking)1 PackingPlanProtoSerializer (org.apache.heron.spi.packing.PackingPlanProtoSerializer)1 IScheduler (org.apache.heron.spi.scheduler.IScheduler)1 IStateManager (org.apache.heron.spi.statemgr.IStateManager)1