Skip to content

Commit

Permalink
Merge pull request #76 from PowerDNS/fix-import-path
Browse files Browse the repository at this point in the history
Rename module to github.com/PowerDNS/lightningstream/lmdbenv
  • Loading branch information
wojas authored Jun 20, 2024
2 parents a241744 + 4ab17be commit d1fec5a
Show file tree
Hide file tree
Showing 46 changed files with 117 additions and 119 deletions.
6 changes: 3 additions & 3 deletions cmd/lightningstream/commands/dropshadow.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"sort"
"strings"

"github.com/PowerDNS/lightningstream/config"
"github.com/PowerDNS/lightningstream/lmdbenv"
"github.com/PowerDNS/lightningstream/syncer"
"github.com/PowerDNS/lmdb-go/lmdb"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"powerdns.com/platform/lightningstream/config"
"powerdns.com/platform/lightningstream/lmdbenv"
"powerdns.com/platform/lightningstream/syncer"
)

func init() {
Expand Down
8 changes: 4 additions & 4 deletions cmd/lightningstream/commands/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import (
"sort"
"strings"

"github.com/PowerDNS/lightningstream/config"
"github.com/PowerDNS/lightningstream/lmdbenv"
"github.com/PowerDNS/lightningstream/syncer"
"github.com/PowerDNS/lightningstream/utils"
"github.com/PowerDNS/lmdb-go/lmdb"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"powerdns.com/platform/lightningstream/config"
"powerdns.com/platform/lightningstream/lmdbenv"
"powerdns.com/platform/lightningstream/syncer"
"powerdns.com/platform/lightningstream/utils"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions cmd/lightningstream/commands/experimental-pdns.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import (
"strings"
"time"

"github.com/PowerDNS/lightningstream/lmdbenv"
"github.com/PowerDNS/lightningstream/lmdbenv/header"
"github.com/PowerDNS/lightningstream/utils"
"github.com/PowerDNS/lmdb-go/lmdb"
"github.com/PowerDNS/lmdb-go/lmdbscan"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"powerdns.com/platform/lightningstream/lmdbenv"
"powerdns.com/platform/lightningstream/lmdbenv/header"
"powerdns.com/platform/lightningstream/utils"
)

func init() {
Expand Down
6 changes: 3 additions & 3 deletions cmd/lightningstream/commands/experimental.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"encoding/binary"
"fmt"

"github.com/PowerDNS/lightningstream/lmdbenv"
"github.com/PowerDNS/lightningstream/lmdbenv/header"
"github.com/PowerDNS/lightningstream/utils"
"github.com/PowerDNS/lmdb-go/lmdb"
"github.com/PowerDNS/lmdb-go/lmdbscan"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"powerdns.com/platform/lightningstream/lmdbenv"
"powerdns.com/platform/lightningstream/lmdbenv/header"
"powerdns.com/platform/lightningstream/utils"
)

func init() {
Expand Down
4 changes: 2 additions & 2 deletions cmd/lightningstream/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"os/exec"
"time"

"github.com/PowerDNS/lightningstream/config"
"github.com/PowerDNS/lightningstream/config/logger"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"powerdns.com/platform/lightningstream/config"
"powerdns.com/platform/lightningstream/config/logger"
)

const (
Expand Down
8 changes: 4 additions & 4 deletions cmd/lightningstream/commands/snapshots.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import (
"path/filepath"
"time"

"github.com/PowerDNS/lightningstream/lmdbenv/dbiflags"
"github.com/PowerDNS/lightningstream/lmdbenv/header"
"github.com/PowerDNS/lightningstream/snapshot"
"github.com/PowerDNS/lightningstream/utils"
"github.com/PowerDNS/simpleblob"
"github.com/samber/lo"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"golang.org/x/exp/slices"
"powerdns.com/platform/lightningstream/lmdbenv/dbiflags"
"powerdns.com/platform/lightningstream/lmdbenv/header"
"powerdns.com/platform/lightningstream/snapshot"
"powerdns.com/platform/lightningstream/utils"
)

func init() {
Expand Down
6 changes: 3 additions & 3 deletions cmd/lightningstream/commands/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import (
"fmt"
"sort"

"github.com/PowerDNS/lightningstream/config"
"github.com/PowerDNS/lightningstream/lmdbenv"
"github.com/PowerDNS/lightningstream/lmdbenv/stats"
"github.com/PowerDNS/lmdb-go/lmdb"
"github.com/c2h5oh/datasize"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"powerdns.com/platform/lightningstream/config"
"powerdns.com/platform/lightningstream/lmdbenv"
"powerdns.com/platform/lightningstream/lmdbenv/stats"
)

func init() {
Expand Down
6 changes: 3 additions & 3 deletions cmd/lightningstream/commands/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import (
"context"
"os"

"github.com/PowerDNS/lightningstream/status"
"github.com/PowerDNS/lightningstream/syncer"
"github.com/PowerDNS/lightningstream/utils"
"github.com/PowerDNS/simpleblob"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/wojas/go-healthz"
"golang.org/x/sync/errgroup"
"powerdns.com/platform/lightningstream/status"
"powerdns.com/platform/lightningstream/syncer"
"powerdns.com/platform/lightningstream/utils"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion cmd/lightningstream/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"powerdns.com/platform/lightningstream/cmd/lightningstream/commands"
"github.com/PowerDNS/lightningstream/cmd/lightningstream/commands"

// Register storage backends
_ "github.com/PowerDNS/simpleblob/backends/fs"
Expand Down
10 changes: 5 additions & 5 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import (
"os"
"time"

"github.com/PowerDNS/lightningstream/lmdbenv/dbiflags"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"gopkg.in/yaml.v2"
"powerdns.com/platform/lightningstream/lmdbenv/dbiflags"

"powerdns.com/platform/lightningstream/config/logger"
"powerdns.com/platform/lightningstream/lmdbenv"
"powerdns.com/platform/lightningstream/status/healthtracker"
"powerdns.com/platform/lightningstream/status/starttracker"
"github.com/PowerDNS/lightningstream/config/logger"
"github.com/PowerDNS/lightningstream/lmdbenv"
"github.com/PowerDNS/lightningstream/status/healthtracker"
"github.com/PowerDNS/lightningstream/status/starttracker"
)

const (
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 powerdns.com/platform/lightningstream
module github.com/PowerDNS/lightningstream

go 1.19

Expand Down
2 changes: 1 addition & 1 deletion lmdbenv/stats/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/prometheus/client_golang/prometheus"
"github.com/sirupsen/logrus"

"powerdns.com/platform/lightningstream/lmdbenv"
"github.com/PowerDNS/lightningstream/lmdbenv"
)

// Collector implements an LMDB stats collector for Prometheus.
Expand Down
2 changes: 1 addition & 1 deletion lmdbenv/stats/collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"testing"

"github.com/PowerDNS/lightningstream/lmdbenv"
"github.com/PowerDNS/lmdb-go/lmdb"
"github.com/prometheus/client_golang/prometheus"
"powerdns.com/platform/lightningstream/lmdbenv"
)

func TestCollector(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion lmdbenv/stats/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ package stats
import (
"os"

"github.com/PowerDNS/lightningstream/lmdbenv"
"github.com/PowerDNS/lmdb-go/lmdb"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"powerdns.com/platform/lightningstream/lmdbenv"
)

// Log logs all LMDB statistics once using logrus
Expand Down
2 changes: 1 addition & 1 deletion lmdbenv/strategy/append_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package strategy
import (
"testing"

"github.com/PowerDNS/lightningstream/lmdbenv"
"github.com/PowerDNS/lmdb-go/lmdb"
"powerdns.com/platform/lightningstream/lmdbenv"
)

func TestAppend(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion lmdbenv/strategy/iterput_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package strategy
import (
"testing"

"powerdns.com/platform/lightningstream/lmdbenv"
"github.com/PowerDNS/lightningstream/lmdbenv"
)

func TestIterPut_empty(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion lmdbenv/strategy/iterupdate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package strategy
import (
"testing"

"powerdns.com/platform/lightningstream/lmdbenv"
"github.com/PowerDNS/lightningstream/lmdbenv"
)

func TestIterUpdate_empty(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion lmdbenv/strategy/put_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package strategy
import (
"testing"

"powerdns.com/platform/lightningstream/lmdbenv"
"github.com/PowerDNS/lightningstream/lmdbenv"
)

func TestPut(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion lmdbenv/strategy/testutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/PowerDNS/lmdb-go/lmdb"
"github.com/pkg/errors"

"powerdns.com/platform/lightningstream/lmdbenv"
"github.com/PowerDNS/lightningstream/lmdbenv"
)

type TestIterator struct {
Expand Down
2 changes: 1 addition & 1 deletion lmdbenv/strategy/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package strategy
import (
"testing"

"powerdns.com/platform/lightningstream/lmdbenv"
"github.com/PowerDNS/lightningstream/lmdbenv"
)

// Test iterator does not do dedup!
Expand Down
6 changes: 3 additions & 3 deletions snapshot/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ In total that is 440 MB data uncompressed. It turns out that half of the
allocation was used by the code copying all key and value bytes.
flat flat% sum% cum cum%
2047.55MB 56.26% 56.26% 2722.09MB 74.80% powerdns.com/platform/lightningstream/snapshot.(*DBI).Unmarshal
674.54MB 18.54% 98.45% 674.54MB 18.54% powerdns.com/platform/lightningstream/snapshot.(*KV).Unmarshal
2047.55MB 56.26% 56.26% 2722.09MB 74.80% github.com/PowerDNS/lightningstream/snapshot.(*DBI).Unmarshal
674.54MB 18.54% 98.45% 674.54MB 18.54% github.com/PowerDNS/lightningstream/snapshot.(*KV).Unmarshal
Patching the generated code to not copy the data reduced the total memory use to
1.4 GB:
1378.77MB 52.20% 52.20% 1378.77MB 52.20% powerdns.com/platform/lightningstream/snapshot.(*DBI).Unmarshal
1378.77MB 52.20% 52.20% 1378.77MB 52.20% github.com/PowerDNS/lightningstream/snapshot.(*DBI).Unmarshal
That is still significantly more than the 440 MB we would expect. Part of it
is likely because the allocated slices are up to 2x larger than needed with
Expand Down
2 changes: 1 addition & 1 deletion snapshot/flags.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package snapshot

import "powerdns.com/platform/lightningstream/lmdbenv/header"
import "github.com/PowerDNS/lightningstream/lmdbenv/header"

func (kv *KV) MaskedFlags() header.Flags {
return header.Flags(kv.Flags).Masked()
Expand Down
6 changes: 3 additions & 3 deletions snapshot/gogosnapshot/compat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"math/rand"
"testing"

"github.com/PowerDNS/lightningstream/snapshot"
"github.com/stretchr/testify/assert"
"powerdns.com/platform/lightningstream/snapshot"
)

func Test_roundtrip_compat_generated(t *testing.T) {
Expand All @@ -31,15 +31,15 @@ func Test_roundtrip_compat_manual(t *testing.T) {
},
Databases: []*DBI{
{
Name: "test-dbi-1",
Name: "test-dbi-1",
Entries: []KV{
// Filled below
},
Flags: 0,
Transform: "",
},
{
Name: "test-dbi-2",
Name: "test-dbi-2",
Entries: []KV{
// Filled below
},
Expand Down
2 changes: 0 additions & 2 deletions snapshot/gogosnapshot/snapshot.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ syntax = "proto3";

package gogosnapshot;

//option go_package = "powerdns.com/platform/lightningstream/snapshot";

import "gogo.proto";
option (gogoproto.goproto_unrecognized_all) = false;
option (gogoproto.goproto_sizecache_all) = false;
Expand Down
4 changes: 2 additions & 2 deletions snapshot/name.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"strings"
"time"

"powerdns.com/platform/lightningstream/lmdbenv/header"
"powerdns.com/platform/lightningstream/utils"
"github.com/PowerDNS/lightningstream/lmdbenv/header"
"github.com/PowerDNS/lightningstream/utils"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion status/httpd.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/sirupsen/logrus"
"github.com/wojas/go-healthz"

"powerdns.com/platform/lightningstream/config"
"github.com/PowerDNS/lightningstream/config"
)

func StartHTTPServer(c config.Config) {
Expand Down
6 changes: 3 additions & 3 deletions status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"context"
"sync"

"github.com/PowerDNS/lightningstream/lmdbenv"
"github.com/PowerDNS/lightningstream/lmdbenv/dbiflags"
"github.com/PowerDNS/lightningstream/lmdbenv/stats"
"github.com/PowerDNS/lmdb-go/lmdb"
"github.com/PowerDNS/simpleblob"
"github.com/c2h5oh/datasize"
"github.com/pkg/errors"
"powerdns.com/platform/lightningstream/lmdbenv"
"powerdns.com/platform/lightningstream/lmdbenv/dbiflags"
"powerdns.com/platform/lightningstream/lmdbenv/stats"
)

type info struct {
Expand Down
6 changes: 3 additions & 3 deletions syncer/cleaner/cleaner.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (
"sync"
"time"

"github.com/PowerDNS/lightningstream/config"
"github.com/PowerDNS/lightningstream/snapshot"
"github.com/PowerDNS/lightningstream/utils"
"github.com/PowerDNS/simpleblob"
"github.com/samber/lo"
"github.com/sirupsen/logrus"
"golang.org/x/exp/slices"
"powerdns.com/platform/lightningstream/config"
"powerdns.com/platform/lightningstream/snapshot"
"powerdns.com/platform/lightningstream/utils"
)

func New(name string, st simpleblob.Interface, cc config.Cleanup, logger logrus.FieldLogger) *Worker {
Expand Down
4 changes: 2 additions & 2 deletions syncer/cleaner/cleaner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
"testing"
"time"

"github.com/PowerDNS/lightningstream/config"
"github.com/PowerDNS/lightningstream/snapshot"
"github.com/PowerDNS/simpleblob/backends/memory"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"powerdns.com/platform/lightningstream/config"
"powerdns.com/platform/lightningstream/snapshot"
)

func mt(timeString string) time.Time {
Expand Down
Loading

0 comments on commit d1fec5a

Please sign in to comment.