Package org.yamcs.yarch.rocksdb
Class DescendingRangeIterator
- java.lang.Object
-
- org.yamcs.yarch.rocksdb.DescendingRangeIterator
-
- All Implemented Interfaces:
AutoCloseable,DbIterator
public class DescendingRangeIterator extends Object implements DbIterator
wrapper around a rocksdb iterator that only supports prev() and is restricted to a range. if strictStart=true then the first rangeStart.length bytes of the key are compared with the rangeStart, if they are equal the record is skipped. same is valid for strictEnd So with the following DB: 1: 0x00 0x00 0x00 0x02 2: 0x01 0x01 0x01 0x00 3: 0x01 0x01 0x01 0x03 4: 0x01 0x01 0x02 0x00 and rangeStart = 0x01 0x01 0x01, strictStart=true the iterator will skip records 1,2 and 3 and start from record 4
-
-
Constructor Summary
Constructors Constructor Description DescendingRangeIterator(org.rocksdb.RocksIterator it, byte[] rangeStart, boolean strictStart, byte[] rangeEnd, boolean strictEnd)Creates a new range iterator that iteates in descending order from rangeEnd to rangeStart
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleanisValid()byte[]key()voidnext()voidprev()byte[]value()
-
-
-
Constructor Detail
-
DescendingRangeIterator
public DescendingRangeIterator(org.rocksdb.RocksIterator it, byte[] rangeStart, boolean strictStart, byte[] rangeEnd, boolean strictEnd)Creates a new range iterator that iteates in descending order from rangeEnd to rangeStart- Parameters:
it-rangeStart-strictStart-rangeEnd-strictEnd-
-
-
Method Detail
-
isValid
public boolean isValid()
- Specified by:
isValidin interfaceDbIterator
-
prev
public void prev()
- Specified by:
previn interfaceDbIterator
-
next
public void next()
- Specified by:
nextin interfaceDbIterator
-
key
public byte[] key()
- Specified by:
keyin interfaceDbIterator
-
value
public byte[] value()
- Specified by:
valuein interfaceDbIterator
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceDbIterator
-
-