You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by bu...@apache.org on 2020/06/02 22:55:42 UTC

[geode-benchmarks] 02/02: rewrite haproxy.cfg when it's modified

This is an automated email from the ASF dual-hosted git repository.

burcham pushed a commit to branch sni
in repository https://gitbox.apache.org/repos/asf/geode-benchmarks.git

commit b75f2e80f311ae37f5a6f708c572a37348a99edd
Author: Bill Burcham <bb...@pivotal.io>
AuthorDate: Tue Jun 2 15:55:22 2020 -0700

    rewrite haproxy.cfg when it's modified
---
 .../main/java/org/apache/geode/benchmark/tasks/StartSniProxy.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartSniProxy.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartSniProxy.java
index 3bdc987..296d8d9 100644
--- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartSniProxy.java
+++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartSniProxy.java
@@ -59,15 +59,15 @@ public class StartSniProxy implements Task {
         internalHostNamesFor(context, SERVER),
         externalHostNamesFor(context, SERVER, namings));
 
-    writeToFile(config, "haproxy.cfg");
+    rewriteFile(config, "haproxy.cfg");
 
     final ProcessControl processControl = new ProcessControl();
     processControl.runCommand(START_DOCKER_DAEMON_COMMAND);
     processControl.runCommand(START_PROXY_COMMAND);
   }
 
-  private void writeToFile(final String content, final String fileName) throws IOException {
-    try (final BufferedWriter writer = new BufferedWriter(new FileWriter(fileName))) {
+  private void rewriteFile(final String content, final String fileName) throws IOException {
+    try (final BufferedWriter writer = new BufferedWriter(new FileWriter(fileName, false))) {
       writer.write(content);
     }
   }