private static void createMetadata()

in infrastructure/src/main/java/org/apache/geode/infrastructure/aws/LaunchCluster.java [283:300]


  private static void createMetadata(String benchmarkTag, List<String> publicIps)
      throws IOException {
    UUID instanceId = UUID.randomUUID();
    Properties metadata = new Properties(System.getProperties());
    metadata.setProperty("benchmark.instanceId", instanceId.toString());
    metadata.setProperty("benchmark.publicIps", String.join(",", publicIps));
    Path configDirectory = Paths.get(BenchmarkMetadata.benchmarkConfigDirectory());

    if (!configDirectory.toFile().exists()) {
      Files.createDirectories(Paths.get(BenchmarkMetadata.benchmarkConfigDirectory()));
    }

    Path metadataPath = Paths.get(AwsBenchmarkMetadata.metadataFileName(benchmarkTag));
    try (FileWriter writer = new FileWriter(metadataPath.toFile())) {
      metadata.store(writer, "Benchmark metadata generated during cluster launch");
    }
    Files.setPosixFilePermissions(metadataPath, PosixFilePermissions.fromString("rw-------"));
  }