GitHub user tejasapatil opened a pull request:

    https://github.com/apache/spark/pull/13351

    [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?
    
    [~sameerag] suggested this over a PR discussion: 
https://github.com/apache/spark/pull/12194#discussion_r64495331
    
    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.
    
    ## How was this patch tested?
    
    Added new test case

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/tejasapatil/spark circular_buffer

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/13351.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #13351
    
----
commit 24e50bbecf88c5713564d6ed88cf5030da5f99ac
Author: Tejas Patil <[email protected]>
Date:   2016-05-27T06:53:19Z

    [SPARK-15601][CORE] CircularBuffer's toString() to print only the contents 
written if buffer isn't full

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to