This commit is contained in:
Linh Vo 2017-03-02 16:06:34 -06:00
parent a39ab12ecc
commit 69cfdb0df9
6 changed files with 7 additions and 10 deletions

View file

@ -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 == "" {

View file

@ -149,4 +149,4 @@ func TestDB_InvalidName(t *testing.T) {
if db != nil {
t.Fatalf("unexpected db name %s", db)
}
}
}

View file

@ -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.

View file

@ -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

View file

@ -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
}

View file

@ -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
}
}