/** * Returns the task instance definition. Returns null if no task definition is specified. * * @param emrClusterDefinition the EMR cluster definition * * @return the task instance definition, or null */ private InstanceDefinition getTaskInstanceDefinition(EmrClusterDefinition emrClusterDefinition) { return emrClusterDefinition.getInstanceDefinitions().getTaskInstances(); }
/** * Returns the task instance definition. Returns null if no task definition is specified. * * @param emrClusterDefinition the EMR cluster definition * * @return the task instance definition, or null */ private InstanceDefinition getTaskInstanceDefinition(EmrClusterDefinition emrClusterDefinition) { return emrClusterDefinition.getInstanceDefinitions().getTaskInstances(); }
/** * Returns {@code true} if the supplied InstanceDefinitions is {@code null} or empty (contains no elements). * * @param instanceDefinitions the instance group definitions from the EMR cluster definition * * @return whether the given InstanceDefinitions is empty */ public boolean isInstanceDefinitionsEmpty(InstanceDefinitions instanceDefinitions) { return (instanceDefinitions == null || (instanceDefinitions.getMasterInstances() == null && instanceDefinitions.getCoreInstances() == null && instanceDefinitions.getTaskInstances() == null)); }
/** * Returns {@code true} if the supplied InstanceDefinitions is {@code null} or empty (contains no elements). * * @param instanceDefinitions the instance group definitions from the EMR cluster definition * * @return whether the given InstanceDefinitions is empty */ public boolean isInstanceDefinitionsEmpty(InstanceDefinitions instanceDefinitions) { return (instanceDefinitions == null || (instanceDefinitions.getMasterInstances() == null && instanceDefinitions.getCoreInstances() == null && instanceDefinitions.getTaskInstances() == null)); }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { { MasterInstanceDefinition theMasterInstances; theMasterInstances = this.getMasterInstances(); strategy.appendField(locator, this, "masterInstances", buffer, theMasterInstances, (this.masterInstances!= null)); } { InstanceDefinition theCoreInstances; theCoreInstances = this.getCoreInstances(); strategy.appendField(locator, this, "coreInstances", buffer, theCoreInstances, (this.coreInstances!= null)); } { InstanceDefinition theTaskInstances; theTaskInstances = this.getTaskInstances(); strategy.appendField(locator, this, "taskInstances", buffer, theTaskInstances, (this.taskInstances!= null)); } return buffer; }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { { MasterInstanceDefinition theMasterInstances; theMasterInstances = this.getMasterInstances(); strategy.appendField(locator, this, "masterInstances", buffer, theMasterInstances, (this.masterInstances!= null)); } { InstanceDefinition theCoreInstances; theCoreInstances = this.getCoreInstances(); strategy.appendField(locator, this, "coreInstances", buffer, theCoreInstances, (this.coreInstances!= null)); } { InstanceDefinition theTaskInstances; theTaskInstances = this.getTaskInstances(); strategy.appendField(locator, this, "taskInstances", buffer, theTaskInstances, (this.taskInstances!= null)); } return buffer; }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { { MasterInstanceDefinition theMasterInstances; theMasterInstances = this.getMasterInstances(); strategy.appendField(locator, this, "masterInstances", buffer, theMasterInstances, (this.masterInstances!= null)); } { InstanceDefinition theCoreInstances; theCoreInstances = this.getCoreInstances(); strategy.appendField(locator, this, "coreInstances", buffer, theCoreInstances, (this.coreInstances!= null)); } { InstanceDefinition theTaskInstances; theTaskInstances = this.getTaskInstances(); strategy.appendField(locator, this, "taskInstances", buffer, theTaskInstances, (this.taskInstances!= null)); } return buffer; }
if (instanceDefinitions.getTaskInstances() != null) instanceGroupConfigs.add(getInstanceGroupConfig(InstanceRoleType.TASK, instanceDefinitions.getTaskInstances().getInstanceType(), instanceDefinitions.getTaskInstances().getInstanceCount(), instanceDefinitions.getTaskInstances().getInstanceSpotPrice(), instanceDefinitions.getTaskInstances().getEbsConfiguration()));
if (instanceDefinitions.getTaskInstances() != null) instanceGroupConfigs.add(getInstanceGroupConfig(InstanceRoleType.TASK, instanceDefinitions.getTaskInstances().getInstanceType(), instanceDefinitions.getTaskInstances().getInstanceCount(), instanceDefinitions.getTaskInstances().getInstanceSpotPrice(), instanceDefinitions.getTaskInstances().getEbsConfiguration()));
lhsTaskInstances = this.getTaskInstances(); InstanceDefinition rhsTaskInstances; rhsTaskInstances = that.getTaskInstances(); if (!strategy.equals(LocatorUtils.property(thisLocator, "taskInstances", lhsTaskInstances), LocatorUtils.property(thatLocator, "taskInstances", rhsTaskInstances), lhsTaskInstances, rhsTaskInstances, (this.taskInstances!= null), (that.taskInstances!= null))) { return false;
lhsTaskInstances = this.getTaskInstances(); InstanceDefinition rhsTaskInstances; rhsTaskInstances = that.getTaskInstances(); if (!strategy.equals(LocatorUtils.property(thisLocator, "taskInstances", lhsTaskInstances), LocatorUtils.property(thatLocator, "taskInstances", rhsTaskInstances), lhsTaskInstances, rhsTaskInstances, (this.taskInstances!= null), (that.taskInstances!= null))) { return false;
lhsTaskInstances = this.getTaskInstances(); InstanceDefinition rhsTaskInstances; rhsTaskInstances = that.getTaskInstances(); if (!strategy.equals(LocatorUtils.property(thisLocator, "taskInstances", lhsTaskInstances), LocatorUtils.property(thatLocator, "taskInstances", rhsTaskInstances), lhsTaskInstances, rhsTaskInstances, (this.taskInstances!= null), (that.taskInstances!= null))) { return false;
public int hashCode(ObjectLocator locator, HashCodeStrategy2 strategy) { int currentHashCode = 1; { MasterInstanceDefinition theMasterInstances; theMasterInstances = this.getMasterInstances(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "masterInstances", theMasterInstances), currentHashCode, theMasterInstances, (this.masterInstances!= null)); } { InstanceDefinition theCoreInstances; theCoreInstances = this.getCoreInstances(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "coreInstances", theCoreInstances), currentHashCode, theCoreInstances, (this.coreInstances!= null)); } { InstanceDefinition theTaskInstances; theTaskInstances = this.getTaskInstances(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "taskInstances", theTaskInstances), currentHashCode, theTaskInstances, (this.taskInstances!= null)); } return currentHashCode; }
public int hashCode(ObjectLocator locator, HashCodeStrategy2 strategy) { int currentHashCode = 1; { MasterInstanceDefinition theMasterInstances; theMasterInstances = this.getMasterInstances(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "masterInstances", theMasterInstances), currentHashCode, theMasterInstances, (this.masterInstances!= null)); } { InstanceDefinition theCoreInstances; theCoreInstances = this.getCoreInstances(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "coreInstances", theCoreInstances), currentHashCode, theCoreInstances, (this.coreInstances!= null)); } { InstanceDefinition theTaskInstances; theTaskInstances = this.getTaskInstances(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "taskInstances", theTaskInstances), currentHashCode, theTaskInstances, (this.taskInstances!= null)); } return currentHashCode; }
public int hashCode(ObjectLocator locator, HashCodeStrategy2 strategy) { int currentHashCode = 1; { MasterInstanceDefinition theMasterInstances; theMasterInstances = this.getMasterInstances(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "masterInstances", theMasterInstances), currentHashCode, theMasterInstances, (this.masterInstances!= null)); } { InstanceDefinition theCoreInstances; theCoreInstances = this.getCoreInstances(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "coreInstances", theCoreInstances), currentHashCode, theCoreInstances, (this.coreInstances!= null)); } { InstanceDefinition theTaskInstances; theTaskInstances = this.getTaskInstances(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "taskInstances", theTaskInstances), currentHashCode, theTaskInstances, (this.taskInstances!= null)); } return currentHashCode; }
/** * The definition will have it's best price search criteria information removed after being updated by the algorithm. This method asserts that is the case. * The task instance information is optional. Task instances will only be validated if it was given in the original definition. * * @param emrClusterDefinition - The definition updated by the algorithm */ private void assertBestPriceCriteriaRemoved(EmrClusterDefinition emrClusterDefinition) { assertNull("master instance max search price was not removed", emrClusterDefinition.getInstanceDefinitions().getMasterInstances().getInstanceMaxSearchPrice()); assertNull("master instance on-demand threshold was not removed", emrClusterDefinition.getInstanceDefinitions().getMasterInstances().getInstanceOnDemandThreshold()); assertNull("core instance max search price was not removed", emrClusterDefinition.getInstanceDefinitions().getCoreInstances().getInstanceMaxSearchPrice()); assertNull("core instance on-demand threshold was not removed", emrClusterDefinition.getInstanceDefinitions().getCoreInstances().getInstanceOnDemandThreshold()); if (emrClusterDefinition.getInstanceDefinitions().getTaskInstances() != null) { assertNull("task instance max search price was not removed", emrClusterDefinition.getInstanceDefinitions().getTaskInstances().getInstanceMaxSearchPrice()); assertNull("task instance on-demand threshold was not removed", emrClusterDefinition.getInstanceDefinitions().getTaskInstances().getInstanceOnDemandThreshold()); } }
if (taskInstancesShouldBeCopiedAndSet == Boolean.TRUE) { InstanceDefinition sourceTaskInstances; sourceTaskInstances = this.getTaskInstances(); InstanceDefinition copyTaskInstances = ((InstanceDefinition) strategy.copy(LocatorUtils.property(locator, "taskInstances", sourceTaskInstances), sourceTaskInstances, (this.taskInstances!= null))); copy.setTaskInstances(copyTaskInstances);
emrClusterDefinition.getInstanceDefinitions().getMasterInstances().getInstanceSpotPrice()); assertEquals("core instance bid price", ON_DEMAND, emrClusterDefinition.getInstanceDefinitions().getCoreInstances().getInstanceSpotPrice()); assertEquals("task instance bid price", ON_DEMAND, emrClusterDefinition.getInstanceDefinitions().getTaskInstances().getInstanceSpotPrice());
assertEquals("master instance bid price", ON_DEMAND, emrClusterDefinition.getInstanceDefinitions().getMasterInstances().getInstanceSpotPrice()); assertEquals("core instance bid price", SPOT_PRICE_VERY_HIGH, emrClusterDefinition.getInstanceDefinitions().getCoreInstances().getInstanceSpotPrice()); assertEquals("task instance bid price", ON_DEMAND, emrClusterDefinition.getInstanceDefinitions().getTaskInstances().getInstanceSpotPrice());
emrClusterDefinition.getInstanceDefinitions().getMasterInstances().getInstanceSpotPrice()); assertEquals("core instance bid price", ON_DEMAND, emrClusterDefinition.getInstanceDefinitions().getCoreInstances().getInstanceSpotPrice()); assertEquals("task instance bid price", ON_DEMAND, emrClusterDefinition.getInstanceDefinitions().getTaskInstances().getInstanceSpotPrice());