Class DataPartitionTable


  • public class DataPartitionTable
    extends java.lang.Object
    • 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 StorageGroup
      void deserialize​(java.io.InputStream inputStream, org.apache.thrift.protocol.TProtocol protocol)
      Only for Snapshot
      void deserialize​(java.nio.ByteBuffer buffer)
      Only for ConsensusRequest
      boolean equals​(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.
      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
      java.util.Map<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot,​SeriesPartitionTable> getDataPartitionMap()  
      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
      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
      java.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)  
      int hashCode()  
      void serialize​(java.io.OutputStream outputStream, org.apache.thrift.protocol.TProtocol protocol)  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • 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 TimePartitionSlots
        dataPartitionTable - 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 SeriesPartitionSlot
        timePartitionSlot - Corresponding TimePartitionSlot
        timePartitionInterval - 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 - SeriesPartitionSlot
        timeSlotId - 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.IOException
        org.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.TException
        Only for Snapshot
        Throws:
        java.io.IOException
        org.apache.thrift.TException
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object