Search in sources :

Example 6 with PartitionRequest

use of org.apache.hyracks.control.common.job.PartitionRequest in project asterixdb by apache.

the class RegisterPartitionRequestWork method run.

@Override
public void run() {
    PartitionId pid = partitionRequest.getPartitionId();
    IJobManager jobManager = ccs.getJobManager();
    JobRun run = jobManager.get(pid.getJobId());
    if (run == null) {
        return;
    }
    PartitionMatchMaker pmm = run.getPartitionMatchMaker();
    Pair<PartitionDescriptor, PartitionRequest> match = pmm.matchPartitionRequest(partitionRequest);
    if (match != null) {
        try {
            PartitionUtils.reportPartitionMatch(ccs, pid, match);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
Also used : PartitionRequest(org.apache.hyracks.control.common.job.PartitionRequest) PartitionDescriptor(org.apache.hyracks.control.common.job.PartitionDescriptor) IJobManager(org.apache.hyracks.control.cc.job.IJobManager) PartitionMatchMaker(org.apache.hyracks.control.cc.partitions.PartitionMatchMaker) PartitionId(org.apache.hyracks.api.partitions.PartitionId) JobRun(org.apache.hyracks.control.cc.job.JobRun)

Example 7 with PartitionRequest

use of org.apache.hyracks.control.common.job.PartitionRequest in project asterixdb by apache.

the class Joblet method advertisePartitionRequest.

public synchronized void advertisePartitionRequest(TaskAttemptId taId, Collection<PartitionId> pids, IPartitionCollector collector, PartitionState minState) throws Exception {
    for (PartitionId pid : pids) {
        partitionRequestMap.put(pid, collector);
        PartitionRequest req = new PartitionRequest(pid, nodeController.getId(), taId, minState);
        nodeController.getClusterController().registerPartitionRequest(req);
    }
}
Also used : PartitionRequest(org.apache.hyracks.control.common.job.PartitionRequest) PartitionId(org.apache.hyracks.api.partitions.PartitionId)

Aggregations

PartitionRequest (org.apache.hyracks.control.common.job.PartitionRequest)7 PartitionId (org.apache.hyracks.api.partitions.PartitionId)6 PartitionDescriptor (org.apache.hyracks.control.common.job.PartitionDescriptor)5 Pair (org.apache.commons.lang3.tuple.Pair)2 IJobManager (org.apache.hyracks.control.cc.job.IJobManager)2 JobRun (org.apache.hyracks.control.cc.job.JobRun)2 PartitionMatchMaker (org.apache.hyracks.control.cc.partitions.PartitionMatchMaker)2 ArrayList (java.util.ArrayList)1 NetworkAddress (org.apache.hyracks.api.comm.NetworkAddress)1 NodeControllerState (org.apache.hyracks.control.cc.NodeControllerState)1 INodeManager (org.apache.hyracks.control.cc.cluster.INodeManager)1 INodeController (org.apache.hyracks.control.common.base.INodeController)1