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/09/25 09:05:32 UTC
[GitHub] [iotdb] KeeProMise opened a new pull request, #7424: [IOTDB-4520] The tag schema region is implemented and supports the influxdb protocol
KeeProMise opened a new pull request, #7424:
URL: https://github.com/apache/iotdb/pull/7424
## Description
The current influxdb adapter uses iotdb to store the order of tags in order to generate a unique path for the combination of tags with the same semantics during implementation. In this way, in the implementation, it is necessary to first access iotdb to obtain the order of tags, and then convert the tags into paths and generate PhysicalPlan, which results in poor performance and is more complicated to implement a tag model adapter. This work enables the influxdb adapter to support the use of native tag model metadata management modules.
## New features
- lsm framework memory structure implementation:see https://apache-iotdb.feishu.cn/docx/doxcncdQ0sejMEEVqC1gIM9CKef#doxcni0oA80sqYOqeoEwp5kHun4
- tag inverted index:see https://apache-iotdb.feishu.cn/docx/doxcnlNVJnjaAMo0xVSpMsOAIVe
- tag schema region: see https://apache-iotdb.feishu.cn/docx/doxcn65XjYe64t8QyGiyLN2Ig0c
- influxdb adapter supports tag schema region:see https://apache-iotdb.feishu.cn/docx/doxcnZzEZ1BwXS6EQfrUEuGOX4d#doxcnKsqAa24qOwya4Oi1qdtFib
--
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
[GitHub] [iotdb] MarcosZyk commented on a diff in pull request #7424: [IOTDB-4520] The tag schema region is implemented and supports the influxdb protocol
Posted by GitBox <gi...@apache.org>.
MarcosZyk commented on code in PR #7424:
URL: https://github.com/apache/iotdb/pull/7424#discussion_r990734926
##########
lsm/src/main/java/org/apache/iotdb/lsm/levelProcess/BasicLevelProcess.java:
##########
@@ -0,0 +1,79 @@
+/*
+ * 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.lsm.levelProcess;
+
+import org.apache.iotdb.lsm.context.RequestContext;
+
+import java.util.List;
+
+/** the processing method corresponding to each layer of memory nodes */
+public abstract class BasicLevelProcess<I, O, C extends RequestContext>
+ implements LevelProcess<I, O, C> {
+
+ // the next level process
+ LevelProcess<O, ?, C> next;
+
+ /**
+ * process the current layer memory node
+ *
+ * @param memNode memory node
+ * @param context request context
+ */
+ public abstract void handle(I memNode, C context);
Review Comment:
Maybe we should define an interface named ```IMemNode```, and state some methods in it.
##########
lsm/src/main/java/org/apache/iotdb/lsm/wal/WALRecord.java:
##########
@@ -0,0 +1,51 @@
+/*
+ * 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.lsm.wal;
+
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+/** represents a wal record, which can be extended to implement more complex wal records */
+public abstract class WALRecord implements Cloneable {
Review Comment:
Make this an Interface. The abstract class is not that convenient in Java, since Java only supports single extension.
##########
lsm/src/main/java/org/apache/iotdb/lsm/manager/LsmManager.java:
##########
@@ -0,0 +1,42 @@
+/*
+ * 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.lsm.manager;
+
+import org.apache.iotdb.lsm.context.RequestContext;
+import org.apache.iotdb.lsm.levelProcess.LevelProcess;
+
+// used to implement lsm manager
+public interface LsmManager<T, C extends RequestContext> {
Review Comment:
Use upper case instead, ```LSMManager```.
##########
lsm/src/main/java/org/apache/iotdb/lsm/context/QueryRequestContext.java:
##########
@@ -0,0 +1,52 @@
+/*
+ * 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.lsm.context;
+
+import org.apache.iotdb.lsm.strategy.PostOrderAccessStrategy;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * represents the context of a query request, this class can be extended to implement a custom
+ * context
+ */
+public class QueryRequestContext extends RequestContext {
+
+ // save the key of each level
+ List<Object> keys;
+
Review Comment:
We shall avoid direct use ```Object``` class. Is there any way to implement this feature with generics?
Besides, the attribute ```keys``` seems to be part of the query request, rather than the query context. The ```context``` usually means to provide some states of the system or module when executing the request.
##########
schema-engine-tag/src/main/java/org/apache/iotdb/db/metadata/tagSchemaRegion/deviceidlist/AppendOnlyDeviceIDListFileManager.java:
##########
@@ -0,0 +1,116 @@
+/*
+ * 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.metadata.tagSchemaRegion.deviceidlist;
+
+import org.apache.iotdb.commons.utils.TestOnly;
+import org.apache.iotdb.db.metadata.idtable.entry.DeviceIDFactory;
+import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+/** for append-only writing of device id list to disk */
+public class AppendOnlyDeviceIDListFileManager {
Review Comment:
It seems we can recover the ```DeviceIDList``` by redo the file of IDTable.
##########
lsm/src/main/java/org/apache/iotdb/lsm/wal/WALReader.java:
##########
@@ -0,0 +1,99 @@
+/*
+ * 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.lsm.wal;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedInputStream;
+import java.io.DataInputStream;
+import java.io.EOFException;
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.util.NoSuchElementException;
+
+/** get records in wal file */
+public class WALReader implements IWALReader {
+ private static final Logger logger = LoggerFactory.getLogger(WALReader.class);
+ // wal file
+ private final File logFile;
+ // wal record prototype, clone on read
+ private final WALRecord prototype;
+ private DataInputStream logStream;
+ // next wal record
+ private WALRecord nextRecord;
+ private boolean fileCorrupted = false;
+
+ public WALReader(File logFile, WALRecord prototype) throws IOException {
+ this.logFile = logFile;
+ this.logStream =
+ new DataInputStream(new BufferedInputStream(Files.newInputStream(logFile.toPath())));
+ this.prototype = prototype;
+ }
+
+ @Override
+ public void close() throws IOException {
+ logStream.close();
+ logStream = null;
+ }
+
+ @Override
+ public boolean hasNext() {
+ if (nextRecord != null) {
+ return true;
+ }
+ try {
+ if (fileCorrupted) {
+ return false;
+ }
+ int logSize = logStream.readInt();
+ if (logSize <= 0) {
+ return false;
+ }
+ // first clone the object through the prototype
+ nextRecord = prototype.clone();
+ // then perform deserialization and assign a value to the new object
+ nextRecord.deserialize(logStream);
+ } catch (EOFException e) {
+ logger.info(e.getMessage());
+ return false;
+ } catch (IOException e) {
+ logger.warn(e.getMessage());
+ fileCorrupted = true;
Review Comment:
When file corrupted, we should recognize whether it is the middle of file or just the tail of the file.
If is tail, it maybe the last log is not completed yet, and we can truncate the corrupted file tail directly.
If is middle, it maybe complex and we should notice the user that the file is corrupted due to unknown cause.
##########
schema-engine-tag/src/main/java/org/apache/iotdb/db/metadata/tagSchemaRegion/TagSchemaConfig.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * 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.metadata.tagSchemaRegion;
+
+/** tag schema region config */
+public class TagSchemaConfig {
Review Comment:
Move this to package ```config```.
##########
schema-engine-tag/src/main/java/org/apache/iotdb/db/metadata/tagSchemaRegion/TagSchemaDescriptor.java:
##########
@@ -0,0 +1,93 @@
+/*
+ * 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.metadata.tagSchemaRegion;
+
+import org.apache.iotdb.commons.conf.IoTDBConstant;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+/** manager tag schema config */
+public class TagSchemaDescriptor {
Review Comment:
Move this to package ```config```.
##########
lsm/src/main/java/org/apache/iotdb/lsm/manager/LsmManager.java:
##########
@@ -0,0 +1,42 @@
+/*
+ * 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.lsm.manager;
+
+import org.apache.iotdb.lsm.context.RequestContext;
+import org.apache.iotdb.lsm.levelProcess.LevelProcess;
+
+// used to implement lsm manager
+public interface LsmManager<T, C extends RequestContext> {
+
+ /**
+ * use this method to process root memory node
+ *
+ * @param memNode memory node
+ * @param context request context
+ */
+ void process(T memNode, C context) throws Exception;
+
+ /**
+ * add the LevelProcess of the next layer of memory nodes
+ *
+ * @param next LevelProcess of the next layer
+ * @return LevelProcess of the next layer
+ */
+ <O> LevelProcess<T, O, C> nextLevel(LevelProcess<T, O, C> next);
Review Comment:
It seems this method is used to build the process method of ```LSMManager```. What about separating these building methods into an individual ```LSMManagerBuilder```. The ```LSMManager``` will only keep the executing methods. PLZ refer to the design pattern, Builder Pattern.
--
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
[GitHub] [iotdb] MarcosZyk merged pull request #7424: [IOTDB-4520] The tag schema region is implemented and supports the influxdb protocol
Posted by GitBox <gi...@apache.org>.
MarcosZyk merged PR #7424:
URL: https://github.com/apache/iotdb/pull/7424
--
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
[GitHub] [iotdb] MarcosZyk commented on a diff in pull request #7424: [IOTDB-4520] The tag schema region is implemented and supports the influxdb protocol
Posted by GitBox <gi...@apache.org>.
MarcosZyk commented on code in PR #7424:
URL: https://github.com/apache/iotdb/pull/7424#discussion_r1004603977
##########
schema-engine-tag/src/main/java/org/apache/iotdb/db/metadata/tagSchemaRegion/tagIndex/Request/DeletionRequest.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * 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.metadata.tagSchemaRegion.tagIndex.Request;
+
+import org.apache.iotdb.lsm.context.requestcontext.RequestContext;
+import org.apache.iotdb.lsm.request.IDeletionRequest;
+
+import java.util.List;
+
+/** Represents a deletion request */
+public class DeletionRequest implements IDeletionRequest<String, Integer, RequestStatus> {
+
+ // tags
+ List<String> keys;
+
+ // int32 id
+ int value;
+
+ // deletion result
+ RequestStatus requestStatus;
Review Comment:
I think the second one is better. The Request shall not reply on the Response. Request and Response are both defined for and be relied on by the interface.
--
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
[GitHub] [iotdb] MarcosZyk commented on a diff in pull request #7424: [IOTDB-4520] The tag schema region is implemented and supports the influxdb protocol
Posted by GitBox <gi...@apache.org>.
MarcosZyk commented on code in PR #7424:
URL: https://github.com/apache/iotdb/pull/7424#discussion_r1002926973
##########
schema-engine-tag/src/main/java/org/apache/iotdb/lsm/engine/ILSMEngine.java:
##########
@@ -0,0 +1,52 @@
+/*
+ * 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.lsm.engine;
+
+import org.apache.iotdb.lsm.context.DeleteRequestContext;
+import org.apache.iotdb.lsm.context.InsertRequestContext;
+import org.apache.iotdb.lsm.context.QueryRequestContext;
+import org.apache.iotdb.lsm.request.DeletionRequest;
+import org.apache.iotdb.lsm.request.InsertionRequest;
+import org.apache.iotdb.lsm.request.QueryRequest;
+
+import java.io.IOException;
+
+public interface ILSMEngine {
+
+ <K, V, R> void insert(InsertionRequest<K, V, R> insertionRequest) throws Exception;
+
+ <K, V, R> void insert(
+ InsertionRequest<K, V, R> insertionRequest, InsertRequestContext insertRequestContext)
Review Comment:
Add java docs
##########
schema-engine-tag/src/main/java/org/apache/iotdb/lsm/levelProcess/ILevelProcess.java:
##########
@@ -0,0 +1,41 @@
+/*
+ * 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.lsm.levelProcess;
+
+import org.apache.iotdb.lsm.context.RequestContext;
+
+/** the processing method corresponding to each layer of memory nodes */
+public interface ILevelProcess<I, O, R, C extends RequestContext> {
Review Comment:
rename to ```ILevelProcessor```
--
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
[GitHub] [iotdb] KeeProMise commented on a diff in pull request #7424: [IOTDB-4520] The tag schema region is implemented and supports the influxdb protocol
Posted by GitBox <gi...@apache.org>.
KeeProMise commented on code in PR #7424:
URL: https://github.com/apache/iotdb/pull/7424#discussion_r1004590736
##########
schema-engine-tag/src/main/java/org/apache/iotdb/lsm/annotation/DeletionProcessor.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * 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.lsm.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Indicates that the class using this annotation is a DeleteLevelProcessor, and the attribute level
+ * of the annotation indicates which layer of memory node the deletion method of the
+ * DeleteLevelProcessor is.
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+public @interface DeletionProcessor {
+ // level of the DeleteLevelProcessor
+ int level() default -1;
+}
Review Comment:
First of all, how many layers are there, how many objects will be generated through reflection, usually the layers are not high, so I don't think the performance will have a big impact, and the layers will not be dynamically expanded at runtime, that is, they are fixed, so there is no need to use Reflection creates objects frequently, and only needs to be created when the framework is initialized. Secondly, mainstream Java frameworks such as spring also use annotation reflection to generate beans that need to be managed. Finally, the method of making the framework manage each layer through annotations is just an optional way. This framework also supports users to create new objects through the constructor and then hand them over to the framework for management.
##########
schema-engine-tag/src/main/java/org/apache/iotdb/db/metadata/tagSchemaRegion/tagIndex/Request/DeletionRequest.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * 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.metadata.tagSchemaRegion.tagIndex.Request;
+
+import org.apache.iotdb.lsm.context.requestcontext.RequestContext;
+import org.apache.iotdb.lsm.request.IDeletionRequest;
+
+import java.util.List;
+
+/** Represents a deletion request */
+public class DeletionRequest implements IDeletionRequest<String, Integer, RequestStatus> {
+
+ // tags
+ List<String> keys;
+
+ // int32 id
+ int value;
+
+ // deletion result
+ RequestStatus requestStatus;
Review Comment:
We define the delete method of ILSMEngine as:
`<K, V, R> void delete(IDeletionRequest<K, V, R> deletionRequest);`
If you use context to save the operation result or response, is it necessary to rely on a DeletionRequestContext object inside the DeletionRequest, as well as InsertionRequest and QueryRequest?
Or the delete method can be defined as:
`<K, V,R> R delete(IDeletionRequest<K, V> deletionRequest);`
Which do you think is better, or do you have any other ideas?
--
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
[GitHub] [iotdb] MarcosZyk commented on a diff in pull request #7424: [IOTDB-4520] The tag schema region is implemented and supports the influxdb protocol
Posted by GitBox <gi...@apache.org>.
MarcosZyk commented on code in PR #7424:
URL: https://github.com/apache/iotdb/pull/7424#discussion_r1002818685
##########
schema-engine-tag/src/main/java/org/apache/iotdb/lsm/request/Request.java:
##########
@@ -0,0 +1,48 @@
+/*
+ * 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.lsm.request;
+
+import org.apache.iotdb.lsm.context.RequestContext;
+
+import java.util.List;
+
+public abstract class Request<K, V, R> {
+
+ RequestType requestType;
Review Comment:
Since these bunch of abstract class ```Request``` and ```XXXRequest``` are stateless, make them as interface and it will be more flexible. The attribute ```requestType``` could be eliminated by setting default implementation of method ```getRequestType()```.
##########
schema-engine-tag/src/main/java/org/apache/iotdb/lsm/engine/LSMEngineBuilder.java:
##########
@@ -0,0 +1,108 @@
+/*
+ * 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.lsm.engine;
+
+import org.apache.iotdb.lsm.context.DeleteRequestContext;
+import org.apache.iotdb.lsm.context.InsertRequestContext;
+import org.apache.iotdb.lsm.context.QueryRequestContext;
+import org.apache.iotdb.lsm.levelProcess.LevelProcessChain;
+import org.apache.iotdb.lsm.manager.DeletionManager;
+import org.apache.iotdb.lsm.manager.InsertionManager;
+import org.apache.iotdb.lsm.manager.QueryManager;
+import org.apache.iotdb.lsm.manager.RecoverManager;
+import org.apache.iotdb.lsm.manager.WALManager;
+import org.apache.iotdb.lsm.request.DeletionRequest;
+import org.apache.iotdb.lsm.request.InsertionRequest;
+import org.apache.iotdb.lsm.request.QueryRequest;
+
+public class LSMEngineBuilder<T> {
+
+ private LSMEngine<T> lsmEngine;
+
+ public LSMEngineBuilder() {
+ lsmEngine = new LSMEngine<>();
+ }
+
+ public LSMEngineBuilder<T> buildWalManager(WALManager walManager) {
+ lsmEngine.setWalManager(walManager);
+ return this;
+ }
+
+ public <R extends InsertionRequest> LSMEngineBuilder<T> buildInsertionManager(
+ LevelProcessChain<T, R, InsertRequestContext> levelProcessChain) {
+ InsertionManager<T, R> insertionManager = new InsertionManager<>(lsmEngine.getWalManager());
+ insertionManager.setLevelProcessChain(levelProcessChain);
+ buildInsertionManager(insertionManager);
+ return this;
+ }
+
+ public <R extends InsertionRequest> LSMEngineBuilder<T> buildInsertionManager(
+ InsertionManager<T, R> insertionManager) {
+ lsmEngine.setInsertionManager(insertionManager);
+ return this;
+ }
+
+ public <R extends DeletionRequest> LSMEngineBuilder<T> buildDeletionManager(
+ LevelProcessChain<T, R, DeleteRequestContext> levelProcessChain) {
+ DeletionManager<T, R> deletionManager = new DeletionManager<>(lsmEngine.getWalManager());
+ deletionManager.setLevelProcessChain(levelProcessChain);
+ buildDeletionManager(deletionManager);
+ return this;
+ }
+
+ public <R extends DeletionRequest> LSMEngineBuilder<T> buildDeletionManager(
+ DeletionManager<T, R> deletionManager) {
+ lsmEngine.setDeletionManager(deletionManager);
+ return this;
+ }
+
+ public <R extends QueryRequest> LSMEngineBuilder<T> buildQueryManager(
+ LevelProcessChain<T, R, QueryRequestContext> levelProcessChain) {
+ QueryManager<T, R> queryManager = new QueryManager<>();
+ queryManager.setLevelProcessChain(levelProcessChain);
+ buildQueryManager(queryManager);
+ return this;
+ }
+
+ public <R extends QueryRequest> LSMEngineBuilder<T> buildQueryManager(
+ QueryManager<T, R> queryManager) {
+ lsmEngine.setQueryManager(queryManager);
+ return this;
+ }
+
+ public LSMEngineBuilder<T> buildRecoverManager(RecoverManager<LSMEngine<T>> recoverManager) {
+ lsmEngine.setRecoverManager(recoverManager);
+ return this;
+ }
+
+ public LSMEngineBuilder<T> buildRecoverManager() {
+ RecoverManager<LSMEngine<T>> recoverManager = new RecoverManager<>(lsmEngine.getWalManager());
+ lsmEngine.setRecoverManager(recoverManager);
+ return this;
+ }
+
+ public LSMEngineBuilder<T> buildRootMemNode(T rootMemNode) {
+ lsmEngine.setRootMemNode(rootMemNode);
+ return this;
+ }
+
+ public LSMEngine<T> builder() {
Review Comment:
Rename to ```build()```
##########
schema-engine-tag/src/main/java/org/apache/iotdb/lsm/engine/LSMEngineDirector.java:
##########
@@ -0,0 +1,103 @@
+/*
+ * 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.lsm.engine;
+
+import org.apache.iotdb.db.metadata.tagSchemaRegion.tagIndex.Request.DeletionRequest;
+import org.apache.iotdb.lsm.context.DeleteRequestContext;
+import org.apache.iotdb.lsm.context.InsertRequestContext;
+import org.apache.iotdb.lsm.context.QueryRequestContext;
+import org.apache.iotdb.lsm.context.RequestContext;
+import org.apache.iotdb.lsm.levelProcess.ILevelProcess;
+import org.apache.iotdb.lsm.levelProcess.LevelProcessChain;
+import org.apache.iotdb.lsm.manager.WALManager;
+import org.apache.iotdb.lsm.property.Property;
+import org.apache.iotdb.lsm.request.InsertionRequest;
+import org.apache.iotdb.lsm.request.QueryRequest;
+import org.apache.iotdb.lsm.request.Request;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.List;
+
+public class LSMEngineDirector<T> {
Review Comment:
Should this class be combined with LSMEngineBuilder?
##########
schema-engine-tag/src/main/java/org/apache/iotdb/lsm/engine/LSMEngineDirector.java:
##########
@@ -0,0 +1,103 @@
+/*
+ * 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.lsm.engine;
+
+import org.apache.iotdb.db.metadata.tagSchemaRegion.tagIndex.Request.DeletionRequest;
+import org.apache.iotdb.lsm.context.DeleteRequestContext;
+import org.apache.iotdb.lsm.context.InsertRequestContext;
+import org.apache.iotdb.lsm.context.QueryRequestContext;
+import org.apache.iotdb.lsm.context.RequestContext;
+import org.apache.iotdb.lsm.levelProcess.ILevelProcess;
+import org.apache.iotdb.lsm.levelProcess.LevelProcessChain;
+import org.apache.iotdb.lsm.manager.WALManager;
+import org.apache.iotdb.lsm.property.Property;
+import org.apache.iotdb.lsm.request.InsertionRequest;
+import org.apache.iotdb.lsm.request.QueryRequest;
+import org.apache.iotdb.lsm.request.Request;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.List;
+
+public class LSMEngineDirector<T> {
+ private static final Logger logger = LoggerFactory.getLogger(LSMEngineDirector.class);
+
+ LSMEngineBuilder<T> lsmEngineBuilder;
+
+ public LSMEngineDirector(LSMEngineBuilder<T> lsmEngineBuilder) {
+ this.lsmEngineBuilder = lsmEngineBuilder;
+ }
+
+ public LSMEngineDirector() {
+ lsmEngineBuilder = new LSMEngineBuilder<>();
+ }
+
+ public LSMEngine<T> getLSMEngine(Property property, WALManager walManager) {
+ try {
+ LevelProcessChain<T, InsertionRequest, InsertRequestContext> insertionLevelProcessChain =
+ generateLevelProcessChain(property.getInsertionLevelProcessClass());
+ LevelProcessChain<T, DeletionRequest, DeleteRequestContext> deletionLevelProcessChain =
+ generateLevelProcessChain(property.getDeletionLevelProcessClass());
+ LevelProcessChain<T, QueryRequest, QueryRequestContext> queryLevelProcessChain =
+ generateLevelProcessChain(property.getQueryLevelProcessClass());
+
+ return lsmEngineBuilder
+ .buildWalManager(walManager)
+ .buildQueryManager(queryLevelProcessChain)
+ .buildInsertionManager(insertionLevelProcessChain)
+ .buildDeletionManager(deletionLevelProcessChain)
+ .buildRecoverManager()
+ .builder();
+
+ } catch (Exception e) {
+ logger.error(e.getMessage());
+ }
+ return null;
+ }
+
+ private <R extends Request, C extends RequestContext>
+ LevelProcessChain<T, R, C> generateLevelProcessChain(List<String> levelProcessClassNames) {
+ LevelProcessChain<T, R, C> levelProcessChain = new LevelProcessChain<>();
+ try {
+ if (levelProcessClassNames.size() > 0) {
+ ILevelProcess iLevelProcess =
+ levelProcessChain.nextLevel(generateLevelProcess(levelProcessClassNames.get(0)));
+ for (int i = 1; i < levelProcessClassNames.size(); i++) {
+ iLevelProcess =
+ iLevelProcess.nextLevel(generateLevelProcess(levelProcessClassNames.get(i)));
+ }
+ }
+ } catch (Exception e) {
+ logger.error(e.getMessage());
+ }
+ return levelProcessChain;
+ }
+
+ private <O, R extends Request, C extends RequestContext>
+ ILevelProcess<T, O, R, C> generateLevelProcess(String className)
+ throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException,
+ InstantiationException, IllegalAccessException {
+ Class c = Class.forName(className);
+ ILevelProcess<T, O, R, C> result =
+ (ILevelProcess<T, O, R, C>) c.getDeclaredConstructor().newInstance();
+ return result;
+ }
Review Comment:
Using reflect to get specific class instance is not recommended.
##########
schema-engine-tag/src/main/java/org/apache/iotdb/lsm/property/Property.java:
##########
@@ -0,0 +1,54 @@
+/*
+ * 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.lsm.property;
+
+import java.util.List;
+
+public class Property {
+
+ List<String> insertionLevelProcessClass;
+
+ List<String> deletionLevelProcessClass;
+
+ List<String> queryLevelProcessClass;
Review Comment:
According to my understanding, this class is used for holding some strategy info of LSMEngine execution. Maybe we can integrate this into LSMEngineBuilde.
##########
server/src/assembly/resources/conf/iotdb-datanode.properties:
##########
@@ -1070,10 +1070,23 @@ timestamp_precision=ms
# Datatype: float
# group_by_fill_cache_size_in_mb=1.0
+####################
+### IDTable Configuration
+####################
+# Datatype: boolean
+# enable_id_table=false
+
+# Datatype: boolean
+# enable_id_table_log_file=false
+
+# Choose the device id transformation method. The value could be Plain and SHA256. If the provided value doesn't match any pre-defined value, Plain will be used as default.
+# Datatype: string
+# device_id_transformation_method=Plain
+
####################
### Schema Engine Configuration
####################
-# Choose the mode of schema engine. The value could be Memory,Schema_File and Rocksdb_based. If the provided value doesn't match any pre-defined value, Memory mode will be used as default.
+# Choose the mode of schema engine. The value could be Memory,Schema_File,Rocksdb_based and Tag. If the provided value doesn't match any pre-defined value, Memory mode will be used as default.
Review Comment:
Hide this until ```IDTable``` and ```TagSchemaRegion``` features are ready for release.
##########
schema-engine-tag/src/main/java/org/apache/iotdb/lsm/engine/LSMEngine.java:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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.lsm.engine;
+
+import org.apache.iotdb.lsm.context.DeleteRequestContext;
+import org.apache.iotdb.lsm.context.InsertRequestContext;
+import org.apache.iotdb.lsm.context.QueryRequestContext;
+import org.apache.iotdb.lsm.manager.DeletionManager;
+import org.apache.iotdb.lsm.manager.InsertionManager;
+import org.apache.iotdb.lsm.manager.QueryManager;
+import org.apache.iotdb.lsm.manager.RecoverManager;
+import org.apache.iotdb.lsm.manager.WALManager;
+import org.apache.iotdb.lsm.recover.IRecoverable;
+import org.apache.iotdb.lsm.request.DeletionRequest;
+import org.apache.iotdb.lsm.request.InsertionRequest;
+import org.apache.iotdb.lsm.request.QueryRequest;
+import org.apache.iotdb.lsm.request.Request;
+
+import java.io.IOException;
+
+public class LSMEngine<T> implements ILSMEngine, IRecoverable {
+
+ private InsertionManager<T, InsertionRequest> insertionManager;
+
+ private DeletionManager<T, DeletionRequest> deletionManager;
+
+ private QueryManager<T, QueryRequest> queryManager;
+
+ private WALManager walManager;
+
+ private RecoverManager<LSMEngine<T>> recoverManager;
+
+ private T rootMemNode;
+
+ public LSMEngine() {}
+
+ public LSMEngine(WALManager walManager) throws Exception {
+ this.walManager = walManager;
+ insertionManager = new InsertionManager<>(walManager);
+ deletionManager = new DeletionManager<>(walManager);
+ queryManager = new QueryManager<>();
+ recoverManager = new RecoverManager<>(walManager);
+ recoverManager.recover(this);
+ }
+
+ public T getRootMemNode() {
+ return rootMemNode;
+ }
+
+ public void setRootMemNode(T rootMemNode) {
+ this.rootMemNode = rootMemNode;
+ }
+
+ @Override
+ public <K, V, R> void insert(InsertionRequest<K, V, R> insertionRequest) throws Exception {
+ insertionManager.process(rootMemNode, insertionRequest, new InsertRequestContext());
+ }
+
+ @Override
+ public <K, V, R> void insert(
+ InsertionRequest<K, V, R> insertionRequest, InsertRequestContext insertRequestContext)
+ throws Exception {
+ insertionManager.process(rootMemNode, insertionRequest, insertRequestContext);
+ }
+
+ @Override
+ public <K, R> void query(QueryRequest<K, R> queryRequest) throws Exception {
+ queryManager.process(rootMemNode, queryRequest, new QueryRequestContext());
+ }
+
+ @Override
+ public <K, R> void query(QueryRequest<K, R> queryRequest, QueryRequestContext queryRequestContext)
+ throws Exception {
+ queryManager.process(rootMemNode, queryRequest, queryRequestContext);
+ }
+
+ @Override
+ public <K, V, R> void delete(DeletionRequest<K, V, R> deletionRequest) throws Exception {
+ deletionManager.process(rootMemNode, deletionRequest, new DeleteRequestContext());
+ }
+
+ @Override
+ public <K, V, R> void delete(
+ DeletionRequest<K, V, R> deletionRequest, DeleteRequestContext deleteRequestContext)
+ throws Exception {
+ deletionManager.process(rootMemNode, deletionRequest, deleteRequestContext);
+ }
+
+ @Override
+ public void recover() throws Exception {
+ recoverManager.recover(this);
+ }
+
+ @Override
+ public void clear() throws IOException {
+ walManager.close();
+ }
+
+ public InsertionManager<T, InsertionRequest> getInsertionManager() {
+ return insertionManager;
+ }
+
+ public <R extends InsertionRequest> void setInsertionManager(
+ InsertionManager<T, R> insertionManager) {
+ this.insertionManager = (InsertionManager<T, InsertionRequest>) insertionManager;
+ }
+
+ public DeletionManager<T, DeletionRequest> getDeletionManager() {
+ return deletionManager;
+ }
+
+ public <R extends DeletionRequest> void setDeletionManager(
+ DeletionManager<T, R> deletionManager) {
+ this.deletionManager = (DeletionManager<T, DeletionRequest>) deletionManager;
+ }
+
+ public QueryManager<T, QueryRequest> getQueryManager() {
+ return queryManager;
+ }
+
+ public <R extends QueryRequest> void setQueryManager(QueryManager<T, R> queryManager) {
+ this.queryManager = (QueryManager<T, QueryRequest>) queryManager;
+ }
+
+ public WALManager getWalManager() {
+ return walManager;
+ }
+
+ public void setWalManager(WALManager walManager) {
+ this.walManager = walManager;
+ }
+
+ public RecoverManager<LSMEngine<T>> getRecoverManager() {
+ return recoverManager;
+ }
+
+ public void setRecoverManager(RecoverManager<LSMEngine<T>> recoverManager) {
+ this.recoverManager = recoverManager;
+ }
Review Comment:
Should these methods be package default only for LSMEngineBuilder usage?
##########
schema-engine-tag/src/main/java/org/apache/iotdb/lsm/manager/ILSMManager.java:
##########
@@ -0,0 +1,51 @@
+/*
+ * 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.lsm.manager;
+
+import org.apache.iotdb.lsm.context.RequestContext;
+
+// used to implement lsm manager
+public interface ILSMManager<T, R, C extends RequestContext> {
Review Comment:
The comments on interface should define the behavior of the interface and describe the usage of this interface. The concrete implementation is not this interface's concern.
--
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
[GitHub] [iotdb] MarcosZyk commented on a diff in pull request #7424: [IOTDB-4520] The tag schema region is implemented and supports the influxdb protocol
Posted by GitBox <gi...@apache.org>.
MarcosZyk commented on code in PR #7424:
URL: https://github.com/apache/iotdb/pull/7424#discussion_r1004621699
##########
schema-engine-tag/src/main/java/org/apache/iotdb/db/metadata/tagSchemaRegion/tagIndex/Request/DeletionRequest.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * 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.metadata.tagSchemaRegion.tagIndex.Request;
+
+import org.apache.iotdb.lsm.context.requestcontext.RequestContext;
+import org.apache.iotdb.lsm.request.IDeletionRequest;
+
+import java.util.List;
+
+/** Represents a deletion request */
+public class DeletionRequest implements IDeletionRequest<String, Integer, RequestStatus> {
+
+ // tags
+ List<String> keys;
+
+ // int32 id
+ int value;
+
+ // deletion result
+ RequestStatus requestStatus;
Review Comment:
I mean if the response needs to be constructed or updated in multi execution stages, the consisting info can be hold and maintained in context.
--
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
[GitHub] [iotdb] jun0315 commented on pull request #7424: [IOTDB-4520] The tag schema region is implemented and supports the influxdb protocol
Posted by GitBox <gi...@apache.org>.
jun0315 commented on PR #7424:
URL: https://github.com/apache/iotdb/pull/7424#issuecomment-1290157217
inflxudb-protocol module LGTM, Thanks for your contribution!
--
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
[GitHub] [iotdb] MarcosZyk commented on a diff in pull request #7424: [IOTDB-4520] The tag schema region is implemented and supports the influxdb protocol
Posted by GitBox <gi...@apache.org>.
MarcosZyk commented on code in PR #7424:
URL: https://github.com/apache/iotdb/pull/7424#discussion_r1002820120
##########
schema-engine-tag/src/main/java/org/apache/iotdb/lsm/property/Property.java:
##########
@@ -0,0 +1,54 @@
+/*
+ * 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.lsm.property;
+
+import java.util.List;
+
+public class Property {
+
+ List<String> insertionLevelProcessClass;
+
+ List<String> deletionLevelProcessClass;
+
+ List<String> queryLevelProcessClass;
Review Comment:
According to my understanding, this class is used for holding some strategy info of LSMEngine execution. Maybe we can integrate this into LSMEngineBuilder.
--
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
[GitHub] [iotdb] MarcosZyk commented on a diff in pull request #7424: [IOTDB-4520] The tag schema region is implemented and supports the influxdb protocol
Posted by GitBox <gi...@apache.org>.
MarcosZyk commented on code in PR #7424:
URL: https://github.com/apache/iotdb/pull/7424#discussion_r1004596837
##########
schema-engine-tag/src/main/java/org/apache/iotdb/lsm/annotation/DeletionProcessor.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * 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.lsm.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Indicates that the class using this annotation is a DeleteLevelProcessor, and the attribute level
+ * of the annotation indicates which layer of memory node the deletion method of the
+ * DeleteLevelProcessor is.
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+public @interface DeletionProcessor {
+ // level of the DeleteLevelProcessor
+ int level() default -1;
+}
Review Comment:
Got 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
[GitHub] [iotdb] MarcosZyk commented on a diff in pull request #7424: [IOTDB-4520] The tag schema region is implemented and supports the influxdb protocol
Posted by GitBox <gi...@apache.org>.
MarcosZyk commented on code in PR #7424:
URL: https://github.com/apache/iotdb/pull/7424#discussion_r996412621
##########
schema-engine-tag/src/main/java/org/apache/iotdb/lsm/wal/WALRecord.java:
##########
@@ -0,0 +1,45 @@
+/*
+ * 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.lsm.wal;
+
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+/** represents a wal record, which can be extended to implement more complex wal records */
+public interface WALRecord extends Cloneable {
Review Comment:
Rename to ```IWALRecord```
##########
schema-engine-tag/src/main/java/org/apache/iotdb/lsm/manager/LSMManager.java:
##########
@@ -0,0 +1,51 @@
+/*
+ * 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.lsm.manager;
+
+import org.apache.iotdb.lsm.context.RequestContext;
+
+// used to implement lsm manager
+public interface LSMManager<T, C extends RequestContext> {
Review Comment:
Rename to ```ILSMManager```.
--
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
[GitHub] [iotdb] MarcosZyk commented on a diff in pull request #7424: [IOTDB-4520] The tag schema region is implemented and supports the influxdb protocol
Posted by GitBox <gi...@apache.org>.
MarcosZyk commented on code in PR #7424:
URL: https://github.com/apache/iotdb/pull/7424#discussion_r1004505932
##########
schema-engine-tag/src/main/java/org/apache/iotdb/db/metadata/tagSchemaRegion/tagIndex/Request/DeletionRequest.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * 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.metadata.tagSchemaRegion.tagIndex.Request;
+
+import org.apache.iotdb.lsm.context.requestcontext.RequestContext;
+import org.apache.iotdb.lsm.request.IDeletionRequest;
+
+import java.util.List;
+
+/** Represents a deletion request */
+public class DeletionRequest implements IDeletionRequest<String, Integer, RequestStatus> {
+
+ // tags
+ List<String> keys;
+
+ // int32 id
+ int value;
+
+ // deletion result
+ RequestStatus requestStatus;
Review Comment:
The result or response should be hold and maintained in context rather request.
##########
schema-engine-tag/src/main/java/org/apache/iotdb/lsm/annotation/DeletionProcessor.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * 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.lsm.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Indicates that the class using this annotation is a DeleteLevelProcessor, and the attribute level
+ * of the annotation indicates which layer of memory node the deletion method of the
+ * DeleteLevelProcessor is.
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+public @interface DeletionProcessor {
+ // level of the DeleteLevelProcessor
+ int level() default -1;
+}
Review Comment:
Nice trial. The annotation does help simplify the code. However, is there any performance analysis to reveal that it is acceptable?
##########
schema-engine-tag/src/main/java/org/apache/iotdb/db/metadata/tagSchemaRegion/tagIndex/TagInvertedIndex.java:
##########
@@ -0,0 +1,193 @@
+/*
+ * 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.metadata.tagSchemaRegion.tagIndex;
+
+import org.apache.iotdb.commons.utils.TestOnly;
+import org.apache.iotdb.db.metadata.tagSchemaRegion.config.TagSchemaConfig;
+import org.apache.iotdb.db.metadata.tagSchemaRegion.config.TagSchemaDescriptor;
+import org.apache.iotdb.db.metadata.tagSchemaRegion.tagIndex.Request.DeletionRequest;
+import org.apache.iotdb.db.metadata.tagSchemaRegion.tagIndex.Request.InsertionRequest;
+import org.apache.iotdb.db.metadata.tagSchemaRegion.tagIndex.Request.QueryRequest;
+import org.apache.iotdb.db.metadata.tagSchemaRegion.tagIndex.memtable.MemTableGroup;
+import org.apache.iotdb.db.metadata.tagSchemaRegion.tagIndex.wal.WALEntry;
+import org.apache.iotdb.db.metadata.tagSchemaRegion.tagIndex.wal.WALManager;
+import org.apache.iotdb.lsm.engine.LSMEngine;
+import org.apache.iotdb.lsm.engine.LSMEngineBuilder;
+
+import org.roaringbitmap.RoaringBitmap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/** tag inverted index, tag is <tagkey,tagValue> and id is int32 auto increment id */
+public class TagInvertedIndex implements ITagInvertedIndex {
+
+ // This file records the wal log
+ private static final String WAL_FILE_NAME = "tag_inverted_index.log";
+
+ private static final Logger logger = LoggerFactory.getLogger(TagInvertedIndex.class);
+
+ // Manage configuration information of tag schema region
+ private static final TagSchemaConfig tagSchemaConfig =
+ TagSchemaDescriptor.getInstance().getTagSchemaConfig();
+
+ // Directly use the lsm engine that comes with the lsm framework to implement the tag inverted
+ // index
+ LSMEngine<MemTableGroup> lsmEngine;
+
+ /**
+ * initialization method
+ *
+ * @param schemaDirPath schema dirPath
+ */
+ public TagInvertedIndex(String schemaDirPath) {
+ try {
+ WALManager walManager =
+ new WALManager(
+ schemaDirPath,
+ WAL_FILE_NAME,
+ tagSchemaConfig.getWalBufferSize(),
+ new WALEntry(),
+ false);
+ // root memory node, used to manage working and immutableMemTables
+ MemTableGroup memTableGroup =
+ new MemTableGroup(tagSchemaConfig.getNumOfDeviceIdsInMemTable());
+
+ // build lsm engine
+ lsmEngine =
+ new LSMEngineBuilder<MemTableGroup>()
+ .buildLSMManagers("org.apache.iotdb.db.metadata.tagSchemaRegion.tagIndex", walManager)
+ .buildRootMemNode(memTableGroup)
+ .build();
+
+ // recover the lsm engine
+ lsmEngine.recover();
+ } catch (Exception e) {
+ logger.error(e.getMessage());
+ }
+ }
+
+ /**
+ * insert tags and device id
+ *
+ * @param tags tags like: <tagKey,tagValue>
+ * @param id INT32 device id
+ */
+ @Override
+ public synchronized void addTags(Map<String, String> tags, int id) {
+ try {
+ for (Map.Entry<String, String> tag : tags.entrySet()) {
+ InsertionRequest insertionRequest =
+ new InsertionRequest(generateKeys(tag.getKey(), tag.getValue()), id);
+ lsmEngine.insert(insertionRequest);
+ }
+ } catch (Exception e) {
+ logger.error(e.getMessage());
+ }
Review Comment:
There's no exception thrown in the interface definition. Please polish the exception handler mechanism. The exception shall be thrown or passed in execution result.
##########
schema-engine-tag/src/main/java/org/apache/iotdb/db/metadata/tagSchemaRegion/tagIndex/Request/RequestStatus.java:
##########
@@ -0,0 +1,41 @@
+/*
+ * 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.metadata.tagSchemaRegion.tagIndex.Request;
+
+/** Indicates the status of the request, whether it is successful after the request is processed */
+public class RequestStatus {
+
+ Boolean success;
+
Review Comment:
Rename to Response or ExecutionResult or something like this.
--
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
[GitHub] [iotdb] KeeProMise commented on a diff in pull request #7424: [IOTDB-4520] The tag schema region is implemented and supports the influxdb protocol
Posted by GitBox <gi...@apache.org>.
KeeProMise commented on code in PR #7424:
URL: https://github.com/apache/iotdb/pull/7424#discussion_r1004606687
##########
schema-engine-tag/src/main/java/org/apache/iotdb/db/metadata/tagSchemaRegion/tagIndex/Request/DeletionRequest.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * 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.metadata.tagSchemaRegion.tagIndex.Request;
+
+import org.apache.iotdb.lsm.context.requestcontext.RequestContext;
+import org.apache.iotdb.lsm.request.IDeletionRequest;
+
+import java.util.List;
+
+/** Represents a deletion request */
+public class DeletionRequest implements IDeletionRequest<String, Integer, RequestStatus> {
+
+ // tags
+ List<String> keys;
+
+ // int32 id
+ int value;
+
+ // deletion result
+ RequestStatus requestStatus;
Review Comment:
ok, i think the same as you
--
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
[GitHub] [iotdb] KeeProMise commented on a diff in pull request #7424: [IOTDB-4520] The tag schema region is implemented and supports the influxdb protocol
Posted by GitBox <gi...@apache.org>.
KeeProMise commented on code in PR #7424:
URL: https://github.com/apache/iotdb/pull/7424#discussion_r1004629671
##########
schema-engine-tag/src/main/java/org/apache/iotdb/db/metadata/tagSchemaRegion/tagIndex/Request/DeletionRequest.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * 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.metadata.tagSchemaRegion.tagIndex.Request;
+
+import org.apache.iotdb.lsm.context.requestcontext.RequestContext;
+import org.apache.iotdb.lsm.request.IDeletionRequest;
+
+import java.util.List;
+
+/** Represents a deletion request */
+public class DeletionRequest implements IDeletionRequest<String, Integer, RequestStatus> {
+
+ // tags
+ List<String> keys;
+
+ // int32 id
+ int value;
+
+ // deletion result
+ RequestStatus requestStatus;
Review Comment:
I understand that I save the response result in the context because the response needs to be constructed or updated in multi execution stages, and then modify the insert, delete, query interface methods in ILSMEngine to return the response instead of void
--
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