ribaraka commented on code in PR #1837:
URL:
https://github.com/apache/cassandra-gocql-driver/pull/1837#discussion_r1840588511
##########
frame.go:
##########
@@ -202,6 +205,8 @@ const (
LocalQuorum Consistency = 0x06
EachQuorum Consistency = 0x07
LocalOne Consistency = 0x0A
+ Serial Consistency = 0x08
+ LocalSerial Consistency = 0x09
Review Comment:
NIT: move `Serial` and `LocalSerial` above `LocalOne` to maintain logical
order.
##########
session.go:
##########
@@ -144,6 +144,10 @@ func NewSession(cfg ClusterConfig) (*Session, error) {
return nil, errors.New("Can't use both Authenticator and
AuthProvider in cluster config.")
}
+ if cfg.SerialConsistency > 0 && !cfg.SerialConsistency.IsSerial() {
+ return nil, fmt.Errorf("the default SerialConsistency level is
not allowed to be anything else but SERIAL or LOCAL_SERIAL. Recived value: %v",
cfg.SerialConsistency)
+ }
Review Comment:
And overall, how about adding another test for this new allowance usage with
the two consistency levels?
##########
session.go:
##########
@@ -144,6 +144,10 @@ func NewSession(cfg ClusterConfig) (*Session, error) {
return nil, errors.New("Can't use both Authenticator and
AuthProvider in cluster config.")
}
+ if cfg.SerialConsistency > 0 && !cfg.SerialConsistency.IsSerial() {
+ return nil, fmt.Errorf("the default SerialConsistency level is
not allowed to be anything else but SERIAL or LOCAL_SERIAL. Recived value: %v",
cfg.SerialConsistency)
+ }
Review Comment:
How about adding a test for this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]