use of org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint in project drill by apache.
the class PhysicalOperatorUtil method getIndexOrderedEndpoints.
/**
* Helper method to create a list of MinorFragmentEndpoint instances from a given endpoint assignment list.
*
* @param endpoints Assigned endpoint list. Index of each endpoint in list indicates the MinorFragmentId of the
* fragment that is assigned to the endpoint.
* @return
*/
public static List<MinorFragmentEndpoint> getIndexOrderedEndpoints(List<DrillbitEndpoint> endpoints) {
List<MinorFragmentEndpoint> destinations = Lists.newArrayList();
int minorFragmentId = 0;
for (DrillbitEndpoint endpoint : endpoints) {
destinations.add(new MinorFragmentEndpoint(minorFragmentId, endpoint));
minorFragmentId++;
}
return destinations;
}
use of org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint in project drill by apache.
the class AbstractMuxExchange method getReceiverParallelizationInfo.
@Override
public ParallelizationInfo getReceiverParallelizationInfo(List<DrillbitEndpoint> senderFragmentEndpoints) {
Preconditions.checkArgument(senderFragmentEndpoints != null && senderFragmentEndpoints.size() > 0, "Sender fragment endpoint list should not be empty");
// We want to run one mux receiver per Drillbit endpoint.
// Identify the number of unique Drillbit endpoints in sender fragment endpoints.
List<DrillbitEndpoint> drillbitEndpoints = ImmutableSet.copyOf(senderFragmentEndpoints).asList();
List<EndpointAffinity> affinities = Lists.newArrayList();
for (DrillbitEndpoint ep : drillbitEndpoints) {
affinities.add(new EndpointAffinity(ep, Double.POSITIVE_INFINITY));
}
return ParallelizationInfo.create(affinities.size(), affinities.size(), affinities);
}
Aggregations