mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
common: clickHouse → clickhouse
Let's say that we use "ClickHouse" and "clickhouse".
This commit is contained in:
@@ -115,7 +115,7 @@ func (schema Schema) ClickHouseSortingKeys() []string {
|
||||
// ClickHousePrimaryKeys returns the list of primary keys.
|
||||
func (schema Schema) ClickHousePrimaryKeys() []string {
|
||||
cols := []string{}
|
||||
for _, key := range schema.clickHousePrimaryKeys {
|
||||
for _, key := range schema.clickhousePrimaryKeys {
|
||||
cols = append(cols, key.String())
|
||||
}
|
||||
return cols
|
||||
|
||||
@@ -189,7 +189,7 @@ const (
|
||||
// in `PrimaryKeys'.
|
||||
func flows() Schema {
|
||||
return Schema{
|
||||
clickHousePrimaryKeys: []ColumnKey{
|
||||
clickhousePrimaryKeys: []ColumnKey{
|
||||
ColumnTimeReceived,
|
||||
ColumnExporterAddress,
|
||||
ColumnEType,
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
func TestFlowsClickHouse(t *testing.T) {
|
||||
c := NewMock(t)
|
||||
for _, key := range c.clickHousePrimaryKeys {
|
||||
for _, key := range c.clickhousePrimaryKeys {
|
||||
if column := c.columnIndex[key]; column.Key == 0 {
|
||||
t.Errorf("primary key %q not a column", key)
|
||||
} else {
|
||||
|
||||
@@ -51,7 +51,7 @@ func New(config Configuration) (*Component, error) {
|
||||
if column.NoDisable {
|
||||
return nil, fmt.Errorf("column %q cannot be disabled", k)
|
||||
}
|
||||
if slices.Contains(schema.clickHousePrimaryKeys, k) {
|
||||
if slices.Contains(schema.clickhousePrimaryKeys, k) {
|
||||
return nil, fmt.Errorf("column %q cannot be disabled (primary key)", k)
|
||||
}
|
||||
column.Disabled = true
|
||||
@@ -76,7 +76,7 @@ func New(config Configuration) (*Component, error) {
|
||||
if column.NoDisable {
|
||||
return nil, fmt.Errorf("column %q cannot be present on main table only", k)
|
||||
}
|
||||
if slices.Contains(schema.clickHousePrimaryKeys, k) {
|
||||
if slices.Contains(schema.clickhousePrimaryKeys, k) {
|
||||
// Primary keys are part of the sorting key.
|
||||
return nil, fmt.Errorf("column %q cannot be present on main table only (primary key)", k)
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ type Schema struct {
|
||||
dynamicColumns ColumnKey
|
||||
// For ClickHouse. This is the set of primary keys (order is important and
|
||||
// may not follow column order) for the aggregated tables.
|
||||
clickHousePrimaryKeys []ColumnKey
|
||||
clickhousePrimaryKeys []ColumnKey
|
||||
}
|
||||
|
||||
// Column represents a column of data.
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
|
||||
func TestHTTPEndpoints(t *testing.T) {
|
||||
r := reporter.NewMock(t)
|
||||
clickHouseComponent := clickhousedb.SetupClickHouse(t, r, false)
|
||||
clickhouseComponent := clickhousedb.SetupClickHouse(t, r, false)
|
||||
config := DefaultConfiguration()
|
||||
config.SkipMigrations = true
|
||||
config.Networks = helpers.MustNewSubnetMap(map[string]NetworkAttributes{
|
||||
@@ -44,7 +44,7 @@ func TestHTTPEndpoints(t *testing.T) {
|
||||
HTTP: httpserver.NewMock(t, r),
|
||||
Schema: sch,
|
||||
GeoIP: geoip.NewMock(t, r, false),
|
||||
ClickHouse: clickHouseComponent,
|
||||
ClickHouse: clickhouseComponent,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("New() error:\n%+v", err)
|
||||
@@ -113,7 +113,7 @@ func TestHTTPEndpoints(t *testing.T) {
|
||||
|
||||
func TestAdditionalASNs(t *testing.T) {
|
||||
r := reporter.NewMock(t)
|
||||
clickHouseComponent := clickhousedb.SetupClickHouse(t, r, false)
|
||||
clickhouseComponent := clickhousedb.SetupClickHouse(t, r, false)
|
||||
config := DefaultConfiguration()
|
||||
config.ASNs = map[uint32]string{
|
||||
1: "New network",
|
||||
@@ -123,7 +123,7 @@ func TestAdditionalASNs(t *testing.T) {
|
||||
HTTP: httpserver.NewMock(t, r),
|
||||
Schema: schema.NewMock(t),
|
||||
GeoIP: geoip.NewMock(t, r, false),
|
||||
ClickHouse: clickHouseComponent,
|
||||
ClickHouse: clickhouseComponent,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("New() error:\n%+v", err)
|
||||
|
||||
@@ -57,7 +57,7 @@ func (c *Component) migrateDatabase() error {
|
||||
c.config.Kafka.Consumers = int(threads)
|
||||
}
|
||||
if err := validateVersion(version); err != nil {
|
||||
return fmt.Errorf("incorrect Clickhouse version: %w", err)
|
||||
return fmt.Errorf("incorrect ClickHouse version: %w", err)
|
||||
}
|
||||
|
||||
if c.config.Cluster != "" {
|
||||
|
||||
@@ -173,14 +173,14 @@ func waitMigrations(t *testing.T, ch *Component) {
|
||||
|
||||
func TestGetHTTPBaseURL(t *testing.T) {
|
||||
r := reporter.NewMock(t)
|
||||
clickHouseComponent := clickhousedb.SetupClickHouse(t, r, false)
|
||||
clickhouseComponent := clickhousedb.SetupClickHouse(t, r, false)
|
||||
http := httpserver.NewMock(t, r)
|
||||
c, err := New(r, DefaultConfiguration(), Dependencies{
|
||||
Daemon: daemon.NewMock(t),
|
||||
HTTP: http,
|
||||
Schema: schema.NewMock(t),
|
||||
GeoIP: geoip.NewMock(t, r, true),
|
||||
ClickHouse: clickHouseComponent,
|
||||
ClickHouse: clickhouseComponent,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("New() error:\n%+v", err)
|
||||
|
||||
@@ -21,7 +21,7 @@ func TestNetworksCSVWithGeoip(t *testing.T) {
|
||||
config := DefaultConfiguration()
|
||||
config.SkipMigrations = true
|
||||
r := reporter.NewMock(t)
|
||||
clickHouseComponent := clickhousedb.SetupClickHouse(t, r, false)
|
||||
clickhouseComponent := clickhousedb.SetupClickHouse(t, r, false)
|
||||
|
||||
t.Run("only GeoIP", func(t *testing.T) {
|
||||
// First use only GeoIP
|
||||
@@ -30,7 +30,7 @@ func TestNetworksCSVWithGeoip(t *testing.T) {
|
||||
HTTP: httpserver.NewMock(t, r),
|
||||
Schema: schema.NewMock(t),
|
||||
GeoIP: geoip.NewMock(t, r, true),
|
||||
ClickHouse: clickHouseComponent,
|
||||
ClickHouse: clickhouseComponent,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("New() error:\n%+v", err)
|
||||
@@ -79,7 +79,7 @@ func TestNetworksCSVWithGeoip(t *testing.T) {
|
||||
HTTP: httpserver.NewMock(t, r),
|
||||
Schema: schema.NewMock(t),
|
||||
GeoIP: geoip.NewMock(t, r, true),
|
||||
ClickHouse: clickHouseComponent,
|
||||
ClickHouse: clickhouseComponent,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("New() error:\n%+v", err)
|
||||
@@ -126,7 +126,7 @@ func TestNetworksCSVWithGeoip(t *testing.T) {
|
||||
HTTP: httpserver.NewMock(t, r),
|
||||
Schema: schema.NewMock(t),
|
||||
GeoIP: geoip.NewMock(t, r, true),
|
||||
ClickHouse: clickHouseComponent,
|
||||
ClickHouse: clickhouseComponent,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("New() error:\n%+v", err)
|
||||
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
|
||||
func TestNetworkSources(t *testing.T) {
|
||||
r := reporter.NewMock(t)
|
||||
clickHouseComponent := clickhousedb.SetupClickHouse(t, r, false)
|
||||
clickhouseComponent := clickhousedb.SetupClickHouse(t, r, false)
|
||||
|
||||
// Mux to answer requests
|
||||
ready := make(chan bool)
|
||||
@@ -104,7 +104,7 @@ func TestNetworkSources(t *testing.T) {
|
||||
HTTP: httpserver.NewMock(t, r),
|
||||
Schema: schema.NewMock(t),
|
||||
GeoIP: geoip.NewMock(t, r, false),
|
||||
ClickHouse: clickHouseComponent,
|
||||
ClickHouse: clickhouseComponent,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("New() error:\n%+v", err)
|
||||
|
||||
Reference in New Issue
Block a user