Skip to content

Commit

Permalink
Merge 'gemini: Accept semicolon separated hosts for clusters' from He…
Browse files Browse the repository at this point in the history
…nrik

"Bot the test anc oracle clusters can now be given a semicolon
separated list of nodes on the command line.

The previous single host/ip still works.

Fixes: #86"

* origin/multiple_hosts:
  gemini: Accept semicolon separated hosts for clusters.
  • Loading branch information
penberg committed May 7, 2019
2 parents 3d8ee84 + 0582b30 commit a8eda74
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## Unreleased

- Gemini now accepts a list of node host names or IPs for the test
and Oracle clusters.

## [1.0.0] - 2019-05-06

- Gemini version is now available in the resulting output.
Expand Down
8 changes: 4 additions & 4 deletions cmd/gemini/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
)

var (
testClusterHost string
oracleClusterHost string
testClusterHost []string
oracleClusterHost []string
schemaFile string
outFileArg string
concurrency int
Expand Down Expand Up @@ -349,9 +349,9 @@ func Execute() {
func init() {

rootCmd.Version = version + ", commit " + commit + ", date " + date
rootCmd.Flags().StringVarP(&testClusterHost, "test-cluster", "t", "", "Host name of the test cluster that is system under test")
rootCmd.Flags().StringSliceVarP(&testClusterHost, "test-cluster", "t", []string{}, "Host names or IPs of the test cluster that is system under test")
rootCmd.MarkFlagRequired("test-cluster")
rootCmd.Flags().StringVarP(&oracleClusterHost, "oracle-cluster", "o", "", "Host name of the oracle cluster that provides correct answers")
rootCmd.Flags().StringSliceVarP(&oracleClusterHost, "oracle-cluster", "o", []string{}, "Host names or IPs of the oracle cluster that provides correct answers")
rootCmd.MarkFlagRequired("oracle-cluster")
rootCmd.Flags().StringVarP(&schemaFile, "schema", "", "", "Schema JSON config file")
rootCmd.Flags().StringVarP(&mode, "mode", "m", mixedMode, "Query operation mode. Mode options: write, read, mixed (default)")
Expand Down
6 changes: 3 additions & 3 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ type JobError struct {
Query string `json:"query"`
}

func NewSession(testClusterHost string, oracleClusterHost string) *Session {
testCluster := gocql.NewCluster(testClusterHost)
func NewSession(testClusterHost []string, oracleClusterHost []string) *Session {
testCluster := gocql.NewCluster(testClusterHost...)
testCluster.Timeout = 5 * time.Second
testSession, err := testCluster.CreateSession()
if err != nil {
panic(err)
}

oracleCluster := gocql.NewCluster(oracleClusterHost)
oracleCluster := gocql.NewCluster(oracleClusterHost...)
oracleCluster.Timeout = 5 * time.Second
oracleSession, err := oracleCluster.CreateSession()
if err != nil {
Expand Down

0 comments on commit a8eda74

Please sign in to comment.