jt2594838 commented on a change in pull request #372: [IOTDB-198]Reimplementation sync module URL: https://github.com/apache/incubator-iotdb/pull/372#discussion_r321148650
########## File path: server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java ########## @@ -950,11 +960,272 @@ protected void mergeEndAction(List<TsFileResource> seqFiles, List<TsFileResource logger.info("{} a merge task ends", storageGroupName); } + /** + * Load a new tsfile to storage group processor + * + * Firstly, determine the loading type of the file, whether it needs to be loaded in sequence list + * or unsequence list. + * + * Secondly, execute the loading process by the type. + * + * Finally, update the latestTimeForEachDevice and latestFlushedTimeForEachDevice. + * + * @param newTsFile new tsfile + * @param newTsFileResource tsfile resource + * @UsedBy sync module. + */ + public void loadNewTsFile(File newTsFile, TsFileResource newTsFileResource) + throws TsFileProcessorException { + writeLock(); + mergeLock.writeLock().lock(); + try { + boolean isOverlap = false; + int preIndex = -1, subsequentIndex = sequenceFileList.size(); + // check new tsfile + outer: + for (int i = 0; i < sequenceFileList.size(); i++) { + if (sequenceFileList.get(i).getFile().getName().equals(newTsFile.getName())) { + return; + } Review comment: When would this happen? It seems incredible. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services