use of org.apache.hyracks.control.nc.Joblet in project asterixdb by apache.
the class CleanupJobletWork method run.
@Override
public void run() {
if (LOGGER.isLoggable(Level.INFO)) {
LOGGER.info("Cleaning up after job: " + jobId);
}
final List<IPartition> unregisteredPartitions = new ArrayList<IPartition>();
ncs.getPartitionManager().unregisterPartitions(jobId, unregisteredPartitions);
ncs.getExecutor().execute(new Runnable() {
@Override
public void run() {
for (IPartition p : unregisteredPartitions) {
try {
// Put deallocate in a try block to make sure that every IPartition is de-allocated.
p.deallocate();
} catch (Exception e) {
if (LOGGER.isLoggable(Level.WARNING)) {
LOGGER.log(Level.WARNING, e.getMessage(), e);
}
}
}
}
});
Map<JobId, Joblet> jobletMap = ncs.getJobletMap();
Joblet joblet = jobletMap.remove(jobId);
if (joblet != null) {
joblet.cleanup(status);
}
}
Aggregations