[PATCH]fix typo in the trunk

2 views
Skip to first unread message

Wang Sen

unread,
Apr 10, 2013, 9:58:53 AM4/10/13
to cloudxy, kangh...@gmail.com
1. Fix the hdfsHFlush to hdfsFlush.
2. Add JAVA_HOME/include to CMakeLists.txt.

Signed-off-by: Wang Sen <kelvi...@gmail.com>
---
Index: src/backend/hdfs_storage.c
===================================================================
--- src/backend/hdfs_storage.c (版本 1857)
+++ src/backend/hdfs_storage.c (工作副本)
@@ -150,14 +150,14 @@
//HLOG_DEBUG("hdfs -- enter func %s", __func__);
hdfsFile hfile = (hdfsFile)file;
//HLOG_DEBUG("hdfs -- leave func %s", __func__);
- return hdfsHFlush((hdfsFS)storage->fs_handler, hfile);
+ return hdfsFlush((hdfsFS)storage->fs_handler, hfile);
}

int hdfs_file_delete(struct back_storage *storage, const char *path){
//HLOG_DEBUG("hdfs -- enter func %s", __func__);
char full_path[256];
build_hdfs_path(full_path, storage->dir, storage->fs_name, path);
- int ret = hdfsDelete((hdfsFS)storage->fs_handler, full_path,0);
+ int ret = hdfsDelete((hdfsFS)storage->fs_handler, full_path);
//HLOG_DEBUG("hdfs -- leave func %s", __func__);
return ret;
}
Index: src/CMakeLists.txt
===================================================================
--- src/CMakeLists.txt (版本 1857)
+++ src/CMakeLists.txt (工作副本)
@@ -27,16 +27,15 @@
MESSAGE(STATUS "Probe Java Home:" ${JAVA_HOME})
INCLUDE_DIRECTORIES(
-
#/usr/lib/glib-2.0/include
#/usr/lib/i386-linux-gnu/glib-2.0/include
- #/usr/lib/x86_64-linux-gnu/glib-2.0/include
- #${JAVA_HOME}/include
- #${JAVA_HOME}/include/linux
+ #/usr/lib/x86_64-linux-gnu/glib-2.0/include
+ ${JAVA_HOME}/include
+ ${JAVA_HOME}/include/linux
#${HADOOP_HOME}/include
#${LOG_HOME}/include
#${SNAPPY_HOME}/include
- /usr/include/
+ /usr/include/
include
.)
# Use SRCS to save all the sources.

harryxiyou

unread,
Apr 11, 2013, 9:12:39 PM4/11/13
to Wang Sen, Kang Hua, clo...@googlegroups.com
On Wed, Apr 10, 2013 at 9:58 PM, Wang Sen <kelvi...@gmail.com> wrote:

Hi brother Wang Sen,

> 1. Fix the hdfsHFlush to hdfsFlush.

Why should we replace hdfsHflush with hdfsFlush? I find the differences between
them are like following.

[...]
233 /**
234 * hdfsFlush - Flush the data.
235 * @param fs The configured filesystem handle.
236 * @param file The file handle.
237 * @return Returns 0 on success, -1 on error.
238 */
239 int hdfsFlush(hdfsFS fs, hdfsFile file);
240
241
242 /**
243 * hdfsHFlush - Flush out the data in client's user buffer. After the
244 * return of this call, new readers will see the data.
245 * @param fs configured filesystem handle
246 * @param file file handle
247 * @return 0 on success, -1 on error and sets errno
248 */
249 int hdfsHFlush(hdfsFS fs, hdfsFile file);
[...]

> 2. Add JAVA_HOME/include to CMakeLists.txt.
>

NACK. In the latest truck of HLFS, we need not maitain 3part, so
JAVA_HOME/include is no need for us. Just install hdfs like this.

sudo apt-get install libhdfs0-dev

See http://code.google.com/p/cloudxy/wiki/INTEGRATE_HLFS_INTO_OPENSTACK#%E5%AE%89%E8%A3%85HLFS
for details.



--
Thanks
Harry Wei

Wang Sen

unread,
Apr 18, 2013, 4:10:03 AM4/18/13
to harryxiyou, Wang Sen, Kang Hua, clo...@googlegroups.com
On Fri, Apr 12, 2013 at 09:12:39AM +0800, harryxiyou wrote:
> On Wed, Apr 10, 2013 at 9:58 PM, Wang Sen <kelvi...@gmail.com> wrote:
>
> Hi brother Wang Sen,
>
> > 1. Fix the hdfsHFlush to hdfsFlush.
>
> Why should we replace hdfsHflush with hdfsFlush? I find the differences between
> them are like following.

Yes, you're right. hdfsHFlush is not a typo, but there's no such a function in
my hdfs.h. So, I cann't compile HLFS.
I installed libhdfs0-dev this way, but cmake && make still cannot work without
JAVA_HOME in the CMakeLists.txt seted. BTW, JAVA_HOME in the bash has been seted.

Error message :

In file included from /home/kelvin/project/cloudxy/hlfs/src/backend/hdfs_storage.c:16:0:
/usr/include/hdfs.h:33:17: 致命错误: jni.h:没有那个文件或目录
编译中断。
make[2]: *** [CMakeFiles/hlfs.dir/backend/hdfs_storage.c.o] 错误 1
make[1]: *** [CMakeFiles/hlfs.dir/all] 错误 2
make: *** [all] 错误 2

>
>
>
> --
> Thanks
> Harry Wei

harryxiyou

unread,
Apr 18, 2013, 5:04:56 AM4/18/13
to clo...@googlegroups.com, Wang Sen, Kang Hua
On Thu, Apr 18, 2013 at 4:10 PM, Wang Sen <kelvi...@gmail.com> wrote:
[...]
> Yes, you're right. hdfsHFlush is not a typo, but there's no such a function in
> my hdfs.h. So, I cann't compile HLFS.

Yeah, it seems that your version of hdfs maybe lower or something wrong else.
Actually, we are concerned about if the differences between these two APIs(
hdfsHFlush and hdfsFlush) may lead to our failure in some conditions. So i think
we should investigate clearly before replace one with another one.

[...]
> I installed libhdfs0-dev this way, but cmake && make still cannot work without
> JAVA_HOME in the CMakeLists.txt seted. BTW, JAVA_HOME in the bash has been seted.
>
> Error message :
>
> In file included from /home/kelvin/project/cloudxy/hlfs/src/backend/hdfs_storage.c:16:0:
> /usr/include/hdfs.h:33:17: 致命错误: jni.h:没有那个文件或目录
> 编译中断。
> make[2]: *** [CMakeFiles/hlfs.dir/backend/hdfs_storage.c.o] 错误 1
> make[1]: *** [CMakeFiles/hlfs.dir/all] 错误 2
> make: *** [all] 错误 2
>

Actually, i am not clear about why you could happen to these errors.
However, i think if you install libhdfs with 'apt-get', APIs of hdfs will
find the libraries and head files(libhdfs needs) itself but you set for him.
Maybe it has something wrong with your JAVA set or installation.


--
Thanks
Harry Wei
Reply all
Reply to author
Forward
0 new messages