Class MultiTsFileDeviceIterator

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class MultiTsFileDeviceIterator
    extends java.lang.Object
    implements java.lang.AutoCloseable
    • Constructor Detail

      • MultiTsFileDeviceIterator

        public MultiTsFileDeviceIterator​(java.util.List<TsFileResource> tsFileResources)
                                  throws java.io.IOException
        Used for inner space compaction.
        Throws:
        java.io.IOException
      • MultiTsFileDeviceIterator

        public MultiTsFileDeviceIterator​(java.util.List<TsFileResource> seqResources,
                                         java.util.List<TsFileResource> unseqResources)
                                  throws java.io.IOException
        Used for cross space compaction.
        Throws:
        java.io.IOException
    • Method Detail

      • hasNextDevice

        public boolean hasNextDevice()
      • nextDevice

        public org.apache.iotdb.tsfile.utils.Pair<java.lang.String,​java.lang.Boolean> nextDevice()
        Return next device that is minimal in lexicographical order
        Returns:
        Pair of device full path and whether this device is aligned
      • iterateNotAlignedSeries

        public MultiTsFileDeviceIterator.MeasurementIterator iterateNotAlignedSeries​(java.lang.String device,
                                                                                     boolean derserializeTimeseriesMetadata)
                                                                              throws java.io.IOException
        return MeasurementIterator, who iterates the measurements of not aligned device
        Parameters:
        device - the full path of the device to be iterated
        Returns:
        Throws:
        java.io.IOException
      • getReaderAndChunkMetadataForCurrentAlignedSeries

        public java.util.LinkedList<org.apache.iotdb.tsfile.utils.Pair<org.apache.iotdb.tsfile.read.TsFileSequenceReader,​java.util.List<org.apache.iotdb.tsfile.file.metadata.AlignedChunkMetadata>>> getReaderAndChunkMetadataForCurrentAlignedSeries()
                                                                                                                                                                                                                                                      throws java.io.IOException
        return a list of the tsfile reader and its aligned chunk metadata list for the aligned device which this iterator is visiting. If there is any modification for this device, it will be applied to the AlignedChunkMetadata, so that the user of this function can reader Chunk directly using the reader and the chunkMetadata returned. Notice, if the TsFile corresponding to a TsFileSequenceReader does not contain the current device, the TsFileSequenceReader will not appear in the return list.
        Returns:
        a list of pair(TsFileSequenceReader, the list of AlignedChunkMetadata for current device)
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.io.IOException