Skip to content
Permalink
Browse files Browse the repository at this point in the history
[IOTDB-4225] Fix QueryContext occupies too much memory
THUMarkLau committed Aug 26, 2022
1 parent 1a2e5d7 commit e5e4f17
Showing 1 changed file with 5 additions and 0 deletions.
* Find the modifications of timeseries 'path' in 'modFile'. If they are not in the cache, read
* them from 'modFile' and put then into the cache.
*/
public List<Modification> getPathModifications(ModificationFile modFile, PartialPath path) {
// if the mods file does not exist, do not add it to the cache
if (!modFile.exists()) {
return Collections.emptyList();
}
Map<String, List<Modification>> fileModifications =
filePathModCache.computeIfAbsent(modFile.getFilePath(), k -> new ConcurrentHashMap<>());
return fileModifications.computeIfAbsent(

COLLECTOR-SAHAB / differentiating test: DeletionQueryTest

{return-object}.size = 0 only occurs in the original version.

path.getFullPath(),
k -> {
List<Modification> allModifications = fileModCache.get(modFile.getFilePath());

COLLECTOR-SAHAB / differentiating test: DeletionQueryTest

modFile.random.seedUniquifier.value = -6698708724752103668 only occurs in the original version.

if (allModifications == null) {
allModifications = (List<Modification>) modFile.getModifications();
fileModCache.put(modFile.getFilePath(), allModifications);
}
List<Modification> finalPathModifications = new ArrayList<>();
if (!allModifications.isEmpty()) {
allModifications.forEach(
modification -> {
if (modification.getPath().matchFullPath(path)) {
finalPathModifications.add(modification);
}
});
}
return finalPathModifications;
});
}
/**

0 comments on commit e5e4f17

Please sign in to comment.