Skip to content

Commit fc2b992

Browse files
committed
fix comments
1 parent 3f84eac commit fc2b992

4 files changed

Lines changed: 27 additions & 9 deletions

File tree

integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBLoadLastCacheIT.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import org.junit.After;
4343
import org.junit.Assert;
4444
import org.junit.Before;
45+
import org.junit.Ignore;
4546
import org.junit.Test;
4647
import org.junit.experimental.categories.Category;
4748
import org.junit.runner.RunWith;
@@ -107,7 +108,7 @@ public void setUp() throws Exception {
107108
.getConfig()
108109
.getDataNodeConfig()
109110
.setLoadLastCacheStrategy(lastCacheLoadStrategy.name())
110-
.setCacheLastValuesForLoad(true);
111+
.setCacheLastValuesForLoad(false);
111112
EnvFactory.getEnv().initClusterEnvironment();
112113
}
113114

@@ -492,9 +493,9 @@ private void queryAll(
492493
int deviceNum = random.nextInt(deviceCnt);
493494
int measurementNum = random.nextInt(measurementCnt);
494495
rateLimiter.acquire();
495-
long start = System.currentTimeMillis();
496+
long start = System.nanoTime();
496497
long result = queryLastOnce(deviceNum, measurementNum, schemas, statement);
497-
long timeConsumption = System.currentTimeMillis() - start;
498+
long timeConsumption = System.nanoTime() - start;
498499
if (result == -1) {
499500
try {
500501
Thread.sleep(1000);
@@ -515,18 +516,18 @@ private void queryAll(
515516
System.out.printf(
516517
"Synchronization ends after %dms, query latency avg %fms %n",
517518
System.currentTimeMillis() - totalStart,
518-
timeConsumptions.stream().mapToLong(i -> i).average().orElse(0.0));
519+
timeConsumptions.stream().mapToLong(i -> i).average().orElse(0.0) / 1000000);
519520
}
520521

521-
// @Ignore("Performance")
522+
//@Ignore("Performance")
522523
@Test
523524
public void testTableLoadPerformance() throws Exception {
524525
int deviceCnt = 100;
525526
int measurementCnt = 100;
526527
int blobMeasurementCnt = 10;
527528
int pointCnt = 100;
528529
int fileCnt = 1000;
529-
int queryPerSec = 1000;
530+
int queryPerSec = 100;
530531
int queryThreadsNum = 10;
531532

532533
PerformanceSchemas schemas =

iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/IoTConsensus.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ public TSStatus write(ConsensusGroupId groupId, IConsensusRequest request)
237237
} else if (!impl.isActive()) {
238238
String message =
239239
String.format(
240-
"Peer is inactive and not ready to write request, %s, DatsaNode Id: %s",
240+
"Peer is inactive and not ready to write request, %s, DataNode Id: %s",
241241
groupId.toString(), impl.getThisNode().getNodeId());
242242
return RpcUtils.getStatus(TSStatusCode.WRITE_PROCESS_REJECT, message);
243243
} else {

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3012,7 +3012,7 @@ public void loadNewTsFile(
30123012
LastCacheLoadStrategy lastCacheLoadStrategy = config.getLastCacheLoadStrategy();
30133013
if ((lastCacheLoadStrategy == LastCacheLoadStrategy.UPDATE
30143014
|| lastCacheLoadStrategy == LastCacheLoadStrategy.UPDATE_NO_BLOB)
3015-
&& !config.isCacheLastValuesForLoad()) {
3015+
&& newTsFileResource.getLastValues() == null) {
30163016
try {
30173017
// init reader outside of lock to boost performance
30183018
lastReader =
@@ -3106,7 +3106,6 @@ public void loadNewTsFile(
31063106
logger.warn("Cannot close last reader after loading TsFile {}", newTsFileResource, e);
31073107
}
31083108
}
3109-
// TODO: do more precise control
31103109
}
31113110
}
31123111

iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties.template

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2087,6 +2087,24 @@ load_active_listening_max_thread_num=0
20872087
# Datatype: int
20882088
load_active_listening_check_interval_seconds=5
20892089

2090+
# The operation performed to LastCache when a TsFile is successfully loaded.
2091+
# UPDATE: use the data in the TsFile to update LastCache;
2092+
# UPDATE_NO_BLOB: similar to UPDATE, but will invalidate LastCache for blob series;
2093+
# CLEAN_DEVICE: invalidate LastCache of devices contained in the TsFile;
2094+
# CLEAN_ALL: clean the whole LastCache.
2095+
last_cache_operation_on_load=UPDATE_NO_BLOB
2096+
2097+
# Whether to cache last values before loading a TsFile. Only effective when
2098+
# last_cache_operation_on_load=UPDATE_NO_BLOB or last_cache_operation_on_load=UPDATE.
2099+
# When set to true, blob series will be ignored even with last_cache_operation_on_load=UPDATE.
2100+
# Enabling this will increase the memory footprint during loading TsFiles.
2101+
cache_last_values_for_load=true
2102+
2103+
# When cache_last_values_for_load=true, the maximum memory that can be used to cache last values.
2104+
# If this value is exceeded, the cached values will be abandoned and last values will be read from
2105+
# the TsFile in a streaming manner.
2106+
cache_last_values_memory_budget_in_byte=4194304
2107+
20902108
####################
20912109
### Dispatch Retry Configuration
20922110
####################

0 commit comments

Comments
 (0)