Hi, If you were to know the batch size on client side to make sure it does not get above the 5kb limit, so that you can "limit the number of statements in a batch", I would suspect you do not need batch at all right ? See https://inoio.de/blog/2016/01/13/cassandra-to-batch-or-not-to-batch/
As for your question, you might get an answer on the java driver ML : java-driver-u...@lists.datastax.com On 23 May 2017 at 15:25, techpyaasa . <techpya...@gmail.com> wrote: > > * WARN [SharedPool-Worker-1] 2017-05-22 20:28:46,204 BatchStatement.java > (line 253) Batch of prepared statements for [site24x7.wm_rawstats_tb, > site24x7.wm_rawstats] is of size 6122, exceeding specified threshold of > 5120 by 1002* > We are frequently getting this message in logs, so I wanted to restrict > inserts at client side by calculating *dataSize* of insert/batch > statements before sending it to c* servers. > > We are using datastax java drivers , how can I get dataSize here?? > > > Any ideas?? > > Thanks in advance > TechPyaasa >