Search in sources :

Example 11 with IJobManager

use of org.apache.hyracks.control.cc.job.IJobManager 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 12 with IJobManager

use of org.apache.hyracks.control.cc.job.IJobManager in project asterixdb by apache.

the class TaskCompleteWork method performEvent.

@Override
protected void performEvent(TaskAttempt ta) {
    try {
        IJobManager jobManager = ccs.getJobManager();
        JobRun run = jobManager.get(jobId);
        if (statistics != null) {
            JobProfile jobProfile = run.getJobProfile();
            Map<String, JobletProfile> jobletProfiles = jobProfile.getJobletProfiles();
            JobletProfile jobletProfile = jobletProfiles.get(nodeId);
            if (jobletProfile == null) {
                jobletProfile = new JobletProfile(nodeId);
                jobletProfiles.put(nodeId, jobletProfile);
            }
            jobletProfile.getTaskProfiles().put(taId, statistics);
        }
        run.getExecutor().notifyTaskComplete(ta);
    } catch (HyracksException e) {
        e.printStackTrace();
    }
}
Also used : JobletProfile(org.apache.hyracks.control.common.job.profiling.om.JobletProfile) HyracksException(org.apache.hyracks.api.exceptions.HyracksException) IJobManager(org.apache.hyracks.control.cc.job.IJobManager) JobProfile(org.apache.hyracks.control.common.job.profiling.om.JobProfile) JobRun(org.apache.hyracks.control.cc.job.JobRun)

Aggregations

IJobManager (org.apache.hyracks.control.cc.job.IJobManager)12 JobRun (org.apache.hyracks.control.cc.job.JobRun)9 HyracksException (org.apache.hyracks.api.exceptions.HyracksException)4 PartitionId (org.apache.hyracks.api.partitions.PartitionId)2 CCServiceContext (org.apache.hyracks.control.cc.application.CCServiceContext)2 INodeManager (org.apache.hyracks.control.cc.cluster.INodeManager)2 PartitionMatchMaker (org.apache.hyracks.control.cc.partitions.PartitionMatchMaker)2 PartitionDescriptor (org.apache.hyracks.control.common.job.PartitionDescriptor)2 PartitionRequest (org.apache.hyracks.control.common.job.PartitionRequest)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Collection (java.util.Collection)1 Pair (org.apache.commons.lang3.tuple.Pair)1 ActivityId (org.apache.hyracks.api.dataflow.ActivityId)1 TaskId (org.apache.hyracks.api.dataflow.TaskId)1 ActivityCluster (org.apache.hyracks.api.job.ActivityCluster)1 IActivityClusterGraphGenerator (org.apache.hyracks.api.job.IActivityClusterGraphGenerator)1 IActivityClusterGraphGeneratorFactory (org.apache.hyracks.api.job.IActivityClusterGraphGeneratorFactory)1 JobId (org.apache.hyracks.api.job.JobId)1 IJobCapacityController (org.apache.hyracks.api.job.resource.IJobCapacityController)1