use of org.apache.heron.proto.system.PhysicalPlans.PhysicalPlan in project heron by twitter.
the class PhysicalPlanProvider method ParseResponseToPhysicalPlan.
protected PhysicalPlan ParseResponseToPhysicalPlan(byte[] responseData) {
// byte to base64 string
String encodedString = new String(responseData);
LOG.fine("tmanager returns physical plan in base64 str: " + encodedString);
// base64 string to proto bytes
byte[] decodedBytes = Base64.getDecoder().decode(encodedString);
// construct proto obj from bytes
PhysicalPlan pp = null;
try {
pp = PhysicalPlan.parseFrom(decodedBytes);
} catch (InvalidProtocolBufferException e) {
throw new InvalidStateException(topologyName, "Failed to fetch the physical plan");
}
return pp;
}
use of org.apache.heron.proto.system.PhysicalPlans.PhysicalPlan in project heron by twitter.
the class ScaleUpResolverTest method createPhysicalPlanProvider.
private PhysicalPlanProvider createPhysicalPlanProvider(TopologyAPI.Topology topology) {
PhysicalPlan pp = PhysicalPlan.newBuilder().setTopology(topology).build();
PhysicalPlanProvider physicalPlanProvider = mock(PhysicalPlanProvider.class);
when(physicalPlanProvider.get()).thenReturn(pp);
return physicalPlanProvider;
}
Aggregations