/** * Gets the core instance price in the cluster. * * @param emrClusterPrice the pricing information * * @return the core instance price */ private BigDecimal getEmrClusterCoreInstancePrice(EmrClusterPriceDto emrClusterPrice) { BigDecimal coreInstancePrice = BigDecimal.ZERO; if (emrClusterPrice.getCorePrice() != null) { coreInstancePrice = emrClusterPrice.getCorePrice().getInstancePrice(); } return coreInstancePrice; }
/** * Gets the core instance price in the cluster. * * @param emrClusterPrice the pricing information * * @return the core instance price */ private BigDecimal getEmrClusterCoreInstancePrice(EmrClusterPriceDto emrClusterPrice) { BigDecimal coreInstancePrice = BigDecimal.ZERO; if (emrClusterPrice.getCorePrice() != null) { coreInstancePrice = emrClusterPrice.getCorePrice().getInstancePrice(); } return coreInstancePrice; }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { { String theAvailabilityZone; theAvailabilityZone = this.getAvailabilityZone(); strategy.appendField(locator, this, "availabilityZone", buffer, theAvailabilityZone, (this.availabilityZone!= null)); } { Ec2PriceDto theMasterPrice; theMasterPrice = this.getMasterPrice(); strategy.appendField(locator, this, "masterPrice", buffer, theMasterPrice, (this.masterPrice!= null)); } { Ec2PriceDto theCorePrice; theCorePrice = this.getCorePrice(); strategy.appendField(locator, this, "corePrice", buffer, theCorePrice, (this.corePrice!= null)); } { Ec2PriceDto theTaskPrice; theTaskPrice = this.getTaskPrice(); strategy.appendField(locator, this, "taskPrice", buffer, theTaskPrice, (this.taskPrice!= null)); } return buffer; }
lhsCorePrice = this.getCorePrice(); Ec2PriceDto rhsCorePrice; rhsCorePrice = that.getCorePrice(); if (!strategy.equals(LocatorUtils.property(thisLocator, "corePrice", lhsCorePrice), LocatorUtils.property(thatLocator, "corePrice", rhsCorePrice), lhsCorePrice, rhsCorePrice, (this.corePrice!= null), (that.corePrice!= null))) { return false;
public int hashCode(ObjectLocator locator, HashCodeStrategy2 strategy) { int currentHashCode = 1; { String theAvailabilityZone; theAvailabilityZone = this.getAvailabilityZone(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "availabilityZone", theAvailabilityZone), currentHashCode, theAvailabilityZone, (this.availabilityZone!= null)); } { Ec2PriceDto theMasterPrice; theMasterPrice = this.getMasterPrice(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "masterPrice", theMasterPrice), currentHashCode, theMasterPrice, (this.masterPrice!= null)); } { Ec2PriceDto theCorePrice; theCorePrice = this.getCorePrice(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "corePrice", theCorePrice), currentHashCode, theCorePrice, (this.corePrice!= null)); } { Ec2PriceDto theTaskPrice; theTaskPrice = this.getTaskPrice(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "taskPrice", theTaskPrice), currentHashCode, theTaskPrice, (this.taskPrice!= null)); } return currentHashCode; }
/** * Updates the given definition with the given subnet and EMR pricing information. * <p/> * Sets the subnet with the given subnet ID. Removes any maxSearchPrice and onDemandThreshold that were set. Sets the spotPrice only if the given cluster * price is a spot. * * @param emrClusterDefinition the definition to update * @param bestEmrClusterSubnet the subnet to use * @param bestEmrClusterPrice the EMR pricing information for each instance */ private void updateInstanceDefinitionsWithBestPrice(EmrClusterDefinition emrClusterDefinition, Subnet bestEmrClusterSubnet, EmrClusterPriceDto bestEmrClusterPrice) { emrClusterDefinition.setSubnetId(bestEmrClusterSubnet.getSubnetId()); emrClusterDefinition.getInstanceDefinitions().getMasterInstances().setInstanceMaxSearchPrice(null); emrClusterDefinition.getInstanceDefinitions().getMasterInstances().setInstanceOnDemandThreshold(null); emrClusterDefinition.getInstanceDefinitions().getMasterInstances().setInstanceSpotPrice(getSpotBidPrice(bestEmrClusterPrice.getMasterPrice())); if (bestEmrClusterPrice.getCorePrice() != null) { emrClusterDefinition.getInstanceDefinitions().getCoreInstances().setInstanceMaxSearchPrice(null); emrClusterDefinition.getInstanceDefinitions().getCoreInstances().setInstanceOnDemandThreshold(null); emrClusterDefinition.getInstanceDefinitions().getCoreInstances().setInstanceSpotPrice(getSpotBidPrice(bestEmrClusterPrice.getCorePrice())); } }
/** * Updates the given definition with the given subnet and EMR pricing information. * <p/> * Sets the subnet with the given subnet ID. Removes any maxSearchPrice and onDemandThreshold that were set. Sets the spotPrice only if the given cluster * price is a spot. * * @param emrClusterDefinition the definition to update * @param bestEmrClusterSubnet the subnet to use * @param bestEmrClusterPrice the EMR pricing information for each instance */ private void updateInstanceDefinitionsWithBestPrice(EmrClusterDefinition emrClusterDefinition, Subnet bestEmrClusterSubnet, EmrClusterPriceDto bestEmrClusterPrice) { emrClusterDefinition.setSubnetId(bestEmrClusterSubnet.getSubnetId()); emrClusterDefinition.getInstanceDefinitions().getMasterInstances().setInstanceMaxSearchPrice(null); emrClusterDefinition.getInstanceDefinitions().getMasterInstances().setInstanceOnDemandThreshold(null); emrClusterDefinition.getInstanceDefinitions().getMasterInstances().setInstanceSpotPrice(getSpotBidPrice(bestEmrClusterPrice.getMasterPrice())); if (bestEmrClusterPrice.getCorePrice() != null) { emrClusterDefinition.getInstanceDefinitions().getCoreInstances().setInstanceMaxSearchPrice(null); emrClusterDefinition.getInstanceDefinitions().getCoreInstances().setInstanceOnDemandThreshold(null); emrClusterDefinition.getInstanceDefinitions().getCoreInstances().setInstanceSpotPrice(getSpotBidPrice(bestEmrClusterPrice.getCorePrice())); } }
if (corePriceShouldBeCopiedAndSet == Boolean.TRUE) { Ec2PriceDto sourceCorePrice; sourceCorePrice = this.getCorePrice(); Ec2PriceDto copyCorePrice = ((Ec2PriceDto) strategy.copy(LocatorUtils.property(locator, "corePrice", sourceCorePrice), sourceCorePrice, (this.corePrice!= null))); copy.setCorePrice(copyCorePrice);