use of org.apache.hyracks.comm.channels.NetworkOutputChannel in project asterixdb by apache.
the class PartitionManager method registerPartition.
public synchronized void registerPartition(PartitionId pid, TaskAttemptId taId, IPartition partition, PartitionState state, boolean updateToCC) throws HyracksDataException {
try {
/**
* process pending requests
*/
NetworkOutputChannel writer = partitionRequests.remove(pid);
if (writer != null) {
writer.setFrameSize(partition.getTaskContext().getInitialFrameSize());
partition.writeTo(writer);
if (!partition.isReusable()) {
return;
}
}
/**
* put a coming available partition into the available partition map
*/
List<IPartition> pList = availablePartitionMap.get(pid);
if (pList == null) {
pList = new ArrayList<>();
availablePartitionMap.put(pid, pList);
}
pList.add(partition);
/**
* update to CC only when necessary
*/
if (updateToCC) {
updatePartitionState(pid, taId, partition, state);
}
} catch (Exception e) {
throw new HyracksDataException(e);
}
}
Aggregations