[ https://issues.apache.org/jira/browse/HDFS-8766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14940047#comment-14940047 ]
James Clampffer commented on HDFS-8766: --------------------------------------- Thanks for the review Bob. 1) Thanks for pointing that out. I'm not sure how the shared_ptr snuck back in; I'll remove that. 2) The thinking there was to avoid making the user do a cast if they just got some fresh space with malloc or wanted to do something else odd with memory in C. I was on the fence about using char *. I have no strong preference either way. 3) That was just a remnant of when I was doing a quick test/prototype; libhdfs used structs and I took the declaration from there. I just left it that way because there wasn't much to hide yet. Originally I had the exposed C functions touching input_stream_ and file_system_ on hdfs_internal and hdfsFile_internal a lot more so I wanted members to be public by default. The only function that does that now is hdfsFileIsOpenForRead and the implementation for that should be in hdfsFile_internal anyway. I can switch it over to a class and make the members private. And yes, I'll put a note into HDFS-8790 about managed pointers and commit them with that patch. > Implement a libhdfs(3) compatible API > ------------------------------------- > > Key: HDFS-8766 > URL: https://issues.apache.org/jira/browse/HDFS-8766 > Project: Hadoop HDFS > Issue Type: Sub-task > Components: hdfs-client > Reporter: James Clampffer > Assignee: James Clampffer > Attachments: HDFS-8766.HDFS-8707.000.patch, > HDFS-8766.HDFS-8707.001.patch, HDFS-8766.HDFS-8707.002.patch, > HDFS-8766.HDFS-8707.003.patch > > > Add a synchronous API that is compatible with the hdfs.h header used in > libhdfs and libhdfs3. This will make it possible for projects using > libhdfs/libhdfs3 to relink against libhdfspp with minimal changes. > This also provides a pure C interface that can be linked against projects > that aren't built in C++11 mode for various reasons but use the same > compiler. It also allows many other programming languages to access > libhdfspp through builtin FFI interfaces. > The libhdfs API is very similar to the posix file API which makes it easier > for programs built using posix filesystem calls to be modified to access HDFS. -- This message was sent by Atlassian JIRA (v6.3.4#6332)