dlmarion opened a new issue, #3514: URL: https://github.com/apache/accumulo/issues/3514
There are several places in the code (below) where Gson instances are created. According to its [javadoc](https://www.javadoc.io/doc/com.google.code.gson/gson/latest/com.google.gson/com/google/gson/Gson.html) (3rd sentence), it's thread-safe. Of course, you don't want to reuse an instance if it's configured differently. We should consolidate where these are located in the code to a single place. ``` core/src/main/java/org/apache/accumulo/core/metadata/schema/ExternalCompactionMetadata.java: private static final Gson GSON = new Gson(); core/src/main/java/org/apache/accumulo/core/metadata/schema/ExternalCompactionFinalState.java: private static final Gson GSON = new Gson(); core/src/main/java/org/apache/accumulo/core/metadata/schema/RootTabletMetadata.java: private final Gson gson = new Gson(); core/src/main/java/org/apache/accumulo/core/clientImpl/bulk/BulkSerialize.java: new Gson().toJson(oldToNewNameMap, writer); core/src/main/java/org/apache/accumulo/core/spi/compaction/DefaultCompactionPlanner.java: new Gson().fromJson(params.getOptions().get("executors"), ExecutorConfig[].class); core/src/main/java/org/apache/accumulo/core/spi/scan/ConfigurableScanServerSelector.java: Gson gson = new Gson(); core/src/main/java/org/apache/accumulo/core/lock/ServiceLockData.java: private static final Gson gson = new Gson(); server/base/src/main/java/org/apache/accumulo/server/metadata/RootGcCandidates.java: private final Gson gson = new Gson(); server/monitor/src/main/java/org/apache/accumulo/monitor/util/logging/AccumuloMonitorAppender.java: private final Gson gson = new Gson(); server/manager/src/main/java/org/apache/accumulo/manager/tableOps/TraceRepo.java: return repo.getClass() + " " + new Gson().toJson(repo, repo.getClass()); test/src/main/java/org/apache/accumulo/test/CountNameNodeOpsBulkIT.java: Map<?,?> jsonObject = new Gson().fromJson(jsonString, Map.class); ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
