Skip to content
Permalink
Browse files

Initial fork (leveldb -> pebble)

  • Loading branch information...
petermattis committed Jun 13, 2018
1 parent 259d925 commit 562651f570228de4eae2fc4f22d5c52ebd5ad7d4
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package leveldb
package pebble

import (
"encoding/binary"
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package leveldb
package pebble

import (
"encoding/binary"
@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file.

// Package bloom implements Bloom filters.
package bloom // import "github.com/golang/leveldb/bloom"
package bloom // import "github.com/petermattis/pebble/bloom"

// Filter is an encoded set of []byte keys.
type Filter []byte
@@ -8,8 +8,8 @@ import (
"fmt"
"os"

"github.com/golang/leveldb/db"
"github.com/golang/leveldb/table"
"github.com/petermattis/pebble/db"
"github.com/petermattis/pebble/table"
)

var (
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package leveldb
package pebble

import (
"fmt"

"github.com/golang/leveldb/db"
"github.com/golang/leveldb/table"
"github.com/petermattis/pebble/db"
"github.com/petermattis/pebble/table"
)

const (
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package leveldb
package pebble

import (
"bytes"
@@ -13,9 +13,9 @@ import (
"testing"
"time"

"github.com/golang/leveldb/db"
"github.com/golang/leveldb/memfs"
"github.com/golang/leveldb/table"
"github.com/petermattis/pebble/db"
"github.com/petermattis/pebble/memfs"
"github.com/petermattis/pebble/table"
)

func TestPickCompaction(t *testing.T) {
@@ -12,7 +12,7 @@
// To calculate the uint32 checksum of some data:
// var u uint32 = crc.New(data).Value()
// In leveldb, the uint32 value is then stored in little-endian format.
package crc // import "github.com/golang/leveldb/crc"
package crc // import "github.com/petermattis/pebble/crc"

import (
"hash/crc32"
@@ -29,7 +29,7 @@
// db := memdb.New(&db.Options{
// Comparer: myComparer,
// })
package db // import "github.com/golang/leveldb/db"
package db // import "github.com/petermattis/pebble/db"

import (
"errors"
@@ -11,7 +11,7 @@ import (
"os/exec"
"testing"

"github.com/golang/leveldb/db"
"github.com/petermattis/pebble/db"
)

var lockFilename = flag.String("lockfile", "", "File to lock. A non-empty value implies a child process.")
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package leveldb
package pebble

import (
"fmt"
@@ -11,7 +11,7 @@ import (
"strconv"
"strings"

"github.com/golang/leveldb/db"
"github.com/petermattis/pebble/db"
)

type fileType int
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package leveldb
package pebble

import (
"path/filepath"
@@ -2,19 +2,19 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package leveldb
package pebble

import (
"bytes"

"github.com/golang/leveldb/db"
"github.com/petermattis/pebble/db"
)

// internalKey is a key used for the in-memory and on-disk partial DBs that
// make up a leveldb DB.
//
// It consists of the user key (as given by the arbitrary code that uses
// package leveldb) followed by an 8-byte trailer:
// package pebble) followed by an 8-byte trailer:
// - 1 byte for the kind of internal key: delete or set,
// - 7 bytes for a uint56 sequence number, in little-endian format.
type internalKey []byte
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package leveldb
package pebble

import (
"testing"

"github.com/golang/leveldb/db"
"github.com/petermattis/pebble/db"
)

func TestInternalKey(t *testing.T) {
@@ -5,7 +5,7 @@
// Package leveldb provides an ordered key/value store.
//
// BUG: This package is incomplete.
package leveldb // import "github.com/golang/leveldb"
package pebble // import "github.com/petermattis/pebble"

import (
"bytes"
@@ -18,10 +18,10 @@ import (
"sync"
"time"

"github.com/golang/leveldb/db"
"github.com/golang/leveldb/memdb"
"github.com/golang/leveldb/record"
"github.com/golang/leveldb/table"
"github.com/petermattis/pebble/db"
"github.com/petermattis/pebble/memdb"
"github.com/petermattis/pebble/record"
"github.com/petermattis/pebble/table"
)

const (
@@ -1,7 +1,7 @@
// Copyright 2012 The LevelDB-Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file.

package leveldb
package pebble

import (
"bytes"
@@ -18,8 +18,8 @@ import (
"testing"
"time"

"github.com/golang/leveldb/db"
"github.com/golang/leveldb/memfs"
"github.com/petermattis/pebble/db"
"github.com/petermattis/pebble/memfs"
)

// try repeatedly calls f, sleeping between calls with exponential back-off,
@@ -9,14 +9,14 @@
// deleted or values are updated with shorter slices. Callers of the package
// are responsible for explicitly compacting a MemDB into a separate DB
// (whether in-memory or on-disk) when appropriate.
package memdb // import "github.com/golang/leveldb/memdb"
package memdb // import "github.com/petermattis/pebble/memdb"

import (
"encoding/binary"
"math/rand"
"sync"

"github.com/golang/leveldb/db"
"github.com/petermattis/pebble/db"
)

// maxHeight is the maximum height of a MemDB's skiplist.
@@ -11,7 +11,7 @@ import (
"strings"
"testing"

"github.com/golang/leveldb/db"
"github.com/petermattis/pebble/db"
)

// count returns the number of entries in a DB.
@@ -6,7 +6,7 @@
//
// It can be useful for tests, and also for LevelDB instances that should not
// ever touch persistent storage, such as a web browser's private browsing mode.
package memfs // import "github.com/golang/leveldb/memfs"
package memfs // import "github.com/petermattis/pebble/memfs"

import (
"bytes"
@@ -19,7 +19,7 @@ import (
"sync"
"time"

"github.com/golang/leveldb/db"
"github.com/petermattis/pebble/db"
)

const sep = string(os.PathSeparator)
@@ -12,7 +12,7 @@ import (
"strings"
"testing"

"github.com/golang/leveldb/db"
"github.com/petermattis/pebble/db"
)

func normalize(name string) string {
@@ -73,7 +73,7 @@
// The wire format allows for limited recovery in the face of data corruption:
// on a format error (such as a checksum mismatch), the reader moves to the
// next block and looks for the next full or first chunk.
package record // import "github.com/golang/leveldb/record"
package record // import "github.com/petermattis/pebble/record"

// The C++ Level-DB code calls this the log, but it has been renamed to record
// to avoid clashing with the standard log package, and because it is generally
@@ -85,7 +85,7 @@ import (
"errors"
"io"

"github.com/golang/leveldb/crc"
"github.com/petermattis/pebble/crc"
)

// These constants are part of the wire format and should not be changed.
@@ -12,8 +12,8 @@ import (
"io"
"sort"

"github.com/golang/leveldb/crc"
"github.com/golang/leveldb/db"
"github.com/petermattis/pebble/crc"
"github.com/petermattis/pebble/db"
"github.com/golang/snappy"
)

@@ -60,7 +60,7 @@ To write a table with three entries:
}
return w.Close()
*/
package table // import "github.com/golang/leveldb/table"
package table // import "github.com/petermattis/pebble/table"

/*
The table file format looks like:
@@ -17,9 +17,9 @@ import (
"strings"
"testing"

"github.com/golang/leveldb/bloom"
"github.com/golang/leveldb/db"
"github.com/golang/leveldb/memfs"
"github.com/petermattis/pebble/bloom"
"github.com/petermattis/pebble/db"
"github.com/petermattis/pebble/memfs"
)

// nonsenseWords are words that aren't in ../testdata/h.txt.
@@ -11,8 +11,8 @@ import (
"fmt"
"io"

"github.com/golang/leveldb/crc"
"github.com/golang/leveldb/db"
"github.com/petermattis/pebble/crc"
"github.com/petermattis/pebble/db"
"github.com/golang/snappy"
)

@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package leveldb
package pebble

import (
"os"
"sync"

"github.com/golang/leveldb/db"
"github.com/golang/leveldb/table"
"github.com/petermattis/pebble/db"
"github.com/petermattis/pebble/table"
)

type tableCache struct {
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package leveldb
package pebble

import (
"bytes"
@@ -12,9 +12,9 @@ import (
"testing"
"time"

"github.com/golang/leveldb/db"
"github.com/golang/leveldb/memfs"
"github.com/golang/leveldb/table"
"github.com/petermattis/pebble/db"
"github.com/petermattis/pebble/memfs"
"github.com/petermattis/pebble/table"
)

type tableCacheTestFile struct {
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package leveldb
package pebble

import (
"fmt"
"sort"

"github.com/golang/leveldb/db"
"github.com/petermattis/pebble/db"
)

// fileMetadata holds the metadata for an on-disk table.

0 comments on commit 562651f

Please sign in to comment.
You can’t perform that action at this time.