use of com.hubspot.singularity.SingularityDeleteResult in project Singularity by HubSpot.
the class SingularityUsageCleanerPoller method deleteObsoleteSlaveUsage.
private void deleteObsoleteSlaveUsage() {
Set<String> slaveIdsToTrackUsageFor = usageHelper.getSlaveIdsToTrackUsageFor();
for (String slaveIdWithUsage : usageManager.getSlavesWithUsage()) {
if (slaveIdsToTrackUsageFor.contains(slaveIdWithUsage)) {
continue;
}
SingularityDeleteResult result = usageManager.deleteSlaveUsage(slaveIdWithUsage);
LOG.debug("Deleted obsolete slave usage {} - {}", slaveIdWithUsage, result);
}
}
use of com.hubspot.singularity.SingularityDeleteResult in project Singularity by HubSpot.
the class SingularityUsageCleanerPoller method deleteObsoleteTaskUsage.
private void deleteObsoleteTaskUsage() {
Set<String> taskIds = new HashSet<>(taskManager.getActiveTaskIdsAsStrings());
List<String> taskIdsWithUsage = usageManager.getTasksWithUsage();
for (String taskIdWithUsage : taskIdsWithUsage) {
if (taskIds.contains(taskIdWithUsage)) {
continue;
}
SingularityDeleteResult result = usageManager.deleteTaskUsage(taskIdWithUsage);
LOG.debug("Deleted obsolete task usage {} - {}", taskIdWithUsage, result);
}
}
use of com.hubspot.singularity.SingularityDeleteResult in project Singularity by HubSpot.
the class PriorityResource method deleteActivePriorityFreeze.
@DELETE
@Path("/freeze")
@ApiOperation("Stops the active priority freeze.")
@ApiResponses({ @ApiResponse(code = 202, message = "The active priority freeze was deleted."), @ApiResponse(code = 400, message = "There was no active priority freeze to delete.") })
public void deleteActivePriorityFreeze(@Auth SingularityUser user) {
authorizationHelper.checkAdminAuthorization(user);
final SingularityDeleteResult deleteResult = priorityManager.deleteActivePriorityFreeze();
checkBadRequest(deleteResult == SingularityDeleteResult.DELETED, "No active priority freeze to delete.");
priorityManager.clearPriorityKill();
}
use of com.hubspot.singularity.SingularityDeleteResult in project Singularity by HubSpot.
the class RequestResource method deleteExpiringObject.
private <T extends SingularityExpiringRequestActionParent<?>> SingularityRequestParent deleteExpiringObject(Class<T> clazz, String requestId, SingularityUser user) {
SingularityRequestWithState requestWithState = fetchRequestWithState(requestId, user);
SingularityDeleteResult deleteResult = requestManager.deleteExpiringObject(clazz, requestId);
WebExceptions.checkNotFound(deleteResult == SingularityDeleteResult.DELETED, "%s didn't have an expiring %s request", clazz.getSimpleName(), requestId);
return fillEntireRequest(requestWithState);
}
use of com.hubspot.singularity.SingularityDeleteResult in project Singularity by HubSpot.
the class SingularityCleaner method cleanupRequestData.
private void cleanupRequestData(SingularityRequestCleanup requestCleanup) {
SingularityDeleteResult deletePendingDeployResult = deployManager.deletePendingDeploy(requestCleanup.getRequestId());
SingularityDeleteResult deleteRequestDeployStateResult = deployManager.deleteRequestDeployState(requestCleanup.getRequestId());
LOG.trace("Deleted pendingDeploy ({}) and requestDeployState ({}) due to {}", deletePendingDeployResult, deleteRequestDeployStateResult, requestCleanup);
taskManager.deleteRequestId(requestCleanup.getRequestId());
deployManager.deleteRequestId(requestCleanup.getRequestId());
LOG.trace("Deleted stale request data for {}", requestCleanup.getRequestId());
}
Aggregations