Search in sources :

Example 1 with JobProfile

use of org.apache.hyracks.control.common.job.profiling.om.JobProfile in project asterixdb by apache.

the class BuildJobProfilesWork method doRun.

@Override
protected void doRun() throws Exception {
    List<JobProfile> profiles = new ArrayList<JobProfile>();
    Map<JobId, Joblet> jobletMap = ncs.getJobletMap();
    for (Joblet ji : jobletMap.values()) {
        profiles.add(new JobProfile(ji.getJobId()));
    }
    for (JobProfile jProfile : profiles) {
        Joblet ji;
        JobletProfile jobletProfile = new JobletProfile(ncs.getId());
        ji = jobletMap.get(jProfile.getJobId());
        if (ji != null) {
            ji.dumpProfile(jobletProfile);
            jProfile.getJobletProfiles().put(ncs.getId(), jobletProfile);
        }
    }
    fv.setValue(profiles);
}
Also used : JobletProfile(org.apache.hyracks.control.common.job.profiling.om.JobletProfile) ArrayList(java.util.ArrayList) JobProfile(org.apache.hyracks.control.common.job.profiling.om.JobProfile) JobId(org.apache.hyracks.api.job.JobId) Joblet(org.apache.hyracks.control.nc.Joblet)

Example 2 with JobProfile

use of org.apache.hyracks.control.common.job.profiling.om.JobProfile in project asterixdb by apache.

the class ReportProfilesWork method run.

@Override
public void run() {
    for (JobProfile profile : profiles) {
        JobRun run = jobManager.get(profile.getJobId());
        if (run != null) {
            JobProfile jp = run.getJobProfile();
            jp.merge(profile);
        }
    }
}
Also used : JobProfile(org.apache.hyracks.control.common.job.profiling.om.JobProfile) JobRun(org.apache.hyracks.control.cc.job.JobRun)

Example 3 with JobProfile

use of org.apache.hyracks.control.common.job.profiling.om.JobProfile 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

JobProfile (org.apache.hyracks.control.common.job.profiling.om.JobProfile)3 JobRun (org.apache.hyracks.control.cc.job.JobRun)2 JobletProfile (org.apache.hyracks.control.common.job.profiling.om.JobletProfile)2 ArrayList (java.util.ArrayList)1 HyracksException (org.apache.hyracks.api.exceptions.HyracksException)1 JobId (org.apache.hyracks.api.job.JobId)1 IJobManager (org.apache.hyracks.control.cc.job.IJobManager)1 Joblet (org.apache.hyracks.control.nc.Joblet)1