}); ContainerAllocationTaskState patch = new ContainerAllocationTaskState(); patch.hostSelections = copySelections; patch.taskInfo = state.taskInfo;
private ContainerAllocationTaskState prepareContainerAllocationTask( ContainerDescription containerDesc, long resourceCount, String placemenStateLink) { String taskLink = buildTaskLink(containerDesc); ContainerAllocationTaskState allocationTask = new ContainerAllocationTaskState(); allocationTask.resourceDescriptionLink = containerDesc.documentSelfLink; allocationTask.groupResourcePlacementLink = placemenStateLink; allocationTask.resourceType = ResourceType.CONTAINER_TYPE.getName(); allocationTask.resourceCount = resourceCount; allocationTask.tenantLinks = containerDesc.tenantLinks; allocationTask.serviceTaskCallback = createServiceCallBack(taskLink); allocationTask.customProperties = new HashMap<>(); return allocationTask; }
private ContainerAllocationTaskState createContainerAllocationTask(String containerDescLink, long resourceCount) { ContainerAllocationTaskState allocationTask = new ContainerAllocationTaskState(); allocationTask.resourceDescriptionLink = containerDescLink; allocationTask.groupResourcePlacementLink = groupPlacementState.documentSelfLink; allocationTask.resourceType = ResourceType.CONTAINER_TYPE.getName(); allocationTask.resourceCount = resourceCount; allocationTask.serviceTaskCallback = ServiceTaskCallback.createEmpty(); allocationTask.customProperties = new HashMap<>(); return allocationTask; }
createResourcePool(), true); ContainerAllocationTaskState allocationTask = new ContainerAllocationTaskState(); allocationTask.resourceDescriptionLink = agentContainerDesc.documentSelfLink; allocationTask.groupResourcePlacementLink = groupPlacementState.documentSelfLink;
private void createContainerAllocationTask(RequestBrokerState state) { getContainerDescription(state, (containerDesc) -> { ContainerAllocationTaskState allocationTask = new ContainerAllocationTaskState(); allocationTask.documentSelfLink = getSelfId(); allocationTask.serviceTaskCallback = ServiceTaskCallback.create(
private void createContainerAllocationTaskState(CompositionSubTaskState state) { ContainerAllocationTaskState allocationTask = new ContainerAllocationTaskState(); allocationTask.documentSelfLink = getSelfId(); allocationTask.serviceTaskCallback = ServiceTaskCallback.create(getSelfLink(), TaskStage.STARTED, SubStage.COMPLETED, TaskStage.STARTED, SubStage.ERROR); allocationTask.customProperties = state.customProperties; allocationTask.resourceDescriptionLink = state.resourceDescriptionLink; allocationTask.resourceCount = Long.valueOf(state.resourceLinks.size()); allocationTask.resourceType = state.resourceType; allocationTask.tenantLinks = state.tenantLinks; allocationTask.requestTrackerLink = state.requestTrackerLink; allocationTask.resourceLinks = state.resourceLinks; allocationTask.postAllocation = state.postAllocation; sendRequest(Operation.createPost(this, ContainerAllocationTaskFactoryService.SELF_LINK) .setBody(allocationTask) .setContextId(state.requestId) .setCompletion((o, e) -> { if (e != null) { failTask("Failure creating container allocation task", e); return; } })); proceedTo(SubStage.EXECUTING); }