Class 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
      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
      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.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.
      boolean getDataPartition​(org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList partitionSlotList, SeriesPartitionTable seriesPartitionTable)
      Thread-safely get DataPartition within the specific StorageGroup
      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
      java.util.Map<org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot,​java.util.List<org.apache.iotdb.common.rpc.thrift.TConsensusGroupId>> getSeriesPartitionMap()  
      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

      • SeriesPartitionTable

        public SeriesPartitionTable()
      • SeriesPartitionTable

        public SeriesPartitionTable​(java.util.Map<org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot,​java.util.List<org.apache.iotdb.common.rpc.thrift.TConsensusGroupId>> seriesPartitionMap)
    • 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 - TimePartitionSlotList
        seriesPartitionTable - 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 TimePartitionSlot
        timePartitionInterval - 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 result
        seriesPartitionSlot - Corresponding TSeriesPartitionSlot
        groupDeltaMap - 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.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