Skip to content

Commit 3f84eac

Browse files
committed
fix UPDATE_NO_BLOB does not take effect
1 parent 68b5ac5 commit 3f84eac

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

  • iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3009,12 +3009,17 @@ public void loadNewTsFile(
30093009
}
30103010

30113011
TsFileLastReader lastReader = null;
3012-
if ((config.getLastCacheLoadStrategy() == LastCacheLoadStrategy.UPDATE
3013-
|| config.getLastCacheLoadStrategy() == LastCacheLoadStrategy.UPDATE_NO_BLOB)
3012+
LastCacheLoadStrategy lastCacheLoadStrategy = config.getLastCacheLoadStrategy();
3013+
if ((lastCacheLoadStrategy == LastCacheLoadStrategy.UPDATE
3014+
|| lastCacheLoadStrategy == LastCacheLoadStrategy.UPDATE_NO_BLOB)
30143015
&& !config.isCacheLastValuesForLoad()) {
30153016
try {
30163017
// init reader outside of lock to boost performance
3017-
lastReader = new TsFileLastReader(newTsFileResource.getTsFilePath());
3018+
lastReader =
3019+
new TsFileLastReader(
3020+
newTsFileResource.getTsFilePath(),
3021+
true,
3022+
lastCacheLoadStrategy == LastCacheLoadStrategy.UPDATE_NO_BLOB);
30183023
} catch (IOException e) {
30193024
throw new LoadFileException(e);
30203025
}
@@ -3109,11 +3114,9 @@ private void onTsFileLoaded(
31093114
TsFileResource newTsFileResource, boolean isFromConsensus, TsFileLastReader lastReader) {
31103115
if (CommonDescriptor.getInstance().getConfig().isLastCacheEnable() && !isFromConsensus) {
31113116
switch (config.getLastCacheLoadStrategy()) {
3112-
case UPDATE_NO_BLOB:
3113-
updateLastCache(newTsFileResource, true, lastReader);
3114-
break;
31153117
case UPDATE:
3116-
updateLastCache(newTsFileResource, false, lastReader);
3118+
case UPDATE_NO_BLOB:
3119+
updateLastCache(newTsFileResource, lastReader);
31173120
break;
31183121
case CLEAN_ALL:
31193122
// The inner cache is shared by TreeDeviceSchemaCacheManager and
@@ -3147,8 +3150,7 @@ private void onTsFileLoaded(
31473150
}
31483151

31493152
@SuppressWarnings("java:S112")
3150-
private void updateLastCache(
3151-
TsFileResource newTsFileResource, boolean ignoreBlob, TsFileLastReader lastReader) {
3153+
private void updateLastCache(TsFileResource newTsFileResource, TsFileLastReader lastReader) {
31523154
boolean isTableModel = isTableModelDatabase(databaseName);
31533155

31543156
Map<IDeviceID, List<Pair<String, TimeValuePair>>> lastValues =

0 commit comments

Comments
 (0)