[
https://issues.apache.org/jira/browse/HADOOP-7824?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13462273#comment-13462273
]
Colin Patrick McCabe commented on HADOOP-7824:
----------------------------------------------
I think we should just do the translation in the JNI code.
In general, people expect the jar files to be portable, meaning you can copy
them from one PC to another without suffering disaster. This will not be true
if we start injecting native constants into the Java code. In contrast,
{{libhadoop.so}} is designed to contain the operating-system and
architecture-specific parts of the code.
Also, do we really want to depend on Perl for our build process? I realize
there's already a {{changes2html.pl}} script, but in general Perl seems like
another build dependency we'd be better off without. Installing Perl on some
platforms will definitely be a hassle-- like Windows. We also don't document
our Perl dependency anywhere right now.
bq. I suspect that [translating the constants] is going to be a lot slower.
I seriously doubt that the performance difference between translating the
constants and passing them straight through will even be measurable. If you
like, I can do some before and after benchmarks with constant translation and
without. Keep in mind, this is a couple of if statements every time we open a
file. Considering the other performance issues we have to tackle, this is less
than noise-- on par with changing constants because you believe comparisons
with 0 are faster, etc.
> Native IO uses wrong constants almost everywhere
> ------------------------------------------------
>
> Key: HADOOP-7824
> URL: https://issues.apache.org/jira/browse/HADOOP-7824
> Project: Hadoop Common
> Issue Type: Bug
> Components: native
> Affects Versions: 0.20.204.0, 0.20.205.0, 1.0.3, 0.23.0, 2.0.0-alpha, 3.0.0
> Environment: Mac OS X, Linux, Solaris, Windows, ...
> Reporter: Dmytro Shteflyuk
> Assignee: Todd Lipcon
> Labels: hadoop
> Attachments: HADOOP-7824.patch, HADOOP-7824.patch, hadoop-7824.txt
>
>
> Constants like O_CREAT, O_EXCL, etc. have different values on OS X and many
> other operating systems.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira