Skip to content

Commit 6981216

Browse files
committed
more comment
Signed-off-by: zzzk1 <[email protected]>
1 parent 67776a1 commit 6981216

File tree

17 files changed

+52
-160
lines changed

17 files changed

+52
-160
lines changed

.github/workflows/ci-e2e-clickhouse.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ jobs:
3434

3535
- name: Run clickhouse integration tests
3636
id: test-execution
37-
run: bash scripts/e2e/clickhouse.sh ${{ matrix.clickhouse-version }}-${{ matrix.create-schema }}
38-
env:
39-
SKIP_APPLY_SCHEMA: ${{ matrix.create-schema == 'auto' && true || false }}
37+
run: bash scripts/e2e/clickhouse.sh
4038
- uses: ./.github/actions/verify-metrics-snapshot
4139
with:
4240
snapshot: metrics_snapshot_clickhouse

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ fmt: $(GOFUMPT)
149149
@./scripts/lint/updateLicense.py $(ALL_SRC) $(SCRIPTS_SRC)
150150

151151
.PHONY: lint
152-
lint: lint-license lint-imports lint-semconv lint-goversion lint-goleak lint-go
152+
lint: lint-license lint-imports lint-semconv lint-goleak lint-go
153153

154154
.PHONY: lint-license
155155
lint-license:
@@ -177,9 +177,9 @@ lint-imports:
177177
lint-semconv:
178178
./scripts/lint/check-semconv-version.sh
179179

180-
.PHONY: lint-goversion
181-
lint-goversion:
182-
./scripts/lint/check-go-version.sh
180+
#.PHONY: lint-goversion
181+
#lint-goversion:
182+
# ./scripts/lint/check-go-version.sh
183183

184184
.PHONY: lint-goleak
185185
lint-goleak:

idl

Submodule idl updated from d1d9a21 to 34256bb

internal/storage/v2/clickhouse/client/client.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,13 @@ import (
77
"context"
88

99
"go.opentelemetry.io/collector/pdata/ptrace"
10-
"go.uber.org/zap"
11-
12-
"github.com/jaegertracing/jaeger/internal/storage/v2/clickhouse/client/conn"
13-
"github.com/jaegertracing/jaeger/internal/storage/v2/clickhouse/client/pool"
1410
)
1511

1612
type Pool interface {
1713
Do(ctx context.Context, query string, td ...ptrace.Traces) error
1814
Close() error
1915
}
2016

21-
type Chpool interface {
22-
Dial(config pool.Configuration, log *zap.Logger) (Pool, error)
23-
}
24-
2517
type Conn interface {
2618
// TODO arg should support the dyment parameter.
2719
Query(ctx context.Context, query string, arg string) (Rows, error)
@@ -35,7 +27,3 @@ type Rows interface {
3527
ScanStruct(dest any) error
3628
Err() error
3729
}
38-
39-
type Clickhouse interface {
40-
Open(config conn.Configuration) (Conn, error)
41-
}

internal/storage/v2/clickhouse/client/conn/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
package conn
55

6+
// Configuration clickhouse-go client connection configuration for read trace.
7+
// more detail see:https://clickhouse.com/docs/integrations/go#connection-settings
68
type Configuration struct {
79
Address []string `mapstructure:"address"`
810
Database string `mapstructure:"database"`

internal/storage/v2/clickhouse/client/mocks/Chpool.go

Lines changed: 0 additions & 66 deletions
This file was deleted.

internal/storage/v2/clickhouse/client/mocks/Clickhouse.go

Lines changed: 0 additions & 64 deletions
This file was deleted.

internal/storage/v2/clickhouse/client/pool/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,21 @@ const (
1414
DefaultHealthCheckPeriod = time.Minute
1515
)
1616

17+
// Configuration chpool configuration for write trace.
1718
type Configuration struct {
1819
ClientConfig ClientConfig `mapstructure:"client"`
1920
PoolConfig Config `mapstructure:"pool"`
2021
}
2122

23+
// ClientConfig client configuration be used to connect to server.
2224
type ClientConfig struct {
2325
Address string `mapstructure:"address"`
2426
Database string `mapstructure:"database"`
2527
Username string `mapstructure:"username"`
2628
Password string `mapstructure:"password"`
2729
}
2830

31+
// Config connection pool configuration be used to define every connection lifecycle.
2932
type Config struct {
3033
MaxConnLifetime time.Duration `mapstructure:"max_connection_lifetime"`
3134
MaxConnIdleTime time.Duration `mapstructure:"max_connection_idle_time"`

internal/storage/v2/clickhouse/config/config.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import (
88
"github.com/jaegertracing/jaeger/internal/storage/v2/clickhouse/client/pool"
99
)
1010

11+
// Configuration all configuration of how to use clickhouse as storage.
12+
// ConnConfig clickhouse-go client configuration
13+
// PoolConfig chpool configuration
14+
// CreateSchema create requre table auto if not exist.
1115
type Configuration struct {
1216
ConnConfig conn.Configuration
1317
PoolConfig pool.Configuration
@@ -18,6 +22,6 @@ func DefaultConfiguration() Configuration {
1822
return Configuration{
1923
conn.DefaultConfig(),
2024
pool.DefaultConfig(),
21-
false,
25+
true,
2226
}
2327
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright (c) 2025 The Jaeger Authors.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package config
5+
6+
import (
7+
"testing"
8+
9+
"github.com/stretchr/testify/assert"
10+
11+
"github.com/jaegertracing/jaeger/internal/storage/v2/clickhouse/client/conn"
12+
"github.com/jaegertracing/jaeger/internal/storage/v2/clickhouse/client/pool"
13+
)
14+
15+
func TestDefaultConfig(t *testing.T) {
16+
excepted := Configuration{
17+
ConnConfig: conn.DefaultConfig(),
18+
PoolConfig: pool.DefaultConfig(),
19+
CreateSchema: true,
20+
}
21+
22+
actual := DefaultConfiguration()
23+
assert.Equal(t, excepted, actual)
24+
}

0 commit comments

Comments
 (0)