public enum StrictPoolSizeCalculationStrategy extends Enum<StrictPoolSizeCalculationStrategy> implements PoolSizeCalculationStrategy
PoolSizeCalculationStrategy that ignores current machine pools and
the statuses of the machines therein, and merely strictly enforces the
fractions as given by the priorities and configuration order of the cloud
adapters.
This class is a thread-safe singleton. The singleton instance only provides only a function of its inputs.
| Enum Constant and Description |
|---|
INSTANCE
The only instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
Map<PrioritizedRemoteCloudAdapter,Long> |
calculatePoolSizes(Map<PrioritizedRemoteCloudAdapter,MachinePool> currentMachinePools,
com.google.common.collect.ImmutableList<PrioritizedRemoteCloudAdapter> cloudAdapters,
long desiredTotalSize)
Calculates the correct pool sizes for the given cloud adapters.
|
static StrictPoolSizeCalculationStrategy |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static StrictPoolSizeCalculationStrategy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final StrictPoolSizeCalculationStrategy INSTANCE
public static StrictPoolSizeCalculationStrategy[] values()
for (StrictPoolSizeCalculationStrategy c : StrictPoolSizeCalculationStrategy.values()) System.out.println(c);
public static StrictPoolSizeCalculationStrategy valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic Map<PrioritizedRemoteCloudAdapter,Long> calculatePoolSizes(Map<PrioritizedRemoteCloudAdapter,MachinePool> currentMachinePools, com.google.common.collect.ImmutableList<PrioritizedRemoteCloudAdapter> cloudAdapters, long desiredTotalSize) throws CloudAdapterException
PoolSizeCalculationStrategycalculatePoolSizes in interface PoolSizeCalculationStrategycurrentMachinePools - The current machine pools, for each adapter.cloudAdapters - The cloud adapters, in the order in which they were
configured, should that matter to the calculation.desiredTotalSize - The desired total pool size.CloudAdapterException - Thrown if there is an error, e.g., while querying current
machine pools from the cloud adapters.Copyright © 2011–2014 elastisys. All rights reserved.