spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zsxwing <...@git.apache.org>
Subject [GitHub] spark pull request #15408: [SPARK-17839][CORE] Use Nio's directbuffer instea...
Date Thu, 13 Oct 2016 21:47:35 GMT
Github user zsxwing commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15408#discussion_r83319614
  
    --- Diff: core/src/main/java/org/apache/spark/io/NioBufferedFileInputStream.java ---
    @@ -72,30 +74,35 @@ private boolean refill() throws IOException {
       }
     
       @Override
    -  public int read() throws IOException {
    +  public synchronized int read() throws IOException {
         if (!refill()) {
           return -1;
         }
         return byteBuffer.get() & 0xFF;
       }
     
       @Override
    -  public int read(byte[] b, int offset, int len) throws IOException {
    +  public synchronized int read(byte[] b, int offset, int len) throws IOException {
         if (!refill()) {
           return -1;
         }
    +    if ((offset | len | (offset + len) | (b.length - (offset + len))) < 0) {
    --- End diff --
    
    @srowen this line comes from BufferedInputStream. I'm ok with rewriting it for readability.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message