Skip to content

Commit 66641fe

Browse files
committed
chore: upgrade ceresdb-client to v1.1.0
1 parent b8e0809 commit 66641fe

File tree

6 files changed

+14
-18
lines changed

6 files changed

+14
-18
lines changed

cmd/tsbs_run_queries_ceresdb/main.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"time"
1111

1212
"github.com/CeresDB/ceresdb-client-go/ceresdb"
13-
"github.com/CeresDB/ceresdb-client-go/types"
1413
"github.com/blagojts/viper"
1514
"github.com/spf13/pflag"
1615
"github.com/timescale/tsbs/internal/utils"
@@ -81,7 +80,7 @@ func newProcessor() query.Processor {
8180

8281
// query.Processor interface implementation
8382
func (p *processor) Init(workerNumber int) {
84-
client, err := ceresdb.NewClient(ceresdbAddr, types.Direct, ceresdb.WithDefaultDatabase("public"))
83+
client, err := ceresdb.NewClient(ceresdbAddr, ceresdb.Direct, ceresdb.WithDefaultDatabase("public"))
8584
if err != nil {
8685
panic(err)
8786
}
@@ -111,7 +110,7 @@ func (p *processor) ProcessQuery(q query.Query, isWarm bool) ([]*query.Stat, err
111110
}
112111

113112
// Main action - run the query
114-
rows, err := p.db.SQLQuery(context.TODO(), types.SQLQueryRequest{
113+
rows, err := p.db.SQLQuery(context.TODO(), ceresdb.SQLQueryRequest{
115114
Tables: []string{string(ceresdbQuery.Table)},
116115
SQL: sql,
117116
})

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.14
44

55
require (
66
github.com/BurntSushi/toml v1.2.0 // indirect
7-
github.com/CeresDB/ceresdb-client-go v1.0.1
7+
github.com/CeresDB/ceresdb-client-go v1.1.0
88
github.com/HdrHistogram/hdrhistogram-go v1.0.0
99
github.com/SiriDB/go-siridb-connector v0.0.0-20190110105621-86b34c44c921
1010
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
5151
github.com/BurntSushi/toml v1.2.0 h1:Rt8g24XnyGTyglgET/PRUNlrUeu9F5L+7FilkXfZgs0=
5252
github.com/BurntSushi/toml v1.2.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
5353
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
54-
github.com/CeresDB/ceresdb-client-go v1.0.1 h1:lWF8DF5S+tNPX+y/OlrHBdGRpXcDZlXFXdIte6MuiIY=
55-
github.com/CeresDB/ceresdb-client-go v1.0.1/go.mod h1:msZb4XO8ak9/JzOSU9ytdWR8YbhTZ1GCEIRSmnZ+Gn4=
56-
github.com/CeresDB/ceresdbproto/golang v0.0.0-20230209095436-43939799b2e6 h1:EqRcuCuMDc+x5vWbyut236dR7RRwWjFOpYjwbi8mNFc=
57-
github.com/CeresDB/ceresdbproto/golang v0.0.0-20230209095436-43939799b2e6/go.mod h1:qLTh6jtSu2ZLIFsU3iiDIKvkrQvyY/Csg6Mk0Ub0QZ4=
54+
github.com/CeresDB/ceresdb-client-go v1.1.0 h1:iCBb03OubOA7NCLSiYBis9lMaR3nu6s0wipUulEeonU=
55+
github.com/CeresDB/ceresdb-client-go v1.1.0/go.mod h1:bZneg5VvvfSZhCnlKO0SjIoPY+fLKnFwhPb3gijLorE=
56+
github.com/CeresDB/ceresdbproto/golang v0.0.0-20230228090856-37ba6214b131 h1:ePzWeIoLOT4FsdjNrmEVrrtm412H2xHM6ZNLamB0bqk=
57+
github.com/CeresDB/ceresdbproto/golang v0.0.0-20230228090856-37ba6214b131/go.mod h1:qLTh6jtSu2ZLIFsU3iiDIKvkrQvyY/Csg6Mk0Ub0QZ4=
5858
github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
5959
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
6060
github.com/Djarvur/go-err113 v0.0.0-20200511133814-5174e21577d5/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs=

pkg/targets/ceresdb/batch.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ import (
55
"time"
66

77
"github.com/CeresDB/ceresdb-client-go/ceresdb"
8-
"github.com/CeresDB/ceresdb-client-go/types"
98
"github.com/influxdata/line-protocol/v2/lineprotocol"
109
"github.com/timescale/tsbs/pkg/data"
1110
)
1211

1312
type batch struct {
1413
pointCount uint64
1514
fieldCount uint64
16-
points []types.Point
15+
points []ceresdb.Point
1716
}
1817

1918
func (b *batch) Len() uint {
@@ -53,7 +52,7 @@ func (b *batch) Append(item data.LoadedPoint) {
5352
if key == nil {
5453
break
5554
}
56-
builder.AddTag(string(key), types.NewStringValue(string(val)))
55+
builder.AddTag(string(key), ceresdb.NewStringValue(string(val)))
5756
}
5857

5958
for {
@@ -64,7 +63,7 @@ func (b *batch) Append(item data.LoadedPoint) {
6463
if key == nil {
6564
break
6665
}
67-
builder.AddField(string(key), types.NewDoubleValue(valueToFloat64(val)))
66+
builder.AddField(string(key), ceresdb.NewDoubleValue(valueToFloat64(val)))
6867
}
6968

7069
timestamp, err := dec.Time(lineprotocol.Nanosecond, time.Time{})

pkg/targets/ceresdb/creator.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"strings"
77

88
"github.com/CeresDB/ceresdb-client-go/ceresdb"
9-
"github.com/CeresDB/ceresdb-client-go/types"
109
"github.com/timescale/tsbs/pkg/data/usecases/common"
1110
"github.com/timescale/tsbs/pkg/targets"
1211
)
@@ -50,7 +49,7 @@ func (d *dbCreator) DBExists(dbName string) bool { return true }
5049

5150
// loader.DBCreator interface implementation
5251
func (d *dbCreator) CreateDB(dbName string) error {
53-
client, err := ceresdb.NewClient(d.config.CeresdbAddr, types.Direct, ceresdb.WithDefaultDatabase("public"))
52+
client, err := ceresdb.NewClient(d.config.CeresdbAddr, ceresdb.Direct, ceresdb.WithDefaultDatabase("public"))
5453
if err != nil {
5554
return err
5655
}
@@ -92,7 +91,7 @@ storage_format = '%s'
9291
`
9392
sql := fmt.Sprintf(tmpl, tableName, strings.Join(columnDefs, ","), d.config.PrimaryKeys, d.config.RowGroupSize, d.config.StorageFormat)
9493
// fmt.Printf("sql = %s\n", sql)
95-
_, err := client.SQLQuery(context.TODO(), types.SQLQueryRequest{
94+
_, err := client.SQLQuery(context.TODO(), ceresdb.SQLQueryRequest{
9695
Tables: []string{tableName},
9796
SQL: sql,
9897
})

pkg/targets/ceresdb/processor.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"time"
77

88
"github.com/CeresDB/ceresdb-client-go/ceresdb"
9-
"github.com/CeresDB/ceresdb-client-go/types"
109
"github.com/timescale/tsbs/pkg/targets"
1110
)
1211

@@ -16,7 +15,7 @@ type processor struct {
1615
}
1716

1817
func (p *processor) Init(workerNum int, doLoad, hashWorkers bool) {
19-
client, err := ceresdb.NewClient(p.addr, types.Direct, ceresdb.WithDefaultDatabase("public"))
18+
client, err := ceresdb.NewClient(p.addr, ceresdb.Direct, ceresdb.WithDefaultDatabase("public"))
2019
if err != nil {
2120
panic(err)
2221
}
@@ -34,7 +33,7 @@ func (p *processor) ProcessBatch(b targets.Batch, doLoad bool) (metricCount, row
3433

3534
func (p *processor) do(b *batch) (uint64, uint64) {
3635
for {
37-
ret, err := p.client.Write(context.TODO(), types.WriteRequest{Points: b.points})
36+
ret, err := p.client.Write(context.TODO(), ceresdb.WriteRequest{Points: b.points})
3837

3938
if err == nil {
4039
// log.Printf("success :%d\n", ret)

0 commit comments

Comments
 (0)