hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Clampffer (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HDFS-11544) libhdfs++: Improve C API error reporting
Date Mon, 20 Mar 2017 22:36:41 GMT

     [ https://issues.apache.org/jira/browse/HDFS-11544?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

James Clampffer updated HDFS-11544:
-----------------------------------
    Attachment: HDFS-11544.HDFS-8707.001.patch

Thanks for the review @Xiaowei zhu!  I noticed a few spelling errors when I was about to commit
so I fixed them in the 001 patch.  Also happened to stumble into some issues with the popcnt
intrinsic unrelated to this so I added a little note there.  Here's the diff between the first
and second patch:

{code}
@@ -44,10 +44,10 @@ static constexpr tPort kDefaultPort = 8020;
 // Functions exposed through the C API and extended C API get tagged with no-op
 // defines.  This is to make it really clear what's being exposed in a way that
 // won't blend into the comments.  Can also be used to add attributes or disable
-// the extentions e.g. "#define HDFS_EXT_API static"
+// the extensions e.g. "#define HDFS_EXT_API static"
 // API declared in hdfs.h shared with libhdfs
 #define HDFS_API
-// API extention funcions specific to libhdfs++ declated in hdfs_ext.h
+// API extension functions specific to libhdfs++ declared in hdfs_ext.h
 #define HDFS_EXT_API
 
 // Common catch-all case to get exception and return the appropriate error code
@@ -128,7 +128,7 @@ int hdfsGetLastError(char *buf, int len) {
 
 /* Clear out last error.  This shouldn't need to be public if functions do it themselves
*/
 static void resetErrorForApiCall(const char *location = nullptr) {
-  // POSIX spec says caller should be responible for resetting errno.
+  // POSIX spec says caller should be responsible for resetting errno.
   // Clearing it here just in case.
   errno = 0;
   if(location)
@@ -930,7 +930,7 @@ int hdfsCreateDirectory(hdfsFS fs, const char* path) {
       return -1;
     }
     Status stat;
-    //Use default permissions and set true for creating all non-existant parent directories
+    //Use default permissions and set true for creating all non-existent parent directories
     stat = fs->get_impl()->Mkdirs(*abs_path, FileSystem::GetDefaultPermissionMask(),
true);
     if (!stat.ok()) {
       return Error(stat);
@@ -1851,6 +1851,7 @@ static bool IsLevelValid(int component) {
 }
 
 //  should use  __builtin_popcnt as optimization on some platforms
+//    *but maybe not Intel: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62011
{code}

> libhdfs++: Improve C API error reporting
> ----------------------------------------
>
>                 Key: HDFS-11544
>                 URL: https://issues.apache.org/jira/browse/HDFS-11544
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: hdfs-client
>            Reporter: James Clampffer
>            Assignee: James Clampffer
>         Attachments: HDFS-11544.HDFS-8707.000.patch, HDFS-11544.HDFS-8707.001.patch
>
>
> The thread local string used for hdfsGetLastError wasn't reset between calls so it could
give stale results in confusing ways.  Now it gets reset with a placeholder that says that
<functionname> hasn't set an error string.
> Also fixed indentation that wasn't consistent + marked which functions are used by the
hdfs.h API and hdfs_ext.h API to make it easier to see when changes could break compatibility.
 Included some minor cleanup for the common case catch blocks.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org


Mime
View raw message