类 StorageGroupPartitionTable
- java.lang.Object
-
- org.apache.iotdb.confignode.persistence.partition.StorageGroupPartitionTable
-
public class StorageGroupPartitionTable extends java.lang.Object
-
-
构造器概要
构造器 构造器 说明 StorageGroupPartitionTable(java.lang.String storageGroupName)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 booleancontainRegion(org.apache.iotdb.common.rpc.thrift.TConsensusGroupId regionId)if the region contained?voidcreateDataPartition(org.apache.iotdb.commons.partition.DataPartitionTable assignedDataPartition)Create DataPartition within the specific StorageGroupvoidcreateRegionGroups(java.util.List<org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet> replicaSets)Cache allocation result of new RegionGroupsvoidcreateSchemaPartition(org.apache.iotdb.commons.partition.SchemaPartitionTable assignedSchemaPartition)Create SchemaPartition within the specific StorageGroupvoiddeleteRegionGroups(java.util.List<org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet> replicaSets)Delete RegionGroups' cachevoiddeserialize(java.io.InputStream inputStream, org.apache.thrift.protocol.TProtocol protocol)booleanequals(java.lang.Object o)java.util.Map<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot,org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList>filterUnassignedDataPartitionSlots(java.util.Map<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot,org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList> partitionSlots)Only Leader use this interface.java.util.List<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot>filterUnassignedSchemaPartitionSlots(java.util.List<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot> partitionSlots)Only Leader use this interface.java.util.List<org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet>getAllReplicaSets()java.util.List<org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet>getAllReplicaSets(org.apache.iotdb.common.rpc.thrift.TConsensusGroupType type)Get all RegionGroups currently owned by this StorageGroupintgetAssignedSeriesPartitionSlotsCount()booleangetDataPartition(java.util.Map<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot,org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList> partitionSlots, org.apache.iotdb.commons.partition.DataPartitionTable dataPartition)Thread-safely get DataPartition within the specific StorageGroupintgetDataPartitionMapSize()org.apache.iotdb.common.rpc.thrift.TConsensusGroupIdgetPrecededDataPartition(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(org.apache.iotdb.common.rpc.thrift.TConsensusGroupType type)Get the number of RegionGroups currently owned by this StorageGroupjava.util.Set<RegionGroup>getRegionGroups(org.apache.iotdb.common.rpc.thrift.TConsensusGroupType type)Get all RegionGroups currently owned by this StorageGroupjava.util.List<org.apache.iotdb.tsfile.utils.Pair<java.lang.Long,org.apache.iotdb.common.rpc.thrift.TConsensusGroupId>>getRegionGroupSlotsCounter(org.apache.iotdb.common.rpc.thrift.TConsensusGroupType type)Only leader use this interface.java.util.List<org.apache.iotdb.common.rpc.thrift.TConsensusGroupId>getRegionId(org.apache.iotdb.common.rpc.thrift.TConsensusGroupType type, org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot seriesSlotId, org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot timeSlotId)java.util.List<org.apache.iotdb.confignode.rpc.thrift.TRegionInfo>getRegionInfoList(GetRegionInfoListPlan regionsInfoPlan)booleangetSchemaPartition(java.util.List<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot> partitionSlots, org.apache.iotdb.commons.partition.SchemaPartitionTable schemaPartition)Thread-safely get SchemaPartition within the specific StorageGroupintgetSchemaPartitionMapSize()java.util.List<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot>getSeriesSlotList(org.apache.iotdb.common.rpc.thrift.TConsensusGroupType type)java.lang.StringgetStorageGroupName()java.util.Set<org.apache.iotdb.common.rpc.thrift.TDataNodeLocation>getStorageGroupRelatedDataNodes(org.apache.iotdb.common.rpc.thrift.TConsensusGroupType type)Get the DataNodes who contain the specific StorageGroup's Schema or Datajava.util.List<org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot>getTimeSlotList(org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot seriesSlotId, long startTime, long endTime)inthashCode()booleanisPredeleted()voidserialize(java.io.OutputStream outputStream, org.apache.thrift.protocol.TProtocol protocol)voidsetPredeleted(boolean predeleted)voidupdateRegionLocation(org.apache.iotdb.common.rpc.thrift.TConsensusGroupId regionId, org.apache.iotdb.common.rpc.thrift.TDataNodeLocation oldNode, org.apache.iotdb.common.rpc.thrift.TDataNodeLocation newNode)update region location
-
-
-
方法详细资料
-
isPredeleted
public boolean isPredeleted()
-
setPredeleted
public void setPredeleted(boolean predeleted)
-
createRegionGroups
public void createRegionGroups(java.util.List<org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet> replicaSets)
Cache allocation result of new RegionGroups- 参数:
replicaSets- List
-
deleteRegionGroups
public void deleteRegionGroups(java.util.List<org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet> replicaSets)
Delete RegionGroups' cache- 参数:
replicaSets- List
-
getAllReplicaSets
public java.util.List<org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet> getAllReplicaSets()
- 返回:
- Deep copy of all Regions' RegionReplicaSet within one StorageGroup
-
getAllReplicaSets
public java.util.List<org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet> getAllReplicaSets(org.apache.iotdb.common.rpc.thrift.TConsensusGroupType type)
Get all RegionGroups currently owned by this StorageGroup- 参数:
type- The specified TConsensusGroupType- 返回:
- Deep copy of all Regions' RegionReplicaSet with the specified TConsensusGroupType
-
getRegionGroups
public java.util.Set<RegionGroup> getRegionGroups(org.apache.iotdb.common.rpc.thrift.TConsensusGroupType type)
Get all RegionGroups currently owned by this StorageGroup- 参数:
type- SchemaRegion or DataRegion- 返回:
- The regions currently owned by this StorageGroup
-
getRegionGroupCount
public int getRegionGroupCount(org.apache.iotdb.common.rpc.thrift.TConsensusGroupType type)
Get the number of RegionGroups currently owned by this StorageGroup- 参数:
type- SchemaRegion or DataRegion- 返回:
- The number of Regions currently owned by this StorageGroup
-
getAssignedSeriesPartitionSlotsCount
public int getAssignedSeriesPartitionSlotsCount()
-
getSchemaPartition
public boolean getSchemaPartition(java.util.List<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot> partitionSlots, org.apache.iotdb.commons.partition.SchemaPartitionTable schemaPartition)Thread-safely get SchemaPartition within the specific StorageGroup- 参数:
partitionSlots- SeriesPartitionSlotsschemaPartition- Where the results are stored- 返回:
- True if all the SeriesPartitionSlots are matched, false otherwise
-
getDataPartition
public boolean getDataPartition(java.util.Map<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot,org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList> partitionSlots, org.apache.iotdb.commons.partition.DataPartitionTable dataPartition)Thread-safely get DataPartition within the specific StorageGroup- 参数:
partitionSlots- SeriesPartitionSlots and TimePartitionSlotsdataPartition- Where the results are stored- 返回:
- True if all the PartitionSlots are matched, false otherwise
-
getPrecededDataPartition
public org.apache.iotdb.common.rpc.thrift.TConsensusGroupId getPrecededDataPartition(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- 参数:
seriesPartitionSlot- Corresponding SeriesPartitionSlottimePartitionSlot- Corresponding TimePartitionSlottimePartitionInterval- Time partition interval- 返回:
- The specific DataPartition's predecessor if exists, null otherwise
-
createSchemaPartition
public void createSchemaPartition(org.apache.iotdb.commons.partition.SchemaPartitionTable assignedSchemaPartition)
Create SchemaPartition within the specific StorageGroup- 参数:
assignedSchemaPartition- Assigned result
-
createDataPartition
public void createDataPartition(org.apache.iotdb.commons.partition.DataPartitionTable assignedDataPartition)
Create DataPartition within the specific StorageGroup- 参数:
assignedDataPartition- Assigned result
-
filterUnassignedSchemaPartitionSlots
public java.util.List<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot> filterUnassignedSchemaPartitionSlots(java.util.List<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot> partitionSlots)
Only Leader use this interface. Filter unassigned SchemaPartitionSlots within the specific StorageGroup- 参数:
partitionSlots- List- 返回:
- Unassigned PartitionSlots
-
getStorageGroupRelatedDataNodes
public java.util.Set<org.apache.iotdb.common.rpc.thrift.TDataNodeLocation> getStorageGroupRelatedDataNodes(org.apache.iotdb.common.rpc.thrift.TConsensusGroupType type)
Get the DataNodes who contain the specific StorageGroup's Schema or Data- 参数:
type- SchemaRegion or DataRegion- 返回:
- Set
, the related DataNodes
-
filterUnassignedDataPartitionSlots
public java.util.Map<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot,org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList> filterUnassignedDataPartitionSlots(java.util.Map<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot,org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList> partitionSlots)
Only Leader use this interface. Filter unassigned DataPartitionSlots within the specific StorageGroup- 参数:
partitionSlots- List- 返回:
- Unassigned PartitionSlots
-
getRegionGroupSlotsCounter
public java.util.List<org.apache.iotdb.tsfile.utils.Pair<java.lang.Long,org.apache.iotdb.common.rpc.thrift.TConsensusGroupId>> getRegionGroupSlotsCounter(org.apache.iotdb.common.rpc.thrift.TConsensusGroupType type)
Only leader use this interface.- 参数:
type- SchemaRegion or DataRegion- 返回:
- RegionGroups' slot count and index
-
getRegionInfoList
public java.util.List<org.apache.iotdb.confignode.rpc.thrift.TRegionInfo> getRegionInfoList(GetRegionInfoListPlan regionsInfoPlan)
-
serialize
public void serialize(java.io.OutputStream outputStream, org.apache.thrift.protocol.TProtocol protocol) throws java.io.IOException, org.apache.thrift.TException- 抛出:
java.io.IOExceptionorg.apache.thrift.TException
-
deserialize
public void deserialize(java.io.InputStream inputStream, org.apache.thrift.protocol.TProtocol protocol) throws java.io.IOException, org.apache.thrift.TException- 抛出:
java.io.IOExceptionorg.apache.thrift.TException
-
getRegionId
public java.util.List<org.apache.iotdb.common.rpc.thrift.TConsensusGroupId> getRegionId(org.apache.iotdb.common.rpc.thrift.TConsensusGroupType type, org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot seriesSlotId, org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot timeSlotId)
-
getTimeSlotList
public java.util.List<org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot> getTimeSlotList(org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot seriesSlotId, long startTime, long endTime)
-
getSeriesSlotList
public java.util.List<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot> getSeriesSlotList(org.apache.iotdb.common.rpc.thrift.TConsensusGroupType type)
-
updateRegionLocation
public void updateRegionLocation(org.apache.iotdb.common.rpc.thrift.TConsensusGroupId regionId, org.apache.iotdb.common.rpc.thrift.TDataNodeLocation oldNode, org.apache.iotdb.common.rpc.thrift.TDataNodeLocation newNode)update region location- 参数:
regionId- regionIdoldNode- old location, will remove itnewNode- new location, will add it
-
containRegion
public boolean containRegion(org.apache.iotdb.common.rpc.thrift.TConsensusGroupId regionId)
if the region contained?- 参数:
regionId- TConsensusGroupId- 返回:
- true if contain
-
getStorageGroupName
public java.lang.String getStorageGroupName()
-
getDataPartitionMapSize
public int getDataPartitionMapSize()
-
getSchemaPartitionMapSize
public int getSchemaPartitionMapSize()
-
equals
public boolean equals(java.lang.Object o)
- 覆盖:
equals在类中java.lang.Object
-
hashCode
public int hashCode()
- 覆盖:
hashCode在类中java.lang.Object
-
-