You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/07/26 14:56:12 UTC
[GitHub] [iotdb] liuminghui233 commented on a diff in pull request #6756: [IOTDB-3727] Support clear cache in new cluster
liuminghui233 commented on code in PR #6756:
URL: https://github.com/apache/iotdb/pull/6756#discussion_r930064655
##########
server/src/main/java/org/apache/iotdb/db/mpp/plan/constant/StatementType.java:
##########
@@ -112,6 +112,7 @@ public enum StatementType {
TTL,
KILL,
FLUSH,
+ ClearCache,
Review Comment:
This type already exists—no need to add it.
##########
integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBClearCacheIT.java:
##########
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iotdb.db.it;
+
+import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.framework.IoTDBTestRunner;
+import org.apache.iotdb.itbase.category.ClusterIT;
+import org.apache.iotdb.itbase.category.LocalStandaloneIT;
+import org.apache.iotdb.itbase.category.RemoteIT;
+
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import static org.junit.Assert.fail;
+
+@RunWith(IoTDBTestRunner.class)
+@Category({LocalStandaloneIT.class, ClusterIT.class, RemoteIT.class})
+public class IoTDBClearCacheIT {
Review Comment:
This test does not verify that we properly cleared the cache. You can refer to `org.apache.iotdb.db.integration.IoTDBClearCacheIT` and migrate it simply.
##########
confignode/src/main/java/org/apache/iotdb/confignode/client/DataNodeRequestType.java:
##########
@@ -34,6 +34,7 @@ public enum DataNodeRequestType {
CREATE_FUNCTION,
DROP_FUNCTION,
FLUSH,
+ CLEARCACHE,
Review Comment:
We should put the new enum value at the end of the list.
##########
server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/sys/ClearCacheStatement.java:
##########
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.db.mpp.plan.statement.sys;
+
+import org.apache.iotdb.commons.path.PartialPath;
+import org.apache.iotdb.db.mpp.plan.analyze.QueryType;
+import org.apache.iotdb.db.mpp.plan.constant.StatementType;
+import org.apache.iotdb.db.mpp.plan.statement.IConfigStatement;
+import org.apache.iotdb.db.mpp.plan.statement.Statement;
+import org.apache.iotdb.db.mpp.plan.statement.StatementVisitor;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Collections;
+import java.util.List;
+
+public class ClearCacheStatement extends Statement implements IConfigStatement {
+
+ private static final Logger logger = LoggerFactory.getLogger(ClearCacheStatement.class);
+ /** list of storage group */
+ private List<PartialPath> storageGroups;
Review Comment:
Maybe this attribute is a typo and we don't need it.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org