New returns a sorted.KeyValue implementation that adds a Flush method to flush the buffer to the backing storage. A flush will also be performed when maxBufferBytes are reached. If maxBufferBytes <= 0, no automatic flushing is performed.
(buffer, backing sorted.KeyValue, maxBufferBytes int64)
| 33 | // also be performed when maxBufferBytes are reached. If |
| 34 | // maxBufferBytes <= 0, no automatic flushing is performed. |
| 35 | func New(buffer, backing sorted.KeyValue, maxBufferBytes int64) *KeyValue { |
| 36 | return &KeyValue{ |
| 37 | buf: buffer, |
| 38 | back: backing, |
| 39 | maxBuffer: maxBufferBytes, |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | var _ sorted.KeyValue = (*KeyValue)(nil) |
| 44 |