Godeps: bump github.com/syndtr/goleveldb/... to ab8b5dcf104

pull/2836/head
Felix Lange 8 years ago
parent a4c4125b11
commit 4d014d6d7e
  1. 24
      Godeps/Godeps.json
  2. 1
      Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/batch.go
  3. 4
      Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/db_compaction.go
  4. 34
      Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/storage/file_storage_nacl.go
  5. 28
      Godeps/_workspace/src/github.com/syndtr/goleveldb/leveldb/util/hash.go

24
Godeps/Godeps.json generated vendored

@ -152,51 +152,51 @@
}, },
{ {
"ImportPath": "github.com/syndtr/goleveldb/leveldb", "ImportPath": "github.com/syndtr/goleveldb/leveldb",
"Rev": "917f41c560270110ceb73c5b38be2a9127387071" "Rev": "ab8b5dcf1042e818ab68e770d465112a899b668e"
}, },
{ {
"ImportPath": "github.com/syndtr/goleveldb/leveldb/cache", "ImportPath": "github.com/syndtr/goleveldb/leveldb/cache",
"Rev": "917f41c560270110ceb73c5b38be2a9127387071" "Rev": "ab8b5dcf1042e818ab68e770d465112a899b668e"
}, },
{ {
"ImportPath": "github.com/syndtr/goleveldb/leveldb/comparer", "ImportPath": "github.com/syndtr/goleveldb/leveldb/comparer",
"Rev": "917f41c560270110ceb73c5b38be2a9127387071" "Rev": "ab8b5dcf1042e818ab68e770d465112a899b668e"
}, },
{ {
"ImportPath": "github.com/syndtr/goleveldb/leveldb/errors", "ImportPath": "github.com/syndtr/goleveldb/leveldb/errors",
"Rev": "917f41c560270110ceb73c5b38be2a9127387071" "Rev": "ab8b5dcf1042e818ab68e770d465112a899b668e"
}, },
{ {
"ImportPath": "github.com/syndtr/goleveldb/leveldb/filter", "ImportPath": "github.com/syndtr/goleveldb/leveldb/filter",
"Rev": "917f41c560270110ceb73c5b38be2a9127387071" "Rev": "ab8b5dcf1042e818ab68e770d465112a899b668e"
}, },
{ {
"ImportPath": "github.com/syndtr/goleveldb/leveldb/iterator", "ImportPath": "github.com/syndtr/goleveldb/leveldb/iterator",
"Rev": "917f41c560270110ceb73c5b38be2a9127387071" "Rev": "ab8b5dcf1042e818ab68e770d465112a899b668e"
}, },
{ {
"ImportPath": "github.com/syndtr/goleveldb/leveldb/journal", "ImportPath": "github.com/syndtr/goleveldb/leveldb/journal",
"Rev": "917f41c560270110ceb73c5b38be2a9127387071" "Rev": "ab8b5dcf1042e818ab68e770d465112a899b668e"
}, },
{ {
"ImportPath": "github.com/syndtr/goleveldb/leveldb/memdb", "ImportPath": "github.com/syndtr/goleveldb/leveldb/memdb",
"Rev": "917f41c560270110ceb73c5b38be2a9127387071" "Rev": "ab8b5dcf1042e818ab68e770d465112a899b668e"
}, },
{ {
"ImportPath": "github.com/syndtr/goleveldb/leveldb/opt", "ImportPath": "github.com/syndtr/goleveldb/leveldb/opt",
"Rev": "917f41c560270110ceb73c5b38be2a9127387071" "Rev": "ab8b5dcf1042e818ab68e770d465112a899b668e"
}, },
{ {
"ImportPath": "github.com/syndtr/goleveldb/leveldb/storage", "ImportPath": "github.com/syndtr/goleveldb/leveldb/storage",
"Rev": "917f41c560270110ceb73c5b38be2a9127387071" "Rev": "ab8b5dcf1042e818ab68e770d465112a899b668e"
}, },
{ {
"ImportPath": "github.com/syndtr/goleveldb/leveldb/table", "ImportPath": "github.com/syndtr/goleveldb/leveldb/table",
"Rev": "917f41c560270110ceb73c5b38be2a9127387071" "Rev": "ab8b5dcf1042e818ab68e770d465112a899b668e"
}, },
{ {
"ImportPath": "github.com/syndtr/goleveldb/leveldb/util", "ImportPath": "github.com/syndtr/goleveldb/leveldb/util",
"Rev": "917f41c560270110ceb73c5b38be2a9127387071" "Rev": "ab8b5dcf1042e818ab68e770d465112a899b668e"
}, },
{ {
"ImportPath": "golang.org/x/crypto/pbkdf2", "ImportPath": "golang.org/x/crypto/pbkdf2",

@ -158,6 +158,7 @@ func (b *Batch) append(p *Batch) {
b.grow(len(p.data) - batchHdrLen) b.grow(len(p.data) - batchHdrLen)
b.data = append(b.data, p.data[batchHdrLen:]...) b.data = append(b.data, p.data[batchHdrLen:]...)
b.rLen += p.rLen b.rLen += p.rLen
b.bLen += p.bLen
} }
if p.sync { if p.sync {
b.sync = true b.sync = true

@ -172,7 +172,7 @@ func (db *DB) compactionTransact(name string, t compactionTransactInterface) {
disableBackoff = db.s.o.GetDisableCompactionBackoff() disableBackoff = db.s.o.GetDisableCompactionBackoff()
) )
for n := 0; ; n++ { for n := 0; ; n++ {
// Check wether the DB is closed. // Check whether the DB is closed.
if db.isClosed() { if db.isClosed() {
db.logf("%s exiting", name) db.logf("%s exiting", name)
db.compactionExitTransact() db.compactionExitTransact()
@ -688,7 +688,7 @@ func (db *DB) compTrigger(compC chan<- cCmd) {
} }
} }
// This will trigger auto compation and/or wait for all compaction to be done. // This will trigger auto compaction and/or wait for all compaction to be done.
func (db *DB) compTriggerWait(compC chan<- cCmd) (err error) { func (db *DB) compTriggerWait(compC chan<- cCmd) (err error) {
ch := make(chan error) ch := make(chan error)
defer close(ch) defer close(ch)

@ -0,0 +1,34 @@
// Copyright (c) 2012, Suryandaru Triandana <syndtr@gmail.com>
// All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// +build nacl
package storage
import (
"os"
"syscall"
)
func newFileLock(path string, readOnly bool) (fl fileLock, err error) {
return nil, syscall.ENOTSUP
}
func setFileLock(f *os.File, readOnly, lock bool) error {
return syscall.ENOTSUP
}
func rename(oldpath, newpath string) error {
return syscall.ENOTSUP
}
func isErrInvalid(err error) bool {
return false
}
func syncDir(name string) error {
return syscall.ENOTSUP
}

@ -7,38 +7,38 @@
package util package util
import ( import (
"bytes"
"encoding/binary" "encoding/binary"
) )
// Hash return hash of the given data. // Hash return hash of the given data.
func Hash(data []byte, seed uint32) uint32 { func Hash(data []byte, seed uint32) uint32 {
// Similar to murmur hash // Similar to murmur hash
var m uint32 = 0xc6a4a793 const (
var r uint32 = 24 m = uint32(0xc6a4a793)
h := seed ^ (uint32(len(data)) * m) r = uint32(24)
)
var (
h = seed ^ (uint32(len(data)) * m)
i int
)
buf := bytes.NewBuffer(data) for n := len(data) - len(data)%4; i < n; i += 4 {
for buf.Len() >= 4 { h += binary.LittleEndian.Uint32(data[i:])
var w uint32
binary.Read(buf, binary.LittleEndian, &w)
h += w
h *= m h *= m
h ^= (h >> 16) h ^= (h >> 16)
} }
rest := buf.Bytes() switch len(data) - i {
switch len(rest) {
default: default:
panic("not reached") panic("not reached")
case 3: case 3:
h += uint32(rest[2]) << 16 h += uint32(data[i+2]) << 16
fallthrough fallthrough
case 2: case 2:
h += uint32(rest[1]) << 8 h += uint32(data[i+1]) << 8
fallthrough fallthrough
case 1: case 1:
h += uint32(rest[0]) h += uint32(data[i])
h *= m h *= m
h ^= (h >> r) h ^= (h >> r)
case 0: case 0:

Loading…
Cancel
Save