Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Goldstein committed Feb 24, 2023
1 parent 4ee7714 commit 09f1964
Show file tree
Hide file tree
Showing 70 changed files with 163 additions and 143 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## [4.0.0] - 2022-02-24

This release fixes a bug in the maxHeaderSize parameter that could lead
to panics. We introduce an external magic number to keep track of external
dependencies. We bump up the minimum required Go version to 1.19. No changes
were made to the format of data on disk. This is a major release because
we are making a switch to SemVer in order to make it easier for the community
to understand when breaking API and data format changes are made.

### Fixed
- fix: update maxHeaderSize #1877
- feat(externalMagic): Introduce external magic number (#1745) #1852
- fix(bench): bring in benchmark fixes from main #1863

### Chores
- upgrade go to 1.19 #1868
- enable linters (gosimple, govet, lll, unused, staticcheck, errcheck, ineffassign, gofmt) #1871 #1870 #1876
- remove dependency on io/ioutil #1879
- various doc and comment fixes #1857

## [3.3.0] - 2022-02-23

This minor release fixes a bug in the maxHeaderSize parameter that could lead
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# BadgerDB

[![Go Reference](https://pkg.go.dev/badge/github.com/dgraph-io/badger/v3.svg)](https://pkg.go.dev/github.com/dgraph-io/badger/v3)
[![Go Report Card](https://goreportcard.com/badge/github.com/dgraph-io/badger/v3)](https://goreportcard.com/report/github.com/dgraph-io/badger/v3)
[![Go Reference](https://pkg.go.dev/badge/github.com/dgraph-io/badger/v4.svg)](https://pkg.go.dev/github.com/dgraph-io/badger/v4)
[![Go Report Card](https://goreportcard.com/badge/github.com/dgraph-io/badger/v4)](https://goreportcard.com/report/github.com/dgraph-io/badger/v4)
[![Sourcegraph](https://sourcegraph.com/github.com/dgraph-io/badger/-/badge.svg)](https://sourcegraph.com/github.com/dgraph-io/badger?badge)
[![ci-badger-tests](https://github.com/dgraph-io/badger/actions/workflows/ci-badger-tests.yml/badge.svg)](https://github.com/dgraph-io/badger/actions/workflows/ci-badger-tests.yml)
[![ci-badger-bank-tests](https://github.com/dgraph-io/badger/actions/workflows/ci-badger-bank-tests.yml/badge.svg)](https://github.com/dgraph-io/badger/actions/workflows/ci-badger-bank-tests.yml)
Expand Down Expand Up @@ -65,7 +65,7 @@ For more details on our version naming schema please read [Choosing a version](#
To start using Badger, install Go 1.19 or above. Badger v3 needs go modules. From your project, run the following command

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

Expand Down
4 changes: 2 additions & 2 deletions backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
"github.com/golang/protobuf/proto"
"github.com/pkg/errors"

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

Expand Down
2 changes: 1 addition & 1 deletion backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (

"github.com/stretchr/testify/require"

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

func TestBackupRestore1(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion badger/cmd/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/spf13/cobra"

"github.com/dgraph-io/badger/v3"
"github.com/dgraph-io/badger/v4"
)

var bo = struct {
Expand Down
6 changes: 3 additions & 3 deletions badger/cmd/bank.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import (

"github.com/spf13/cobra"

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

Expand Down
4 changes: 2 additions & 2 deletions badger/cmd/flatten.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"github.com/pkg/errors"
"github.com/spf13/cobra"

"github.com/dgraph-io/badger/v3"
"github.com/dgraph-io/badger/v3/options"
"github.com/dgraph-io/badger/v4"
"github.com/dgraph-io/badger/v4/options"
)

var flattenCmd = &cobra.Command{
Expand Down
8 changes: 4 additions & 4 deletions badger/cmd/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ import (
"github.com/pkg/errors"
"github.com/spf13/cobra"

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

type flagOptions struct {
Expand Down
8 changes: 4 additions & 4 deletions badger/cmd/pick_table_bench.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import (

"github.com/spf13/cobra"

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

var pickBenchCmd = &cobra.Command{
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/v3"
"github.com/dgraph-io/badger/v3/pb"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/badger/v4"
"github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/badger/v4/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 @@ -24,7 +24,7 @@ import (

"github.com/spf13/cobra"

"github.com/dgraph-io/badger/v3"
"github.com/dgraph-io/badger/v4"
)

var restoreFile string
Expand Down
2 changes: 1 addition & 1 deletion badger/cmd/rotate.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/spf13/cobra"

"github.com/dgraph-io/badger/v3"
"github.com/dgraph-io/badger/v4"
)

var oldKeyPath string
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 @@ -23,8 +23,8 @@ import (

"github.com/stretchr/testify/require"

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

func TestRotate(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions badger/cmd/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (
"github.com/pkg/errors"
"github.com/spf13/cobra"

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

var streamCmd = &cobra.Command{
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/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/badger/v4"
"github.com/dgraph-io/badger/v4/options"
"github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/badger/v4/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 @@ -25,7 +25,7 @@ import (
"github.com/dustin/go-humanize"
"go.opencensus.io/zpages"

"github.com/dgraph-io/badger/v3/badger/cmd"
"github.com/dgraph-io/badger/v4/badger/cmd"
"github.com/dgraph-io/ristretto/z"
)

Expand Down
4 changes: 2 additions & 2 deletions batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (

"github.com/pkg/errors"

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

Expand Down
2 changes: 1 addition & 1 deletion batch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

"github.com/stretchr/testify/require"

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

func TestWriteBatch(t *testing.T) {
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/v3/table"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/badger/v4/table"
"github.com/dgraph-io/badger/v4/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 @@ -34,11 +34,11 @@ import (
humanize "github.com/dustin/go-humanize"
"github.com/pkg/errors"

"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/badger/v4/options"
"github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/badger/v4/skl"
"github.com/dgraph-io/badger/v4/table"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto"
"github.com/dgraph-io/ristretto/z"
)
Expand Down
8 changes: 4 additions & 4 deletions db2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ import (

"github.com/stretchr/testify/require"

"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/dgraph-io/badger/v4/options"
"github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/badger/v4/table"
"github.com/dgraph-io/badger/v4/y"
"github.com/dgraph-io/ristretto/z"
)

Expand Down
6 changes: 3 additions & 3 deletions db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ import (

"github.com/stretchr/testify/require"

"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/badger/v4/options"
"github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/badger/v4/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/v3/y"
"github.com/dgraph-io/badger/v4/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 @@ -26,7 +26,7 @@ import (

"golang.org/x/sys/unix"

"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/badger/v4/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_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"path/filepath"
"syscall"

"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/badger/v4/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/v3/y"
"github.com/dgraph-io/badger/v4/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.19 or above. Badger v2 needs go modules. Run the following command to retrieve the library.

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

Expand Down Expand Up @@ -60,7 +60,7 @@ package main
import (
"log"

badger "github.com/dgraph-io/badger/v3"
badger "github.com/dgraph-io/badger/v4"
)

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/v3
module github.com/dgraph-io/badger/v4

go 1.19

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/v3"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/badger/v4"
"github.com/dgraph-io/badger/v4/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 @@ -25,8 +25,8 @@ import (
"sync"
"time"

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

Expand Down
6 changes: 3 additions & 3 deletions iterator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import (

"github.com/stretchr/testify/require"

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

type tableMock struct {
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/v3/pb"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/badger/v4/pb"
"github.com/dgraph-io/badger/v4/y"
)

const (
Expand Down
Loading

0 comments on commit 09f1964

Please sign in to comment.