类 ClusterSchemaManager


  • public class ClusterSchemaManager
    extends java.lang.Object
    The ClusterSchemaManager Manages cluster schema read and write requests.
    • 构造器详细资料

    • 方法详细资料

      • setStorageGroup

        public org.apache.iotdb.common.rpc.thrift.TSStatus setStorageGroup​(SetStorageGroupPlan setStorageGroupPlan)
        Set StorageGroup
        返回:
        SUCCESS_STATUS if the StorageGroup is set successfully. STORAGE_GROUP_ALREADY_EXISTS if the StorageGroup is already set. PERSISTENCE_FAILURE if fail to set StorageGroup in MTreeAboveSG.
      • deleteStorageGroup

        public org.apache.iotdb.common.rpc.thrift.TSStatus deleteStorageGroup​(DeleteStorageGroupPlan deleteStorageGroupPlan)
        Delete StorageGroup synchronized to protect the safety of adjustMaxRegionGroupNum
      • countMatchedStorageGroups

        public org.apache.iotdb.consensus.common.DataSet countMatchedStorageGroups​(CountStorageGroupPlan countStorageGroupPlan)
        Count StorageGroups by specific path pattern
        返回:
        CountStorageGroupResp
      • getMatchedStorageGroupSchema

        public org.apache.iotdb.consensus.common.DataSet getMatchedStorageGroupSchema​(GetStorageGroupPlan getStorageGroupPlan)
        Get StorageGroupSchemas by specific path pattern
        返回:
        StorageGroupSchemaDataSet
      • showStorageGroup

        public org.apache.iotdb.confignode.rpc.thrift.TShowStorageGroupResp showStorageGroup​(GetStorageGroupPlan getStorageGroupPlan)
        Only used in cluster tool show StorageGroup
      • getAllTTLInfo

        public java.util.Map<java.lang.String,​java.lang.Long> getAllTTLInfo()
      • setTTL

        public org.apache.iotdb.common.rpc.thrift.TSStatus setTTL​(SetTTLPlan setTTLPlan)
        Update TTL for the specific StorageGroup or all databases in a path
        参数:
        setTTLPlan - setTTLPlan
        返回:
        SUCCESS_STATUS if successfully update the TTL, STORAGE_GROUP_NOT_EXIST if the path doesn't exist
      • setSchemaReplicationFactor

        public org.apache.iotdb.common.rpc.thrift.TSStatus setSchemaReplicationFactor​(SetSchemaReplicationFactorPlan setSchemaReplicationFactorPlan)
      • setDataReplicationFactor

        public org.apache.iotdb.common.rpc.thrift.TSStatus setDataReplicationFactor​(SetDataReplicationFactorPlan setDataReplicationFactorPlan)
      • setTimePartitionInterval

        public org.apache.iotdb.common.rpc.thrift.TSStatus setTimePartitionInterval​(SetTimePartitionIntervalPlan setTimePartitionIntervalPlan)
      • adjustMaxRegionGroupNum

        public void adjustMaxRegionGroupNum()
        Only leader use this interface. Adjust the maxSchemaRegionGroupNum and maxDataRegionGroupNum of each StorageGroup bases on existing cluster resources
      • calcMaxRegionGroupNum

        public static int calcMaxRegionGroupNum​(int leastRegionGroupNum,
                                                double resourceWeight,
                                                int resource,
                                                int storageGroupNum,
                                                int replicationFactor,
                                                int allocatedRegionGroupCount)
      • getStorageGroupSchemaByName

        public org.apache.iotdb.confignode.rpc.thrift.TStorageGroupSchema getStorageGroupSchemaByName​(java.lang.String storageGroup)
                                                                                               throws StorageGroupNotExistsException
        Only leader use this interface.
        参数:
        storageGroup - StorageGroupName
        返回:
        The specific StorageGroupSchema
        抛出:
        StorageGroupNotExistsException - When the specific StorageGroup doesn't exist
      • getReplicationFactor

        public int getReplicationFactor​(java.lang.String storageGroup,
                                        org.apache.iotdb.common.rpc.thrift.TConsensusGroupType consensusGroupType)
                                 throws StorageGroupNotExistsException
        Only leader use this interface
        参数:
        storageGroup - StorageGroupName
        consensusGroupType - SchemaRegion for SchemaReplicationFactor and DataRegion for DataReplicationFactor
        返回:
        SchemaReplicationFactor or DataReplicationFactor
        抛出:
        StorageGroupNotExistsException - When the specific StorageGroup doesn't exist
      • getMatchedStorageGroupSchemasByName

        public java.util.Map<java.lang.String,​org.apache.iotdb.confignode.rpc.thrift.TStorageGroupSchema> getMatchedStorageGroupSchemasByName​(java.util.List<java.lang.String> rawPathList)
        Only leader use this interface.
        参数:
        rawPathList - List
        返回:
        the matched StorageGroupSchemas
      • getStorageGroupNames

        public java.util.List<java.lang.String> getStorageGroupNames()
        Only leader use this interface.
        返回:
        List, all StorageGroups' name
      • getMaxRegionGroupNum

        public int getMaxRegionGroupNum​(java.lang.String storageGroup,
                                        org.apache.iotdb.common.rpc.thrift.TConsensusGroupType consensusGroupType)
        Only leader use this interface. Get the maxRegionGroupNum of specific StorageGroup.
        参数:
        storageGroup - StorageGroupName
        consensusGroupType - SchemaRegion or DataRegion
        返回:
        maxSchemaRegionGroupNum or maxDataRegionGroupNum
      • createTemplate

        public org.apache.iotdb.common.rpc.thrift.TSStatus createTemplate​(CreateSchemaTemplatePlan createSchemaTemplatePlan)
        create schema template
        参数:
        createSchemaTemplatePlan - CreateSchemaTemplatePlan
        返回:
        TSStatus
      • getAllTemplates

        public org.apache.iotdb.confignode.rpc.thrift.TGetAllTemplatesResp getAllTemplates()
        show schema template
        返回:
        TGetAllTemplatesResp
      • getTemplate

        public org.apache.iotdb.confignode.rpc.thrift.TGetTemplateResp getTemplate​(java.lang.String req)
        show nodes in schema template
      • setSchemaTemplate

        public org.apache.iotdb.common.rpc.thrift.TSStatus setSchemaTemplate​(java.lang.String templateName,
                                                                             java.lang.String path)
        mount template
      • getPathsSetTemplate

        public org.apache.iotdb.confignode.rpc.thrift.TGetPathsSetTemplatesResp getPathsSetTemplate​(java.lang.String templateName)
        show path set template xx
      • getAllTemplateSetInfo

        public byte[] getAllTemplateSetInfo()
        get all template set info to sync to all dataNodes, the pre unset template info won't be taken
      • getTemplateSetInfo

        public TemplateSetInfoResp getTemplateSetInfo​(java.util.List<org.apache.iotdb.commons.path.PartialPath> patternList)
      • checkIsTemplateSetOnPath

        public org.apache.iotdb.tsfile.utils.Pair<org.apache.iotdb.common.rpc.thrift.TSStatus,​org.apache.iotdb.db.metadata.template.Template> checkIsTemplateSetOnPath​(java.lang.String templateName,
                                                                                                                                                                             java.lang.String path)
      • preUnsetSchemaTemplate

        public org.apache.iotdb.common.rpc.thrift.TSStatus preUnsetSchemaTemplate​(int templateId,
                                                                                  org.apache.iotdb.commons.path.PartialPath path)
      • rollbackPreUnsetSchemaTemplate

        public org.apache.iotdb.common.rpc.thrift.TSStatus rollbackPreUnsetSchemaTemplate​(int templateId,
                                                                                          org.apache.iotdb.commons.path.PartialPath path)
      • unsetSchemaTemplateInBlackList

        public org.apache.iotdb.common.rpc.thrift.TSStatus unsetSchemaTemplateInBlackList​(int templateId,
                                                                                          org.apache.iotdb.commons.path.PartialPath path)
      • dropSchemaTemplate

        public org.apache.iotdb.common.rpc.thrift.TSStatus dropSchemaTemplate​(java.lang.String templateName)