quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jianq...@apache.org
Subject [21/39] incubator-quickstep git commit: IWYU for DefaultsConfigurator.
Date Thu, 15 Dec 2016 03:51:01 GMT
IWYU for DefaultsConfigurator.


Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/54e0654b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/54e0654b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/54e0654b

Branch: refs/heads/min-max-stats
Commit: 54e0654bfb9a42553129428fa94f78535e2781f4
Parents: e666a81
Author: Zuyu Zhang <zuyuz@apache.org>
Authored: Sun Nov 20 23:30:42 2016 -0800
Committer: Zuyu Zhang <zuyuz@apache.org>
Committed: Sun Nov 20 23:30:42 2016 -0800

----------------------------------------------------------------------
 cli/DefaultsConfigurator.hpp | 28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/54e0654b/cli/DefaultsConfigurator.hpp
----------------------------------------------------------------------
diff --git a/cli/DefaultsConfigurator.hpp b/cli/DefaultsConfigurator.hpp
index 7450d88..4fd62ac 100644
--- a/cli/DefaultsConfigurator.hpp
+++ b/cli/DefaultsConfigurator.hpp
@@ -20,17 +20,23 @@
 #ifndef QUICKSTEP_CLI_DEFAULTS_CONFIGURATOR_HPP_
 #define QUICKSTEP_CLI_DEFAULTS_CONFIGURATOR_HPP_
 
+#include "storage/StorageConfig.h"  // For QUICKSTEP_HAVE_LIBNUMA.
+
+#ifdef QUICKSTEP_HAVE_LIBNUMA
+#include <numa.h>
+#endif  // QUICKSTEP_HAVE_LIBNUMA
+
+#include <cstddef>
 #include <thread>  // NOLINT(build/c++11)
+
+#ifdef QUICKSTEP_HAVE_LIBNUMA
 #include <unordered_map>
+#endif  // QUICKSTEP_HAVE_LIBNUMA
+
 #include <vector>
 
-#include "storage/StorageConfig.h"
 #include "utility/Macros.hpp"
 
-#ifdef QUICKSTEP_HAVE_LIBNUMA
-#include <numa.h>
-#endif
-
 namespace quickstep {
 
 /** \addtogroup CLI
@@ -60,12 +66,12 @@ class DefaultsConfigurator {
    *         have libnuma.
    **/
   static std::size_t GetNumNUMANodes() {
-  #ifdef QUICKSTEP_HAVE_LIBNUMA
+#ifdef QUICKSTEP_HAVE_LIBNUMA
     // Id of the maximum node.
     return numa_max_node() + 1;
-  #else
+#else
     return 1;
-  #endif
+#endif  // QUICKSTEP_HAVE_LIBNUMA
   }
 
   /**
@@ -80,7 +86,7 @@ class DefaultsConfigurator {
    **/
   static std::size_t GetNumNUMANodesCoveredByWorkers(const std::vector<int> &worker_cpu_affinities)
{
     if (!worker_cpu_affinities.empty()) {
-     #ifdef QUICKSTEP_HAVE_LIBNUMA
+#ifdef QUICKSTEP_HAVE_LIBNUMA
       // Key = NUMA node, value = whether there is at least one worker whose
       // affinity is set to a core on the given NUMA node.
       std::unordered_map<int, bool> any_worker_on_numa_node;
@@ -93,7 +99,7 @@ class DefaultsConfigurator {
         }
       }
       return any_worker_on_numa_node.size();
-     #endif
+#endif  // QUICKSTEP_HAVE_LIBNUMA
     }
     // When libnuma is not available, or worker affinities are not specified,
     // the default return value is 1.
@@ -108,9 +114,9 @@ class DefaultsConfigurator {
 
   DISALLOW_COPY_AND_ASSIGN(DefaultsConfigurator);
 };
+
 /** @} */
 
 }  // namespace quickstep
 
 #endif  // QUICKSTEP_CLI_DEFAULTS_CONFIGURATOR_HPP_
-


Mime
View raw message