mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
clean up
This commit is contained in:
parent
a39ab12ecc
commit
69cfdb0df9
6 changed files with 7 additions and 10 deletions
|
|
@ -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 == "" {
|
||||
|
|
|
|||
|
|
@ -149,4 +149,4 @@ func TestDB_InvalidName(t *testing.T) {
|
|||
if db != nil {
|
||||
t.Fatalf("unexpected db name %s", db)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
2
frame.go
2
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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue