You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hawq.apache.org by "Pierre de Freminville (Jira)" <ji...@apache.org> on 2020/03/31 09:44:00 UTC

[jira] [Commented] (HAWQ-1173) hdfsConnect in libhdfs3 is not consistent with hdfsConnect in native libhdfs (JNI) when port is 0

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

Pierre de Freminville commented on HAWQ-1173:
---------------------------------------------

I propose to close/freeze the issue as we have adapted the code on our side.
{code:java}
inline bool HdfsUri::connect() {    
    struct hdfsBuilder* builder = hdfsNewBuilder();
    hdfsBuilderSetNameNode(builder, uri_m.c_str());
    if (port_m > 0) {
        hdfsBuilderSetNameNodePort(builder, port_m);
    }
    else {
#ifdef HAVE_LIBHDFS
        // There is no default port set in hdfsNewBuilder method of native libhdfs, we need to provide it ourselves
        hdfsBuilderSetNameNodePort(builder, 0);
#endif
    }
    fs_m = hdfsBuilderConnect(builder);
#ifdef HAVE_LIBHDFS3
    // The builder is freed in hdfsBuilderConnect() for native libhdfs but not for libhdfs3
    hdfsFreeBuilder(builder);
#endif
    if(!fs_m) {
        throw std::logic_error(uri_m + " -> Oops! Failed to connect to hdfs!");
    }
}

{code}

> hdfsConnect in libhdfs3 is not consistent with hdfsConnect in native libhdfs (JNI) when port is 0
> -------------------------------------------------------------------------------------------------
>
>                 Key: HAWQ-1173
>                 URL: https://issues.apache.org/jira/browse/HAWQ-1173
>             Project: Apache HAWQ
>          Issue Type: Improvement
>          Components: libhdfs
>            Reporter: Pierre de Freminville
>            Assignee: Zhanwei Wang
>            Priority: Trivial
>
> Hello,
> I noticed that the following is not possible with libhdfs3
> {code}hdfsFS fs = hdfsConnect("default", 0);{code}
> because of asserts such as:
> {code}PARAMETER_ASSERT(port > 0, NULL, EINVAL);{code}
> I could be nice to allow that to be consistent with what is done in the native libhdfs (JNI).
> The file of interest in the native library is:
> * hadoop-hdfs-native-client/src/main/native/libhdfs/hdfs.c



--
This message was sent by Atlassian Jira
(v8.3.4#803005)