From 96208283df9f749a90d1e7c41ca624102885b7bf Mon Sep 17 00:00:00 2001 From: Travis Turner Date: Tue, 5 Jun 2018 16:38:29 -0500 Subject: [PATCH] remove final instances of Field --- ctl/import.go | 14 +++++++------- fragment_test.go | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ctl/import.go b/ctl/import.go index 493e1429b..c6c0f0188 100644 --- a/ctl/import.go +++ b/ctl/import.go @@ -145,7 +145,7 @@ func (cmd *ImportCommand) ensureSchema(ctx context.Context) error { func (cmd *ImportCommand) importPath(ctx context.Context, frameType, path string) error { // If frameType is `int`, treat the import data as values to be range-encoded. if frameType == pilosa.FrameTypeInt { - return cmd.bufferFieldValues(ctx, path) + return cmd.bufferValues(ctx, path) } else { if cmd.StringKeys { return cmd.bufferBitsK(ctx, path) @@ -358,8 +358,8 @@ func (cmd *ImportCommand) importBitsK(ctx context.Context, bits []pilosa.Bit) er return nil } -// bufferFieldValues buffers slices of fieldValues to be imported as a batch. -func (cmd *ImportCommand) bufferFieldValues(ctx context.Context, path string) error { +// bufferValues buffers slices of fieldValues to be imported as a batch. +func (cmd *ImportCommand) bufferValues(ctx context.Context, path string) error { a := make([]pilosa.FieldValue, 0, cmd.BufferSize) var r *csv.Reader @@ -418,7 +418,7 @@ func (cmd *ImportCommand) bufferFieldValues(ctx context.Context, path string) er // If we've reached the buffer size then import field values. if len(a) == cmd.BufferSize { - if err := cmd.importFieldValues(ctx, a); err != nil { + if err := cmd.importValues(ctx, a); err != nil { return err } a = a[:0] @@ -426,15 +426,15 @@ func (cmd *ImportCommand) bufferFieldValues(ctx context.Context, path string) er } // If there are still values in the buffer then flush them. - if err := cmd.importFieldValues(ctx, a); err != nil { + if err := cmd.importValues(ctx, a); err != nil { return err } return nil } -// importFieldValues sends batches of fieldValues to the server. -func (cmd *ImportCommand) importFieldValues(ctx context.Context, vals []pilosa.FieldValue) error { +// importValues sends batches of fieldValues to the server. +func (cmd *ImportCommand) importValues(ctx context.Context, vals []pilosa.FieldValue) error { logger := log.New(cmd.Stderr, "", log.LstdFlags) // Group vals by slice. diff --git a/fragment_test.go b/fragment_test.go index e1c9b7fd4..6a96fb677 100644 --- a/fragment_test.go +++ b/fragment_test.go @@ -220,7 +220,7 @@ func TestFragment_SetValue(t *testing.T) { } // Ensure a fragment can sum field values. -func TestFragment_FieldSum(t *testing.T) { +func TestFragment_Sum(t *testing.T) { const bitDepth = 16 f := test.MustOpenFragment("i", "f", pilosa.ViewStandard, 0, "") @@ -259,7 +259,7 @@ func TestFragment_FieldSum(t *testing.T) { } // Ensure a fragment can find the min and max of field values. -func TestFragment_FieldMinMax(t *testing.T) { +func TestFragment_MinMax(t *testing.T) { const bitDepth = 16 f := test.MustOpenFragment("i", "f", pilosa.ViewStandard, 0, "") @@ -332,7 +332,7 @@ func TestFragment_FieldMinMax(t *testing.T) { } // Ensure a fragment query for matching fields. -func TestFragment_FieldRange(t *testing.T) { +func TestFragment_Range(t *testing.T) { const bitDepth = 16 t.Run("EQ", func(t *testing.T) {