Skip to content

Commit

Permalink
Remove unnecessary parameter
Browse files Browse the repository at this point in the history
Signed-off-by: Prithvi Raj <p.r@uber.com>
  • Loading branch information
vprithvi committed May 15, 2018
1 parent b5ade19 commit 3eb9c63
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 12 deletions.
3 changes: 0 additions & 3 deletions plugin/storage/cassandra/dependencystore/storage.go
Expand Up @@ -34,21 +34,18 @@ const (
// DependencyStore handles all queries and insertions to Cassandra dependencies
type DependencyStore struct {
session cassandra.Session
dependencyDataFrequency time.Duration
dependenciesTableMetrics *casMetrics.Table
logger *zap.Logger
}

// NewDependencyStore returns a DependencyStore
func NewDependencyStore(
session cassandra.Session,
dependencyDataFrequency time.Duration,
metricsFactory metrics.Factory,
logger *zap.Logger,
) *DependencyStore {
return &DependencyStore{
session: session,
dependencyDataFrequency: dependencyDataFrequency,
dependenciesTableMetrics: casMetrics.NewTable(metricsFactory, "Dependencies"),
logger: logger,
}
Expand Down
2 changes: 1 addition & 1 deletion plugin/storage/cassandra/dependencystore/storage_test.go
Expand Up @@ -48,7 +48,7 @@ func withDepStore(fn func(s *depStorageTest)) {
session: session,
logger: logger,
logBuffer: logBuffer,
storage: NewDependencyStore(session, 24*time.Hour, metricsFactory, logger),
storage: NewDependencyStore(session, metricsFactory, logger),
}
fn(s)
}
Expand Down
2 changes: 1 addition & 1 deletion plugin/storage/cassandra/factory.go
Expand Up @@ -106,7 +106,7 @@ func (f *Factory) CreateSpanWriter() (spanstore.Writer, error) {

// CreateDependencyReader implements storage.Factory
func (f *Factory) CreateDependencyReader() (dependencystore.Reader, error) {
return cDepStore.NewDependencyStore(f.primarySession, f.Options.DepStoreDataFrequency, f.primaryMetricsFactory, f.logger), nil
return cDepStore.NewDependencyStore(f.primarySession, f.primaryMetricsFactory, f.logger), nil
}

// CreateArchiveSpanReader implements storage.ArchiveFactory
Expand Down
7 changes: 0 additions & 7 deletions plugin/storage/cassandra/options.go
Expand Up @@ -47,7 +47,6 @@ const (

// common storage settings
suffixSpanStoreWriteCacheTTL = ".span-store-write-cache-ttl"
suffixDepStoreDataFrequency = ".dependency-store-data-frequency"
)

// Options contains various type of Cassandra configs and provides the ability
Expand All @@ -57,7 +56,6 @@ type Options struct {
primary *namespaceConfig
others map[string]*namespaceConfig
SpanStoreWriteCacheTTL time.Duration
DepStoreDataFrequency time.Duration
}

// the Servers field in config.Configuration is a list, which we cannot represent with flags.
Expand Down Expand Up @@ -93,7 +91,6 @@ func NewOptions(primaryNamespace string, otherNamespaces ...string) *Options {
},
others: make(map[string]*namespaceConfig, len(otherNamespaces)),
SpanStoreWriteCacheTTL: time.Hour * 12,
DepStoreDataFrequency: time.Hour * 24,
}

for _, namespace := range otherNamespaces {
Expand All @@ -112,9 +109,6 @@ func (opt *Options) AddFlags(flagSet *flag.FlagSet) {
flagSet.Duration(opt.primary.namespace+suffixSpanStoreWriteCacheTTL,
opt.SpanStoreWriteCacheTTL,
"The duration to wait before rewriting an existing service or operation name")
flagSet.Duration(opt.primary.namespace+suffixDepStoreDataFrequency,
opt.DepStoreDataFrequency,
"Frequency of service dependency calculations")
}

func addFlags(flagSet *flag.FlagSet, nsConfig *namespaceConfig) {
Expand Down Expand Up @@ -201,7 +195,6 @@ func (opt *Options) InitFromViper(v *viper.Viper) {
cfg.initFromViper(v)
}
opt.SpanStoreWriteCacheTTL = v.GetDuration(opt.primary.namespace + suffixSpanStoreWriteCacheTTL)
opt.DepStoreDataFrequency = v.GetDuration(opt.primary.namespace + suffixDepStoreDataFrequency)
}

func (cfg *namespaceConfig) initFromViper(v *viper.Viper) {
Expand Down

0 comments on commit 3eb9c63

Please sign in to comment.