import org.openspaces.admin.zone.config.AnyZonesConfig;
import org.openspaces.core.util.MemoryUnit;
public class ElasticScaleConfigFactory {
private static final String SCALING_RULE_MUST_SPECIFY_SERVICE_STATISTICS_ERROR_MSG = "scalingRule must specify serviceStatistics (either a closure or reference a predefined serviceStatistics name).";
private static final Logger logger = Logger.getLogger(ElasticScaleConfigFactory.class.getName());
<BUG>public static ManualCapacityScaleConfig createManualCapacityScaleConfig(int totalMemoryInMB, boolean locationAware) {
ManualCapacityScaleConfig config = new ManualCapacityScaleConfigurer()
.memoryCapacity(totalMemoryInMB, MemoryUnit.MEGABYTES)
.atMostOneContainerPerMachine()

.create();
config.setGridServiceAgentZonesAware(locationAware);</BUG>
return config;

import org.openspaces.admin.zone.config.AnyZonesConfig;
import org.openspaces.core.util.MemoryUnit;
public class ElasticScaleConfigFactory {
private static final String SCALING_RULE_MUST_SPECIFY_SERVICE_STATISTICS_ERROR_MSG = "scalingRule must specify serviceStatistics (either a closure or reference a predefined serviceStatistics name).";
private static final Logger logger = Logger.getLogger(ElasticScaleConfigFactory.class.getName());
public static ManualCapacityScaleConfig createManualCapacityScaleConfig(int totalMemoryInMB,
double totalCpuCores,
boolean locationAware, boolean shared) {
ManualCapacityScaleConfig config = new ManualCapacityScaleConfigurer()
.memoryCapacity(totalMemoryInMB, MemoryUnit.MEGABYTES)
.numberOfCpuCores(totalCpuCores)
.create();
if (!shared) {
config.setAtMostOneContainerPerMachine(true);
