Skip to content

Commit

Permalink
add config for scylla access for nova (#70)
Browse files Browse the repository at this point in the history
Signed-off-by: YifengW86 <[email protected]>
  • Loading branch information
YifengW86 authored Oct 2, 2024
1 parent cdb061d commit 75c5521
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ type Adapter struct {
// needed for Facebook
PlatformID string
AppSecret string

// needed for Nova
NovaScylla AdapterNovaScylla
}
19 changes: 19 additions & 0 deletions config/bidderinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ type BidderInfo struct {

// For MSP Plugin extension only.
MspSoPath string `mapstructure:"so_path,omitempty" json:"so_path,omitempty"`

// For Nova Adapter only
NovaScylla AdapterNovaScylla `yaml:"scylla" mapstructure:"scylla"`
}

// BidderInfoExperiment specifies non-production ready feature config for a bidder
Expand Down Expand Up @@ -182,6 +185,13 @@ type SyncerEndpoint struct {
UserMacro string `yaml:"userMacro" mapstructure:"user_macro"`
}

// AdapterNovaScylla specifies the the scylla config for Nova Adapter
type AdapterNovaScylla struct {
Cluster string `yaml:"cluster" mapstructure:"cluster"`
KeySpace string `yaml:"keyspace" mapstructure:"keyspace"`
TimeOut int32 `yaml:"query_timeout" mapstructure:"query_timeout"`
}

func (bi BidderInfo) IsEnabled() bool {
return !bi.Disabled
}
Expand Down Expand Up @@ -439,6 +449,15 @@ func applyBidderInfoConfigOverrides(configBidderInfos BidderInfos, fsBidderInfos
if bidderInfo.EndpointCompression == "" && fsBidderCfg.EndpointCompression != "" {
bidderInfo.EndpointCompression = fsBidderCfg.EndpointCompression
}
if bidderInfo.NovaScylla.Cluster == "" && fsBidderCfg.NovaScylla.Cluster != "" {
bidderInfo.NovaScylla.Cluster = fsBidderCfg.NovaScylla.Cluster
}
if bidderInfo.NovaScylla.KeySpace == "" && fsBidderCfg.NovaScylla.KeySpace != "" {
bidderInfo.NovaScylla.KeySpace = fsBidderCfg.NovaScylla.KeySpace
}
if bidderInfo.NovaScylla.TimeOut == 0 && fsBidderCfg.NovaScylla.TimeOut > 0 {
bidderInfo.NovaScylla.TimeOut = fsBidderCfg.NovaScylla.TimeOut
}

// validate and try to apply the legacy usersync_url configuration in attempt to provide
// an easier upgrade path. be warned, this will break if the bidder adds a second syncer
Expand Down
1 change: 1 addition & 0 deletions exchange/adapter_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func buildAdapterInfo(bidderInfo config.BidderInfo) config.Adapter {
adapter.PlatformID = bidderInfo.PlatformID
adapter.AppSecret = bidderInfo.AppSecret
adapter.XAPI = bidderInfo.XAPI
adapter.NovaScylla = bidderInfo.NovaScylla
return adapter
}

Expand Down

0 comments on commit 75c5521

Please sign in to comment.