类 PartitionInfo
- java.lang.Object
-
- org.apache.iotdb.confignode.persistence.partition.PartitionInfo
-
- 所有已实现的接口:
org.apache.iotdb.commons.snapshot.SnapshotProcessor
public class PartitionInfo extends java.lang.Object implements org.apache.iotdb.commons.snapshot.SnapshotProcessorThe PartitionInfo stores cluster PartitionTable. The PartitionTable including: 1. regionMap: location of Region member 2. schemaPartition: location of schema 3. dataPartition: location of data
-
-
构造器概要
构造器 构造器 说明 PartitionInfo()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidclear()org.apache.iotdb.common.rpc.thrift.TSStatuscreateDataPartition(CreateDataPartitionPlan plan)Create DataPartitionorg.apache.iotdb.common.rpc.thrift.TSStatuscreateRegionGroups(CreateRegionGroupsPlan plan)Thread-safely cache allocation result of new RegionGroupsorg.apache.iotdb.common.rpc.thrift.TSStatuscreateSchemaPartition(CreateSchemaPartitionPlan plan)Create SchemaPartitionvoiddeleteStorageGroup(DeleteStorageGroupPlan plan)Thread-safely delete StorageGroupbooleanequals(java.lang.Object o)java.util.Map<java.lang.String,java.util.Map<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot,org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList>>filterUnassignedDataPartitionSlots(java.util.Map<java.lang.String,java.util.Map<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot,org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList>> partitionSlotsMap)Only Leader use this interface.java.util.Map<java.lang.String,java.util.List<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot>>filterUnassignedSchemaPartitionSlots(java.util.Map<java.lang.String,java.util.List<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot>> partitionSlotsMap)Only Leader use this interface.intgenerateNextRegionGroupId()java.util.List<org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet>getAllReplicaSets()Only leader use this interface.java.util.List<org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet>getAllReplicaSets(java.lang.String storageGroup)Only leader use this interface.java.util.List<org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet>getAllReplicaSets(org.apache.iotdb.common.rpc.thrift.TConsensusGroupType type)Only leader use this interface.intgetAssignedSeriesPartitionSlotsCount(java.lang.String storageGroup)org.apache.iotdb.consensus.common.DataSetgetDataPartition(GetDataPartitionPlan plan)Thread-safely get DataPartitionorg.apache.iotdb.common.rpc.thrift.TConsensusGroupIdgetPrecededDataPartition(java.lang.String storageGroup, org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot seriesPartitionSlot, org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot timePartitionSlot, long timePartitionInterval)Checks whether the specified DataPartition has a predecessor and returns if it doesintgetRegionGroupCount(java.lang.String storageGroup, org.apache.iotdb.common.rpc.thrift.TConsensusGroupType type)Only leader use this interface.java.util.List<org.apache.iotdb.tsfile.utils.Pair<java.lang.Long,org.apache.iotdb.common.rpc.thrift.TConsensusGroupId>>getRegionGroupSlotsCounter(java.lang.String storageGroup, org.apache.iotdb.common.rpc.thrift.TConsensusGroupType type)Only leader use this interface.org.apache.iotdb.consensus.common.DataSetgetRegionId(GetRegionIdPlan plan)org.apache.iotdb.consensus.common.DataSetgetRegionInfoList(GetRegionInfoListPlan regionsInfoPlan)Get region informationjava.util.List<RegionMaintainTask>getRegionMaintainEntryList()Get a deep copy of RegionCleanList for RegionCleaner to maintain cluster RegionReplicasjava.lang.StringgetRegionStorageGroup(org.apache.iotdb.common.rpc.thrift.TConsensusGroupId regionId)get database for regionorg.apache.iotdb.consensus.common.DataSetgetSchemaNodeManagementPartition(java.util.List<java.lang.String> matchedStorageGroups)Get SchemaNodeManagementPartition through matched storageGrouporg.apache.iotdb.consensus.common.DataSetgetSchemaPartition(GetSchemaPartitionPlan plan)Thread-safely get SchemaPartitionorg.apache.iotdb.consensus.common.DataSetgetSeriesSlotList(GetSeriesSlotListPlan plan)intgetStorageGroupPartitionTableSize()java.util.Set<org.apache.iotdb.common.rpc.thrift.TDataNodeLocation>getStorageGroupRelatedDataNodes(java.lang.String storageGroup, org.apache.iotdb.common.rpc.thrift.TConsensusGroupType type)Get the DataNodes who contain the specific StorageGroup's Schema or Dataorg.apache.iotdb.consensus.common.DataSetgetTimeSlotList(GetTimeSlotListPlan plan)inthashCode()org.apache.iotdb.common.rpc.thrift.TSStatusofferRegionMaintainTasks(OfferRegionMaintainTasksPlan offerRegionMaintainTasksPlan)Offer a batch of RegionMaintainTasks for the RegionMaintainerorg.apache.iotdb.common.rpc.thrift.TSStatuspollRegionMaintainTask()Poll the head of RegionMaintainTasks from the regionMaintainTaskList after it's executed successfullyorg.apache.iotdb.common.rpc.thrift.TSStatuspreDeleteStorageGroup(PreDeleteStorageGroupPlan preDeleteStorageGroupPlan)Thread-safely pre-delete the specific StorageGroupvoidprocessLoadSnapshot(java.io.File snapshotDir)booleanprocessTakeSnapshot(java.io.File snapshotDir)org.apache.iotdb.common.rpc.thrift.TSStatussetStorageGroup(SetStorageGroupPlan plan)Thread-safely create new StorageGroupPartitionInfointupdateRegionGroupMetric(org.apache.iotdb.common.rpc.thrift.TConsensusGroupType type)Update RegionGroup-related metricorg.apache.iotdb.common.rpc.thrift.TSStatusupdateRegionLocation(UpdateRegionLocationPlan req)Update the location info of given regionId
-
-
-
方法详细资料
-
generateNextRegionGroupId
public int generateNextRegionGroupId()
-
setStorageGroup
public org.apache.iotdb.common.rpc.thrift.TSStatus setStorageGroup(SetStorageGroupPlan plan)
Thread-safely create new StorageGroupPartitionInfo- 参数:
plan- SetStorageGroupPlan- 返回:
- SUCCESS_STATUS if the new StorageGroupPartitionInfo is created successfully.
-
createRegionGroups
public org.apache.iotdb.common.rpc.thrift.TSStatus createRegionGroups(CreateRegionGroupsPlan plan)
Thread-safely cache allocation result of new RegionGroups- 参数:
plan- CreateRegionGroupsPlan- 返回:
- SUCCESS_STATUS
-
offerRegionMaintainTasks
public org.apache.iotdb.common.rpc.thrift.TSStatus offerRegionMaintainTasks(OfferRegionMaintainTasksPlan offerRegionMaintainTasksPlan)
Offer a batch of RegionMaintainTasks for the RegionMaintainer- 返回:
- SUCCESS_STATUS
-
pollRegionMaintainTask
public org.apache.iotdb.common.rpc.thrift.TSStatus pollRegionMaintainTask()
Poll the head of RegionMaintainTasks from the regionMaintainTaskList after it's executed successfully- 返回:
- SUCCESS_STATUS
-
getRegionMaintainEntryList
public java.util.List<RegionMaintainTask> getRegionMaintainEntryList()
Get a deep copy of RegionCleanList for RegionCleaner to maintain cluster RegionReplicas- 返回:
- A deep copy of RegionCleanList
-
preDeleteStorageGroup
public org.apache.iotdb.common.rpc.thrift.TSStatus preDeleteStorageGroup(PreDeleteStorageGroupPlan preDeleteStorageGroupPlan)
Thread-safely pre-delete the specific StorageGroup- 参数:
preDeleteStorageGroupPlan- PreDeleteStorageGroupPlan- 返回:
- SUCCESS_STATUS
-
deleteStorageGroup
public void deleteStorageGroup(DeleteStorageGroupPlan plan)
Thread-safely delete StorageGroup- 参数:
plan- DeleteStorageGroupPlan
-
getSchemaPartition
public org.apache.iotdb.consensus.common.DataSet getSchemaPartition(GetSchemaPartitionPlan plan)
Thread-safely get SchemaPartition- 参数:
plan- SchemaPartitionPlan with partitionSlotsMap- 返回:
- SchemaPartitionDataSet that contains only existing SchemaPartition
-
getDataPartition
public org.apache.iotdb.consensus.common.DataSet getDataPartition(GetDataPartitionPlan plan)
Thread-safely get DataPartition- 参数:
plan- DataPartitionPlan with partitionSlotsMap- 返回:
- DataPartitionDataSet that contains only existing DataPartition
-
getPrecededDataPartition
public org.apache.iotdb.common.rpc.thrift.TConsensusGroupId getPrecededDataPartition(java.lang.String storageGroup, org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot seriesPartitionSlot, org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot timePartitionSlot, long timePartitionInterval)Checks whether the specified DataPartition has a predecessor and returns if it does- 参数:
storageGroup- StorageGroupNameseriesPartitionSlot- Corresponding SeriesPartitionSlottimePartitionSlot- Corresponding TimePartitionSlottimePartitionInterval- Time partition interval- 返回:
- The specific DataPartition's predecessor if exists, null otherwise
-
createSchemaPartition
public org.apache.iotdb.common.rpc.thrift.TSStatus createSchemaPartition(CreateSchemaPartitionPlan plan)
Create SchemaPartition- 参数:
plan- CreateSchemaPartitionPlan with SchemaPartition assigned result- 返回:
- TSStatusCode.SUCCESS_STATUS
-
createDataPartition
public org.apache.iotdb.common.rpc.thrift.TSStatus createDataPartition(CreateDataPartitionPlan plan)
Create DataPartition- 参数:
plan- CreateDataPartitionPlan with DataPartition assigned result- 返回:
- TSStatusCode.SUCCESS_STATUS
-
getSchemaNodeManagementPartition
public org.apache.iotdb.consensus.common.DataSet getSchemaNodeManagementPartition(java.util.List<java.lang.String> matchedStorageGroups)
Get SchemaNodeManagementPartition through matched storageGroup
-
getRegionInfoList
public org.apache.iotdb.consensus.common.DataSet getRegionInfoList(GetRegionInfoListPlan regionsInfoPlan)
Get region information
-
updateRegionLocation
public org.apache.iotdb.common.rpc.thrift.TSStatus updateRegionLocation(UpdateRegionLocationPlan req)
Update the location info of given regionId- 参数:
req- UpdateRegionLocationReq- 返回:
- TSStatus
-
getRegionStorageGroup
public java.lang.String getRegionStorageGroup(org.apache.iotdb.common.rpc.thrift.TConsensusGroupId regionId)
get database for region- 参数:
regionId- regionId- 返回:
- database name
-
filterUnassignedSchemaPartitionSlots
public java.util.Map<java.lang.String,java.util.List<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot>> filterUnassignedSchemaPartitionSlots(java.util.Map<java.lang.String,java.util.List<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot>> partitionSlotsMap)
Only Leader use this interface. Filter unassigned SchemaPartitionSlots- 参数:
partitionSlotsMap- Map> - 返回:
- Map
>, SchemaPartitionSlots that is not assigned in partitionSlotsMap
-
filterUnassignedDataPartitionSlots
public java.util.Map<java.lang.String,java.util.Map<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot,org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList>> filterUnassignedDataPartitionSlots(java.util.Map<java.lang.String,java.util.Map<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot,org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList>> partitionSlotsMap)
Only Leader use this interface. Filter unassigned SchemaPartitionSlots- 参数:
partitionSlotsMap- Map> - 返回:
- Map
>, DataPartitionSlots that is not assigned in partitionSlotsMap
-
getAllReplicaSets
public java.util.List<org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet> getAllReplicaSets()
Only leader use this interface.- 返回:
- Deep copy of all Regions' RegionReplicaSet
-
getAllReplicaSets
public java.util.List<org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet> getAllReplicaSets(org.apache.iotdb.common.rpc.thrift.TConsensusGroupType type)
Only leader use this interface.- 参数:
type- The specified TConsensusGroupType- 返回:
- Deep copy of all Regions' RegionReplicaSet with the specified TConsensusGroupType
-
getAllReplicaSets
public java.util.List<org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet> getAllReplicaSets(java.lang.String storageGroup)
Only leader use this interface.- 参数:
storageGroup- The specified StorageGroup- 返回:
- All Regions' RegionReplicaSet of the specified StorageGroup
-
getRegionGroupCount
public int getRegionGroupCount(java.lang.String storageGroup, org.apache.iotdb.common.rpc.thrift.TConsensusGroupType type) throws StorageGroupNotExistsExceptionOnly leader use this interface.Get the number of RegionGroups currently owned by the specified StorageGroup
- 参数:
storageGroup- StorageGroupNametype- SchemaRegion or DataRegion- 返回:
- Number of Regions currently owned by the specific StorageGroup
- 抛出:
StorageGroupNotExistsException- When the specific StorageGroup doesn't exist
-
getAssignedSeriesPartitionSlotsCount
public int getAssignedSeriesPartitionSlotsCount(java.lang.String storageGroup)
-
getStorageGroupRelatedDataNodes
public java.util.Set<org.apache.iotdb.common.rpc.thrift.TDataNodeLocation> getStorageGroupRelatedDataNodes(java.lang.String storageGroup, org.apache.iotdb.common.rpc.thrift.TConsensusGroupType type)Get the DataNodes who contain the specific StorageGroup's Schema or Data- 参数:
storageGroup- The specific StorageGroup's nametype- SchemaRegion or DataRegion- 返回:
- Set
, the related DataNodes
-
getRegionGroupSlotsCounter
public java.util.List<org.apache.iotdb.tsfile.utils.Pair<java.lang.Long,org.apache.iotdb.common.rpc.thrift.TConsensusGroupId>> getRegionGroupSlotsCounter(java.lang.String storageGroup, org.apache.iotdb.common.rpc.thrift.TConsensusGroupType type)Only leader use this interface.- 参数:
storageGroup- StorageGroupNametype- SchemaRegion or DataRegion- 返回:
- The StorageGroup's Running or Available Regions that sorted by the number of allocated slots
-
updateRegionGroupMetric
public int updateRegionGroupMetric(org.apache.iotdb.common.rpc.thrift.TConsensusGroupType type)
Update RegionGroup-related metric- 参数:
type- SchemaRegion or DataRegion- 返回:
- the number of SchemaRegion or DataRegion
-
processTakeSnapshot
public boolean processTakeSnapshot(java.io.File snapshotDir) throws org.apache.thrift.TException, java.io.IOException- 指定者:
processTakeSnapshot在接口中org.apache.iotdb.commons.snapshot.SnapshotProcessor- 抛出:
org.apache.thrift.TExceptionjava.io.IOException
-
processLoadSnapshot
public void processLoadSnapshot(java.io.File snapshotDir) throws org.apache.thrift.TException, java.io.IOException- 指定者:
processLoadSnapshot在接口中org.apache.iotdb.commons.snapshot.SnapshotProcessor- 抛出:
org.apache.thrift.TExceptionjava.io.IOException
-
getRegionId
public org.apache.iotdb.consensus.common.DataSet getRegionId(GetRegionIdPlan plan)
-
getTimeSlotList
public org.apache.iotdb.consensus.common.DataSet getTimeSlotList(GetTimeSlotListPlan plan)
-
getSeriesSlotList
public org.apache.iotdb.consensus.common.DataSet getSeriesSlotList(GetSeriesSlotListPlan plan)
-
getStorageGroupPartitionTableSize
public int getStorageGroupPartitionTableSize()
-
clear
public void clear()
-
equals
public boolean equals(java.lang.Object o)
- 覆盖:
equals在类中java.lang.Object
-
hashCode
public int hashCode()
- 覆盖:
hashCode在类中java.lang.Object
-
-