@Test public void testToConfigurationNodes() { Subnet subnet0 = getTestSubnet(Prefix.parse("1.1.1.0/24"), "subnet0", "vpc"); Subnet subnet1 = getTestSubnet(Prefix.parse("1.1.1.0/24"), "subnet1", "vpc"); ElasticsearchDomain esd = new ElasticsearchDomain( "arn", "es-domain", "vpc", "vpcendpoint", 4, ImmutableList.of("sg"), ImmutableList.of(subnet0.getId(), subnet1.getId()), true); List<Configuration> configurations = esd.toConfigurationNodes( new ConvertedConfiguration(), Region.builder("r1") .setSubnets(ImmutableMap.of(subnet0.getId(), subnet0, subnet1.getId(), subnet1)) .build(), new Warnings()); assertThat( configurations.stream() .map(Configuration::getHostname) .collect(ImmutableList.toImmutableList()), equalTo( IntStream.range(0, esd.getInstanceCount()) .mapToObj(i -> getNodeName(i, esd.getId(), esd.getVpcEndpoint())) .collect(ImmutableList.toImmutableList()))); }
public List<Configuration> toConfigurationNodes( ConvertedConfiguration awsConfiguration, Region region, Warnings warnings) { return IntStream.range(0, _instanceCount) .mapToObj( instanceNum -> toConfigurationNode( instanceNum, _subnets.get(instanceNum % _subnets.size()), awsConfiguration, region, warnings)) .filter(Objects::nonNull) .collect(ImmutableList.toImmutableList()); }
ElasticsearchDomain implements AwsVpcEntity, Serializable { public List<Configuration> toConfigurationNodes( ConvertedConfiguration awsConfiguration, Region region, Warnings warnings) { return IntStream.range(0, _instanceCount) .mapToObj( instanceNum -> toConfigurationNode( instanceNum, _subnets.get(instanceNum % _subnets.size()), awsConfiguration, region, warnings)) .filter(Objects::nonNull) .collect(ImmutableList.toImmutableList()); } }
ElasticsearchDomain implements AwsVpcEntity, Serializable { public List<Configuration> toConfigurationNodes( ConvertedConfiguration awsConfiguration, Region region, Warnings warnings) { return IntStream.range(0, _instanceCount) .mapToObj( instanceNum -> toConfigurationNode( instanceNum, _subnets.get(instanceNum % _subnets.size()), awsConfiguration, region, warnings)) .filter(Objects::nonNull) .collect(ImmutableList.toImmutableList()); } ElasticsearchDomain(
      String arn,
      String domainName,
      @Nullable String vpcId,
      @Nullable String vpcEndpoint,
      int instanceCount,
      List<String> securityGroups,
      List<String> subnets,
      boolean available); }
ElasticsearchDomain implements AwsVpcEntity, Serializable { public List<Configuration> toConfigurationNodes( ConvertedConfiguration awsConfiguration, Region region, Warnings warnings) { return IntStream.range(0, _instanceCount) .mapToObj( instanceNum -> toConfigurationNode( instanceNum, _subnets.get(instanceNum % _subnets.size()), awsConfiguration, region, warnings)) .filter(Objects::nonNull) .collect(ImmutableList.toImmutableList()); } ElasticsearchDomain(
      String arn,
      String domainName,
      @Nullable String vpcId,
      @Nullable String vpcEndpoint,
      int instanceCount,
      List<String> securityGroups,
      List<String> subnets,
      boolean available); boolean getAvailable(); @Nonnull String getDomainName(); @Override String getId(); int getInstanceCount(); @Nonnull List<String> getSecurityGroups(); @Nonnull List<String> getSubnets(); @Nullable String getVpcEndpoint(); @Nullable String getVpcId(); List<Configuration> toConfigurationNodes(
      ConvertedConfiguration awsConfiguration, Region region, Warnings warnings); @Override boolean equals(Object o); @Override int hashCode(); }
ElasticsearchDomain implements AwsVpcEntity, Serializable { public List<Configuration> toConfigurationNodes( ConvertedConfiguration awsConfiguration, Region region, Warnings warnings) { return IntStream.range(0, _instanceCount) .mapToObj( instanceNum -> toConfigurationNode( instanceNum, _subnets.get(instanceNum % _subnets.size()), awsConfiguration, region, warnings)) .filter(Objects::nonNull) .collect(ImmutableList.toImmutableList()); } ElasticsearchDomain(
      String arn,
      String domainName,
      @Nullable String vpcId,
      @Nullable String vpcEndpoint,
      int instanceCount,
      List<String> securityGroups,
      List<String> subnets,
      boolean available); boolean getAvailable(); @Nonnull String getDomainName(); @Override String getId(); int getInstanceCount(); @Nonnull List<String> getSecurityGroups(); @Nonnull List<String> getSubnets(); @Nullable String getVpcEndpoint(); @Nullable String getVpcId(); List<Configuration> toConfigurationNodes(
      ConvertedConfiguration awsConfiguration, Region region, Warnings warnings); @Override boolean equals(Object o); @Override int hashCode();  }