protected IDeviceID toDeviceID(String[] nodes) {
    String tableName;
    int segmentCnt = nodes.length;
    // not a tree id, no need to generate dummy table
    if (nodes.length > 0 && !Objects.equals(nodes[0], PATH_ROOT)) {
      return Factory.DEFAULT_FACTORY.create(nodes);
    }
    // assuming DEFAULT_SEGMENT_NUM_FOR_TABLE_NAME = 3
    String[] segments;
    if (segmentCnt <= 1) {
      // "root" -> {"root"}
      segments = nodes;
    } else if (segmentCnt < TSFileConfig.DEFAULT_SEGMENT_NUM_FOR_TABLE_NAME + 1) {
      // "root.a" -> {"root", "a"}
      // "root.a.b" -> {"root.a", "b"}
      tableName = String.join(PATH_SEPARATOR, Arrays.copyOfRange(nodes, 0, segmentCnt - 1));
      segments = new String[2];
      segments[0] = tableName;
      segments[1] = nodes[segmentCnt - 1];
    } else {
      // "root.a.b.c" -> {"root.a.b", "c"}
      // "root.a.b.c.d" -> {"root.a.b", "c", "d"}
      tableName =
          String.join(
              PATH_SEPARATOR,
              Arrays.copyOfRange(nodes, 0, TSFileConfig.DEFAULT_SEGMENT_NUM_FOR_TABLE_NAME));
      int newSegmentCnt = nodes.length - TSFileConfig.DEFAULT_SEGMENT_NUM_FOR_TABLE_NAME + 1;
      segments = new String[newSegmentCnt];
      segments[0] = tableName;
      System.arraycopy(
          nodes, TSFileConfig.DEFAULT_SEGMENT_NUM_FOR_TABLE_NAME, segments, 1, newSegmentCnt - 1);
    }
    return Factory.DEFAULT_FACTORY.create(segments);
  }
String basic total, 32B

<ul>
  <li>Object header, 8B
  <li>char[] reference + header + length, 8 + 4 + 8= 20B
  <li>hash code, 4B
</ul>
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PartialPath.java