DeleteRange is a method on RocksDbStore that deletes a range of log entries
(min, max uint64)
| 100 | |
| 101 | // DeleteRange is a method on RocksDbStore that deletes a range of log entries |
| 102 | func (rds *RocksDbStore) DeleteRange(min, max uint64) error { |
| 103 | ro := gorocksdb.NewDefaultReadOptions() |
| 104 | wo := gorocksdb.NewDefaultWriteOptions() |
| 105 | wb := gorocksdb.NewWriteBatch() |
| 106 | defer func() { |
| 107 | ro.Destroy() |
| 108 | wo.Destroy() |
| 109 | wb.Destroy() |
| 110 | }() |
| 111 | wb.DeleteRange(uint64ToBytes(min), uint64ToBytes(max)) |
| 112 | err := rds.conn.Write(wo, wb) |
| 113 | if err != nil { |
| 114 | return err |
| 115 | } |
| 116 | return nil |
| 117 | } |
| 118 | |
| 119 | func (rds *RocksDbStore) Set(key []byte, val []byte) error { |
| 120 | if len(key) == 0 { |
nothing calls this directly
no test coverage detected