Class DataPartitionTable
- java.lang.Object
-
- org.apache.iotdb.commons.partition.DataPartitionTable
-
public class DataPartitionTable extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description DataPartitionTable()DataPartitionTable(java.util.Map<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot,SeriesPartitionTable> dataPartitionMap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<org.apache.iotdb.common.rpc.thrift.TConsensusGroupId,java.util.Map<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot,java.util.concurrent.atomic.AtomicLong>>createDataPartition(DataPartitionTable assignedDataPartition)Create DataPartition within the specific StorageGroupvoiddeserialize(java.io.InputStream inputStream, org.apache.thrift.protocol.TProtocol protocol)Only for Snapshotvoiddeserialize(java.nio.ByteBuffer buffer)Only for ConsensusRequestbooleanequals(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.booleangetDataPartition(java.util.Map<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot,org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList> partitionSlots, DataPartitionTable dataPartitionTable)Thread-safely get DataPartition within the specific StorageGroupjava.util.Map<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot,SeriesPartitionTable>getDataPartitionMap()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 doesjava.util.List<org.apache.iotdb.common.rpc.thrift.TConsensusGroupId>getRegionId(org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot seriesSlotId, org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot timeSlotId)Query a timePartition's corresponding dataRegionIdsjava.util.List<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot>getSeriesSlotList()java.util.List<org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot>getTimeSlotList(org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot seriesSlotId, long startTime, long endTime)inthashCode()voidserialize(java.io.OutputStream outputStream, org.apache.thrift.protocol.TProtocol protocol)
-
-
-
Constructor Detail
-
DataPartitionTable
public DataPartitionTable()
-
DataPartitionTable
public DataPartitionTable(java.util.Map<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot,SeriesPartitionTable> dataPartitionMap)
-
-
Method Detail
-
getDataPartitionMap
public java.util.Map<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot,SeriesPartitionTable> getDataPartitionMap()
-
getDataPartition
public boolean getDataPartition(java.util.Map<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot,org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList> partitionSlots, DataPartitionTable dataPartitionTable)Thread-safely get DataPartition within the specific StorageGroup- Parameters:
partitionSlots- SeriesPartitionSlots and TimePartitionSlotsdataPartitionTable- Store the matched Partitions- Returns:
- 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- Parameters:
seriesPartitionSlot- Corresponding SeriesPartitionSlottimePartitionSlot- Corresponding TimePartitionSlottimePartitionInterval- Time partition interval- Returns:
- The specific DataPartition's predecessor if exists, null otherwise
-
createDataPartition
public java.util.Map<org.apache.iotdb.common.rpc.thrift.TConsensusGroupId,java.util.Map<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot,java.util.concurrent.atomic.AtomicLong>> createDataPartition(DataPartitionTable assignedDataPartition)
Create DataPartition within the specific StorageGroup- Parameters:
assignedDataPartition- Assigned result- Returns:
- Map
>
-
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- Parameters:
partitionSlots- SeriesPartitionSlots and TimePartitionSlots- Returns:
- Unassigned PartitionSlots
-
getRegionId
public java.util.List<org.apache.iotdb.common.rpc.thrift.TConsensusGroupId> getRegionId(org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot seriesSlotId, org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot timeSlotId)Query a timePartition's corresponding dataRegionIds- Parameters:
seriesSlotId- SeriesPartitionSlottimeSlotId- TimePartitionSlot- Returns:
- the timePartition's corresponding dataRegionIds, if timeSlotId == -1, then return all the seriesSlot's dataRegionIds
-
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()
-
serialize
public void serialize(java.io.OutputStream outputStream, org.apache.thrift.protocol.TProtocol protocol) throws java.io.IOException, org.apache.thrift.TException- Throws:
java.io.IOExceptionorg.apache.thrift.TException
-
deserialize
public void deserialize(java.nio.ByteBuffer buffer)
Only for ConsensusRequest
-
deserialize
public void deserialize(java.io.InputStream inputStream, org.apache.thrift.protocol.TProtocol protocol) throws java.io.IOException, org.apache.thrift.TExceptionOnly for Snapshot- Throws:
java.io.IOExceptionorg.apache.thrift.TException
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-