jt2594838 commented on a change in pull request #1169:
URL: https://github.com/apache/incubator-iotdb/pull/1169#discussion_r428409879
##########
File path:
server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
##########
@@ -2215,9 +2275,41 @@ public String getStorageGroupName() {
return storageGroupName;
}
+ /**
+ * Check if the data of "tsFileResource" all exist locally by comparing the
historical versions
+ * in the partition of "partitionNumber". This is available only when the
IoTDB which generated
+ * "tsFileResource" has the same close file policy as the local one.
+ * If one of the version in "tsFileResource" equals to a version of a
working file, false is
+ * also returned because "tsFileResource" may have unwritten data of that
file.
+ * @param tsFileResource
+ * @param partitionNum
+ * @return true if the historicalVersions of "tsFileResource" is a subset of
+ * partitionDirectFileVersions, or false if it is not a subset and it does
not contain any
+ * version of a working file
+ */
public boolean isFileAlreadyExist(TsFileResource tsFileResource, long
partitionNum) {
Review comment:
That is its current usage indeed, but it does not mean what it is
capable of.
The real functionality of this method is to check the existence of a TsFile
under the consistency of the versions, and it just happened to serve the
distributed module, which does not mean it is constrained only to that use.
For example, if we have an apple that is only for eating currently, we do
not rename it to "AppleThatIsOnlyForEating", because we know that an apple is
an apple and it may also be used to make apple juice or something different.
----------------------------------------------------------------
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]