@SuppressWarnings("squid:S2095")
  @Override
  public IWALNode applyForWALNode(String applicantUniqueId) {
    nodesLock.lock();
    try {
      if (!uniqueId2Nodes.containsKey(applicantUniqueId)) {
        // add 1 node when reaching threshold
        if (uniqueId2Nodes.size() == walNodes.size() * APPLICATION_NODE_RATIO) {
          nodeIdCounter++;
          IWALNode node = createWALNode(String.valueOf(nodeIdCounter));
          if (!(node instanceof WALNode)) {
            return node;
          }
          walNodes.add((WALNode) node);
        }
        uniqueId2Nodes.put(applicantUniqueId, walNodes.get(walNodes.size() - 1));
      }

      return uniqueId2Nodes.get(applicantUniqueId);
    } finally {
      nodesLock.unlock();
    }
  }
This strategy creates wal nodes according to the number of memTables. Each wal node manages fixed
number of memTables.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/allocation/ElasticStrategy.java