-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added flags for driving cassandra connection compression through config #1675
Added flags for driving cassandra connection compression through config #1675
Conversation
Signed-off-by: Sagar Anand <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #1675 +/- ##
==========================================
+ Coverage 98.49% 98.49% +<.01%
==========================================
Files 193 193
Lines 9286 9291 +5
==========================================
+ Hits 9146 9151 +5
Misses 111 111
Partials 29 29
Continue to review full report at Codecov.
|
@yurishkuro : Could you review this PR please? |
pkg/cassandra/config/config.go
Outdated
@@ -38,6 +38,7 @@ type Configuration struct { | |||
MaxRetryAttempts int `validate:"min=0" yaml:"max_retry_attempt"` | |||
ProtoVersion int `yaml:"proto_version"` | |||
Consistency string `yaml:"consistency"` | |||
EnableCompression bool `yaml:"enable-compression"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes the struct not backwards compatible, because the default value will be false (only initializing from CLI flags would use true as default).
I prefer to call this DisableCompression
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yurishkuro : Sure, disableCompression makes more sense, now that I think about it. Will make the changes.
Quick question though, the following puts the default value of enableCompression to be true. So, default as true also affects the backend compatibility?
flagSet.Bool(
nsConfig.namespace+suffixEnableCompression,
true,
"Enable the use of Compression while connecting to Cassandra API based Storage backend. Uses SnappyCompression by default")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This default only works if flags are used. But the CassandraConfiguration struct can also be used directly, e.g. it's how we do it in our customized binaries at Uber, where configuration is read from yaml files and auto-populated into config structs. So the struct itself should be backwards compatible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this @yurishkuro
Made the required changes, please review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a couple of small tweaks
pkg/cassandra/config/config.go
Outdated
} | ||
|
||
fmt.Println("Compression is:") | ||
fmt.Println(cluster.Compressor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove print statements, we don't do that in Jaeger. I believe at some point we simply log the whole config struct, using the logger, not println.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad..Removed these in the latest push
plugin/storage/cassandra/options.go
Outdated
flagSet.Bool( | ||
nsConfig.namespace+suffixDisableCompression, | ||
false, | ||
"Disables the use of the default Snappy Compression while connecting to the Cassandra Cluster if set to true") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may want to add to description: "This may be useful when using Azure Cosmos DB instead of Cassandra"
Signed-off-by: Sagar Anand <[email protected]>
@yurishkuro : If everything seems ok, could you please merge this? |
All good, I was just waiting for a green build. |
Signed-off-by: Sagar Anand [email protected]
Which problem is this PR solving?
Short description of the changes