Thanks, this explains the weird behavior I was seeing :) Best regards,
Robin Verlangen *Chief Data Architect* Disclaimer: The information contained in this message and attachments is intended solely for the attention and use of the named addressee and may be confidential. If you are not the intended recipient, you are reminded that the information remains the property of the sender. You must not use, disclose, distribute, copy, print or rely on this e-mail. If you have received this message in error, please contact the sender immediately and irrevocably delete this message and any copies. On Tue, Feb 23, 2016 at 5:20 AM, Abhishek Agarwal <abhishc...@gmail.com> wrote: > Reusing values in tuple is not possible. collector.emit puts values into a > queue from where they are transferred in batch. If you reuse the values, > you will modify the tuples in transfer queue as well, leading to duplicate > data. > > On Mon, Feb 22, 2016 at 10:19 PM, Robin Verlangen <ro...@us2.nl> wrote: > >> Hi there, >> >> I was wondering about re-using the Values in a tuple, so usually you do >> something like: >> >> _collector.emit(OUTPUT_STREAM, tuple, new Values("my value")); >> >> but I was thinking or doing like following in prepare of bolt >> >> values = new Values(); >> values.ensureCapacity(1); >> values.add(0, null); >> >> and then execute >> >> values.set(0, "my value") >> >> So now I have two questions; >> - is this technically identical (apart from not reconstructing the >> object)? >> - is it possible that this confuses storm in some way to serialize the >> wrong data and send basically duplicate data to the next bolt? >> >> Thanks! >> >> Best regards, >> >> Robin Verlangen >> *Chief Data Architect* >> >> Disclaimer: The information contained in this message and attachments is >> intended solely for the attention and use of the named addressee and may be >> confidential. If you are not the intended recipient, you are reminded that >> the information remains the property of the sender. You must not use, >> disclose, distribute, copy, print or rely on this e-mail. If you have >> received this message in error, please contact the sender immediately and >> irrevocably delete this message and any copies. >> > > > > -- > Regards, > Abhishek Agarwal > >