Skip to content

Commit

Permalink
CHYT: Fix geodata naming style issue
Browse files Browse the repository at this point in the history
ef20643d21bc9ed57859367f5856e567382c6494
  • Loading branch information
DimasKovas committed Jun 21, 2024
1 parent 25ef172 commit e0f6e1e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions yt/chyt/controller/internal/chyt/artifacts.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ func (c *Controller) appendOpArtifacts(ctx context.Context, speclet *Speclet, fi
{"clickhouse-trampoline", TrampolineBinaryDirectory.Child(speclet.TrampolineVersionOrDefault())},
}

if speclet.EnableGeoDataOrDefault(c.config.EnableGeoDataOrDefault()) {
artifacts = append(artifacts, artifact{"geodata.tgz", speclet.GeoDataPathOrDefault()})
if speclet.EnableGeodataOrDefault(c.config.EnableGeodataOrDefault()) {
artifacts = append(artifacts, artifact{"geodata.tgz", speclet.GeodataPathOrDefault()})
}

var artifactDescription = map[string]yson.RawValue{}
Expand Down
22 changes: 11 additions & 11 deletions yt/chyt/controller/internal/chyt/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ type Config struct {
AddressResolver map[string]any `yson:"address_resolver"`
EnableYandexSpecificLinks *bool `yson:"enable_yandex_specific_links"`
ExportSystemLogTables *bool `yson:"export_system_log_tables"`
EnableGeoData *bool `yson:"enable_geo_data"`
EnableGeodata *bool `yson:"enable_geodata"`
}

const (
DefaultEnableYandexSpecificLinks = false
DefaultExportSystemLogTables = false
DefaultEnableGeoData = false
DefaultEnableGeodata = false
)

func (c *Config) LogRotationModeOrDefault() LogRotationModeType {
Expand All @@ -62,11 +62,11 @@ func (c *Config) ExportSystemLogTablesOrDefault() bool {
return DefaultExportSystemLogTables
}

func (c *Config) EnableGeoDataOrDefault() bool {
if c.EnableGeoData != nil {
return *c.EnableGeoData
func (c *Config) EnableGeodataOrDefault() bool {
if c.EnableGeodata != nil {
return *c.EnableGeodata
}
return DefaultEnableGeoData
return DefaultEnableGeodata
}

type Controller struct {
Expand Down Expand Up @@ -149,7 +149,7 @@ func (c *Controller) buildCommand(speclet *Speclet) string {

var args []string
args = append(args, trampolinePath, chytPath)
if speclet.EnableGeoDataOrDefault(c.config.EnableGeoDataOrDefault()) {
if speclet.EnableGeodataOrDefault(c.config.EnableGeodataOrDefault()) {
args = append(args, "--prepare-geodata")
}
return strings.Join(args, " ")
Expand Down Expand Up @@ -307,16 +307,16 @@ func (c *Controller) DescribeOptions(parsedSpeclet any) []strawberry.OptionGroup
Title: "Enable geodata",
Name: "enable_geodata",
Type: strawberry.TypeBool,
CurrentValue: speclet.EnableGeoData,
DefaultValue: c.config.EnableGeoDataOrDefault(),
CurrentValue: speclet.EnableGeodata,
DefaultValue: c.config.EnableGeodataOrDefault(),
Description: "If true, system dictionaries for geo-functions are set up automatically.",
},
{
Title: "Geodata path",
Name: "geodata_path",
Type: strawberry.TypePath,
CurrentValue: speclet.GeoDataPath,
DefaultValue: DefaultGeoDataPath,
CurrentValue: speclet.GeodataPath,
DefaultValue: DefaultGeodataPath,
},
{
Title: "Export system log tables",
Expand Down
20 changes: 10 additions & 10 deletions yt/chyt/controller/internal/chyt/speclet.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ type Speclet struct {
CHYTVersion *string `yson:"chyt_version"`
TrampolineVersion *string `yson:"trampoline_version"`

EnableGeoData *bool `yson:"enable_geodata"`
GeoDataPath *ypath.Path `yson:"geodata_path"`
EnableGeodata *bool `yson:"enable_geodata"`
GeodataPath *ypath.Path `yson:"geodata_path"`

// RuntimeDataPath defines where all clique table belongings reside (e.g. stderr/core-tables, log dyntables, etc).
RuntimeDataPath *ypath.Path `yson:"runtime_data_path"`
Expand All @@ -34,7 +34,7 @@ const (
DefaultCHYTVersion = "ytserver-clickhouse"
DefaultTrampolineVersion = "clickhouse-trampoline"

DefaultGeoDataPath = ypath.Path("//sys/clickhouse/geodata/geodata.tgz")
DefaultGeodataPath = ypath.Path("//sys/clickhouse/geodata/geodata.tgz")

DefaultRuntimeDataPath = ypath.Path("//sys/clickhouse/kolkhoz")
)
Expand All @@ -53,18 +53,18 @@ func (speclet *Speclet) TrampolineVersionOrDefault() string {
return DefaultTrampolineVersion
}

func (speclet *Speclet) EnableGeoDataOrDefault(defaultValue bool) bool {
if speclet.EnableGeoData != nil {
return *speclet.EnableGeoData
func (speclet *Speclet) EnableGeodataOrDefault(defaultValue bool) bool {
if speclet.EnableGeodata != nil {
return *speclet.EnableGeodata
}
return defaultValue
}

func (speclet *Speclet) GeoDataPathOrDefault() ypath.Path {
if speclet.GeoDataPath != nil {
return *speclet.GeoDataPath
func (speclet *Speclet) GeodataPathOrDefault() ypath.Path {
if speclet.GeodataPath != nil {
return *speclet.GeodataPath
}
return DefaultGeoDataPath
return DefaultGeodataPath
}

func (speclet *Speclet) RuntimeDataPathOrDefault() ypath.Path {
Expand Down

0 comments on commit e0f6e1e

Please sign in to comment.