/** * Processes a Cloudlet cancel request. * * @param cloudletId ID of the cloudlet to be canceled * @param userId ID of the cloudlet's owner * @param vmId the id of the VM where the cloudlet has to be canceled * * @pre $none * @post $none */ protected void processCloudletCancel(int cloudletId, int userId, int vmId) { Cloudlet cl = getVmAllocationPolicy().getHost(vmId, userId).getVm(vmId,userId) .getCloudletScheduler().cloudletCancel(cloudletId); sendNow(userId, CloudSimTags.CLOUDLET_CANCEL, cl); }
/** * Processes a Cloudlet pause request. * * @param cloudletId ID of the cloudlet to be paused * @param userId ID of the cloudlet's owner * @param ack indicates if the event's sender expects to receive * an acknowledge message when the event finishes to be processed * @param vmId the id of the VM where the cloudlet has to be paused * * @pre $none * @post $none */ protected void processCloudletPause(int cloudletId, int userId, int vmId, boolean ack) { boolean status = getVmAllocationPolicy().getHost(vmId, userId).getVm(vmId,userId) .getCloudletScheduler().cloudletPause(cloudletId); if (ack) { int[] data = new int[3]; data[0] = getId(); data[1] = cloudletId; if (status) { data[2] = CloudSimTags.TRUE; } else { data[2] = CloudSimTags.FALSE; } sendNow(userId, CloudSimTags.CLOUDLET_PAUSE_ACK, data); } }
vmId = data[2]; status = getVmAllocationPolicy().getHost(vmId, userId).getVm(vmId,userId).getCloudletScheduler() .getCloudletStatus(cloudletId); userId = cl.getUserId(); status = getVmAllocationPolicy().getHost(vmId, userId).getVm(vmId,userId) .getCloudletScheduler().getCloudletStatus(cloudletId); } catch (Exception e) {
double eventTime = getVmAllocationPolicy().getHost(vmId, userId).getVm(vmId,userId) .getCloudletScheduler().cloudletResume(cloudletId);
Vm vm = host.getVm(vmId, userId); CloudletScheduler scheduler = vm.getCloudletScheduler(); double estimatedFinishTime = scheduler.cloudletSubmit(cl, fileTransferTime);
Vm vm = host.getVm(vmId, userId); CloudletScheduler scheduler = vm.getCloudletScheduler(); double estimatedFinishTime = scheduler.cloudletSubmit(cl, fileTransferTime);