[ 
https://issues.apache.org/jira/browse/TRAFODION-3110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16522667#comment-16522667
 ] 

ASF GitHub Bot commented on TRAFODION-3110:
-------------------------------------------

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. 


> Refactor LOB access to use the new implementation of HdfsClient
> ---------------------------------------------------------------
>
>                 Key: TRAFODION-3110
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-3110
>             Project: Apache Trafodion
>          Issue Type: Sub-task
>          Components: sql-exe
>            Reporter: Selvaganesan Govindarajan
>            Assignee: Selvaganesan Govindarajan
>            Priority: Major
>
> By making LOB to use the new implementation of HdfsClient, the use of libHdfs 
> is avoided in yet another feature. This also simplifies the hdfs access 
> related code in this feature.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to