From 5507f803405d7402e3dda2d0b8e2dfca01c47c43 Mon Sep 17 00:00:00 2001 From: Justin Chan Date: Fri, 14 Jun 2019 16:06:50 -0400 Subject: [PATCH] Rename function --- src/dbnode/integration/disk_cleanup_index_test.go | 2 +- src/dbnode/persist/fs/files.go | 8 ++++---- src/dbnode/persist/fs/files_test.go | 4 ++-- src/dbnode/storage/index.go | 2 +- src/dbnode/storage/shard.go | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/dbnode/integration/disk_cleanup_index_test.go b/src/dbnode/integration/disk_cleanup_index_test.go index 36b53ff855..d622a633b2 100644 --- a/src/dbnode/integration/disk_cleanup_index_test.go +++ b/src/dbnode/integration/disk_cleanup_index_test.go @@ -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" diff --git a/src/dbnode/persist/fs/files.go b/src/dbnode/persist/fs/files.go index b36d93fd92..96479971b7 100644 --- a/src/dbnode/persist/fs/files.go +++ b/src/dbnode/persist/fs/files.go @@ -980,8 +980,8 @@ func DeleteFileSetAt(filePathPrefix string, namespace ident.ID, shard uint32, bl return DeleteFiles(fileset.AbsoluteFilepaths) } -// DataFilePathsBefore returns all the flush data fileset paths whose timestamps are earlier than a given time. -func DataFilePathsBefore(filePathPrefix string, namespace ident.ID, shard uint32, t time.Time) ([]string, error) { +// DataFileSetsBefore returns all the flush data fileset paths whose timestamps are earlier than a given time. +func DataFileSetsBefore(filePathPrefix string, namespace ident.ID, shard uint32, t time.Time) ([]string, error) { matched, err := filesetFiles(filesetFilesSelector{ fileSetType: persist.FileSetFlushType, contentType: persist.FileSetDataContentType, @@ -996,8 +996,8 @@ func DataFilePathsBefore(filePathPrefix string, namespace ident.ID, shard uint32 return FilesBefore(matched.Filepaths(), t) } -// IndexFilePathsBefore returns all the flush index fileset paths whose timestamps are earlier than a given time. -func IndexFilePathsBefore(filePathPrefix string, namespace ident.ID, t time.Time) ([]string, error) { +// IndexFileSetsBefore returns all the flush index fileset paths whose timestamps are earlier than a given time. +func IndexFileSetsBefore(filePathPrefix string, namespace ident.ID, t time.Time) ([]string, error) { matched, err := filesetFiles(filesetFilesSelector{ fileSetType: persist.FileSetFlushType, contentType: persist.FileSetIndexContentType, diff --git a/src/dbnode/persist/fs/files_test.go b/src/dbnode/persist/fs/files_test.go index 91db576886..b28243f1b9 100644 --- a/src/dbnode/persist/fs/files_test.go +++ b/src/dbnode/persist/fs/files_test.go @@ -475,7 +475,7 @@ func TestFileSetFilesBefore(t *testing.T) { cutoffIter := 8 cutoff := time.Unix(0, int64(cutoffIter)) - res, err := DataFilePathsBefore(dir, testNs1ID, shard, cutoff) + res, err := DataFileSetsBefore(dir, testNs1ID, shard, cutoff) require.NoError(t, err) require.Equal(t, cutoffIter, len(res)) @@ -1073,7 +1073,7 @@ func TestIndexFileSetsBefore(t *testing.T) { } files.create(t, dir) - results, err := IndexFilePathsBefore(dir, ns1, timeFor(3)) + results, err := IndexFileSetsBefore(dir, ns1, timeFor(3)) require.NoError(t, err) require.Len(t, results, 3) for _, res := range results { diff --git a/src/dbnode/storage/index.go b/src/dbnode/storage/index.go index c01764529a..4e0a60dfde 100644 --- a/src/dbnode/storage/index.go +++ b/src/dbnode/storage/index.go @@ -277,7 +277,7 @@ func newNamespaceIndexWithOptions( bufferFuture: nsMD.Options().RetentionOptions().BufferFuture(), coldWritesEnabled: nsMD.Options().ColdWritesEnabled(), - indexFilesetsBeforeFn: fs.IndexFilePathsBefore, + indexFilesetsBeforeFn: fs.IndexFileSetsBefore, deleteFilesFn: fs.DeleteFiles, newBlockFn: newBlockFn, diff --git a/src/dbnode/storage/shard.go b/src/dbnode/storage/shard.go index 491e69d4c1..25f3b0230a 100644 --- a/src/dbnode/storage/shard.go +++ b/src/dbnode/storage/shard.go @@ -269,7 +269,7 @@ func newDatabaseShard( newMergerFn: fs.NewMerger, newFSMergeWithMemFn: newFSMergeWithMem, filesetsFn: fs.DataFiles, - filesetPathsBeforeFn: fs.DataFilePathsBefore, + filesetPathsBeforeFn: fs.DataFileSetsBefore, deleteFilesFn: fs.DeleteFiles, snapshotFilesFn: fs.SnapshotFiles, sleepFn: time.Sleep,