qiaojialin commented on a change in pull request #664: [IOTDB-333] Storage
group divide by time range
URL: https://github.com/apache/incubator-iotdb/pull/664#discussion_r361049708
##########
File path:
server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
##########
@@ -514,7 +572,70 @@ private TsFileProcessor
getOrCreateTsFileProcessor(boolean sequence) {
return tsFileProcessor;
}
- private TsFileProcessor createTsFileProcessor(boolean sequence)
+ /**
+ * get processor from hashmap, flush oldest processor is necessary
+ *
+ * @param timeRangeId time partition range
+ * @param tsFileProcessorHashMap tsFileProcessorHashMap
+ * @param tsfileProcessorLastUseTime last use time of this processor map
+ * @param fileList file list to add new processor
+ * @param sequence whether is sequence or not
+ */
+ private TsFileProcessor getOrCreateTsFileProcessorIntern(long timeRangeId,
+ HashMap<Long, TsFileProcessor> tsFileProcessorHashMap,
+ HashMap<Long, Long> tsfileProcessorLastUseTime,
+ Collection<TsFileResource> fileList,
+ boolean sequence)
+ throws IOException, DiskSpaceInsufficientException {
+
+ TsFileProcessor res = null;
+ // we have to ensure only one thread can change
workSequenceTsFileProcessors
+ writeLock();
+ try {
+ if (!tsFileProcessorHashMap.containsKey(timeRangeId)) {
+ // we have to remove oldest processor to control the num of the
memtables
+ if (tsFileProcessorHashMap.size()
+ >= IoTDBConstant.MEMTABLE_NUM_IN_EACH_STORAGE_GROUP / 2) {
Review comment:
In current configuration, the memtable is 5. Then, we have 2 sequence and 2
unsequence, can we have 5 processors?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services