Manage subnets and when launching EMR clusters using Instance Fleet
Log validSubnetIds
@@ -489,17 +489,18 @@ public class EmrHelperServiceImpl implements EmrHelperService
List<Subnet> subnets = emrPricingHelper.getSubnets(emrClusterDefinition, awsParamsDto);
+ List<String> validSubnetIds = subnets.stream()
+ .filter(subnet -> subnet.getAvailableIpAddressCount() >= instanceFleetMinimumIpAvailableFilter)
+ .map(Subnet::getSubnetId).collect(Collectors.toList());
+
String contextInfo = String.format("namespace=\"%s\" emrClusterDefinitionName=\"%s\" emrClusterName=\"%s\" " +
- "instanceFleetMinimumIpAvailableFilter=%s subnetAvailableIpAddressCounts=%s", emrClusterAlternateKeyDto.getNamespace(),
+ "instanceFleetMinimumIpAvailableFilter=%s subnetAvailableIpAddressCounts=%s validSubnetIds=%s", emrClusterAlternateKeyDto.getNamespace(),
emrClusterAlternateKeyDto.getEmrClusterDefinitionName(), emrClusterAlternateKeyDto.getEmrClusterName(), instanceFleetMinimumIpAvailableFilter,
- jsonHelper.objectToJson(subnets.stream().collect(Collectors.toMap(Subnet::getSubnetId, Subnet::getAvailableIpAddressCount))));
+ jsonHelper.objectToJson(subnets.stream().collect(Collectors.toMap(Subnet::getSubnetId, Subnet::getAvailableIpAddressCount))),
+ validSubnetIds.toString());
LOGGER.info("Current IP availability: {}", contextInfo);
- List<String> validSubnetIds = subnets.stream()
- .filter(subnet -> subnet.getAvailableIpAddressCount() >= instanceFleetMinimumIpAvailableFilter)
- .map(Subnet::getSubnetId).collect(Collectors.toList());
-
if (validSubnetIds.isEmpty())
{
throw new IllegalArgumentException( "Specified subnets do not have enough available IP addresses required for the instance fleet. " +
