Class DeletionGroup


  • public class DeletionGroup
    extends java.lang.Object
    This class provides below functions

    1) Save many deletion time-intervals.

    2) Merge overlap intervals to 1 interval.

    3) Check whether 1 time-range's data has been deleted according to saved deletion time-intervals.

    4) Check whether 1 time-point's data has been deleted according to saved deletion time-intervals.

    5) For time-ascending batch data, provide better-performance method to check whether 1 time-point's data has been deleted.

    • Constructor Summary

      Constructors 
      Constructor Description
      DeletionGroup()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addDelInterval​(long startTime, long endTime)
      Insert delete time interval data for every deletion.
      DeletionGroup.DeletedType checkDeletedState​(long startTime, long endTime)
      Check the deletion-state of the data-points of specific time range according to the info of .mods
      java.util.TreeMap<java.lang.Long,​java.lang.Long> getDelIntervalMap()  
      boolean isDeleted​(long ts)
      Check whether this timestamp's data has been deleted according to .mods info and data timestamp
      boolean isDeleted​(long ts, DeletionGroup.IntervalCursor intervalCursor)
      Check whether ascending timestamp batch data have been deleted according to .mods info.
      boolean isEmpty()
      If this object has no deletion data (i.e delIntervalMap is empty), return true
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DeletionGroup

        public DeletionGroup()
    • Method Detail

      • addDelInterval

        public void addDelInterval​(long startTime,
                                   long endTime)
        Insert delete time interval data for every deletion.
        Parameters:
        startTime -
        endTime -
      • isEmpty

        public boolean isEmpty()
        If this object has no deletion data (i.e delIntervalMap is empty), return true
        Returns:
      • checkDeletedState

        public DeletionGroup.DeletedType checkDeletedState​(long startTime,
                                                           long endTime)
        Check the deletion-state of the data-points of specific time range according to the info of .mods
        Parameters:
        startTime - - the start time of data set, inclusive
        endTime - - the end time of data set, inclusive
        Returns:
        - Please refer to the definition of DeletedType
      • isDeleted

        public boolean isDeleted​(long ts)
        Check whether this timestamp's data has been deleted according to .mods info and data timestamp
        Parameters:
        ts - - data timestamp
        Returns:
      • isDeleted

        public boolean isDeleted​(long ts,
                                 DeletionGroup.IntervalCursor intervalCursor)
        Check whether ascending timestamp batch data have been deleted according to .mods info. This method has better performance than method isDeleted(long ts) for time-ascending bath data.

        Note1: This method is only used for processing time-ascending batch data.

        Note2: Input parameter intervalCursor must be 1 variable. For first calling this method, need use new variable intervalCursor or call intervalCursor.reset(). Then continue using same variable intervalCursor for consequent calling.

        Parameters:
        ts -
        intervalCursor -
        Returns:
      • getDelIntervalMap

        public java.util.TreeMap<java.lang.Long,​java.lang.Long> getDelIntervalMap()