Change getSeriesId to seriesID to be idomatic
parent
bbc2d2e477
commit
ec96fe2eb9
10
database.go
10
database.go
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue