hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colin Patrick McCabe (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-4712) New libhdfs method hdfsGetDataNodes
Date Tue, 30 Apr 2013 19:56:16 GMT

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

Colin Patrick McCabe commented on HDFS-4712:
--------------------------------------------

{code}
+    jExc = (invokeMethod(env, &jVal,  INSTANCE, jDataNodeInfo, DATANODE_INFO,
+        "getHostName", "()Ljava/lang/String;")|| jVal.l == NULL);
{code}

I don't understand this code.  jExc is either a pointer to an exception, or NULL.  What sense
does it make to assign a true/false value to this variable?  You need to add a separate line
which checks the returned variable against NULL and handles it somehow, probably by adding
a blank string in the hostname field of {{hdfsDataNodeInfo}}.

{code}
+    jobject enumType;
{code}

This is not initialized, but you later call {{destroyLocalReference}} on it.  Initialize it
to {{NULL}}.

{code}
+        if (!dataNodeInfoList[i]) {
+            fprintf(stderr, "dataNodeInfoList: out of memory");
+            return ENOMEM;
+        }
{code}

This function returns {{hdfsDataNodeInfo **}}, not an integer.

{code}
+}
+
+                                                
+
+
+
 /**
  * vim: ts=4: sw=4: et:
  */
{code}

{code}
 /* Macros for constructing method signatures */
@@ -2661,11 +2666,248 @@
 
     //Free entire block
     free(hdfsFileInfo);
+
 }
{code}

Please don't add all these empty lines everywhere, especially to unrelated code.  It's ok
to have a blank line here or there, but two or more in a row inside a function seems excessive.
 You must have a really big monitor.  It is ok to have multiple blank lines between functions
(which seems to be the only place you didn't add more than one blank line).

Don't get discouraged.  I can tell that you are making progress.  It would really help if
you checked the compiler warning messages generated by gcc.  Your patch should not add warning
messages.  These lines should show up in the Maven output.  Look for something like this:

{code}
/home/cmccabe/hadoop5/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.c: In function
‘getDataNodeInfo’:
/home/cmccabe/hadoop5/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.c:2678:10:
warning: assignment makes pointer f
rom integer without a cast [enabled by default]
{code}
                
> New libhdfs method hdfsGetDataNodes
> -----------------------------------
>
>                 Key: HDFS-4712
>                 URL: https://issues.apache.org/jira/browse/HDFS-4712
>             Project: Hadoop HDFS
>          Issue Type: New Feature
>          Components: libhdfs
>            Reporter: andrea manzi
>         Attachments: HDFS-4712.patch, hdfs.c.diff, hdfs.h.diff
>
>
> we have implemented a possible extension to libhdfs to retrieve information about the
available datanodes ( there was a mail on the hadoop-hdsf-dev mailing list initially abut
this :
> http://mail-archives.apache.org/mod_mbox/hadoop-hdfs-dev/201204.mbox/%3CCANhO-
> s0mvORORrxPjnjbQL6bRkJ4C7L+u816xkdc+2r0WHjBcw@mail.gmail.com%3E)
> i would like to know how to proceed to create a patch, cause on the wiki http://wiki.apache.org/hadoop/HowToContribute
i can see info about JAVA patches but nothing related to extensions in C.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message