aryangupta1998 commented on a change in pull request #782: URL: https://github.com/apache/hadoop-ozone/pull/782#discussion_r412310797
########## File path: hadoop-ozone/native-client/libo3fs/o3fs.h ########## @@ -0,0 +1,44 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OZFS_DOT_H +#define OZFS_DOT_H + +#include "hdfs/hdfs.h" + +struct hdfs_internal; +typedef struct hdfs_internal* ozfsFS; + +struct hdfsFile_internal; +typedef struct hdfsFile_internal* ozfsFile; + +ozfsFS ozfsConnect(const char* nn, tPort port, const char* bucket, Review comment: changed ########## File path: hadoop-ozone/native-client/libo3fs/o3fs.c ########## @@ -0,0 +1,67 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "o3fs.h" +#include "hdfs/hdfs.h" +#include <fcntl.h> +#include <inttypes.h> +#include <stdio.h> +#include <string.h> +#define O3FS "o3fs://" + +ozfsFS ozfsConnect(const char *host, tPort port, + const char *bucket, const char *vol) +{ + struct hdfsBuilder *bld = hdfsNewBuilder(); + int len = 0; + if (!bld){ + return NULL; + } + len = strlen(host) + strlen(bucket) + strlen(vol) + strlen(O3FS); + char string[len + 2]; + snprintf(string, len + 3, "%s%s.%s.%s", O3FS, bucket, vol, host); + // After snprintf command, + // string = o3fs://bucket4.vol4.127.0.0.1 (URI without port) + //printf("URI : %s\n", string); Review comment: removed ---------------------------------------------------------------- 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: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
