Search in sources :

Example 1 with JobletProfile

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

use of org.apache.hyracks.control.common.job.profiling.om.JobletProfile 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)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 JobRun (org.apache.hyracks.control.cc.job.JobRun)1 Joblet (org.apache.hyracks.control.nc.Joblet)1