Github user selvaganesang commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1612#discussion_r197898558
  
    --- Diff: core/sql/src/main/java/org/trafodion/sql/HDFSClient.java ---
    @@ -359,36 +392,54 @@ int hdfsWrite(byte[] buff) throws IOException
                 logger_.debug("HDFSClient.hdfsWrite() - output stream created" 
);
           }
           outStream_.write(buff);
    +      if (outStream_ instanceof FSDataOutputStream)
    +         ((FSDataOutputStream)outStream_).hsync();
           if (logger_.isDebugEnabled()) 
              logger_.debug("HDFSClient.hdfsWrite() - bytes written " + 
buff.length);
           return buff.length;
         }
     
    -    int hdfsRead(ByteBuffer buffer) throws IOException
    +    int hdfsRead(long pos, ByteBuffer buffer) throws IOException
         {
           if (logger_.isDebugEnabled()) 
              logger_.debug("HDFSClient.hdfsRead() - started" );
           if (fsdis_ == null && inStream_ == null ) {
    +         try {
              codec_ = codecFactory_.getCodec(filepath_);
              if (codec_ != null) {
                 compressed_ = true;
                 inStream_ = codec_.createInputStream(fs_.open(filepath_));
              }
              else
                 fsdis_ = fs_.open(filepath_);
    -         pos_ = 0;
    +         } catch (java.io.FileNotFoundException e) {
    +            return 0;
    +         }
           }
           int lenRemain;   
    --- End diff --
    
    Yes. The chunking should happen in the JNI side. 


---

Reply via email to