Change getSeriesId to seriesID to be idomatic

pull/1165/head
Paul Dix 2014-12-03 10:32:39 -05:00
parent bbc2d2e477
commit ec96fe2eb9
2 changed files with 6 additions and 6 deletions

View File

@ -392,12 +392,12 @@ func unmarshalPoint(data []byte) (uint32, time.Time, map[string]interface{}, err
return id, timestamp, v, err
}
// getSeriesId returns the unique id of a series and tagset and a bool indicating if it was found
func (db *Database) getSeriesId(name string, tags map[string]string) (uint32, bool) {
// seriesID returns the unique id of a series and tagset and a bool indicating if it was found
func (db *Database) seriesID(name string, tags map[string]string) (uint32, bool) {
var id uint32
var err error
db.server.meta.view(func(tx *metatx) error {
id, err = tx.getSeriesId(db.name, name, tags)
id, err = tx.seriesID(db.name, name, tags)
return nil
})
if err != nil {
@ -407,7 +407,7 @@ func (db *Database) getSeriesId(name string, tags map[string]string) (uint32, bo
}
func (db *Database) createSeriesIfNotExists(name string, tags map[string]string) (uint32, error) {
if id, ok := db.getSeriesId(name, tags); ok {
if id, ok := db.seriesID(name, tags); ok {
return id, nil
}
@ -420,7 +420,7 @@ func (db *Database) createSeriesIfNotExists(name string, tags map[string]string)
if err != nil {
return uint32(0), err
}
id, ok := db.getSeriesId(name, tags)
id, ok := db.seriesID(name, tags)
if !ok {
return uint32(0), ErrSeriesNotFound
}

View File

@ -845,7 +845,7 @@ func (tx *metatx) deleteDatabase(name string) error {
}
// returns a unique series id by database, name and tags. Returns ErrSeriesNotFound
func (tx *metatx) getSeriesId(database, name string, tags map[string]string) (uint32, error) {
func (tx *metatx) seriesID(database, name string, tags map[string]string) (uint32, error) {
// get the bucket that holds series data for the database
b := tx.Bucket([]byte("Series")).Bucket([]byte(database))
if b == nil {