Affects Version/s: 1.8.2
Fix Version/s: None
I am loading large sets of data into Avro files and cataloging them for quick access. My code for the load looks a bit like this.
When I am ready to read the data, that was the code that I initially used.
This worked for the majority of cases. But a few of them had a problem with the call to sync. In these cases a call to "reader.tell()" indicated that the sync was actually PAST the offset. This meant that I would never retrieve the file that I wanted.
In order to work around this issue, I implemented a simple reversal algorithm which works roughly like this.
This works correctly in, what I believe, are all cases. Now I am SURE that I am doing something wrong, since this process seems like an extremely convoluted way to retrieve data. However, the issue is what happened next.
To see if performance could be improved, I changed my last loop to this.
My schema has several string fields and a contents field which is bytes. It looks something like this.
Once I made the change for performance, I started seeing data returned like this.
I'm thinking that this is because the byte array is being reused. Any ideas on this?