public void setTTL(String[] nodes, long ttl) {
    int start = nodes[0].equals("root") ? 1 : 0;
    if (nodes.length <= start || ttl < 0) {
      return;
    }
    CacheNode current = ttlCacheTree;
    for (int i = start; i < nodes.length; i++) {
      CacheNode child = current.getChild(nodes[i]);
      if (child == null) {
        child = current.addChild(nodes[i], NULL_TTL);
      }
      current = child;
    }
    if (current.ttl == NULL_TTL) {
      ttlCount++;
    }
    current.ttl = ttl;
  }
Put ttl into cache tree.

@param nodes should be prefix path or specific device path without wildcard
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/ttl/TTLCache.java