Proposed patch: further wrapping of FileInputStream's native method

Chan, Sunny Sunny.Chan at gs.com
Tue May 10 07:13:27 UTC 2016


The available() and sync() are the only native methods in the FileInputStream that has not been "wrapped".

Our use case is that we have an internal storage implementation and we would like to be able to provide support for older applications that use  java.io api without modify the apps to use our NIO.2 Filesystem implementation. Without these method wrapped it is difficult to instrument them and redirect calls as needed.

A longer term goal is to investigate and see whether we can find a way to divert all the old java.io APIs to an NIO.2 filesystem implementation. However this is more complex and will involve a much bigger change and we will propose a JEP once we are confident that can be done. 

-----Original Message-----
From: Chris Hegarty [mailto:chris.hegarty at oracle.com] 
Sent: 09 May 2016 21:26
To: Chan, Sunny [Tech]; 'core-libs-dev at openjdk.java.net'; Brian Burkhalter
Subject: Re: Proposed patch: further wrapping of FileInputStream's native method

The changes in your patch look ok.

It is not clear, at least to me, why these methods are all that interesting, or even why they were not covered by 8054720. Maybe Brian Burkhalter, or others may know.

-Chris.

On 09/05/16 04:27, Chan, Sunny wrote:
> Previously in JDK-8054720<https://urldefense.proofpoint.com/v2/url?u=http-3A__bugs.java.com_view-5Fbug.do-3Fbug-5Fid-3D8054720&d=CwIC-g&c=7563p3e2zaQw0AB1wrFVgyagb2IE5rTZOYPxLxfZlX4&r=e-nMYEAYoRWWms8SM-H97SgyQYsz-xaiLmQPYwZ3m5E&m=G8UmhcMufoGaZD0iiU4Hf4QJHS9mwZVT4AdR3_fPJag&s=n-zTnSLgQwAuVdDnvHlxvPTF_3APoiXc852l2yFk22c&e= >, a number of native methods has been wrapped in order to allow instrumentation. We would like to propose to wrap a number of other methods (available(), skip()) so that we can perform further instrumentation.
>
> I have attached the patch with this email for review.
>
> Sunny Chan
> Executive Director
> Technology
>
> Goldman Sachs (Asia) L.L.C. | 39th Floor | The Center | 99 Queens Road 
> Central | Hong Kong
> Email:  sunny.chan at gs.com | Tel: +852 2978 6481 | Fax: +852 2978 0633
>
> Learn more about Goldman Sachs
> GS.com<http://www.goldmansachs.com/> | 
> Blog<http://www.goldmansachs.com/careers/blog/index.html> | 
> LinkedIn<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.linke
> din.com_company_goldman-2Dsachs_careers&d=CwIC-g&c=7563p3e2zaQw0AB1wrF
> Vgyagb2IE5rTZOYPxLxfZlX4&r=e-nMYEAYoRWWms8SM-H97SgyQYsz-xaiLmQPYwZ3m5E
> &m=G8UmhcMufoGaZD0iiU4Hf4QJHS9mwZVT4AdR3_fPJag&s=ZALJij0E_VXVArh5_UUN6
> KaxOgRAfwJt3c6knN9VhiQ&e= > | 
> YouTube<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.youtub
> e.com_goldmansachs&d=CwIC-g&c=7563p3e2zaQw0AB1wrFVgyagb2IE5rTZOYPxLxfZ
> lX4&r=e-nMYEAYoRWWms8SM-H97SgyQYsz-xaiLmQPYwZ3m5E&m=G8UmhcMufoGaZD0iiU
> 4Hf4QJHS9mwZVT4AdR3_fPJag&s=STP6W4Xg7OT1W0Xe6KAMXiiDbB99x1bY5FD9sltWA9
> w&e= > | 
> Twitter<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.twitte
> r.com_goldmansachs&d=CwIC-g&c=7563p3e2zaQw0AB1wrFVgyagb2IE5rTZOYPxLxfZ
> lX4&r=e-nMYEAYoRWWms8SM-H97SgyQYsz-xaiLmQPYwZ3m5E&m=G8UmhcMufoGaZD0iiU
> 4Hf4QJHS9mwZVT4AdR3_fPJag&s=s3sqRhvYPmAYbqdkOYZuyv72FdMWlWTcLMTioPkF1j
> c&e= >
>
> This message may contain information that is confidential or privileged.  If you are not the intended recipient, please advise the sender immediately and delete this message.  See http://www.gs.com/disclaimer/email for further information on confidentiality and the risks inherent in electronic communication.
>



More information about the core-libs-dev mailing list