spark-instrumented-optimizer/core/src/test
Tejas Patil ac38bdc756 [SPARK-15601][CORE] CircularBuffer's toString() to print only the contents written if buffer isn't full
## What changes were proposed in this pull request?

1. The class allocated 4x space than needed as it was using `Int` to store the `Byte` values

2. If CircularBuffer isn't full, currently toString() will print some garbage chars along with the content written as is tries to print the entire array allocated for the buffer. The fix is to keep track of buffer getting full and don't print the tail of the buffer if it isn't full (suggestion by sameeragarwal over https://github.com/apache/spark/pull/12194#discussion_r64495331)

3. Simplified `toString()`

## How was this patch tested?

Added new test case

Author: Tejas Patil <tejasp@fb.com>

Closes #13351 from tejasapatil/circular_buffer.
2016-05-31 19:52:22 -05:00
..
java [SPARK-15357] Cooperative spilling should check consumer memory mode 2016-05-18 09:44:21 -07:00
resources [SPARK-10372] [CORE] basic test framework for entire spark scheduler 2016-05-26 00:29:09 -05:00
scala/org/apache [SPARK-15601][CORE] CircularBuffer's toString() to print only the contents written if buffer isn't full 2016-05-31 19:52:22 -05:00