avro icon indicating copy to clipboard operation
avro copied to clipboard

AVRO-3594: FsInput to use openFile() API

Open steveloughran opened this issue 2 years ago • 2 comments

Boost performance reading from object stores in hadoop 3.3.0+ by using the openFile builder API and passing in the file length as an option (can save a HEAD) and asks for adaptive IO (sequential going to random if the client starts seeking)

saving that HEAD request is a key benefit against s3 as it can save 50-100 mS per file.

Jira

  • [X] My PR addresses the following Avro Jira issues and references them in the PR title. For example, "AVRO-1234: My Avro PR"
    • https://issues.apache.org/jira/browse/AVRO-XXX
    • In case you are adding a dependency, check if the license complies with the ASF 3rd Party License Policy.

Tests

  • [X] My PR does not need testing for this extremely good reason:
  1. All existing local file IO tests act as regression tests.
  2. avro isn't set up for integration tests with abfs/gs/s3a urls.
  3. mocking doesn't really do much here.

Integration tests would be the way to do this, but the foundational set up to do this is pretty complex. My cloudstream project downstream of spark is set up to do this.

Commits

  • [X] My commits all reference Jira issues in their subject lines. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Documentation

  • [X] In case of new functionality, my PR adds documentation that describes how to use it.
    • All the public functions and the classes in the PR contain Javadoc that explain what it does

no new docs

steveloughran avatar Aug 04 '22 16:08 steveloughran

except that hadoop-2 profile still exists, doesn't it? which means that even though hadoop 3 profile is full of features, the 2.x one blocks things from working

steveloughran avatar Aug 04 '22 16:08 steveloughran

@clesaec this can't go in until hadoop2 is cut as a profile.

I am actually doing a shim library to do reflection invocation on the newer operations, with fallbacks if not found. https://github.com/steveloughran/fs-api-shim

but even so, the sooner avro goes to recent hadoop 3.x release only the better.

steveloughran avatar Aug 05 '22 17:08 steveloughran