This is an automated email from the ASF dual-hosted git repository.
jiangtian pushed a commit to branch dev_TTL
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
The following commit(s) were added to refs/heads/dev_TTL by this push:
new 38835ba change log level fix tests
38835ba is described below
commit 38835ba51ab8cf57f01184c965f684c5ada040f6
Author: jt <[email protected]>
AuthorDate: Mon Sep 23 16:34:01 2019 +0800
change log level
fix tests
---
.../iotdb/db/engine/storagegroup/StorageGroupProcessor.java | 6 ++++--
.../test/java/org/apache/iotdb/db/integration/IoTDBTtlIT.java | 9 +++++++--
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git
a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
index b1744e9..12cfa96 100755
---
a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
+++
b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
@@ -348,7 +348,7 @@ public class StorageGroupProcessor {
public boolean insert(InsertPlan insertPlan) throws QueryProcessorException {
// reject insertions that are out of ttl
if (!checkTTL(insertPlan.getTime())) {
- return false;
+ throw new OutOfTTLException(insertPlan.getTime(),
(System.currentTimeMillis() - dataTTL));
}
writeLock();
try {
@@ -591,7 +591,9 @@ public class StorageGroupProcessor {
public synchronized void checkFilesTTL() {
long timeBound = System.currentTimeMillis() - dataTTL;
- logger.info("TTL removing files before {}", new Date(timeBound));
+ if (logger.isDebugEnabled()) {
+ logger.debug("TTL removing files before {}", new Date(timeBound));
+ }
try {
for (TsFileResource tsFileResource : unSequenceFileList) {
checkFileTTL(tsFileResource, timeBound, true);
diff --git
a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBTtlIT.java
b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBTtlIT.java
index bdee0f0..c45a687 100644
--- a/server/src/test/java/org/apache/iotdb/db/integration/IoTDBTtlIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/integration/IoTDBTtlIT.java
@@ -62,16 +62,21 @@ public class IoTDBTtlIT {
try {
statement.execute("SET TTL TO root.TTL_SG1 1000");
} catch (SQLException e) {
- assertEquals(TSStatusCode.NOT_A_STORAGE_GROUP_ERROR.getStatusCode(),
e.getErrorCode());
+ assertEquals(TSStatusCode.EXECUTE_STATEMENT_ERROR.getStatusCode(),
e.getErrorCode());
}
try {
statement.execute("UNSET TTL TO root.TTL_SG1");
} catch (SQLException e) {
- assertEquals(TSStatusCode.NOT_A_STORAGE_GROUP_ERROR.getStatusCode(),
e.getErrorCode());
+ assertEquals(TSStatusCode.EXECUTE_STATEMENT_ERROR.getStatusCode(),
e.getErrorCode());
}
statement.execute("SET STORAGE GROUP TO root.TTL_SG1");
statement.execute("CREATE TIMESERIES root.TTL_SG1.s1 WITH
DATATYPE=INT64,ENCODING=PLAIN");
+ try {
+ statement.execute("SET TTL TO root.TTL_SG1.s1 1000");
+ } catch (SQLException e) {
+ assertEquals(TSStatusCode.NOT_A_STORAGE_GROUP_ERROR.getStatusCode(),
e.getErrorCode());
+ }
long now = System.currentTimeMillis();
for (int i = 0; i < 100; i ++) {