Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for numbered filesets #1720

Merged
merged 13 commits into from
Jun 21, 2019
16 changes: 5 additions & 11 deletions src/cmd/tools/dtest/util/seed/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,18 +128,12 @@ func (t *fileInfoExtractor) visit(fPath string, f os.FileInfo, err error) error
t.shards[uint32(shardNum)] = struct{}{}

name := f.Name()
first := strings.Index(name, "-")
if first == -1 {
return fmt.Errorf("unable to find '-' in %v", name)
nameSplit := strings.Split(name, "-")
if len(nameSplit) < 2 {
return fmt.Errorf("unable to parse time from %v", name)
}
last := strings.LastIndex(name, "-")
if last == -1 {
return fmt.Errorf("unable to find '-' in %v", name)
}
if first == last {
return fmt.Errorf("found only single '-' in %v", name)
}
num, parseErr := strconv.ParseInt(name[first+1:last], 10, 64)

num, parseErr := strconv.ParseInt(nameSplit[1], 10, 64)
if parseErr != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions src/dbnode/integration/disk_cleanup_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ import (
"testing"
"time"

"github.com/m3db/m3/src/dbnode/namespace"
"github.com/m3db/m3/src/dbnode/persist/fs"
"github.com/m3db/m3/src/dbnode/persist/fs/commitlog"
"github.com/m3db/m3/src/dbnode/sharding"
"github.com/m3db/m3/src/dbnode/storage"
"github.com/m3db/m3/src/dbnode/namespace"
"github.com/m3db/m3/src/x/ident"

"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -114,7 +114,7 @@ type cleanupTimesFileSet struct {

func (fset *cleanupTimesFileSet) anyExist() bool {
for _, t := range fset.times {
exists, err := fs.DataFileSetExistsAt(fset.filePathPrefix, fset.namespace, fset.shard, t)
exists, err := fs.DataFileSetExists(fset.filePathPrefix, fset.namespace, fset.shard, t, 0)
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion src/dbnode/integration/disk_cleanup_index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import (
"testing"
"time"

"github.com/m3db/m3/src/dbnode/namespace"
"github.com/m3db/m3/src/dbnode/persist/fs"
"github.com/m3db/m3/src/dbnode/retention"
"github.com/m3db/m3/src/dbnode/namespace"
xclock "github.com/m3db/m3/src/x/clock"

"github.com/stretchr/testify/require"
Expand Down
6 changes: 3 additions & 3 deletions src/dbnode/integration/disk_flush_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ import (

"github.com/m3db/m3/src/dbnode/encoding"
"github.com/m3db/m3/src/dbnode/integration/generate"
ns "github.com/m3db/m3/src/dbnode/namespace"
"github.com/m3db/m3/src/dbnode/persist"
"github.com/m3db/m3/src/dbnode/persist/fs"
"github.com/m3db/m3/src/dbnode/sharding"
"github.com/m3db/m3/src/dbnode/storage"
ns "github.com/m3db/m3/src/dbnode/namespace"
"github.com/m3db/m3/src/x/ident"
"github.com/m3db/m3/src/x/ident/testutil"
xtime "github.com/m3db/m3/src/x/time"
Expand Down Expand Up @@ -122,8 +122,8 @@ func waitUntilDataFilesFlushed(
for timestamp, seriesList := range testData {
for _, series := range seriesList {
shard := shardSet.Lookup(series.ID)
exists, err := fs.DataFileSetExistsAt(
filePathPrefix, namespace, shard, timestamp.ToTime())
exists, err := fs.DataFileSetExists(
filePathPrefix, namespace, shard, timestamp.ToTime(), 0)
if err != nil {
panic(err)
}
Expand Down
Loading