Skip to content

Add SchemaRegion Interfaces to SchemaEngine#5349

Merged
qiaojialin merged 17 commits intoapache:masterfrom
MarcosZyk:schema_region
Mar 28, 2022
Merged

Add SchemaRegion Interfaces to SchemaEngine#5349
qiaojialin merged 17 commits intoapache:masterfrom
MarcosZyk:schema_region

Conversation

@MarcosZyk
Copy link
Contributor

@MarcosZyk MarcosZyk commented Mar 26, 2022

Description

Implement LocalConfigManager

  1. Local schema configs include storage group, template, schemaRegion and dataRegion(in progress), thus all the related managers and management code have been moved from SchemaEngine to LocalConfigManager
  2. LocalConfigManager will manage the configs above for dataNode and will interact with ConfigNode
  3. LocalConfigManager simulates the behavior of config node on one DataNode
  4. Currently, the SchemaEngine has been refactored to a schema query/plan executor. It is still now the entrance of all metadata queries in standalone mode.

Add SchemaRegion Management to LocalConfigManager

  1. Add SchemaRegion Management to LocalSchemaConfigManager for new cluster development, including createSchemaRegion, getSchemaRegion and deleteSchemaRegion
  2. In current standalone mode, or in v0.14, each storage group will only have one schemaRegion

Refactor Storage Group Management

The persistent log records of storage group operation has been separated and stored in storage_group_log.bin. The folder of storage group will be created only one there's schemaRegion needed to be create.

Future work

LocalConfigManager

  1. Extract an Interface for ConfigNode and make LocalConfigManager implements it.
  2. Implement dataRegion management in LocalConfigManager.
  3. Implement the cluster config management based on ConfigNode and LocalConfigManager in DataNode

Rename

Rename current SchemaEngine to LocalSchemaProcessor to act only as the proxy of schema query.
Rename SchemaRegionManager to SchemaEngine to manage schemaRegion.

The development of new cluster will based on LocalConfigManager, SchemaRegion and new SchemaEngine.

Template

I'tried to implement multi schemaRegions for one storage group, which is quite similar with the schemaRegion management and metadata operation implementation in cluster mode. Everything worked fine except one feature, Template, which is too complex to be handled, and the corresponding scheme hasn't been design in new cluster.

The template can be set to any Internal node under sg in mtree, and this is the main difficulty. In current schema partition design, an Internal node may exists in several schemaRegions of one storage group, since the schema is partitioned by device hash.

I've designed and implement a version but it isn't worth enough to be mocked or applied on standalone mode. Hope there will be a nice solution.

new File(logFilePath).getParentFile().mkdirs();
Whitebox.setInternalState(schemaEngine, "logFilePath", logFilePath);
schemaEngine.initForMultiSchemaEngineTest();
// schemaEngine.initForMultiSchemaEngineTest();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?

Comment on lines +40 to +41
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add {}

* This class simulates the behaviour of configNode to manage the schema configs locally. The schema
* configs include storage group, schema region and template.
*/
public class LocalSchemaConfigManager {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public class LocalSchemaConfigManager {
public class LocalConfigManager {

import java.util.concurrent.ConcurrentHashMap;

// manage all the schemaRegion in this dataNode
public class SchemaRegionManager {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public class SchemaRegionManager {
public class SchemaEngine {

@qiaojialin qiaojialin merged commit b103385 into apache:master Mar 28, 2022
xinzhongtianxia pushed a commit to xinzhongtianxia/iotdb that referenced this pull request Apr 5, 2022
…er_meta

* remotes/upstream/master:
  Rename SchemaEngine to LocalSchemaProcessor and Rename SchemaRegionManager to SchemaEngine (apache#5359)
  Add SchemaRegion Interfaces to SchemaEngine (apache#5349)
  [IOTDB-2803] adapt metadata write operation to plannode (apache#5344)
  [IOTDB-2679] Support logical operators in select clauses (apache#5273)
  [IOTDB-2671][metrics] Improve the implementation of iotdbReporter (apache#5338)

# Conflicts:
#	server/src/main/java/org/apache/iotdb/db/mpp/sql/planner/LogicalPlanner.java
#	server/src/test/java/org/apache/iotdb/db/mpp/sql/plan/LogicalPlannerTest.java
@MarcosZyk MarcosZyk deleted the schema_region branch April 22, 2022 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants