/** * Returns the hash code of the string that is returned by {@link #toString()}. * * @see java.lang.Object#hashCode() */ @Override public int hashCode() { return toString().hashCode(); }
/** * Compares the strings returned by {@link #toString()}, assuming <code>obj</code> is another {@link JobId}. * * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { if (this == obj) { return true; } if ((obj == null) || !(obj instanceof JobId)) { return false; } return this.toString().equals(obj.toString()); }
/** * Returns the single string that contains the unique job ID which identifies a particular invocation of a * particular job. This string is used to determine this object's hash code and for equality checks. Note that * {@link HistoryJobId} objects are only ever equal to other {@link HistoryJobId} objects (they are never equal to * concrete instances of {@link JobId}). * * @see java.lang.Object#toString() */ public String toString() { return joinPartsIntoJobIdString(super.toString(), Long.toString(createdTime)); } }
@Override public ResourceOperationSchedule getResourceOperationSchedule(Subject whoami, int scheduleId) { OperationScheduleEntity operationScheduleEntity = entityManager.find(OperationScheduleEntity.class, scheduleId); try { ResourceOperationSchedule resourceOperationSchedule = getResourceOperationSchedule(whoami, operationScheduleEntity.getJobId().toString()); return resourceOperationSchedule; } catch (SchedulerException e) { throw new RuntimeException("Failed to retrieve ResourceOperationSchedule with id [" + scheduleId + "].", e); } }
@Override public GroupOperationSchedule getGroupOperationSchedule(Subject whoami, int scheduleId) { OperationScheduleEntity operationScheduleEntity = entityManager.find(OperationScheduleEntity.class, scheduleId); try { GroupOperationSchedule groupOperationSchedule = getGroupOperationSchedule(whoami, operationScheduleEntity .getJobId().toString()); return groupOperationSchedule; } catch (SchedulerException e) { throw new RuntimeException("Failed to retrieve GroupOperationSchedule with id [" + scheduleId + "].", e); } }
operationManager.unscheduleResourceOperation(overlord, schedule.getJobId().toString(), resourceId); } catch (UnscheduleException ise) { log.warn("Failed to unschedule job [" + schedule + "] for a resource being deleted [" + resourceId
for (ResourceOperationScheduleComposite composite : results) { try { ResourceOperationSchedule sched = getResourceOperationSchedule(subject, composite.getJobId().toString()); OperationDefinition def = getSupportedResourceOperation(overlord, composite.getResourceId(), sched.getOperationName(), false);
for (GroupOperationScheduleComposite composite : results) { try { GroupOperationSchedule sched = getGroupOperationSchedule(subject, composite.getJobId().toString()); OperationDefinition def = getSupportedGroupOperation(overlord, composite.getGroupId(), sched.getOperationName(), false);
log.debug("Found operation schedule, unscheduling " + schedule); operationManager.unscheduleResourceOperation(subject, schedule.getJobId().toString(), resource.getId());
private void removeCompatibleGroupConstructs(Subject subject, ResourceGroup group) throws ResourceGroupDeleteException { // for compatible groups, first recursively remove any referring backing groups for auto-clusters List<ResourceGroup> clusterBackingGroups = group.getClusterBackingGroups(); if (null != clusterBackingGroups) { for (ResourceGroup referringGroup : clusterBackingGroups) { deleteResourceGroup(subject, referringGroup.getId()); } } Subject overlord = subjectManager.getOverlord(); try { List<GroupOperationSchedule> ops = operationManager.findScheduledGroupOperations(overlord, group.getId()); for (GroupOperationSchedule schedule : ops) { operationManager.unscheduleGroupOperation(overlord, schedule.getJobId().toString(), group.getId()); } } catch (Exception e) { throw new ResourceGroupDeleteException("Failed to get jobs for a group being deleted [" + group + "]; will not attempt to unschedule anything", e); } groupAlertDefinitionManager.purgeAllGroupAlertDefinitions(subject, group.getId()); }
String jobGroup = history.getJobGroup(); JobId jobId = new JobId(jobName, jobGroup); hist.setJobId(jobId.toString());