GetLog is a method on RocksDbStore that retrieves a log entry by its index
(index uint64, log *raft.Log)
| 53 | |
| 54 | // GetLog is a method on RocksDbStore that retrieves a log entry by its index |
| 55 | func (rds *RocksDbStore) GetLog(index uint64, log *raft.Log) error { |
| 56 | ro := gorocksdb.NewDefaultReadOptions() |
| 57 | defer ro.Destroy() |
| 58 | |
| 59 | val, err := rds.conn.Get(ro, uint64ToBytes(index)) |
| 60 | if err != nil { |
| 61 | return err |
| 62 | } |
| 63 | err = encoding.DecodeMessagePack(val.Data(), log) |
| 64 | if err != nil { |
| 65 | return err |
| 66 | } |
| 67 | return nil |
| 68 | } |
| 69 | |
| 70 | // StoreLog is a method on RocksDbStore that stores a single log entry |
| 71 | func (rds *RocksDbStore) StoreLog(log *raft.Log) error { |
nothing calls this directly
no test coverage detected