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

Enable FileSplits to be obtained directly from InputFormat #7002

Closed

Conversation

vinothchandar
Copy link
Collaborator

  • SplitLoader calls ipf.getSplits() if annotated with @UseFileSplitsFromInputFormat
  • CustomInputFormats will need to define annotation with the above simple name, to use this

This is followup to PR #6969

 - SplitLoader calls ipf.getSplits() if annotated with @UseFileSplitsFromInputFormat
 - CustomInputFormats will need to define annotation with the above simple name, to use this
@vinothchandar
Copy link
Collaborator Author

hi @electrum , PR as we discussed before.. Have tested this in house, against HoodieInputFormat.

@zhenxiao cc

@vinothchandar
Copy link
Collaborator Author

Ping Ping. :)

@vinothchandar
Copy link
Collaborator Author

@electrum Do you have any suggestions?

@zhenxiao
Copy link
Collaborator

@electrum @martint we've using this PR in production for a few months, could you please take a review when you are free?

@vinothchandar
Copy link
Collaborator Author

hi, any updates on this?

@vinothchandar
Copy link
Collaborator Author

@electrum @martint Just another friendly ping..

@vinothchandar
Copy link
Collaborator Author

@electrum Can you please take a look at the PR?

@electrum
Copy link
Contributor

electrum commented Feb 21, 2017 via email

@vinothchandar
Copy link
Collaborator Author

@electrum No worries.. I will rebase it again, when you are ready. Just lmk.


private boolean shouldUseFileSplitsFromInputFormat(InputFormat<?, ?> inputFormat)
{
Annotation[] annotations = inputFormat.getClass().getAnnotations();
Copy link
Contributor

Choose a reason for hiding this comment

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

We can use streams for this:

return Arrays.stream(inputFormat.getClass().getAnnotations())
        .map(Annotation::annotationType)
        .map(Class::getSimpleName)
        .anyMatch(name -> name.equals("UseFileSplitsFromInputFormat"));

@electrum
Copy link
Contributor

electrum commented Mar 8, 2017

Merged, thanks!

@electrum electrum closed this Mar 8, 2017
@vinothchandar
Copy link
Collaborator Author

Thanks @electrum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants