OneSizeFitsQuorum commented on code in PR #16869:
URL: https://github.com/apache/iotdb/pull/16869#discussion_r2589447283
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/allocation/AbstractNodeAllocationStrategy.java:
##########
@@ -57,6 +57,10 @@ protected AbstractNodeAllocationStrategy() {
protected IWALNode createWALNode(String identifier) {
try {
+ if (folderManager == null) {
+ folderManager = new FolderManager(
+ Arrays.asList(commonConfig.getWalDirs()),
DirectoryStrategyType.SEQUENCE_STRATEGY);
+ }
Review Comment:
these codes are already in locks, so there is no need to use synchronized.
But I will use AtomicReference just in case
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/allocation/AbstractNodeAllocationStrategy.java:
##########
@@ -57,6 +57,10 @@ protected AbstractNodeAllocationStrategy() {
protected IWALNode createWALNode(String identifier) {
try {
+ if (folderManager == null) {
+ folderManager = new FolderManager(
+ Arrays.asList(commonConfig.getWalDirs()),
DirectoryStrategyType.SEQUENCE_STRATEGY);
+ }
Review Comment:
These codes are already in locks, so there is no need to use synchronized.
But I will use AtomicReference just in case
--
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]