@Override
  public Map<IDeviceID, Long> getMaxTime() {
    Map<IDeviceID, Long> latestTimeForEachDevice = new HashMap<>();
    for (Entry<IDeviceID, IWritableMemChunkGroup> entry : memTableMap.entrySet()) {
      if (entry.getValue().count() > 0 && !entry.getValue().isEmpty()) {
        latestTimeForEachDevice.put(entry.getKey(), entry.getValue().getMaxTime());
      }
    }
    return latestTimeForEachDevice;
  }
Notice: this method is concurrent unsafe.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AbstractMemTable.java