mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-10 07:34:04 -08:00
7e85711df0
This reintroduces a LevelDB-based metrics index. Change-Id: I4111540301c52255a07b2f570761707a32f72c05
22 lines
315 B
Go
22 lines
315 B
Go
package index
|
|
|
|
import (
|
|
"github.com/syndtr/goleveldb/leveldb"
|
|
)
|
|
|
|
type batch struct {
|
|
batch *leveldb.Batch
|
|
}
|
|
|
|
func (b *batch) Put(key, value encodable) {
|
|
b.batch.Put(key.encode(), value.encode())
|
|
}
|
|
|
|
func (b *batch) Delete(k encodable) {
|
|
b.batch.Delete(k.encode())
|
|
}
|
|
|
|
func (b *batch) Reset() {
|
|
b.batch.Reset()
|
|
}
|