@Override protected ServiceTaskCallbackResponse getFinishedCallbackResponse( ContainerAllocationTaskState state) { CallbackCompleteResponse finishedResponse = new CallbackCompleteResponse(); finishedResponse.copy(state.serviceTaskCallback.getFinishedResponse()); finishedResponse.resourceLinks = state.resourceLinks; if (state.resourceLinks == null || state.resourceLinks.isEmpty()) { logWarning("No resourceLinks found for allocated resources."); } return finishedResponse; }
@Override protected ServiceTaskCallbackResponse getFailedCallbackResponse( ContainerAllocationTaskState state) { CallbackCompleteResponse failedResponse = new CallbackCompleteResponse(); failedResponse.copy(state.serviceTaskCallback.getFailedResponse(state.taskInfo.failure)); failedResponse.resourceLinks = state.resourceLinks; if (state.resourceLinks == null || state.resourceLinks.isEmpty()) { logWarning("No resourceLinks found for allocated resources."); } return failedResponse; }
private void completeTask(ContainerAllocationTaskState state) { if (state.hostSelections != null) { try { ContainerHostDataCollectionState body = new ContainerHostDataCollectionState(); body.noHostOperation = true; body.computeContainerHostLinks = new HashSet<String>( state.resourceNameToHostSelection.values() .stream().map((r) -> r.hostLink) .collect(Collectors.toList())); logInfo("Container Host collection started for: [%s]", body.computeContainerHostLinks); sendRequest(Operation.createPatch(this, ContainerHostDataCollectionService.HOST_INFO_DATA_COLLECTION_LINK) .setBody(body) .setCompletion((o, e) -> { if (e != null) { logWarning("Container Host [%s] can't be updated. Error: [%s]", body.computeContainerHostLinks, Utils.toString(e)); } })); } catch (Throwable e) { logSevere(e); } } complete(); }
logWarning("Health check timeout exceeded.");