hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From whe...@apache.org
Subject [06/50] [abbrv] hadoop git commit: HDFS-8725. Use std::chrono to implement the timer in the asio library.
Date Sat, 11 Jul 2015 00:07:29 GMT
HDFS-8725. Use std::chrono to implement the timer in the asio library.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/d1bba58a
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/d1bba58a
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/d1bba58a

Branch: refs/heads/HDFS-8707
Commit: d1bba58a63a07c57259dbe9f27ef723b35408349
Parents: 6f03d4a
Author: Haohui Mai <wheat9@apache.org>
Authored: Tue Jul 7 13:25:51 2015 -0700
Committer: Haohui Mai <wheat9@apache.org>
Committed: Fri Jul 10 17:05:29 2015 -0700

----------------------------------------------------------------------
 .../src/main/native/libhdfspp/CMakeLists.txt    |  2 +-
 .../include/asio/basic_deadline_timer.hpp       |  2 ++
 .../asio-1.10.2/include/asio/deadline_timer.hpp | 23 ++++++++++++++++++++
 .../include/asio/deadline_timer_service.hpp     |  2 ++
 .../asio-1.10.2/include/asio/time_traits.hpp    |  8 +++++++
 5 files changed, 36 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/d1bba58a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/CMakeLists.txt
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/CMakeLists.txt
index 96bbaed..2986b88 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/CMakeLists.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/CMakeLists.txt
@@ -18,7 +18,7 @@
 
 project (libhdfspp)
 
-add_definitions(-DASIO_STANDALONE)
+add_definitions(-DASIO_STANDALONE -DASIO_CPP11_DATE_TIME)
 
 if(UNIX)
 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -std=c++11 -g -fPIC -fno-strict-aliasing")

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d1bba58a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/basic_deadline_timer.hpp
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/basic_deadline_timer.hpp
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/basic_deadline_timer.hpp
index 6aef75c..d0fc371 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/basic_deadline_timer.hpp
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/basic_deadline_timer.hpp
@@ -18,6 +18,7 @@
 #include "asio/detail/config.hpp"
 
 #if defined(ASIO_HAS_BOOST_DATE_TIME) \
+  || defined(ASIO_CPP11_DATE_TIME) \
   || defined(GENERATING_DOCUMENTATION)
 
 #include <cstddef>
@@ -513,6 +514,7 @@ public:
 #include "asio/detail/pop_options.hpp"
 
 #endif // defined(ASIO_HAS_BOOST_DATE_TIME)
+       // || defined(ASIO_CPP11_DATE_TIME)
        // || defined(GENERATING_DOCUMENTATION)
 
 #endif // ASIO_BASIC_DEADLINE_TIMER_HPP

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d1bba58a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/deadline_timer.hpp
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/deadline_timer.hpp
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/deadline_timer.hpp
index cf018d0..c0b7fe8 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/deadline_timer.hpp
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/deadline_timer.hpp
@@ -18,23 +18,46 @@
 #include "asio/detail/config.hpp"
 
 #if defined(ASIO_HAS_BOOST_DATE_TIME) \
+  || defined(ASIO_CPP11_DATE_TIME) \
   || defined(GENERATING_DOCUMENTATION)
 
 #include "asio/detail/socket_types.hpp" // Must come before posix_time.
 #include "asio/basic_deadline_timer.hpp"
 
+#if defined(ASIO_HAS_BOOST_DATE_TIME)
+
 #include "asio/detail/push_options.hpp"
 #include <boost/date_time/posix_time/posix_time_types.hpp>
 #include "asio/detail/pop_options.hpp"
 
+#elif defined(ASIO_CPP11_DATE_TIME)
+
+#include "asio/detail/chrono_time_traits.hpp"
+#include "asio/wait_traits.hpp"
+#include <chrono>
+
+#endif
+
 namespace asio {
 
+#if defined(ASIO_HAS_BOOST_DATE_TIME)
 /// Typedef for the typical usage of timer. Uses a UTC clock.
 typedef basic_deadline_timer<boost::posix_time::ptime> deadline_timer;
 
+#elif defined(ASIO_CPP11_DATE_TIME)
+
+typedef basic_deadline_timer<
+    std::chrono::system_clock,
+    detail::chrono_time_traits<std::chrono::system_clock,
+                               wait_traits<std::chrono::system_clock>>>
+    deadline_timer;
+
+#endif
+
 } // namespace asio
 
 #endif // defined(ASIO_HAS_BOOST_DATE_TIME)
+       // || defined(ASIO_CPP11_DATE_TIME)
        // || defined(GENERATING_DOCUMENTATION)
 
 #endif // ASIO_DEADLINE_TIMER_HPP

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d1bba58a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/deadline_timer_service.hpp
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/deadline_timer_service.hpp
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/deadline_timer_service.hpp
index cac8ef9..990c2e7 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/deadline_timer_service.hpp
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/deadline_timer_service.hpp
@@ -18,6 +18,7 @@
 #include "asio/detail/config.hpp"
 
 #if defined(ASIO_HAS_BOOST_DATE_TIME) \
+  || defined(ASIO_CPP11_DATE_TIME) \
   || defined(GENERATING_DOCUMENTATION)
 
 #include <cstddef>
@@ -166,6 +167,7 @@ private:
 #include "asio/detail/pop_options.hpp"
 
 #endif // defined(ASIO_HAS_BOOST_DATE_TIME)
+       // || defined(ASIO_CPP11_DATE_TIME)
        // || defined(GENERATING_DOCUMENTATION)
 
 #endif // ASIO_DEADLINE_TIMER_SERVICE_HPP

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d1bba58a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/time_traits.hpp
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/time_traits.hpp
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/time_traits.hpp
index b3a5216..1a8c2df 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/time_traits.hpp
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/native/libhdfspp/third_party/asio-1.10.2/include/asio/time_traits.hpp
@@ -18,11 +18,14 @@
 #include "asio/detail/socket_types.hpp" // Must come before posix_time.
 
 #if defined(ASIO_HAS_BOOST_DATE_TIME) \
+  || defined(ASIO_CPP11_DATE_TIME) \
   || defined(GENERATING_DOCUMENTATION)
 
+#if defined(ASIO_HAS_BOOST_DATE_TIME)
 #include "asio/detail/push_options.hpp"
 #include <boost/date_time/posix_time/posix_time_types.hpp>
 #include "asio/detail/pop_options.hpp"
+#endif // defined(ASIO_HAS_BOOST_DATE_TIME)
 
 #include "asio/detail/push_options.hpp"
 
@@ -32,6 +35,8 @@ namespace asio {
 template <typename Time>
 struct time_traits;
 
+#if defined(ASIO_HAS_BOOST_DATE_TIME)
+
 /// Time traits specialised for posix_time.
 template <>
 struct time_traits<boost::posix_time::ptime>
@@ -78,11 +83,14 @@ struct time_traits<boost::posix_time::ptime>
   }
 };
 
+#endif // defined(ASIO_HAS_BOOST_DATE_TIME)
+
 } // namespace asio
 
 #include "asio/detail/pop_options.hpp"
 
 #endif // defined(ASIO_HAS_BOOST_DATE_TIME)
+       // || defined(ASIO_CPP11_DATE_TIME)
        // || defined(GENERATING_DOCUMENTATION)
 
 #endif // ASIO_TIME_TRAITS_HPP


Mime
View raw message