Re: possible cell buffer size issue

2022-01-28 Thread Neophytos Demetriou
Thank you Bowen, I ended up using the type of the cell to get the string for now. On Fri, Jan 28, 2022 at 5:01 AM Bowen Song wrote: > Just FYI, you may want to do put the return value of cell.buffer() in a > variable instead of calling it twice, because there's no guarantee that you > will get t

Re: possible cell buffer size issue

2022-01-28 Thread Bowen Song
Just FYI, you may want to do put the return value of cell.buffer() in a variable instead of calling it twice, because there's no guarantee that you will get the same (cached) ByteBuffer object on the second call. Also, you may want to do a rewind() first, just in case... On 28/01/2022 09:22, N

Re: possible cell buffer size issue

2022-01-28 Thread Neophytos Demetriou
I've solved the issue with the following for the time being: byte[] arr = new byte[cell.buffer().remaining()]; cell.buffer().get(arr); I shouldn't have been calling array() in the first place it seems. - Neophytos On Fri, Jan 28, 2022 at 2:06 AM Neophytos Demetriou wrote: > Hi, thanks for the

Re: possible cell buffer size issue

2022-01-27 Thread Neophytos Demetriou
Hi, thanks for the prompt reply. I've tried this. Here's what I'm writing: bytes: 3 capacity: 3 limit: 3 offset: 0 Here's what I'm reading: cell buffer size: 1048576 capacity: 1048576 limit: 212 arrayOffset: 0 It still does not seem right. I would have expected Cassandra to allocate a buffer the

Re: possible cell buffer size issue

2022-01-27 Thread Bowen Song
I'm not a Java developer, but based on my best knowledge, ByteBuffer.array() method returns the whole byte array, not just the part of the byte array that's meaningful (i.e. has ever been written to). You may want to check the difference between the bb.capacity() and bb.limit(), and also check

possible cell buffer size issue

2022-01-27 Thread Neophytos Demetriou
Hi, I'm new to the list but not new to Cassandra. I'm writing an app on top of C* and I have come across an issue (huge cell buffer size after applying a mutation) that I haven't been able to resolve yet. I would appreciate any suggestions/help to resolve this. Here are the details: 1. I have a c