From b2d86ebf782215d0b869ee7bf70b89cd148a0733 Mon Sep 17 00:00:00 2001 From: Chris Nauroth Date: Sat, 23 Aug 2014 05:30:59 +0000 Subject: [PATCH] HDFS-4852. Merging change r1619967 from trunk to branch-2. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1619968 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 2 ++ .../hadoop-hdfs/src/site/apt/LibHdfs.apt.vm | 29 ++++++++++++------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 9216bd44fc6..490d0d04e8f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -285,6 +285,8 @@ Release 2.6.0 - UNRELEASED HDFS-6829. DFSAdmin refreshSuperUserGroupsConfiguration failed in security cluster (zhaoyunjiong via Arpit Agarwal) + HDFS-4852. libhdfs documentation is out of date. (cnauroth) + Release 2.5.0 - 2014-08-11 INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/site/apt/LibHdfs.apt.vm b/hadoop-hdfs-project/hadoop-hdfs/src/site/apt/LibHdfs.apt.vm index 5ad50ab6356..23ff678ba51 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/site/apt/LibHdfs.apt.vm +++ b/hadoop-hdfs-project/hadoop-hdfs/src/site/apt/LibHdfs.apt.vm @@ -26,14 +26,17 @@ C API libhdfs (HDFS). It provides C APIs to a subset of the HDFS APIs to manipulate HDFS files and the filesystem. libhdfs is part of the Hadoop distribution and comes pre-compiled in - <<<${HADOOP_PREFIX}/libhdfs/libhdfs.so>>> . + <<<${HADOOP_HDFS_HOME}/lib/native/libhdfs.so>>> . libhdfs is compatible with + Windows and can be built on Windows by running <<>> within the + <<>> directory of the source tree. * The APIs - The libhdfs APIs are a subset of: {{{hadoop fs APIs}}}. + The libhdfs APIs are a subset of the + {{{../../api/org/apache/hadoop/fs/FileSystem.html}Hadoop FileSystem APIs}}. The header file for libhdfs describes each API in detail and is - available in <<<${HADOOP_PREFIX}/src/c++/libhdfs/hdfs.h>>> + available in <<<${HADOOP_HDFS_HOME}/include/hdfs.h>>>. * A Sample Program @@ -55,24 +58,28 @@ C API libhdfs fprintf(stderr, "Failed to 'flush' %s\n", writePath); exit(-1); } - hdfsCloseFile(fs, writeFile); + hdfsCloseFile(fs, writeFile); } ---- * How To Link With The Library - See the Makefile for <<>> in the libhdfs source directory - (<<<${HADOOP_PREFIX}/src/c++/libhdfs/Makefile>>>) or something like: - <<>> + See the CMake file for <<>> in the libhdfs source + directory (<<>>) or + something like: + <<>> * Common Problems The most common problem is the <<>> is not set properly when calling a program that uses libhdfs. Make sure you set it to all the - Hadoop jars needed to run Hadoop itself. Currently, there is no way to - programmatically generate the classpath, but a good bet is to include - all the jar files in <<<${HADOOP_PREFIX}>>> and <<<${HADOOP_PREFIX}/lib>>> as well - as the right configuration directory containing <<>> + Hadoop jars needed to run Hadoop itself as well as the right configuration + directory containing <<>>. It is not valid to use wildcard + syntax for specifying multiple jars. It may be useful to run + <<>> or <<>>> to + generate the correct classpath for your deployment. See + {{{../hadoop-common/CommandsManual.html#classpath}Hadoop Commands Reference}} + for more information on this command. * Thread Safe