/** * 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); }
/** * Gets the current requested mips. * * @return the current requested mips */ public List<Double> getCurrentRequestedMips() { List<Double> currentRequestedMips = getCloudletScheduler().getCurrentRequestedMips(); if (isBeingInstantiated()) { currentRequestedMips = new ArrayList<Double>(); for (int i = 0; i < getNumberOfPes(); i++) { currentRequestedMips.add(getMips()); } } return currentRequestedMips; }
/** * Gets the current requested bw. * * @return the current requested bw */ public long getCurrentRequestedBw() { if (isBeingInstantiated()) { return getBw(); } return (long) (getCloudletScheduler().getCurrentRequestedUtilizationOfBw() * getBw()); }
/** * Verifies if some cloudlet inside this Datacenter already finished. * If yes, send it to the User/Broker * * @pre $none * @post $none */ protected void checkCloudletCompletion() { List<? extends Host> list = getVmAllocationPolicy().getHostList(); for (int i = 0; i < list.size(); i++) { Host host = list.get(i); for (Vm vm : host.getVmList()) { while (vm.getCloudletScheduler().isFinishedCloudlets()) { Cloudlet cl = vm.getCloudletScheduler().getNextFinishedCloudlet(); if (cl != null) { sendNow(cl.getUserId(), CloudSimTags.CLOUDLET_RETURN, cl); } } } } }
.getCloudletScheduler().cloudletCancel(cloudletId); vm.getCloudletScheduler().cloudletSubmit(cl, fileTransferTime);
Vm vm = host.getVm(vmId, userId); CloudletScheduler scheduler = vm.getCloudletScheduler(); double estimatedFinishTime = scheduler.cloudletSubmit(cl, fileTransferTime);
/** * Gets the current requested ram. * * @return the current requested ram */ public int getCurrentRequestedRam() { if (isBeingInstantiated()) { return getRam(); } return (int) (getCloudletScheduler().getCurrentRequestedUtilizationOfRam() * getRam()); }
@Override public double updateVmProcessing(final double currentTime, final List<Double> mipsShare) { double time = super.updateVmProcessing(currentTime, mipsShare); if (currentTime > getPreviousTime() && (currentTime - 0.1) % getSchedulingInterval() == 0) { double utilization = getTotalUtilizationOfCpu(getCloudletScheduler().getPreviousTime()); if (CloudSim.clock() != 0 || utilization != 0) { addUtilizationHistoryValue(utilization); } setPreviousTime(currentTime); } return time; }
/** * 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); } }
.getCloudletStatus(cloudletId); .getCloudletScheduler().getCloudletStatus(cloudletId); } catch (Exception e) { Log.printConcatLine(getName(), ": Error in processing CloudSimTags.CLOUDLET_STATUS");
.getCloudletScheduler().cloudletResume(cloudletId);
Vm vm = host.getVm(vmId, userId); CloudletScheduler scheduler = vm.getCloudletScheduler(); double estimatedFinishTime = scheduler.cloudletSubmit(cl, fileTransferTime);