Skip to content

Commit

Permalink
changing badger module path to v3 (#1636)
Browse files Browse the repository at this point in the history
* changing badger module path to v3

* running go mod tidy

* updating metric keys + proto package
  • Loading branch information
aman bansal authored Jan 13, 2021
1 parent 38eb5a1 commit b69163b
Show file tree
Hide file tree
Showing 68 changed files with 331 additions and 331 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ For more details on our version naming schema please read [Choosing a version](#
To start using Badger, install Go 1.12 or above. Badger v2 needs go modules. Run the following command to retrieve the library.

```sh
$ go get github.com/dgraph-io/badger/v2
$ go get github.com/dgraph-io/badger/v3
```
This will retrieve the library.

##### Note: Badger does not directly use CGO but it relies on https://github.com/DataDog/zstd for compression and it requires gcc/cgo. If you wish to use badger without gcc/cgo, you can run `CGO_ENABLED=0 go get github.com/dgraph-io/badger/v2` which will download badger without the support for ZSTD compression algorithm.
##### Note: Badger does not directly use CGO but it relies on https://github.com/DataDog/zstd for compression and it requires gcc/cgo. If you wish to use badger without gcc/cgo, you can run `CGO_ENABLED=0 go get github.com/dgraph-io/badger/v3` which will download badger without the support for ZSTD compression algorithm.

#### Installing Badger Command Line Tool

Expand Down
4 changes: 2 additions & 2 deletions backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"encoding/binary"
"io"

"github.com/dgraph-io/badger/v2/pb"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3/pb"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/ristretto/z"
"github.com/golang/protobuf/proto"
)
Expand Down
2 changes: 1 addition & 1 deletion backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"testing"
"time"

"github.com/dgraph-io/badger/v2/pb"
"github.com/dgraph-io/badger/v3/pb"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion badger/cmd/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"math"
"os"

"github.com/dgraph-io/badger/v2"
"github.com/dgraph-io/badger/v3"
"github.com/spf13/cobra"
)

Expand Down
6 changes: 3 additions & 3 deletions badger/cmd/bank.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import (
"sync/atomic"
"time"

"github.com/dgraph-io/badger/v2"
"github.com/dgraph-io/badger/v2/pb"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3"
"github.com/dgraph-io/badger/v3/pb"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/ristretto/z"
"github.com/spf13/cobra"
)
Expand Down
4 changes: 2 additions & 2 deletions badger/cmd/flatten.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"fmt"
"math"

"github.com/dgraph-io/badger/v2"
"github.com/dgraph-io/badger/v2/options"
"github.com/dgraph-io/badger/v3"
"github.com/dgraph-io/badger/v3/options"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)
Expand Down
6 changes: 3 additions & 3 deletions badger/cmd/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import (

"github.com/pkg/errors"

"github.com/dgraph-io/badger/v2"
"github.com/dgraph-io/badger/v2/table"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3"
"github.com/dgraph-io/badger/v3/table"
"github.com/dgraph-io/badger/v3/y"
humanize "github.com/dustin/go-humanize"
"github.com/spf13/cobra"
)
Expand Down
6 changes: 3 additions & 3 deletions badger/cmd/read_bench.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import (
"github.com/pkg/errors"
"github.com/spf13/cobra"

"github.com/dgraph-io/badger/v2"
"github.com/dgraph-io/badger/v2/pb"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3"
"github.com/dgraph-io/badger/v3/pb"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/ristretto/z"
)

Expand Down
2 changes: 1 addition & 1 deletion badger/cmd/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"os"
"path"

"github.com/dgraph-io/badger/v2"
"github.com/dgraph-io/badger/v3"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion badger/cmd/rotate.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"os"
"time"

"github.com/dgraph-io/badger/v2"
"github.com/dgraph-io/badger/v3"

"github.com/spf13/cobra"
)
Expand Down
4 changes: 2 additions & 2 deletions badger/cmd/rotate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"os"
"testing"

"github.com/dgraph-io/badger/v2"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3"
"github.com/dgraph-io/badger/v3/y"
"github.com/stretchr/testify/require"
)

Expand Down
6 changes: 3 additions & 3 deletions badger/cmd/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (
"math"
"os"

"github.com/dgraph-io/badger/v2"
"github.com/dgraph-io/badger/v2/options"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3"
"github.com/dgraph-io/badger/v3/options"
"github.com/dgraph-io/badger/v3/y"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)
Expand Down
8 changes: 4 additions & 4 deletions badger/cmd/write_bench.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ import (
humanize "github.com/dustin/go-humanize"
"github.com/spf13/cobra"

"github.com/dgraph-io/badger/v2"
"github.com/dgraph-io/badger/v2/options"
"github.com/dgraph-io/badger/v2/pb"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3"
"github.com/dgraph-io/badger/v3/options"
"github.com/dgraph-io/badger/v3/pb"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/ristretto/z"
)

Expand Down
2 changes: 1 addition & 1 deletion badger/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
_ "net/http/pprof"
"runtime"

"github.com/dgraph-io/badger/v2/badger/cmd"
"github.com/dgraph-io/badger/v3/badger/cmd"
"github.com/dgraph-io/ristretto/z"
"github.com/dustin/go-humanize"
"go.opencensus.io/zpages"
Expand Down
4 changes: 2 additions & 2 deletions batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"sync"
"sync/atomic"

