hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Haohui Mai (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-8766) Implement a libhdfs(3) compatible API
Date Wed, 30 Sep 2015 01:09:04 GMT

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

Haohui Mai commented on HDFS-8766:
----------------------------------

Thanks for updating the patch.

{code}
+add_subdirectory(compatibility)
{code}

It should be named as {{binding/c}}.

{code}
+  virtual ~IoServiceImpl(){}
+
{code}

It doesn't seem to be necessary.

{code}
+#include "../../include/compatibility/hdfs.h"
{code}

The include paths are incorrect. It should be "compatibility/hdfs.h". There are many places
like this.

{code}
+struct hdfsFile_internal {
+  hdfsFile_internal(InputStream *is) : inputStream(is){};
...
{code}

The naming is far off for the Google C++ style guide (which is the one this project is used
for). Please refer to http://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Naming
and adhere to the naming conventions.

{code}
+  InputStream *inputStream;
{code}

Looks like {{hdfsFile_internal}} owns the object. It should be {{unique_ptr}}.

{code}
+  bool connect(const char *nn, tPort port, unsigned int threads = 1) {
{code}

Please separate the declaration and the implementation of the function.

{code}
if (nullptr == file)
{code}

Another examples that is off the styling guide. Please change it to {{if (file)}}. There are
multiple snippets like that. 




> 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
>
>
> 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)

Mime
View raw message