Class SeriesPartitionTable
- java.lang.Object
-
- org.apache.iotdb.commons.partition.SeriesPartitionTable
-
public class SeriesPartitionTable extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description SeriesPartitionTable()SeriesPartitionTable(java.util.Map<org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot,java.util.List<org.apache.iotdb.common.rpc.thrift.TConsensusGroupId>> seriesPartitionMap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateDataPartition(SeriesPartitionTable assignedSeriesPartitionTable, org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot seriesPartitionSlot, 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>> groupDeltaMap)Create DataPartition within the specific SeriesPartitionSlotvoiddeserialize(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.List<org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot>filterUnassignedDataPartitionSlots(java.util.List<org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot> partitionSlots)Only Leader use this interface.booleangetDataPartition(org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList partitionSlotList, SeriesPartitionTable seriesPartitionTable)Thread-safely get DataPartition within the specific StorageGrouporg.apache.iotdb.common.rpc.thrift.TConsensusGroupIdgetPrecededDataPartition(org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot timePartitionSlot, long timePartitionInterval)Checks whether the specified DataPartition has a predecessor and returns if it doesjava.util.Map<org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot,java.util.List<org.apache.iotdb.common.rpc.thrift.TConsensusGroupId>>getSeriesPartitionMap()inthashCode()voidserialize(java.io.OutputStream outputStream, org.apache.thrift.protocol.TProtocol protocol)
-
-
-
Method Detail
-
getSeriesPartitionMap
public java.util.Map<org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot,java.util.List<org.apache.iotdb.common.rpc.thrift.TConsensusGroupId>> getSeriesPartitionMap()
-
getDataPartition
public boolean getDataPartition(org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList partitionSlotList, SeriesPartitionTable seriesPartitionTable)Thread-safely get DataPartition within the specific StorageGroup- Parameters:
partitionSlotList- TimePartitionSlotListseriesPartitionTable- Store the matched SeriesPartitions- Returns:
- True if all the SeriesPartitionSlots are matched, false otherwise
-
getPrecededDataPartition
public org.apache.iotdb.common.rpc.thrift.TConsensusGroupId getPrecededDataPartition(org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot timePartitionSlot, long timePartitionInterval)Checks whether the specified DataPartition has a predecessor and returns if it does- Parameters:
timePartitionSlot- Corresponding TimePartitionSlottimePartitionInterval- Time partition interval- Returns:
- The specific DataPartition's predecessor if exists, null otherwise
-
createDataPartition
public void createDataPartition(SeriesPartitionTable assignedSeriesPartitionTable, org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot seriesPartitionSlot, 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>> groupDeltaMap)
Create DataPartition within the specific SeriesPartitionSlot- Parameters:
assignedSeriesPartitionTable- Assigned resultseriesPartitionSlot- Corresponding TSeriesPartitionSlotgroupDeltaMap- Map>
-
filterUnassignedDataPartitionSlots
public java.util.List<org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot> filterUnassignedDataPartitionSlots(java.util.List<org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot> partitionSlots)
Only Leader use this interface. And this interface is synchronized. Thread-safely filter no assigned DataPartitionSlots within the specific SeriesPartitionSlot- Parameters:
partitionSlots- TimePartitionSlots- Returns:
- Unassigned PartitionSlots
-
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
-
-