"github.com/dgraph-io/badger/v2/pb"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3/pb"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/ristretto/z"
"github.com/pkg/errors"
)
Expand Down
2 changes: 1 addition & 1 deletion batch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"testing"
"time"

"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3/y"

"github.com/stretchr/testify/require"
)
Expand Down
4 changes: 2 additions & 2 deletions compaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"math"
"sync"

"github.com/dgraph-io/badger/v2/table"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3/table"
"github.com/dgraph-io/badger/v3/y"
)

type keyRange struct {
Expand Down
10 changes: 5 additions & 5 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ import (
"sync/atomic"
"time"

"github.com/dgraph-io/badger/v2/options"
"github.com/dgraph-io/badger/v2/pb"
"github.com/dgraph-io/badger/v2/skl"
"github.com/dgraph-io/badger/v2/table"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3/options"
"github.com/dgraph-io/badger/v3/pb"
"github.com/dgraph-io/badger/v3/skl"
"github.com/dgraph-io/badger/v3/table"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/ristretto"
"github.com/dgraph-io/ristretto/z"
humanize "github.com/dustin/go-humanize"
Expand Down
8 changes: 4 additions & 4 deletions db2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ import (
"testing"
"time"

"github.com/dgraph-io/badger/v2/options"
"github.com/dgraph-io/badger/v3/options"

"github.com/dgraph-io/badger/v2/pb"
"github.com/dgraph-io/badger/v2/table"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3/pb"
"github.com/dgraph-io/badger/v3/table"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/ristretto/z"
"github.com/stretchr/testify/require"
)
Expand Down
6 changes: 3 additions & 3 deletions db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ import (

"github.com/stretchr/testify/require"

"github.com/dgraph-io/badger/v2/options"
"github.com/dgraph-io/badger/v2/pb"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3/options"
"github.com/dgraph-io/badger/v3/pb"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/ristretto/z"
)

Expand Down
2 changes: 1 addition & 1 deletion dir_plan9.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"path/filepath"
"strings"

"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3/y"
)

// directoryLockGuard holds a lock on a directory and a pid file inside. The pid file isn't part
Expand Down
2 changes: 1 addition & 1 deletion dir_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"os"
"path/filepath"

"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3/y"
"golang.org/x/sys/unix"
)

Expand Down
2 changes: 1 addition & 1 deletion dir_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"path/filepath"
"syscall"

"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3/y"
)

// FILE_ATTRIBUTE_TEMPORARY - A file that is being used for temporary storage.
Expand Down
2 changes: 1 addition & 1 deletion discard.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"sort"
"sync"

"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/ristretto/z"
)

Expand Down
4 changes: 2 additions & 2 deletions docs/content/get-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ aliases = ["/get-started"]
To start using Badger, install Go 1.12 or above. Badger v2 needs go modules. Run the following command to retrieve the library.

```sh
$ go get github.com/dgraph-io/badger/v2
$ go get github.com/dgraph-io/badger/v3
```
This will retrieve the library.

Expand Down Expand Up @@ -60,7 +60,7 @@ package main
import (
"log"
badger "github.com/dgraph-io/badger/v2"
badger "github.com/dgraph-io/badger/v3"
)
func main() {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/dgraph-io/badger/v2
module github.com/dgraph-io/badger/v3

go 1.12

Expand Down
4 changes: 2 additions & 2 deletions integration/testgc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"sync/atomic"
"time"

"github.com/dgraph-io/badger/v2"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/ristretto/z"
)

Expand Down
4 changes: 2 additions & 2 deletions iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import (
"sync/atomic"
"time"

"github.com/dgraph-io/badger/v2/table"
"github.com/dgraph-io/badger/v3/table"
"github.com/dgraph-io/ristretto/z"

"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3/y"
)

type prefetchStatus uint8
Expand Down
6 changes: 3 additions & 3 deletions iterator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import (
"strings"
"testing"

"github.com/dgraph-io/badger/v2/options"
"github.com/dgraph-io/badger/v2/table"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3/options"
"github.com/dgraph-io/badger/v3/table"
"github.com/dgraph-io/badger/v3/y"
"github.com/stretchr/testify/require"
)

Expand Down
4 changes: 2 additions & 2 deletions key_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (
"sync"
"time"

"github.com/dgraph-io/badger/v2/pb"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3/pb"
"github.com/dgraph-io/badger/v3/y"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions level_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"sort"
"sync"

"github.com/dgraph-io/badger/v2/table"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3/table"
"github.com/dgraph-io/badger/v3/y"
)

type levelHandler struct {
Expand Down
6 changes: 3 additions & 3 deletions levels.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import (

otrace "go.opencensus.io/trace"

"github.com/dgraph-io/badger/v2/pb"
"github.com/dgraph-io/badger/v2/table"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3/pb"
"github.com/dgraph-io/badger/v3/table"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/ristretto/z"
"github.com/pkg/errors"
)
Expand Down
8 changes: 4 additions & 4 deletions levels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import (
"testing"
"time"

"github.com/dgraph-io/badger/v2/options"
"github.com/dgraph-io/badger/v2/pb"
"github.com/dgraph-io/badger/v2/table"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3/options"
"github.com/dgraph-io/badger/v3/pb"
"github.com/dgraph-io/badger/v3/table"
"github.com/dgraph-io/badger/v3/y"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion managed_db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"testing"
"time"

"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/ristretto/z"
"github.com/stretchr/testify/require"
)
Expand Down
Loading

0 comments on commit b69163b

Please sign in to comment.