Open tarzanek opened 4 years ago
Java driver has requestSizeInBytes to give a higher estimate of Statement size for counting the batch size https://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Statement.html#requestSizeInBytes-com.datastax.driver.core.ProtocolVersion-com.datastax.driver.core.CodecRegistry-
go has only Batch::Size()
so when client wants to do exact batch splitting, it's hard to count the statement size
Could above be ported over from java to go?
Java logic is in: https://github.com/scylladb/java-driver/blob/3.7.1-scylla-2/driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java#L203 or https://github.com/scylladb/java-driver/blob/3.7.1-scylla-2/driver-core/src/main/java/com/datastax/driver/core/RegularStatement.java#L185 or https://github.com/scylladb/java-driver/blob/3.7.1-scylla-2/driver-core/src/main/java/com/datastax/driver/core/BoundStatement.java#L307 (and similar, just query java driver tree for requestSizeInBytes)
I'd say yes and it needs to be added upstream in gocql/gocql.
https://github.com/gocql/gocql/issues/1448
Java driver has requestSizeInBytes to give a higher estimate of Statement size for counting the batch size https://docs.datastax.com/en/drivers/java/3.7/com/datastax/driver/core/Statement.html#requestSizeInBytes-com.datastax.driver.core.ProtocolVersion-com.datastax.driver.core.CodecRegistry-
go has only Batch::Size()
so when client wants to do exact batch splitting, it's hard to count the statement size
Could above be ported over from java to go?
Java logic is in: https://github.com/scylladb/java-driver/blob/3.7.1-scylla-2/driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java#L203 or https://github.com/scylladb/java-driver/blob/3.7.1-scylla-2/driver-core/src/main/java/com/datastax/driver/core/RegularStatement.java#L185 or https://github.com/scylladb/java-driver/blob/3.7.1-scylla-2/driver-core/src/main/java/com/datastax/driver/core/BoundStatement.java#L307 (and similar, just query java driver tree for requestSizeInBytes)