All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.cloudbus.cloudsim.allocationpolicies.migration.VmAllocationPolicyMigrationNull Maven / Gradle / Ivy

Go to download

CloudSim Plus: A modern, highly extensible and easier-to-use Java 8+ Framework for Modeling and Simulation of Cloud Computing Infrastructures and Services

There is a newer version: 8.0.0
Show newest version
package org.cloudbus.cloudsim.allocationpolicies.migration;

import org.cloudbus.cloudsim.allocationpolicies.VmAllocationPolicy;
import org.cloudbus.cloudsim.datacenters.Datacenter;
import org.cloudbus.cloudsim.hosts.Host;
import org.cloudbus.cloudsim.hosts.HostSuitability;
import org.cloudbus.cloudsim.selectionpolicies.VmSelectionPolicy;
import org.cloudbus.cloudsim.vms.Vm;
import org.cloudsimplus.autoscaling.VerticalVmScaling;

import java.util.*;
import java.util.function.BiFunction;

/**
 * A class that implements the Null Object Design Pattern for {@link VmAllocationPolicyMigration}
 * class.
 *
 * @author Manoel Campos da Silva Filho
 * @see VmAllocationPolicyMigration#NULL
 */
final class VmAllocationPolicyMigrationNull implements VmAllocationPolicyMigration {
    @Override public Datacenter getDatacenter() { return Datacenter.NULL; }
    @Override public void setDatacenter(Datacenter datacenter) {/**/}
    @Override public HostSuitability allocateHostForVm(Vm vm) { return HostSuitability.NULL; }
    @Override public HostSuitability allocateHostForVm(Vm vm, Host host) {
        return HostSuitability.NULL;
    }
    @Override public  List allocateHostForVm(Collection vmCollection) { return Collections.emptyList(); }
    @Override public boolean scaleVmVertically(VerticalVmScaling scaling) {
        return false;
    }
    @Override public void deallocateHostForVm(Vm vm) {/**/}
    @Override public Optional findHostForVm(Vm vm) { return Optional.empty(); }
    @Override public boolean isVmMigrationSupported() { return false; }
    @Override public int getHostCountForParallelSearch() { return 0; }
    @Override public void setHostCountForParallelSearch(int hostCountForParallelSearch) {/**/}
    @Override public  List getHostList() {
        return Collections.emptyList();
    }
    @Override public Map getOptimizedAllocationMap(List vmList) { return Collections.emptyMap(); }
    @Override public void setFindHostForVmFunction(BiFunction> findHostForVmFunction) {/**/}
    @Override public boolean isHostOverloaded(Host host) { return false; }
    @Override public boolean isHostUnderloaded(Host host) { return false; }
    @Override public double getOverUtilizationThreshold(Host host) { return 0; }
    @Override public void setVmSelectionPolicy(VmSelectionPolicy vmSelectionPolicy) {/**/}
    @Override public VmSelectionPolicy getVmSelectionPolicy() {
        return VmSelectionPolicy.NULL;
    }
    @Override public double getUnderUtilizationThreshold() {
        return 0;
    }
    @Override public void setUnderUtilizationThreshold(double underUtilizationThreshold) {/**/}
    @Override public boolean areHostsUnderloaded() { return false; }
    @Override public boolean areHostsOverloaded() { return false; }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy