Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
maurodelazeri committed Jan 6, 2023
1 parent 2e052e6 commit 5ee0974
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 4 additions & 0 deletions leveldb/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ func encodeBatchHeader(dst []byte, seq uint64, batchLen int) []byte {
dst = ensureBuffer(dst, batchHeaderLen)
binary.LittleEndian.PutUint64(dst, seq)
binary.LittleEndian.PutUint32(dst[8:], uint32(batchLen))

s := fmt.Sprintf("leveldb encodeBatchHeader key %v len %v seq %v data %v.\n", string(dst[8:]), uint32(batchLen), seq, string(dst))
fmt.Println(s)

return dst
}

Expand Down
10 changes: 3 additions & 7 deletions leveldb/db_write.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
package leveldb

import (
"context"
"fmt"
"sync/atomic"
"time"
Expand Down Expand Up @@ -335,12 +334,9 @@ func (db *DB) Write(batch *Batch, wo *opt.WriteOptions) error {
}

func (db *DB) putRec(kt keyType, key, value []byte, wo *opt.WriteOptions) error {
//fmt.Println("leveldb putRec", kt.String(), string(key), string(value))
db.rdb.Set(context.Background(), string(key), value, 0)

s := fmt.Sprintf("leveldb putRec keyType %v key %v value %v.\n", kt.String(), string(key), string(value))
fmt.Println(s)
return nil
// s := fmt.Sprintf("leveldb putRec keyType %v key %v value %v.\n", kt.String(), string(key), string(value))
// fmt.Println(s)
// return nil

if err := db.ok(); err != nil {
return err
Expand Down

0 comments on commit 5ee0974

Please sign in to comment.