This is an automated email from the ASF dual-hosted git repository.
chaow pushed a commit to branch rel/0.12
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/rel/0.12 by this push:
new 8f567e9 add audit log when execute delete and set sg for tracing
(#3511)
8f567e9 is described below
commit 8f567e97f3fc7bf1ae17529a2e3c6af030f54d9a
Author: yanhong wang <[email protected]>
AuthorDate: Tue Jul 6 22:48:51 2021 +0800
add audit log when execute delete and set sg for tracing (#3511)
---
.../java/org/apache/iotdb/db/qp/executor/PlanExecutor.java | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git
a/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
b/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
index 073e718..824e4ff 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
@@ -197,6 +197,8 @@ import static
org.apache.iotdb.tsfile.common.constant.TsFileConstant.TSFILE_SUFF
public class PlanExecutor implements IPlanExecutor {
private static final Logger logger =
LoggerFactory.getLogger(PlanExecutor.class);
+ private static final Logger AUDIT_LOGGER =
+ LoggerFactory.getLogger(IoTDBConstant.AUDIT_LOGGER_NAME);
// for data query
protected IQueryRouter queryRouter;
// for administration
@@ -959,6 +961,11 @@ public class PlanExecutor implements IPlanExecutor {
@Override
public void delete(DeletePlan deletePlan) throws QueryProcessException {
+ AUDIT_LOGGER.info(
+ "delete data from {} in [{},{}]",
+ deletePlan.getPaths(),
+ deletePlan.getDeleteStartTime(),
+ deletePlan.getDeleteEndTime());
for (PartialPath path : deletePlan.getPaths()) {
delete(
path,
@@ -1445,6 +1452,7 @@ public class PlanExecutor implements IPlanExecutor {
protected boolean deleteTimeSeries(DeleteTimeSeriesPlan deleteTimeSeriesPlan)
throws QueryProcessException {
+ AUDIT_LOGGER.info("delete timeseries {}", deleteTimeSeriesPlan.getPaths());
List<PartialPath> deletePathList = deleteTimeSeriesPlan.getPaths();
for (int i = 0; i < deletePathList.size(); i++) {
PartialPath path = deletePathList.get(i);
@@ -1512,6 +1520,7 @@ public class PlanExecutor implements IPlanExecutor {
public boolean setStorageGroup(SetStorageGroupPlan setStorageGroupPlan)
throws QueryProcessException {
+ AUDIT_LOGGER.info("set storage group to {}",
setStorageGroupPlan.getPath());
PartialPath path = setStorageGroupPlan.getPath();
try {
IoTDB.metaManager.setStorageGroup(path);
@@ -1523,6 +1532,7 @@ public class PlanExecutor implements IPlanExecutor {
protected boolean deleteStorageGroups(DeleteStorageGroupPlan
deleteStorageGroupPlan)
throws QueryProcessException {
+ AUDIT_LOGGER.info("delete storage group {}",
deleteStorageGroupPlan.getPaths());
List<PartialPath> deletePathList = new ArrayList<>();
try {
for (PartialPath storageGroupPath : deleteStorageGroupPlan.getPaths()) {