[IOTDB-5674] Multi-Mode IMNode Management#9243
Conversation
server/src/test/java/org/apache/iotdb/db/metadata/mtree/schemafile/RecordUtilTests.java
Outdated
Show resolved
Hide resolved
| IMeasurementSchema getSchema(); | ||
|
|
||
| TSDataType getDataType(String measurementId); | ||
| void setSchema(IMeasurementSchema schema); |
There was a problem hiding this comment.
We assume the schema is immutable. Is this interface necessary?
There was a problem hiding this comment.
use to implement moveDataToNewMNode()
There was a problem hiding this comment.
There seems only device node replacement. There won't be any measurement node replacement. Maybe we can push down the moveDataToNewMNode() to only InternalMNode and its subclass.
| import org.apache.iotdb.commons.schema.node.info.IMeasurementInfo; | ||
| import org.apache.iotdb.commons.schema.node.role.IDatabaseMNode; | ||
| import org.apache.iotdb.commons.schema.node.role.IDeviceMNode; | ||
| import org.apache.iotdb.commons.schema.node.role.IMeasurementMNode; |
There was a problem hiding this comment.
The device and measurement related code seems only being used in server package.
server/src/main/java/org/apache/iotdb/db/metadata/mnode/config/IConfigMNode.java
Show resolved
Hide resolved
server/src/main/java/org/apache/iotdb/db/metadata/mtree/ConfigMTree.java
Show resolved
Hide resolved
server/src/main/java/org/apache/iotdb/db/metadata/mtree/IMTreeBelowSG.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/apache/iotdb/db/metadata/mnode/schemafile/ICacheMNode.java
Outdated
Show resolved
Hide resolved
| void pin(IMNode node) throws MetadataException; | ||
| void pin(N node) throws MetadataException; | ||
|
|
||
| void unPin(IMNode node); | ||
| void unPin(N node); | ||
|
|
||
| void unPinPath(IMNode node); | ||
| void unPinPath(N node); |
There was a problem hiding this comment.
Maybe these interfaces should only be behavior of CachdMTreeStore. The common behavior are releaseNode and releasePath, which only used in Traverser.
There was a problem hiding this comment.
Yes.. but it's still be used in SchemaRegionSchemaFileImpl. I added these todo's about a month ago..
// TODO: This interface should not be exposed to SchemaRegion
public void pinMNode(ICacheMNode node) throws MetadataException {
store.pin(node);
}
// TODO: This interface should not be exposed to SchemaRegion
public void unPinMNode(ICacheMNode node) {
store.unPin(node);
}
private void unPinPath(ICacheMNode node) {
store.unPinPath(node);
}
// TODO: This interface should not be exposed to SchemaRegion
public void updateMNode(ICacheMNode node) throws MetadataException {
store.updateMNode(node);
}
There was a problem hiding this comment.
At least the Traverser shall not sense these interface? It takes a big effort to refactor the implementations in SchemaRegionSchemaFileImpl.
| // measurement in template should be processed only if templateMap is not null | ||
| protected Map<Integer, Template> templateMap; | ||
| protected IMNodeFactory<N> nodeFactory; |
There was a problem hiding this comment.
This can be pushed down to MeasurementTraverser. This class will act as a common traverser and will be placed in package node-commons.
There was a problem hiding this comment.
I think it's ok to put all the getChild logic in a base class. It will also make it easier to read.
Description
https://apache-iotdb.feishu.cn/docx/JZhudIX6Vob7kxx62t2cWeeLnbb