You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/04/08 14:03:06 UTC

[GitHub] [hadoop-ozone] aryangupta1998 commented on a change in pull request #782: HDDS-3352. Support for native ozone filesystem client using libhdfs.

aryangupta1998 commented on a change in pull request #782: HDDS-3352. Support for native ozone filesystem client using libhdfs.
URL: https://github.com/apache/hadoop-ozone/pull/782#discussion_r405549703
 
 

 ##########
 File path: hadoop-ozone/native-client/libozone/ozfs.c
 ##########
 @@ -0,0 +1,42 @@
+#include "ozfs.h"
+#include "hdfs/hdfs.h"
+#include <fcntl.h>
+#include <inttypes.h>
+#include <stdio.h>
+#include <string.h>
+
+
+ozfsFS ozfsConnect(const char *host, tPort port, const char *bucket, const char *vol)
+{
+    struct hdfsBuilder *bld = hdfsNewBuilder();
+    char string[100] = "";
+    int len = 0;
+    if (!bld)
+        return NULL;
+    len = strlen(host) + strlen(bucket) + strlen(vol) + strlen("o3fs://");
+    snprintf(string, len + 5, "o3fs://%s.%s.%s", bucket, vol, host);
 
 Review comment:
   Thanks for pointing out @fapifta 
   I changed len+5 to len+3 (len+2 for the two dots and +1 for the null character that’s being appended by snprintf).
   Also I changed string[100] to string[len+2].

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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