Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HADOOP-11867: Add gather API to file system. #1830

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

omalley
Copy link
Contributor

@omalley omalley commented Feb 3, 2020

Add API to PositionedReadable to have an asynchronous gather API.

Copy link
Contributor

@steveloughran steveloughran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet.

  1. What are the benchmark numbers?
  2. it's going to need some docs in inputstream.md
  3. It'd be good to PoC an object store: s3a, ozone, abfs...
  4. And we will need to think about some contract tests to test/break the implementations

I presume this design will suit ORC?

}

/**
* Find the checksum ranges that correspond to the given data ranges.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

be nice to explain why this is needed, for those of us who don't normally go near this file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why what is needed? You mean the code to compare the checksums? The current code requires a lot of context that isn't true in the new API. The current code is super inefficient because it did a bad job of working around those limitations. In particular, if you look at the current pread code, it reopens the crc file for each seek.

* @return the minimum number of bytes
*/
default int minimumReasonableSeek() {
return 4 * 1024;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should really be constants somewhere, even if within this interface

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, although the difference between having the constant in the method versus defined and used once is pretty minor.
Those constants should be determined by testing on each of the different file systems. I suspect the minimum seek on local fs < hdfs < s3.

hadoop-common-project/benchmark/pom.xml Show resolved Hide resolved
@omalley
Copy link
Contributor Author

omalley commented Feb 4, 2020

The benchmark numbers are posted on the jira.

You'll need to help with the spec that you've developed in fsdatainputstream.md. Fundamentally, the new call is logically the same the input ranges being read using pread in an undefined order.
When the CompletableFuture returned from range.getData() is done, the data must be in the buffer.

And yes, I believe this structure will work well for ORC (and likely Parquet).

@apache apache deleted a comment from hadoop-yetus Feb 5, 2020
@bgaborg bgaborg self-requested a review February 12, 2020 12:58
@steveloughran
Copy link
Contributor

@omalley -you still working on this?

@omalley omalley force-pushed the async-io branch 3 times, most recently from 7b5a300 to c988142 Compare September 19, 2020 00:52
@apache apache deleted a comment from hadoop-yetus Sep 19, 2020
int requestLength = request.getLength();
// If we need to change the offset or length, make a copy and do it
if (offsetChange != 0 || readData.remaining() != requestLength) {
readData = readData.slice();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new name should be readDataCopy or anything better just to be sure that we are not changing the original buffer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it isn't copying the data. It is much closer to ByteBuffer's slice, which gives a second view on to the same data buffer. So you get a new ByteBuffer object that shares the same underlying memory.

@apache apache deleted a comment from hadoop-yetus Sep 21, 2020
@apache apache deleted a comment from hadoop-yetus Sep 21, 2020
@apache apache deleted a comment from hadoop-yetus Sep 21, 2020
@apache apache deleted a comment from hadoop-yetus Sep 21, 2020
@apache apache deleted a comment from hadoop-yetus Sep 21, 2020
@steveloughran
Copy link
Contributor

hey @omalley -thanks for the update. Could you do anything with the fields in AsyncBenchmark, as they are flooding yetus

Unused field:AsyncBenchmark_BufferChoice_jmhType_B3.java

@omalley
Copy link
Contributor Author

omalley commented Sep 21, 2020

Yeah, I just added a suppression file for findbugs that hopefully will make Yetus happy. Sigh findbugs and generated code are not a good combination.

@steveloughran steveloughran added enhancement fs fs/s3 changes related to hadoop-aws; submitter must declare test endpoint labels Sep 22, 2020
@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 24s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s No case conflicting files found.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 3m 36s Maven dependency ordering for branch
+1 💚 mvninstall 28m 40s trunk passed
+1 💚 compile 20m 36s trunk passed with JDK Ubuntu-11.0.8+10-post-Ubuntu-0ubuntu118.04.1
+1 💚 compile 17m 19s trunk passed with JDK Private Build-1.8.0_265-8u265-b01-0ubuntu2~18.04-b01
+1 💚 checkstyle 2m 48s trunk passed
+1 💚 mvnsite 21m 4s trunk passed
+1 💚 shadedclient 39m 22s branch has no errors when building and testing our client artifacts.
+1 💚 javadoc 6m 26s trunk passed with JDK Ubuntu-11.0.8+10-post-Ubuntu-0ubuntu118.04.1
+1 💚 javadoc 6m 57s trunk passed with JDK Private Build-1.8.0_265-8u265-b01-0ubuntu2~18.04-b01
+0 🆗 spotbugs 2m 5s Used deprecated FindBugs config; considering switching to SpotBugs.
+1 💚 findbugs 37m 57s trunk passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 33s Maven dependency ordering for patch
+1 💚 mvninstall 24m 8s the patch passed
+1 💚 compile 20m 3s the patch passed with JDK Ubuntu-11.0.8+10-post-Ubuntu-0ubuntu118.04.1
+1 💚 javac 20m 3s the patch passed
+1 💚 compile 17m 24s the patch passed with JDK Private Build-1.8.0_265-8u265-b01-0ubuntu2~18.04-b01
+1 💚 javac 17m 24s the patch passed
-0 ⚠️ checkstyle 2m 50s root: The patch generated 28 new + 90 unchanged - 4 fixed = 118 total (was 94)
+1 💚 mvnsite 17m 55s the patch passed
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 xml 0m 7s The patch has no ill-formed XML file.
+1 💚 shadedclient 15m 24s patch has no errors when building and testing our client artifacts.
+1 💚 javadoc 6m 29s the patch passed with JDK Ubuntu-11.0.8+10-post-Ubuntu-0ubuntu118.04.1
+1 💚 javadoc 6m 54s the patch passed with JDK Private Build-1.8.0_265-8u265-b01-0ubuntu2~18.04-b01
+1 💚 findbugs 39m 26s the patch passed
_ Other Tests _
-1 ❌ unit 577m 2s root in the patch passed.
-1 ❌ asflicense 1m 50s The patch generated 1 ASF License warnings.
895m 41s
Reason Tests
Failed junit tests hadoop.yarn.applications.distributedshell.TestDistributedShell
hadoop.yarn.server.resourcemanager.security.TestDelegationTokenRenewer
hadoop.yarn.server.resourcemanager.TestRMRestart
hadoop.yarn.sls.TestReservationSystemInvariants
hadoop.hdfs.TestFileChecksum
hadoop.hdfs.TestSnapshotCommands
hadoop.hdfs.TestFileChecksumCompositeCrc
hadoop.hdfs.TestDFSClientRetries
hadoop.hdfs.TestStripedFileAppend
hadoop.hdfs.server.sps.TestExternalStoragePolicySatisfier
hadoop.crypto.key.kms.server.TestKMS
Subsystem Report/Notes
Docker ClientAPI=1.40 ServerAPI=1.40 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-1830/12/artifact/out/Dockerfile
GITHUB PR #1830
JIRA Issue HADOOP-11867
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient xml findbugs checkstyle
uname Linux a64523bb9bef 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 7fae413
Default Java Private Build-1.8.0_265-8u265-b01-0ubuntu2~18.04-b01
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.8+10-post-Ubuntu-0ubuntu118.04.1 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_265-8u265-b01-0ubuntu2~18.04-b01
checkstyle https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-1830/12/artifact/out/diff-checkstyle-root.txt
unit https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-1830/12/artifact/out/patch-unit-root.txt
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-1830/12/testReport/
asflicense https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-1830/12/artifact/out/patch-asflicense-problems.txt
Max. process+thread count 3731 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-common hadoop-common-project . hadoop-common-project/benchmark U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-1830/12/console
versions git=2.17.1 maven=3.6.0 findbugs=4.0.6
Powered by Apache Yetus 0.13.0-SNAPSHOT https://yetus.apache.org

This message was automatically generated.

@mukund-thakur
Copy link
Contributor

I am trying to compile and run the benchmark added.

I am using this command
java -cp target/hadoop-benchmark-3.4.0-SNAPSHOT-uber.jar org.apache.hadoop.benchmark.AsyncBenchmark /tmp/benchmark
and seeing this failure
java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer; at org.apache.hadoop.benchmark.AsyncBenchmark$FileRangeCallback.completed(AsyncBenchmark.java:185) at org.apache.hadoop.benchmark.AsyncBenchmark$FileRangeCallback.completed(AsyncBenchmark.java:161

Also when I try to run the same using IDE while selecting the JRE to be Bundled, it works fine.

Anything specific I have to do before running the benchmark.

FYI related : https://stackoverflow.com/questions/61267495/exception-in-thread-main-java-lang-nosuchmethoderror-java-nio-bytebuffer-flip

Thanks

@apache apache deleted a comment from hadoop-yetus Sep 24, 2020
@apache apache deleted a comment from hadoop-yetus Sep 24, 2020
@apache apache deleted a comment from hadoop-yetus Sep 24, 2020
@apache apache deleted a comment from hadoop-yetus Sep 24, 2020
@steveloughran
Copy link
Contributor

@mukund-thakur : build and test with the same JDK; java 9+ added some overloaded methods to bytebuyffer. If code has been built against a newer JVM than the one you test against, you will get link problems.

Warning: some openjdk8 builds (Amazon Corretto) have the overloaded methods, so cannot be used to build things you intend to run elsewhere.

Recommend you set up JAVA_HOME to point to the java version you want, run maven builds on the command line

@mukund-thakur
Copy link
Contributor

@mukund-thakur : build and test with the same JDK; java 9+ added some overloaded methods to bytebuyffer. If code has been built against a newer JVM than the one you test against, you will get link problems.

Warning: some openjdk8 builds (Amazon Corretto) have the overloaded methods, so cannot be used to build things you intend to run elsewhere.

Recommend you set up JAVA_HOME to point to the java version you want, run maven builds on the command line

Thank @steveloughran . It works after setting java home explicitly to 1.8.

@mukund-thakur
Copy link
Contributor

I have one question. Why merging of ranges is not done for RawLocalFileSystem but done for ChecksumFileSystem?

}
stream.readAsync(ranges, bufferChoice.allocate);
for(FileRange range: ranges) {
blackhole.consume(range.getData().get());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blackhole.consume(ranges); can be used ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement fs/s3 changes related to hadoop-aws; submitter must declare test endpoint fs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants