Return-Path: X-Original-To: apmail-hadoop-hdfs-commits-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3AE5AC707 for ; Thu, 19 Jul 2012 18:23:37 +0000 (UTC) Received: (qmail 46105 invoked by uid 500); 19 Jul 2012 18:23:37 -0000 Delivered-To: apmail-hadoop-hdfs-commits-archive@hadoop.apache.org Received: (qmail 46047 invoked by uid 500); 19 Jul 2012 18:23:37 -0000 Mailing-List: contact hdfs-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-dev@hadoop.apache.org Delivered-To: mailing list hdfs-commits@hadoop.apache.org Received: (qmail 46039 invoked by uid 99); 19 Jul 2012 18:23:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jul 2012 18:23:37 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jul 2012 18:23:35 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 4F3CF238897A; Thu, 19 Jul 2012 18:23:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1363458 - in /hadoop/common/branches/branch-2/hadoop-hdfs-project: ./ hadoop-hdfs/ hadoop-hdfs/src/main/java/ hadoop-hdfs/src/main/native/ hadoop-hdfs/src/main/native/libhdfs/ hadoop-hdfs/src/main/native/libhdfs/test/ hadoop-hdfs/src/main/... Date: Thu, 19 Jul 2012 18:23:15 -0000 To: hdfs-commits@hadoop.apache.org From: eli@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120719182316.4F3CF238897A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: eli Date: Thu Jul 19 18:23:15 2012 New Revision: 1363458 URL: http://svn.apache.org/viewvc?rev=1363458&view=rev Log: HDFS-3673. libhdfs: fix some compiler warnings. Contributed by Colin Patrick McCabe Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/ (props changed) hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/ (props changed) hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/ (props changed) hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/ (props changed) hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.c hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.h hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs_test.h hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/jni_helper.c hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test/test_libhdfs_read.c hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test_libhdfs_threaded.c hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/datanode/ (props changed) hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/ (props changed) hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/secondary/ (props changed) hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/hdfs/ (props changed) Propchange: hadoop/common/branches/branch-2/hadoop-hdfs-project/ ------------------------------------------------------------------------------ Merged /hadoop/common/trunk/hadoop-hdfs-project:r1363457 Propchange: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/ ------------------------------------------------------------------------------ Merged /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs:r1363457 Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1363458&r1=1363457&r2=1363458&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original) +++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Thu Jul 19 18:23:15 2012 @@ -161,6 +161,8 @@ Release 2.0.1-alpha - UNRELEASED HDFS-3666. Plumb more exception messages to terminate. (eli) + HDFS-3673. libhdfs: fix some compiler warnings. (Colin Patrick McCabe via eli) + OPTIMIZATIONS HDFS-2982. Startup performance suffers when there are many edit log Propchange: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/ ------------------------------------------------------------------------------ Merged /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java:r1363457 Propchange: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/ ------------------------------------------------------------------------------ Merged /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native:r1363457 Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.c URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.c?rev=1363458&r1=1363457&r2=1363458&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.c (original) +++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.c Thu Jul 19 18:23:15 2012 @@ -275,7 +275,7 @@ done: */ static int jStrToCstr(JNIEnv *env, jstring jstr, char **cstr) { - char *tmp; + const char *tmp; tmp = (*env)->GetStringUTFChars(env, jstr, NULL); *cstr = strdup(tmp); @@ -632,7 +632,7 @@ done: if (ret) errno = ret; - return gFsRef; + return (hdfsFS)gFsRef; } int hdfsDisconnect(hdfsFS fs) @@ -667,7 +667,7 @@ int hdfsDisconnect(hdfsFS fs) } //Release unnecessary references - (*env)->DeleteGlobalRef(env, fs); + (*env)->DeleteGlobalRef(env, jFS); return 0; } Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.h URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.h?rev=1363458&r1=1363457&r2=1363458&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.h (original) +++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.h Thu Jul 19 18:23:15 2012 @@ -81,15 +81,6 @@ extern "C" { */ int hdfsFileIsOpenForWrite(hdfsFile file); - /** - * Disable the direct read optimization for a file. - * - * This is mainly provided for unit testing purposes. - * - * @param file The HDFS file - */ - void hdfsFileDisableDirectRead(hdfsFile file); - /** * hdfsConnectAsUser - Connect to a hdfs file system as a specific user * Connect to the hdfs. @@ -101,7 +92,6 @@ extern "C" { */ hdfsFS hdfsConnectAsUser(const char* nn, tPort port, const char *user); - /** * hdfsConnect - Connect to a hdfs file system. * Connect to the hdfs. Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs_test.h URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs_test.h?rev=1363458&r1=1363457&r2=1363458&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs_test.h (original) +++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs_test.h Thu Jul 19 18:23:15 2012 @@ -19,7 +19,7 @@ #ifndef LIBHDFS_HDFS_TEST_H #define LIBHDFS_HDFS_TEST_H -struct hdfs_internal; +struct hdfsFile_internal; /** * Some functions that are visible only for testing. @@ -38,7 +38,16 @@ extern "C" { * @return 1 if the file is using the direct read optimization, * 0 otherwise. */ - int hdfsFileUsesDirectRead(struct hdfs_internal *file); + int hdfsFileUsesDirectRead(struct hdfsFile_internal *file); + + /** + * Disable the direct read optimization for a file. + * + * This is mainly provided for unit testing purposes. + * + * @param file The HDFS file + */ + void hdfsFileDisableDirectRead(struct hdfsFile_internal *file); #ifdef __cplusplus } #endif Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/jni_helper.c URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/jni_helper.c?rev=1363458&r1=1363457&r2=1363458&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/jni_helper.c (original) +++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/jni_helper.c Thu Jul 19 18:23:15 2012 @@ -550,7 +550,8 @@ JNIEnv* getJNIEnv(void) ret = pthread_key_create(&gTlsKey, hdfsThreadDestructor); if (ret) { pthread_mutex_unlock(&jvmMutex); - fprintf("pthread_key_create failed with error %d\n", ret); + fprintf(stderr, "getJNIEnv: pthread_key_create failed with " + "error %d\n", ret); return NULL; } gTlsKeyInitialized = 1; @@ -569,7 +570,7 @@ JNIEnv* getJNIEnv(void) } tls = calloc(1, sizeof(struct hdfsTls)); if (!tls) { - fprintf(stderr, "getJNIEnv: OOM allocating %d bytes\n", + fprintf(stderr, "getJNIEnv: OOM allocating %zd bytes\n", sizeof(struct hdfsTls)); return NULL; } Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test/test_libhdfs_read.c URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test/test_libhdfs_read.c?rev=1363458&r1=1363457&r2=1363458&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test/test_libhdfs_read.c (original) +++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test/test_libhdfs_read.c Thu Jul 19 18:23:15 2012 @@ -35,7 +35,6 @@ int main(int argc, char **argv) { } const char* rfile = argv[1]; - tSize fileTotalSize = strtoul(argv[2], NULL, 10); tSize bufferSize = strtoul(argv[3], NULL, 10); hdfsFile readFile = hdfsOpenFile(fs, rfile, O_RDONLY, bufferSize, 0, 0); Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test_libhdfs_threaded.c URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test_libhdfs_threaded.c?rev=1363458&r1=1363457&r2=1363458&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test_libhdfs_threaded.c (original) +++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test_libhdfs_threaded.c Thu Jul 19 18:23:15 2012 @@ -25,6 +25,7 @@ #include #include #include +#include #define TLH_MAX_THREADS 100 Propchange: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/datanode/ ------------------------------------------------------------------------------ Merged /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/datanode:r1363457 Propchange: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/ ------------------------------------------------------------------------------ Merged /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs:r1363457 Propchange: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/secondary/ ------------------------------------------------------------------------------ Merged /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/secondary:r1363457 Propchange: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/hdfs/ ------------------------------------------------------------------------------ Merged /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/hdfs:r1363457