@SuppressWarnings("squid:S2095")
  @Override
  public IWALNode applyForWALNode(String applicantUniqueId) {
    WALNode selectedNode;
    nodesLock.lock();
    try {
      if (walNodes.size() < maxWalNodeNum) {
        nodeIdCounter++;
        IWALNode node = createWALNode(String.valueOf(nodeIdCounter));
        if (!(node instanceof WALNode)) {
          return node;
        }
        selectedNode = (WALNode) node;
        walNodes.add(selectedNode);
      } else {
        // select next wal node by sequence order
        nodeCursor = (nodeCursor + 1) % maxWalNodeNum;
        selectedNode = walNodes.get(nodeCursor);
      }
    } finally {
      nodesLock.unlock();
    }
    return selectedNode;
  }
This strategy creates n wal nodes and allocate them by round-robin strategy. In other words,
several identifiers (like data regions) can share one wal node.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/allocation/RoundRobinStrategy.java