From 69cfdb0df9fd8f2394e46058e7fcda84cc3e85ea Mon Sep 17 00:00:00 2001 From: Linh Vo Date: Thu, 2 Mar 2017 16:06:34 -0600 Subject: [PATCH] clean up --- cmd/pilosactl/main.go | 2 -- db_test.go | 2 +- fragment.go | 6 +++--- frame.go | 2 +- frame_test.go | 2 +- pilosa.go | 3 +-- 6 files changed, 7 insertions(+), 10 deletions(-) diff --git a/cmd/pilosactl/main.go b/cmd/pilosactl/main.go index 5491dbfca..bb22d14ac 100644 --- a/cmd/pilosactl/main.go +++ b/cmd/pilosactl/main.go @@ -303,7 +303,6 @@ func (cmd *ExportCommand) Run(ctx context.Context) error { logger := log.New(cmd.Stderr, "", log.LstdFlags) // Validate arguments. - fmt.Print("1213224") if cmd.Database == "" { return pilosa.ErrDatabaseRequired } else if cmd.Frame == "" { @@ -973,7 +972,6 @@ func (cmd *BenchCommand) Run(ctx context.Context) error { // runSetBit executes a benchmark of random SetBit() operations. func (cmd *BenchCommand) runSetBit(ctx context.Context, client *pilosa.Client) error { - fmt.Print("Nodb") if cmd.N == 0 { return errors.New("operation count required") } else if cmd.Database == "" { diff --git a/db_test.go b/db_test.go index f0bdc60e2..96120dc1e 100644 --- a/db_test.go +++ b/db_test.go @@ -149,4 +149,4 @@ func TestDB_InvalidName(t *testing.T) { if db != nil { t.Fatalf("unexpected db name %s", db) } -} \ No newline at end of file +} diff --git a/fragment.go b/fragment.go index 9bc542f93..1181f1739 100644 --- a/fragment.go +++ b/fragment.go @@ -213,11 +213,11 @@ func (f *Fragment) openCache() error { // Determine cache type from frame name. if strings.HasSuffix(f.frame, FrameSuffixRank) { c := NewRankCache() - c.ThresholdLength = 500000 - c.ThresholdIndex = 450000 + c.ThresholdLength = 50000 + c.ThresholdIndex = 45000 f.cache = c } else { - f.cache = NewLRUCache(500000) + f.cache = NewLRUCache(50000) } // Read cache data from disk. diff --git a/frame.go b/frame.go index 8ec419057..fa47517c5 100644 --- a/frame.go +++ b/frame.go @@ -46,7 +46,7 @@ type Frame struct { } // NewFrame returns a new instance of frame. -func NewFrame(path, db, name string) (*Frame, error){ +func NewFrame(path, db, name string) (*Frame, error) { err := ValidateName(name) if err != nil { return nil, err diff --git a/frame_test.go b/frame_test.go index 34f03ee15..042bd751e 100644 --- a/frame_test.go +++ b/frame_test.go @@ -96,7 +96,7 @@ func (f *Frame) Reopen() error { path, db, name := f.Path(), f.DB(), f.Name() f.Frame, err = pilosa.NewFrame(path, db, name) - if err != nil{ + if err != nil { return err } diff --git a/pilosa.go b/pilosa.go index f6efb0987..14e5ef203 100644 --- a/pilosa.go +++ b/pilosa.go @@ -80,7 +80,6 @@ func decodeProfile(pb *internal.Profile) *Profile { // TimeFormat is the go-style time format used to parse string dates. const TimeFormat = "2006-01-02T15:04" - // Restrict name using regex func ValidateName(name string) error { expr := regexp.MustCompile(`^([a-z0-9._-]{1,64}$)`) @@ -89,4 +88,4 @@ func ValidateName(name string) error { return ErrName } return nil -} \ No newline at end of file +}