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

ASF GitHub Bot commented on HADOOP-20079:
-----------------------------------------

hadoop-yetus commented on PR #8967:
URL: https://github.com/apache/hadoop/pull/8967#issuecomment-6775540190

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |:----:|----------:|--------:|:--------:|:-------:|
   | +0 :ok: |  reexec  |   0m 38s |  |  Docker mode activated.  |
   |||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  |  No case conflicting files 
found.  |
   | +0 :ok: |  codespell  |   0m  0s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  0s |  |  detect-secrets was not available.  
|
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain 
any @author tags.  |
   | +1 :green_heart: |  test4tests  |   0m  0s |  |  The patch appears to 
include 1 new or modified test files.  |
   |||| _ trunk Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |  46m  4s |  |  trunk passed  |
   | +1 :green_heart: |  compile  |  16m 41s |  |  trunk passed with JDK 
Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu  |
   | +1 :green_heart: |  compile  |  16m 50s |  |  trunk passed with JDK 
Ubuntu-17.0.20.1+1-1-24.04-Ubuntu  |
   | +1 :green_heart: |  checkstyle  |   1m 31s |  |  trunk passed  |
   | +1 :green_heart: |  mvnsite  |   2m  4s |  |  trunk passed  |
   | +1 :green_heart: |  javadoc  |   1m 31s |  |  trunk passed with JDK 
Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu  |
   | +1 :green_heart: |  javadoc  |   1m 23s |  |  trunk passed with JDK 
Ubuntu-17.0.20.1+1-1-24.04-Ubuntu  |
   | +1 :green_heart: |  spotbugs  |   3m 12s |  |  trunk passed  |
   | +1 :green_heart: |  shadedclient  |  31m 49s |  |  branch has no errors 
when building and testing our client artifacts.  |
   |||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   1m 16s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |  15m 49s |  |  the patch passed with JDK 
Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu  |
   | +1 :green_heart: |  javac  |  15m 49s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |  17m  2s |  |  the patch passed with JDK 
Ubuntu-17.0.20.1+1-1-24.04-Ubuntu  |
   | +1 :green_heart: |  javac  |  17m  2s |  |  the patch passed  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks 
issues.  |
   | +1 :green_heart: |  checkstyle  |   1m 28s |  |  the patch passed  |
   | +1 :green_heart: |  mvnsite  |   2m  2s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   1m 29s |  |  the patch passed with JDK 
Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu  |
   | +1 :green_heart: |  javadoc  |   1m 28s |  |  the patch passed with JDK 
Ubuntu-17.0.20.1+1-1-24.04-Ubuntu  |
   | +1 :green_heart: |  spotbugs  |   3m 20s |  |  the patch passed  |
   | +1 :green_heart: |  shadedclient  |  31m 56s |  |  patch has no errors 
when building and testing our client artifacts.  |
   |||| _ Other Tests _ |
   | +1 :green_heart: |  unit  |  23m 47s |  |  hadoop-common in the patch 
passed.  |
   | +1 :green_heart: |  asflicense  |   1m 15s |  |  The patch does not 
generate ASF License warnings.  |
   |  |   | 224m 19s |  |  |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.56 ServerAPI=1.56 base: 
https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8967/2/artifact/out/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hadoop/pull/8967 |
   | Optional Tests | dupname asflicense compile javac javadoc mvninstall 
mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets |
   | uname | Linux 91a2fddb718a 5.15.0-198-generic #208-Ubuntu SMP Fri Sep 4 
10:22:38 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/bin/hadoop.sh |
   | git revision | trunk / d8868a40b328dd2e5d585a23fcbed51343bf9bae |
   | Default Java | Ubuntu-17.0.20.1+1-1-24.04-Ubuntu |
   | Multi-JDK versions | 
/usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.12.1+1-1-24.04.4-Ubuntu 
/usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.20.1+1-1-24.04-Ubuntu |
   |  Test Results | 
https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8967/2/testReport/ |
   | Max. process+thread count | 1452 (vs. ulimit of 10000) |
   | modules | C: hadoop-common-project/hadoop-common U: 
hadoop-common-project/hadoop-common |
   | Console output | 
https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8967/2/console |
   | versions | git=2.43.0 maven=3.9.15 spotbugs=4.9.7 |
   | Powered by | Apache Yetus 0.14.1 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   




> SFTPInputStream reads one byte per call: override read(byte[], int, int)
> ------------------------------------------------------------------------
>
>                 Key: HADOOP-20079
>                 URL: https://issues.apache.org/jira/browse/HADOOP-20079
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 3.3.1, 3.3.6, 3.5.0, 3.4.1
>            Reporter: Andrei Iatsuk
>            Priority: Major
>              Labels: pull-request-available
>
> {{SFTPInputStream}} overrides only {{read()}}. It does not override 
> {{read(byte[], int, int)}}, so the default implementation from 
> {{java.io.InputStream}} is used, and it calls {{read()}} for every byte.
> Because of this, every bulk read from an {{sftp://}} path goes byte by byte: 
> {{IOUtils.copyBytes}}, {{readFully}}, positioned reads, 
> {{BufferedInputStream}}. For each byte there is a synchronized call, the 
> checks for closed stream, EOF and seek, a one-byte read in JSch and a 
> statistics update. The read is CPU-bound and very slow, about 6 MB/s on 
> localhost. A bigger buffer on the caller side does not help, because all 
> wrappers end in the same default method.
> This is a regression from HADOOP-14566. In branch-3.2 {{SFTPInputStream}} had 
> {{read(byte[], int, int)}}, which called the JSch stream directly. 
> HADOOP-14566 rewrote the class to support seek, and this method was removed. 
> So all releases since 3.3.1 have the problem, and trunk too.
> Fix: add {{read(byte[], int, int)}} again. It passes the whole buffer to the 
> JSch stream and updates {{pos}}, {{nextPos}} and the statistics in the same 
> way as {{read()}}.
> Benchmark: sequential read of a 1 GiB file from a local OpenSSH sftp server, 
> with {{FileSystem.open()}} and {{IOUtils.copyBytes()}} with a 64 KB buffer:
> ||Build||Run 1||Run 2||Run 3||Mean||
> |trunk (28c018cdafe)|6.0 MB/s|6.0 MB/s|6.0 MB/s|6.0 MB/s|
> |with fix|530.5 MB/s|554.7 MB/s|539.7 MB/s|541.6 MB/s|
> Corretto 21.0.13, 16 vCPU. Runs were interleaved: before, after, before, 
> after, ...
> I will open a PR with the fix and a unit test.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

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

Reply via email to