Class ClusterSchemaInfo
java.lang.Object
org.apache.iotdb.confignode.persistence.schema.ClusterSchemaInfo
- All Implemented Interfaces:
SnapshotProcessor
The
ClusterSchemaInfo stores cluster schemaEngine. The cluster schemaEngine including: 1.
StorageGroupSchema 2. Template (Not implement yet)-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdjust the maximum RegionGroup count of each Database.Alter DatabaseSchema.voidCheck database limit if necessary.checkTemplateSettable(CheckTemplateSettablePlan checkTemplateSettablePlan) voidclear()commitSetSchemaTemplate(CommitSetSchemaTemplatePlan commitSetSchemaTemplatePlan) Cache DatabaseSchema.createSchemaTemplate(CreateSchemaTemplatePlan createSchemaTemplatePlan) Delete Database.dropSchemaTemplate(DropSchemaTemplatePlan dropSchemaTemplatePlan) extendSchemaTemplate(ExtendSchemaTemplatePlan extendSchemaTemplatePlan) org.apache.tsfile.utils.Pair<Set<TSchemaNode>,Set<PartialPath>> getChildNodePathInNextLevel(PartialPath partialPath, PathPatternTree scope) Only leader use this interface.getMatchedDatabaseSchemaByName(String database) Only leader use this interface.getMatchedDatabaseSchemasByName(List<String> rawPathList) Only leader use this interface.getMatchedDatabaseSchemasByOneName(String[] databasePathPattern) Only leader use this interface.intgetMaxRegionGroupNum(String database, TConsensusGroupType consensusGroupType) Only leader use this interface.intgetMinRegionGroupNum(String database, TConsensusGroupType consensusGroupType) Only leader use this interface.org.apache.tsfile.utils.Pair<List<PartialPath>,Set<PartialPath>> getNodesListInGivenLevel(PartialPath partialPath, int level, PathPatternTree scope) getPathsSetTemplate(GetPathsSetTemplatePlan getPathsSetTemplatePlan) getTemplate(int id) getTemplate(GetSchemaTemplatePlan getSchemaTemplatePlan) Get the templateId set on paths covered by input path pattern.voidisDatabaseNameValid(String databaseName) Check if the specified DatabaseName is valid.preSetSchemaTemplate(PreSetSchemaTemplatePlan preSetSchemaTemplatePlan) voidprocessLoadSnapshot(File snapshotDir) voidprocessMTreeLoadSnapshot(File snapshotDir) booleanprocessMTreeTakeSnapshot(File snapshotDir) booleanprocessTakeSnapshot(File snapshotDir) setSchemaTemplate(SetSchemaTemplatePlan setSchemaTemplatePlan)
-
Constructor Details
-
ClusterSchemaInfo
- Throws:
IOException
-
-
Method Details
-
createDatabase
Cache DatabaseSchema.- Parameters:
plan- DatabaseSchemaPlan- Returns:
- SUCCESS_STATUS if the Database is set successfully.
-
alterDatabase
Alter DatabaseSchema.- Parameters:
plan- DatabaseSchemaPlan- Returns:
- SUCCESS_STATUS if the DatabaseSchema is altered successfully.
-
deleteDatabase
Delete Database.- Parameters:
plan- DeleteDatabasePlan- Returns:
- SUCCESS_STATUS
-
checkDatabaseLimit
Check database limit if necessary.- Throws:
SchemaQuotaExceededException- if the number of databases exceeds the limitMetadataException- if other exceptions happen
-
countMatchedDatabases
- Returns:
- The number of matched Databases by the specified Database pattern
-
getMatchedDatabaseSchemas
- Returns:
- All DatabaseSchemas that matches to the specified Database pattern
-
setSchemaReplicationFactor
-
setDataReplicationFactor
-
setTimePartitionInterval
-
adjustMaxRegionGroupCount
Adjust the maximum RegionGroup count of each Database.- Parameters:
plan- AdjustMaxRegionGroupCountPlan- Returns:
- SUCCESS_STATUS
-
getDatabaseNames
Only leader use this interface.- Returns:
- List <DatabaseName>, all Databases' name.
-
isDatabaseNameValid
Check if the specified DatabaseName is valid.- Parameters:
databaseName- The specified DatabaseName- Throws:
MetadataException- If the DatabaseName invalid i.e. the specified DatabaseName is already exist, or it's a prefix of another DatabaseName
-
getMatchedDatabaseSchemaByName
public TDatabaseSchema getMatchedDatabaseSchemaByName(String database) throws DatabaseNotExistsException Only leader use this interface. Get the specificTDatabaseSchema- Parameters:
database- DatabaseName- Returns:
- The specific DatabaseSchema
- Throws:
DatabaseNotExistsException- When the specific Database doesn't exist
-
getMatchedDatabaseSchemasByName
Only leader use this interface. Get the matched DatabaseSchemas.- Parameters:
rawPathList- Databases' path patterns or full paths- Returns:
- All DatabaseSchemas that matches to the specific Database patterns
-
getMatchedDatabaseSchemasByPrefix
Only leader use this interface. Get the matched DatabaseSchemas.- Parameters:
prefix- prefix path such as root.a- Returns:
- All DatabaseSchemas that matches to the prefix path such as root.a.db1, root.a.db2
-
getMinRegionGroupNum
Only leader use this interface. Get the maxRegionGroupNum of specified Database.- Parameters:
database- DatabaseNameconsensusGroupType- SchemaRegion or DataRegion- Returns:
- maxSchemaRegionGroupNum or maxDataRegionGroupNum
-
getMaxRegionGroupNum
Only leader use this interface. Get the maxRegionGroupNum of specified Database.- Parameters:
database- DatabaseNameconsensusGroupType- SchemaRegion or DataRegion- Returns:
- maxSchemaRegionGroupNum or maxDataRegionGroupNum
-
processTakeSnapshot
- Specified by:
processTakeSnapshotin interfaceSnapshotProcessor- Throws:
IOException
-
processMTreeTakeSnapshot
- Throws:
IOException
-
processLoadSnapshot
- Specified by:
processLoadSnapshotin interfaceSnapshotProcessor- Throws:
IOException
-
processMTreeLoadSnapshot
- Throws:
IOException
-
getNodesListInGivenLevel
public org.apache.tsfile.utils.Pair<List<PartialPath>,Set<PartialPath>> getNodesListInGivenLevel(PartialPath partialPath, int level, PathPatternTree scope) -
getChildNodePathInNextLevel
public org.apache.tsfile.utils.Pair<Set<TSchemaNode>,Set<PartialPath>> getChildNodePathInNextLevel(PartialPath partialPath, PathPatternTree scope) -
createSchemaTemplate
-
getAllTemplates
-
getTemplate
-
getTemplate
- Throws:
MetadataException
-
checkTemplateSettable
-
setSchemaTemplate
-
preSetSchemaTemplate
-
commitSetSchemaTemplate
-
getPathsSetTemplate
-
getAllTemplateSetInfo
-
getTemplateSetInfo
Get the templateId set on paths covered by input path pattern. Resolve the input path patterns into specified path pattern start with template set path. The result set is organized as specified path pattern -> template id -
preUnsetSchemaTemplate
-
rollbackUnsetSchemaTemplate
-
unsetSchemaTemplate
-
dropSchemaTemplate
-
extendSchemaTemplate
-
getMatchedDatabaseSchemasByOneName
-
clear
public void clear()
-