You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2019/10/14 07:44:50 UTC

[GitHub] [incubator-iotdb] jt2594838 commented on a change in pull request #430: [IOTDB-193]Create schema automatically

jt2594838 commented on a change in pull request #430: [IOTDB-193]Create schema automatically
URL: https://github.com/apache/incubator-iotdb/pull/430#discussion_r334353560
 
 

 ##########
 File path: server/src/main/java/org/apache/iotdb/db/utils/DeviceIdCache.java
 ##########
 @@ -0,0 +1,53 @@
+package org.apache.iotdb.db.utils;
+
+import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.db.exception.StorageGroupException;
+import org.apache.iotdb.tsfile.exception.cache.CacheException;
+
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+public abstract class DeviceIdCache {
 
 Review comment:
   The number of devices in a system is rather limited and holding all in memory is not a burden, so I do not suggest making it an LRU cache for meaningless overhead. 
   Nevertheless, I seriously doubt the performance of using a List, as the `contains()` method can be extremely slow even when there are only thousands of devices (not to mention you are using a COWList). I strongly recommend using a HashSet.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services