/** * Prints a message and a new line. * * @param message the message */ public static void printLine(String message) { if (!isDisabled()) { print(message + LINE_SEPARATOR); } }
/** * Prints the message passed as a non-String object and a new line. * * @param message the message */ public static void printLine(Object message) { if (!isDisabled()) { printLine(String.valueOf(message)); } }
/** * Prints a string formated as in String.format(), followed by a new line. * * @param format the format * @param args the args */ public static void formatLine(String format, Object... args) { if (!isDisabled()) { printLine(String.format(format, args)); } }
/** * Prints the message passed as a non-String object. * * @param message the message */ public static void print(Object message) { if (!isDisabled()) { print(String.valueOf(message)); } }
/** * Prints a string formated as in String.format(). * * @param format the format * @param args the args */ public static void format(String format, Object... args) { if (!isDisabled()) { print(String.format(format, args)); } }
/** * Prints an empty line. */ public static void printLine() { if (!isDisabled()) { print(LINE_SEPARATOR); } }
/** * Prints the concatenated text representation of the arguments. * * @param messages the messages to print */ public static void printConcat(Object... messages) { if (!isDisabled()) { buffer.setLength(0); // Clear the buffer for(int i = 0 ; i < messages.length ; i ++) { buffer.append(String.valueOf(messages[i])); } print(buffer); } }
/** * Prints the concatenated text representation of the arguments and a new line. * * @param messages the messages to print */ public static void printConcatLine(Object... messages) { if (!isDisabled()) { buffer.setLength(0); // Clear the buffer for(int i = 0 ; i < messages.length ; i ++) { buffer.append(String.valueOf(messages[i])); } printLine(buffer); } }
/** * Prints a message. * * @param message the message */ public static void print(String message) { if (!isDisabled()) { try { getOutput().write(message.getBytes()); } catch (IOException e) { e.printStackTrace(); } } }
if (!Log.isDisabled()) { for (ContainerVm vm : vmsToMigrateFromUnderUtilizedHost) { Log.print(vm.getId() + " ");
/** * Prints the over utilized hosts. * * @param overUtilizedHosts the over utilized hosts */ protected void printOverUtilizedHosts(List<PowerContainerHostUtilizationHistory> overUtilizedHosts) { if (!Log.isDisabled()) { Log.printLine("Over-utilized hosts:"); for (PowerContainerHostUtilizationHistory host : overUtilizedHosts) { Log.printConcatLine("Host #", host.getId()); } Log.printLine(); } }
/** * Prints the over utilized hosts. * * @param overUtilizedHosts the over utilized hosts */ protected void printOverUtilizedHosts(List<PowerHostUtilizationHistory> overUtilizedHosts) { if (!Log.isDisabled()) { Log.printLine("Over-utilized hosts:"); for (PowerHostUtilizationHistory host : overUtilizedHosts) { Log.printConcatLine("Host #", host.getId()); } Log.printLine(); } }
if (!Log.isDisabled()) { for (Container container : containersToMigrateFromUnderUtilizedHost) { Log.print(container.getId() + " ");
if (!Log.isDisabled()) { for (ContainerVm vm : vmsToMigrateFromUnderUtilizedHost) { Log.print(vm.getId() + " ");
if (!Log.isDisabled()) { for (Vm vm : vmsToMigrateFromUnderUtilizedHost) { Log.print(vm.getId() + " ");
/** * Allocates a host for a given VM. * * @param vm a virtual machine. * * @return <code>true</code> if the host could be allocated; * <code>false</code> otherwise. */ @Override public boolean allocateHostForVm(Vm vm) { PowerHost allocatedHost = findHostForVm(vm); if (allocatedHost != null && allocatedHost.vmCreate(vm)) { //if vm has been succesfully created in the host getVmTable().put(vm.getUid(), allocatedHost); if (!Log.isDisabled()) { Log.print(String.format("%.2f: VM #" + vm.getId() + " has been allocated to the host #" + allocatedHost.getId() + "\n", CloudSim.clock())); } return true; } return false; }
vm = VmList.getById(getVmsCreatedList(), cloudlet.getVmId()); if (vm == null) { // vm was not created if(!Log.isDisabled()) { Log.printConcatLine(CloudSim.clock(), ": ", getName(), ": Postponing execution of cloudlet ", cloudlet.getCloudletId(), ": bount VM not available"); if (!Log.isDisabled()) { Log.printConcatLine(CloudSim.clock(), ": ", getName(), ": Sending cloudlet ", cloudlet.getCloudletId(), " to VM #", vm.getId());
double totalAllocatedMips = getVmScheduler().getTotalAllocatedMipsForVm(vm); if (!Log.isDisabled()) { Log.formatLine( "%.2f: [Host #" + getId() + "] Total allocated MIPS for VM #" + vm.getId()
double totalAllocatedMips = getContainerVmScheduler().getTotalAllocatedMipsForContainerVm(containerVm); if (!Log.isDisabled()) { Log.formatLine( "%.2f: [Host #" + getId() + "] Total allocated MIPS for VM #" + containerVm.getId()