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

Alan Burlison commented on HADOOP-7824:
---------------------------------------

I've prototyped an alternate fix for this, which is to remove 'final' from the 
public static members used to hold the various O_ constants defined in 
NativeIO.java but otherwise to leave them alone, then use a JNI_OnLoad hook to 
update the values of the public static members to the correct platform-specific 
values. Looking at the classfile disassembly it will be slightly slower than at 
present - the existing public static final members are inlined to either sipush 
or ldc of the appropriate constant values whereas if the final modifier is 
removed (needed to prevent the inlining) then getstatic is used to fetch the 
value. However it should still be significantly faster than the string-based 
approach suggested in the latest patch attached to this bug. If this approach 
is acceptable please let me know and I'll get a patch sorted out.

I'm specifically interested in fixing this for Solaris but it should work on 
all platforms.

> 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 was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to