Class V012FileTimeIndex

  • All Implemented Interfaces:
    ITimeIndex

    public class V012FileTimeIndex
    extends java.lang.Object
    implements ITimeIndex
    • Constructor Detail

      • V012FileTimeIndex

        public V012FileTimeIndex()
        devices
    • Method Detail

      • serialize

        public void serialize​(java.io.OutputStream outputStream)
                       throws java.io.IOException
        Description copied from interface: ITimeIndex
        serialize to outputStream
        Specified by:
        serialize in interface ITimeIndex
        Parameters:
        outputStream - outputStream
        Throws:
        java.io.IOException
      • deserialize

        public FileTimeIndex deserialize​(java.io.InputStream inputStream)
                                  throws java.io.IOException
        Description copied from interface: ITimeIndex
        deserialize from inputStream
        Specified by:
        deserialize in interface ITimeIndex
        Parameters:
        inputStream - inputStream
        Returns:
        TimeIndex
        Throws:
        java.io.IOException
      • deserialize

        public FileTimeIndex deserialize​(java.nio.ByteBuffer buffer)
        Description copied from interface: ITimeIndex
        deserialize from byte buffer
        Specified by:
        deserialize in interface ITimeIndex
        Parameters:
        buffer - byte buffer
        Returns:
        TimeIndex
      • close

        public void close()
        Description copied from interface: ITimeIndex
        do something when TsFileResource is closing (may be empty method)
        Specified by:
        close in interface ITimeIndex
      • getDevices

        public java.util.Set<java.lang.String> getDevices​(java.lang.String tsFilePath,
                                                          TsFileResource tsFileResource)
        Description copied from interface: ITimeIndex
        get devices in TimeIndex
        Specified by:
        getDevices in interface ITimeIndex
        Returns:
        device names
      • endTimeEmpty

        public boolean endTimeEmpty()
        Specified by:
        endTimeEmpty in interface ITimeIndex
        Returns:
        whether end time is empty (Long.MIN_VALUE)
      • stillLives

        public boolean stillLives​(long timeLowerBound)
        Specified by:
        stillLives in interface ITimeIndex
        Parameters:
        timeLowerBound - time lower bound
        Returns:
        whether any of the device lives over the given time bound
      • calculateRamSize

        public long calculateRamSize()
        Specified by:
        calculateRamSize in interface ITimeIndex
        Returns:
        Calculate file index ram size
      • getTimePartition

        public long getTimePartition​(java.lang.String tsFilePath)
        Description copied from interface: ITimeIndex
        get time partition
        Specified by:
        getTimePartition in interface ITimeIndex
        Parameters:
        tsFilePath - tsFile absolute path
        Returns:
        partition
      • isSpanMultiTimePartitions

        public boolean isSpanMultiTimePartitions()
        Description copied from interface: ITimeIndex
        Check whether the tsFile spans multiple time partitions.
        Specified by:
        isSpanMultiTimePartitions in interface ITimeIndex
        Returns:
        true if the tsFile spans multiple time partitions, otherwise false.
      • updateStartTime

        public void updateStartTime​(java.lang.String deviceId,
                                    long time)
        Description copied from interface: ITimeIndex
        update start time
        Specified by:
        updateStartTime in interface ITimeIndex
        Parameters:
        deviceId - device name
        time - start time
      • updateEndTime

        public void updateEndTime​(java.lang.String deviceId,
                                  long time)
        Description copied from interface: ITimeIndex
        update end time
        Specified by:
        updateEndTime in interface ITimeIndex
        Parameters:
        deviceId - device name
        time - end time
      • putStartTime

        public void putStartTime​(java.lang.String deviceId,
                                 long time)
        Description copied from interface: ITimeIndex
        put start time
        Specified by:
        putStartTime in interface ITimeIndex
        Parameters:
        deviceId - device name
        time - start time
      • putEndTime

        public void putEndTime​(java.lang.String deviceId,
                               long time)
        Description copied from interface: ITimeIndex
        put end time
        Specified by:
        putEndTime in interface ITimeIndex
        Parameters:
        deviceId - device name
        time - end time
      • getStartTime

        public long getStartTime​(java.lang.String deviceId)
        Description copied from interface: ITimeIndex
        get start time of device
        Specified by:
        getStartTime in interface ITimeIndex
        Parameters:
        deviceId - device name
        Returns:
        start time
      • getEndTime

        public long getEndTime​(java.lang.String deviceId)
        Description copied from interface: ITimeIndex
        get end time of device
        Specified by:
        getEndTime in interface ITimeIndex
        Parameters:
        deviceId - device name
        Returns:
        end time
      • checkDeviceIdExist

        public boolean checkDeviceIdExist​(java.lang.String deviceId)
        Description copied from interface: ITimeIndex
        check whether deviceId exists in TsFile
        Specified by:
        checkDeviceIdExist in interface ITimeIndex
        Parameters:
        deviceId - device name
        Returns:
        true if the deviceId may exist in TsFile, otherwise false.
      • getMinStartTime

        public long getMinStartTime()
        Description copied from interface: ITimeIndex
        get min start time of device
        Specified by:
        getMinStartTime in interface ITimeIndex
        Returns:
        min start time
      • getMaxEndTime

        public long getMaxEndTime()
        Description copied from interface: ITimeIndex
        get max end time of device
        Specified by:
        getMaxEndTime in interface ITimeIndex
        Returns:
        max end time
      • compareDegradePriority

        public int compareDegradePriority​(ITimeIndex timeIndex)
        Description copied from interface: ITimeIndex
        compare the priority of two ITimeIndex
        Specified by:
        compareDegradePriority in interface ITimeIndex
        Parameters:
        timeIndex - another timeIndex
        Returns:
        value is less than 0 if the priority of this timeIndex is higher than the argument, value is equal to 0 if the priority of this timeIndex is equal to the argument, value is larger than 0 if the priority of this timeIndex is less than the argument
      • mayContainsDevice

        public boolean mayContainsDevice​(java.lang.String device)
        Description copied from interface: ITimeIndex
        Whether this TsFile contains this device, if false, it must not contain this device, if true, it may or may not contain this device
        Specified by:
        mayContainsDevice in interface ITimeIndex