This is an automated email from the ASF dual-hosted git repository.
domgarguilo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/main by this push:
new 4d1f7a0a1d Use Properties.store for MAC config props (#6179)
4d1f7a0a1d is described below
commit 4d1f7a0a1d3f08d89e718d42d3b892a9e32d4fed
Author: Dom G. <[email protected]>
AuthorDate: Thu Mar 5 12:46:43 2026 -0500
Use Properties.store for MAC config props (#6179)
---
.../miniclusterImpl/MiniAccumuloClusterImpl.java | 9 +-
.../test/ScanServerGroupConfigurationIT.java | 105 +++++++++++----------
2 files changed, 59 insertions(+), 55 deletions(-)
diff --git
a/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java
b/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java
index 5a7485a07f..021766179c 100644
---
a/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java
+++
b/minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java
@@ -502,12 +502,15 @@ public class MiniAccumuloClusterImpl implements
AccumuloCluster {
private void writeConfigProperties(java.nio.file.Path file,
Map<String,String> settings)
throws IOException {
- BufferedWriter fileWriter = Files.newBufferedWriter(file);
+ Properties props = new Properties();
for (Entry<String,String> entry : settings.entrySet()) {
- fileWriter.append(entry.getKey() + "=" + entry.getValue() + "\n");
+ props.setProperty(entry.getKey(), entry.getValue());
+ }
+
+ try (BufferedWriter fileWriter = Files.newBufferedWriter(file)) {
+ props.store(fileWriter, null);
}
- fileWriter.close();
}
private Configuration loadExistingHadoopConfiguration() {
diff --git
a/test/src/main/java/org/apache/accumulo/test/ScanServerGroupConfigurationIT.java
b/test/src/main/java/org/apache/accumulo/test/ScanServerGroupConfigurationIT.java
index 725b098886..e2ebe4b0db 100644
---
a/test/src/main/java/org/apache/accumulo/test/ScanServerGroupConfigurationIT.java
+++
b/test/src/main/java/org/apache/accumulo/test/ScanServerGroupConfigurationIT.java
@@ -45,58 +45,59 @@ import org.junit.jupiter.api.Test;
public class ScanServerGroupConfigurationIT extends SharedMiniClusterBase {
- // @formatter:off
- public static final String clientConfiguration =
- "["+
- " {"+
- " \"isDefault\": true,"+
- " \"maxBusyTimeout\": \"5m\","+
- " \"busyTimeoutMultiplier\": 8,"+
- " \"scanTypeActivations\": [],"+
- " \"timeToWaitForScanServers\":\"0s\","+
- " \"attemptPlans\": ["+
- " {"+
- " \"servers\": \"3\","+
- " \"busyTimeout\": \"33ms\","+
- " \"salt\": \"one\""+
- " },"+
- " {"+
- " \"servers\": \"13\","+
- " \"busyTimeout\": \"33ms\","+
- " \"salt\": \"two\""+
- " },"+
- " {"+
- " \"servers\": \"100%\","+
- " \"busyTimeout\": \"33ms\""+
- " }"+
- " ]"+
- " },"+
- " {"+
- " \"isDefault\": false,"+
- " \"maxBusyTimeout\": \"5m\","+
- " \"busyTimeoutMultiplier\": 8,"+
- " \"group\": \"GROUP1\","+
- " \"scanTypeActivations\": [\"use_group1\"],"+
- " \"timeToWaitForScanServers\":\"0s\","+
- " \"attemptPlans\": ["+
- " {"+
- " \"servers\": \"3\","+
- " \"busyTimeout\": \"33ms\","+
- " \"salt\": \"one\""+
- " },"+
- " {"+
- " \"servers\": \"13\","+
- " \"busyTimeout\": \"33ms\","+
- " \"salt\": \"two\""+
- " },"+
- " {"+
- " \"servers\": \"100%\","+
- " \"busyTimeout\": \"33ms\""+
- " }"+
- " ]"+
- " }"+
- "]";
- // @formatter:on
+ public static final String clientConfiguration = """
+ [
+ {
+ "isDefault": true,
+ "maxBusyTimeout": "5m",
+ "busyTimeoutMultiplier": 8,
+ "scanTypeActivations": [],
+ "timeToWaitForScanServers": "0s",
+ "attemptPlans": [
+ {
+ "servers": "3",
+ "busyTimeout": "33ms",
+ "salt": "one"
+ },
+ {
+ "servers": "13",
+ "busyTimeout": "33ms",
+ "salt": "two"
+ },
+ {
+ "servers": "100%",
+ "busyTimeout": "33ms"
+ }
+ ]
+ },
+ {
+ "isDefault": false,
+ "maxBusyTimeout": "5m",
+ "busyTimeoutMultiplier": 8,
+ "group": "GROUP1",
+ "scanTypeActivations": [
+ "use_group1"
+ ],
+ "timeToWaitForScanServers": "0s",
+ "attemptPlans": [
+ {
+ "servers": "3",
+ "busyTimeout": "33ms",
+ "salt": "one"
+ },
+ {
+ "servers": "13",
+ "busyTimeout": "33ms",
+ "salt": "two"
+ },
+ {
+ "servers": "100%",
+ "busyTimeout": "33ms"
+ }
+ ]
+ }
+ ]
+ """;
private static class Config implements MiniClusterConfigurationCallback {
@Override