-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add cassandra v4 support #3225
Merged
Merged
Add cassandra v4 support #3225
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
da2c742
Add schema for cassandra v4.0.
Ashmita152 d476ac2
Aligning nomenclature of cassandra integration test with elasticsearc…
Ashmita152 4d93c07
Feedbacks
Ashmita152 200470d
Merge branch 'master' into cassandra-v4
Ashmita152 d4ccaa6
Feedbacks
Ashmita152 6dab52e
Feedbacks
Ashmita152 57b9d96
Apply v3 and v4 based on cassandra version
Ashmita152 c13212a
Add comment
Ashmita152 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Feedbacks
Signed-off-by: Ashmita Bohara <[email protected]>
commit d4ccaa617cbe05e81d7d6c9c8e8c27a492f0c067
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,66 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
set -euxf -o pipefail | ||
|
||
# Build the schema container and run it rather than using the existing container in Docker Hub since that | ||
# requires this current build to succeed before this test can use it; chicken and egg problem. | ||
docker build -t jaeger-cassandra-schema-integration-test plugin/storage/cassandra/ | ||
docker run -e CQLSH_HOST=localhost -e CQLSH_PORT=9042 -e TEMPLATE=/cassandra-schema/$1.cql.tmpl --network=host jaeger-cassandra-schema-integration-test | ||
usage() { | ||
echo $"Usage: $0 <cassandra_version> <schema_version>" | ||
exit 1 | ||
} | ||
|
||
# Run the test. | ||
export STORAGE=cassandra | ||
make storage-integration-test | ||
check_arg() { | ||
if [ ! $# -eq 2 ]; then | ||
echo "ERROR: need exactly two arguments, <cassandra_version> <schema_version>" | ||
usage | ||
fi | ||
} | ||
|
||
setup_cassandra() { | ||
local tag=$1 | ||
local image=cassandra | ||
local params=( | ||
--rm | ||
--detach | ||
--publish 9042:9042 | ||
--publish 9160:9160 | ||
) | ||
local cid=$(docker run ${params[@]} ${image}:${tag}) | ||
echo ${cid} | ||
} | ||
|
||
teardown_cassandra() { | ||
local cid=$1 | ||
docker kill ${cid} | ||
} | ||
|
||
apply_schema() { | ||
local image=cassandra-schema | ||
local schema_dir=plugin/storage/cassandra/ | ||
local schema_version=$1 | ||
local params=( | ||
--rm | ||
--env CQLSH_HOST=localhost | ||
--env CQLSH_PORT=9042 | ||
--env TEMPLATE=/cassandra-schema/${schema_version}.cql.tmpl | ||
--network host | ||
) | ||
docker build -t ${image} ${schema_dir} | ||
docker run ${params[@]} ${image} | ||
} | ||
|
||
run_integration_test() { | ||
local version=$1 | ||
local schema_version=$2 | ||
local cid=$(setup_cassandra ${version}) | ||
apply_schema "$2" | ||
STORAGE=cassandra make storage-integration-test | ||
teardown_cassandra ${cid} | ||
Ashmita152 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
main() { | ||
check_arg "$@" | ||
|
||
echo "Executing integration test for $1 with schema $2.cql.tmpl" | ||
run_integration_test "$1" "$2" | ||
} | ||
|
||
main "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 is a nice refactoring, makes the script much more maintainable