Class DeletionGroup
- java.lang.Object
-
- org.apache.iotdb.db.sync.datasource.DeletionGroup
-
public class DeletionGroup extends java.lang.ObjectThis class provides below functions1) 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDeletionGroup.DeletedTypestatic classDeletionGroup.IntervalCursor
-
Constructor Summary
Constructors Constructor Description DeletionGroup()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDelInterval(long startTime, long endTime)Insert delete time interval data for every deletion.DeletionGroup.DeletedTypecheckDeletedState(long startTime, long endTime)Check the deletion-state of the data-points of specific time range according to the info of .modsjava.util.TreeMap<java.lang.Long,java.lang.Long>getDelIntervalMap()booleanisDeleted(long ts)Check whether this timestamp's data has been deleted according to .mods info and data timestampbooleanisDeleted(long ts, DeletionGroup.IntervalCursor intervalCursor)Check whether ascending timestamp batch data have been deleted according to .mods info.booleanisEmpty()If this object has no deletion data (i.e delIntervalMap is empty), return true
-
-
-
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, inclusiveendTime- - 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()
-
-