Example #1
0
func (l *LevelDB) BatchPut(kvs []*epaxos.KVpair) error {
	b := new(leveldb.Batch)
	for i := range kvs {
		b.Set([]byte(kvs[i].Key), kvs[i].Value)
	}
	return l.ldb.Apply(*b, l.wsync)
}
Example #2
0
func (ck *DBClerk) BatchPutString(table Table, key string, value string, batch *leveldb.Batch) {
	table_key := append([]byte{byte(table)}, []byte(key)...)
	batch.Set(table_key, []byte(value))
}