Commit 5c5c8cd5 authored by Nikolay's avatar Nikolay

Performance improvement of DatcenterBroker::submitCloudlets().

parent 2faca426
......@@ -340,6 +340,7 @@ public class DatacenterBroker extends SimEntity {
*/
protected void submitCloudlets() {
int vmIndex = 0;
List<Cloudlet> successfullySubmitted = new ArrayList<Cloudlet>();
for (Cloudlet cloudlet : getCloudletList()) {
Vm vm;
// if user didn't bind this cloudlet and it has not been executed yet
......@@ -361,12 +362,11 @@ public class DatacenterBroker extends SimEntity {
cloudletsSubmitted++;
vmIndex = (vmIndex + 1) % getVmsCreatedList().size();
getCloudletSubmittedList().add(cloudlet);
successfullySubmitted.add(cloudlet);
}
// remove submitted cloudlets from waiting list
for (Cloudlet cloudlet : getCloudletSubmittedList()) {
getCloudletList().remove(cloudlet);
}
getCloudletList().removeAll(successfullySubmitted);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment