@@ -38,8 +38,7 @@ type Shipper interface {
38
38
Sync (ctx context.Context ) (uploaded int , err error )
39
39
}
40
40
41
- // UserTSDB is a user's TSDB.
42
- type UserTSDB struct {
41
+ type userTSDB struct {
43
42
* tsdb.DB
44
43
45
44
// Thanos shipper used to ship blocks to the storage.
@@ -50,7 +49,7 @@ type UserTSDB struct {
50
49
51
50
// TSDBState holds data structures used by the TSDB storage engine
52
51
type TSDBState struct {
53
- dbs map [string ]* UserTSDB // tsdb sharded by userID
52
+ dbs map [string ]* userTSDB // tsdb sharded by userID
54
53
bucket objstore.Bucket
55
54
56
55
// Keeps count of in-flight requests
@@ -79,7 +78,7 @@ func NewV2(cfg Config, clientConfig client.Config, limits *validation.Overrides,
79
78
quit : make (chan struct {}),
80
79
wal : & noopWAL {},
81
80
TSDBState : TSDBState {
82
- dbs : make (map [string ]* UserTSDB ),
81
+ dbs : make (map [string ]* userTSDB ),
83
82
bucket : bucketClient ,
84
83
tsdbMetrics : newTSDBMetrics (registerer ),
85
84
},
@@ -391,7 +390,7 @@ func (i *Ingester) v2MetricsForLabelMatchers(ctx old_ctx.Context, req *client.Me
391
390
return result , nil
392
391
}
393
392
394
- func (i * Ingester ) getTSDB (userID string ) * UserTSDB {
393
+ func (i * Ingester ) getTSDB (userID string ) * userTSDB {
395
394
i .userStatesMtx .RLock ()
396
395
defer i .userStatesMtx .RUnlock ()
397
396
db , _ := i .TSDBState .dbs [userID ]
@@ -412,7 +411,7 @@ func (i *Ingester) getTSDBUsers() []string {
412
411
return ids
413
412
}
414
413
415
- func (i * Ingester ) getOrCreateTSDB (userID string , force bool ) (* UserTSDB , error ) {
414
+ func (i * Ingester ) getOrCreateTSDB (userID string , force bool ) (* userTSDB , error ) {
416
415
db := i .getTSDB (userID )
417
416
if db != nil {
418
417
return db , nil
@@ -452,7 +451,7 @@ func (i *Ingester) getOrCreateTSDB(userID string, force bool) (*UserTSDB, error)
452
451
}
453
452
454
453
// createTSDB creates a TSDB for a given userID, and returns the created db.
455
- func (i * Ingester ) createTSDB (userID string ) (* UserTSDB , error ) {
454
+ func (i * Ingester ) createTSDB (userID string ) (* userTSDB , error ) {
456
455
tsdbPromReg := prometheus .NewRegistry ()
457
456
458
457
udir := i .cfg .TSDBConfig .BlocksDir (userID )
@@ -467,7 +466,7 @@ func (i *Ingester) createTSDB(userID string) (*UserTSDB, error) {
467
466
return nil , err
468
467
}
469
468
470
- userDB := & UserTSDB {
469
+ userDB := & userTSDB {
471
470
DB : db ,
472
471
}
473
472
@@ -507,7 +506,7 @@ func (i *Ingester) closeAllTSDB() {
507
506
for userID , userDB := range i .TSDBState .dbs {
508
507
userID := userID
509
508
510
- go func (db * UserTSDB ) {
509
+ go func (db * userTSDB ) {
511
510
defer wg .Done ()
512
511
513
512
if err := db .Close (); err != nil {
0 commit comments