hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bch...@apache.org
Subject svn commit: r1593181 - in /hadoop/common/branches/HADOOP-10388/hadoop-native-core: CMakeLists.txt hdfs/namenode-rpc-unit.c rpc/protoc-gen-hrpc.cc rpc/shorten.c
Date Thu, 08 May 2014 05:09:08 GMT
Author: bchang
Date: Thu May  8 05:09:07 2014
New Revision: 1593181

URL: http://svn.apache.org/r1593181
Log:
HADOOP-10577. Native Hadoop Client: Fix some minor error and compile on macosx (Binglin Chang)

Modified:
    hadoop/common/branches/HADOOP-10388/hadoop-native-core/CMakeLists.txt
    hadoop/common/branches/HADOOP-10388/hadoop-native-core/hdfs/namenode-rpc-unit.c
    hadoop/common/branches/HADOOP-10388/hadoop-native-core/rpc/protoc-gen-hrpc.cc
    hadoop/common/branches/HADOOP-10388/hadoop-native-core/rpc/shorten.c

Modified: hadoop/common/branches/HADOOP-10388/hadoop-native-core/CMakeLists.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HADOOP-10388/hadoop-native-core/CMakeLists.txt?rev=1593181&r1=1593180&r2=1593181&view=diff
==============================================================================
--- hadoop/common/branches/HADOOP-10388/hadoop-native-core/CMakeLists.txt (original)
+++ hadoop/common/branches/HADOOP-10388/hadoop-native-core/CMakeLists.txt Thu May  8 05:09:07
2014
@@ -31,9 +31,9 @@ if (NOT (PROTOBUFC_LIB AND PROTOBUFC_EXE
 endif()
 
 # Find protobuf
-find_library(PROTOC_LIB NAMES libprotoc.so
+find_library(PROTOC_LIB NAMES protoc
     HINTS /usr/lib /usr/lib64)
-find_library(PROTOBUF_LIB NAMES libprotobuf.so
+find_library(PROTOBUF_LIB NAMES protobuf
     HINTS /usr/lib /usr/lib64)
 find_program(PROTOC_EXE NAMES protoc)
 find_path(PROTOC_HEADER_PATH NAMES 

Modified: hadoop/common/branches/HADOOP-10388/hadoop-native-core/hdfs/namenode-rpc-unit.c
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HADOOP-10388/hadoop-native-core/hdfs/namenode-rpc-unit.c?rev=1593181&r1=1593180&r2=1593181&view=diff
==============================================================================
--- hadoop/common/branches/HADOOP-10388/hadoop-native-core/hdfs/namenode-rpc-unit.c (original)
+++ hadoop/common/branches/HADOOP-10388/hadoop-native-core/hdfs/namenode-rpc-unit.c Thu May
 8 05:09:07 2014
@@ -68,13 +68,12 @@ void set_replication_cb(SetReplicationRe
     if (err) {
         fprintf(stderr, "set_replication_cb: got an error.  %s\n",
                 hadoop_err_msg(err));
-        goto done;
+    } else {
+        fprintf(stderr, "set_replication_cb: resp->result = %d\n",
+                !!resp->result);
     }
-    fprintf(stderr, "set_replication_cb: resp->result = %d\n",
-            !!resp->result);
 
-done:
-    sem_post(sem);
+    uv_sem_post(sem);
     if (err) {
         hadoop_err_free(err);
     }
@@ -83,6 +82,8 @@ done:
     }
 }
 
+
+
 int main(void)
 {
     struct hrpc_messenger_builder *msgr_bld;
@@ -110,7 +111,7 @@ int main(void)
         req.replication = 2;
         cnn_async_set_replication(proxy, &req, set_replication_cb, &sem);
     }
-    sem_wait(&sem);
+    uv_sem_wait(&sem);
 
     hrpc_proxy_free(proxy);
     hrpc_messenger_shutdown(msgr);

Modified: hadoop/common/branches/HADOOP-10388/hadoop-native-core/rpc/protoc-gen-hrpc.cc
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HADOOP-10388/hadoop-native-core/rpc/protoc-gen-hrpc.cc?rev=1593181&r1=1593180&r2=1593181&view=diff
==============================================================================
--- hadoop/common/branches/HADOOP-10388/hadoop-native-core/rpc/protoc-gen-hrpc.cc (original)
+++ hadoop/common/branches/HADOOP-10388/hadoop-native-core/rpc/protoc-gen-hrpc.cc Thu May
 8 05:09:07 2014
@@ -23,7 +23,13 @@
 #include <google/protobuf/io/printer.h>
 #include <google/protobuf/io/zero_copy_stream.h>
 #include <google/protobuf/stubs/common.h>
+
+#include <cstddef>
+#ifdef _LIBCPP_VERSION
+#include <memory>
+#else
 #include <tr1/memory>
+#endif
 
 #include <iostream>
 #include <map>
@@ -58,8 +64,11 @@ using google::protobuf::compiler::Genera
 using google::protobuf::io::Printer;
 using std::map;
 using std::string;
+#ifdef _LIBCPP_VERSION
+using std::shared_ptr;
+#else
 using std::tr1::shared_ptr;
-
+#endif
 typedef map<string, string> string_map_t;
 
 static string camel_case_to_uscore(const string &in)

Modified: hadoop/common/branches/HADOOP-10388/hadoop-native-core/rpc/shorten.c
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HADOOP-10388/hadoop-native-core/rpc/shorten.c?rev=1593181&r1=1593180&r2=1593181&view=diff
==============================================================================
--- hadoop/common/branches/HADOOP-10388/hadoop-native-core/rpc/shorten.c (original)
+++ hadoop/common/branches/HADOOP-10388/hadoop-native-core/rpc/shorten.c Thu May  8 05:09:07
2014
@@ -63,13 +63,13 @@ static void add_word(char ***words, size
     new_num_words = *num_words + 1;
     nword = strdup(word);
     if (!nword) {
-        fprintf(stderr, "failed to allocate memory for %Zd words\n",
+        fprintf(stderr, "failed to allocate memory for %zu words\n",
                 new_num_words);
         exit(1);
     }
     nwords = realloc(*words, sizeof(char **) * new_num_words);
     if (!nwords) {
-        fprintf(stderr, "failed to allocate memory for %Zd words\n",
+        fprintf(stderr, "failed to allocate memory for %zu words\n",
                 new_num_words);
         free(nword);
         exit(1);



Mime
View raw message