类 ClusterSchemaManager
- java.lang.Object
-
- org.apache.iotdb.confignode.manager.ClusterSchemaManager
-
public class ClusterSchemaManager extends java.lang.ObjectThe ClusterSchemaManager Manages cluster schema read and write requests.
-
-
构造器概要
构造器 构造器 说明 ClusterSchemaManager(IManager configManager, ClusterSchemaInfo clusterSchemaInfo)
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 voidadjustMaxRegionGroupNum()Only leader use this interface.static intcalcMaxRegionGroupNum(int leastRegionGroupNum, double resourceWeight, int resource, int storageGroupNum, int replicationFactor, int allocatedRegionGroupCount)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)org.apache.iotdb.consensus.common.DataSetcountMatchedStorageGroups(CountStorageGroupPlan countStorageGroupPlan)Count StorageGroups by specific path patternorg.apache.iotdb.common.rpc.thrift.TSStatuscreateTemplate(CreateSchemaTemplatePlan createSchemaTemplatePlan)create schema templateorg.apache.iotdb.common.rpc.thrift.TSStatusdeleteStorageGroup(DeleteStorageGroupPlan deleteStorageGroupPlan)Delete StorageGroup synchronized to protect the safety of adjustMaxRegionGroupNumorg.apache.iotdb.common.rpc.thrift.TSStatusdropSchemaTemplate(java.lang.String templateName)org.apache.iotdb.confignode.rpc.thrift.TGetAllTemplatesRespgetAllTemplates()show schema templatebyte[]getAllTemplateSetInfo()get all template set info to sync to all dataNodes, the pre unset template info won't be takenjava.util.Map<java.lang.String,java.lang.Long>getAllTTLInfo()org.apache.iotdb.consensus.common.DataSetgetMatchedStorageGroupSchema(GetStorageGroupPlan getStorageGroupPlan)Get StorageGroupSchemas by specific path patternjava.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.intgetMaxRegionGroupNum(java.lang.String storageGroup, org.apache.iotdb.common.rpc.thrift.TConsensusGroupType consensusGroupType)Only leader use this interface.org.apache.iotdb.confignode.rpc.thrift.TGetPathsSetTemplatesRespgetPathsSetTemplate(java.lang.String templateName)show path set template xxintgetReplicationFactor(java.lang.String storageGroup, org.apache.iotdb.common.rpc.thrift.TConsensusGroupType consensusGroupType)Only leader use this interfacejava.util.List<java.lang.String>getStorageGroupNames()Only leader use this interface.org.apache.iotdb.confignode.rpc.thrift.TStorageGroupSchemagetStorageGroupSchemaByName(java.lang.String storageGroup)Only leader use this interface.org.apache.iotdb.confignode.rpc.thrift.TGetTemplateRespgetTemplate(java.lang.String req)show nodes in schema templateTemplateSetInfoRespgetTemplateSetInfo(java.util.List<org.apache.iotdb.commons.path.PartialPath> patternList)org.apache.iotdb.common.rpc.thrift.TSStatuspreUnsetSchemaTemplate(int templateId, org.apache.iotdb.commons.path.PartialPath path)org.apache.iotdb.common.rpc.thrift.TSStatusrollbackPreUnsetSchemaTemplate(int templateId, org.apache.iotdb.commons.path.PartialPath path)org.apache.iotdb.common.rpc.thrift.TSStatussetDataReplicationFactor(SetDataReplicationFactorPlan setDataReplicationFactorPlan)org.apache.iotdb.common.rpc.thrift.TSStatussetSchemaReplicationFactor(SetSchemaReplicationFactorPlan setSchemaReplicationFactorPlan)org.apache.iotdb.common.rpc.thrift.TSStatussetSchemaTemplate(java.lang.String templateName, java.lang.String path)mount templateorg.apache.iotdb.common.rpc.thrift.TSStatussetStorageGroup(SetStorageGroupPlan setStorageGroupPlan)Set StorageGrouporg.apache.iotdb.common.rpc.thrift.TSStatussetTimePartitionInterval(SetTimePartitionIntervalPlan setTimePartitionIntervalPlan)org.apache.iotdb.common.rpc.thrift.TSStatussetTTL(SetTTLPlan setTTLPlan)Update TTL for the specific StorageGroup or all databases in a pathorg.apache.iotdb.confignode.rpc.thrift.TShowStorageGroupRespshowStorageGroup(GetStorageGroupPlan getStorageGroupPlan)Only used in cluster tool show StorageGrouporg.apache.iotdb.common.rpc.thrift.TSStatusunsetSchemaTemplateInBlackList(int templateId, org.apache.iotdb.commons.path.PartialPath path)
-
-
-
构造器详细资料
-
ClusterSchemaManager
public ClusterSchemaManager(IManager configManager, ClusterSchemaInfo clusterSchemaInfo)
-
-
方法详细资料
-
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 StorageGroupNotExistsExceptionOnly 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 StorageGroupNotExistsExceptionOnly leader use this interface- 参数:
storageGroup- StorageGroupNameconsensusGroupType- 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- StorageGroupNameconsensusGroupType- 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)
-
-