[gutil] remove the rest of 'using ...' from headers

Removed the rest of 'using ...' directives from gutil header files.

This is a follow-up for 154b07de73ca2b949fceacef6798411dc4a3c6eb.
This changelist does not contain any functional changes.

Change-Id: I99e3fc83366fe7c7a5ddcc6e3b7b2028e3bc7a22
Reviewed-on: http://gerrit.cloudera.org:8080/7649
Reviewed-by: Alexey Serbin <aser...@cloudera.com>
Tested-by: Kudu Jenkins


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

Branch: refs/heads/master
Commit: 71454b69a5eb9b0e27bfa18af205ac92e4fe8d5a
Parents: bc73f88
Author: Alexey Serbin <ale...@apache.org>
Authored: Thu Aug 10 14:22:51 2017 -0700
Committer: Alexey Serbin <aser...@cloudera.com>
Committed: Fri Aug 11 00:08:22 2017 +0000

----------------------------------------------------------------------
 src/kudu/gutil/hash/hash.h               | 11 ++-----
 src/kudu/gutil/port.h                    |  3 --
 src/kudu/gutil/strings/escaping.h        | 45 ---------------------------
 src/kudu/gutil/strings/join.h            |  7 +----
 src/kudu/gutil/strings/serialize.cc      | 13 ++++----
 src/kudu/gutil/strings/serialize.h       | 15 +++++----
 src/kudu/gutil/strings/split.cc          |  3 +-
 src/kudu/gutil/strings/split.h           | 11 +++----
 src/kudu/master/catalog_manager.cc       |  2 +-
 src/kudu/server/tracing-path-handlers.cc |  2 +-
 src/kudu/tserver/tablet_server-test.cc   |  2 +-
 11 files changed, 26 insertions(+), 88 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/71454b69/src/kudu/gutil/hash/hash.h
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/hash/hash.h b/src/kudu/gutil/hash/hash.h
index 3c14f80..6fb61aa 100644
--- a/src/kudu/gutil/hash/hash.h
+++ b/src/kudu/gutil/hash/hash.h
@@ -78,11 +78,7 @@
 #include <string.h>
 #include <algorithm>
 #include <ext/hash_map>
-using __gnu_cxx::hash;
-using __gnu_cxx::hash_map;     // hacky way to make sure we import standard 
hash<> fns
 #include <ext/hash_set>
-using __gnu_cxx::hash;
-using __gnu_cxx::hash_set;
 #include <string>
 #include <utility>
 
@@ -98,7 +94,6 @@ using __gnu_cxx::hash_set;
 #include "kudu/gutil/hash/legacy_hash.h"
 #include "kudu/gutil/hash/string_hash.h"
 
-#include <ext/hash_set>
 namespace __gnu_cxx {
 
 
@@ -214,7 +209,6 @@ inline uint64 FingerprintCat(uint64 fp1, uint64 fp2) {
   return Hash64NumWithSeed(fp1, fp2);
 }
 
-#include <ext/hash_set>
 namespace __gnu_cxx {
 
 
@@ -308,8 +302,8 @@ template<> struct hash<std::string> {
 template<class First, class Second>
 struct hash<pair<First, Second> > {
   size_t operator()(const pair<First, Second>& p) const {
-    size_t h1 = hash<First>()(p.first);
-    size_t h2 = hash<Second>()(p.second);
+    size_t h1 = __gnu_cxx::hash<First>()(p.first);
+    size_t h2 = __gnu_cxx::hash<Second>()(p.second);
     // The decision below is at compile time
     return (sizeof(h1) <= sizeof(uint32)) ?
             Hash32NumWithSeed(h1, h2)
@@ -406,7 +400,6 @@ struct GoodFastHash<const std::basic_string<_CharT, 
_Traits, _Alloc> > {
 // functions are declared in this file.
 
 #if defined(__GNUC__)
-#include <ext/hash_set>
 namespace __gnu_cxx {
 
 extern template class hash_set<std::string>;

http://git-wip-us.apache.org/repos/asf/kudu/blob/71454b69/src/kudu/gutil/port.h
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/port.h b/src/kudu/gutil/port.h
index 6222cca..e1cbf7d 100644
--- a/src/kudu/gutil/port.h
+++ b/src/kudu/gutil/port.h
@@ -231,9 +231,6 @@ inline size_t strnlen(const char *s, size_t maxlen) {
   return maxlen;
 }
 
-namespace std {}  // Avoid error if we didn't see std.
-using namespace std;  // Just like VC++, we need a using here.
-
 // Doesn't exist on OSX; used in google.cc for send() to mean "no flags".
 #define MSG_NOSIGNAL 0
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/71454b69/src/kudu/gutil/strings/escaping.h
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/strings/escaping.h 
b/src/kudu/gutil/strings/escaping.h
index b94001b..0d1f574 100644
--- a/src/kudu/gutil/strings/escaping.h
+++ b/src/kudu/gutil/strings/escaping.h
@@ -627,49 +627,4 @@ void CleanStringLineEndings(std::string* str, bool 
auto_end_last_line);
 
 }  // namespace strings
 
-// The following functions used to be defined in strutil.h in the top-level
-// namespace, so we alias them here. Do not add new functions here.
-//
-//             Talk to him if you want to help.
-//
-// DEPRECATED(mec): Using these names in the global namespace is deprecated.
-// Use the strings:: names.
-
-using strings::EscapeStrForCSV;
-using strings::UnescapeCEscapeSequences;
-using strings::UnescapeCEscapeString;
-using strings::CEscapeString;
-using strings::CHexEscapeString;
-using strings::CEscape;
-using strings::CHexEscape;
-using strings::BackslashEscape;
-using strings::BackslashUnescape;
-using strings::QuotedPrintableUnescape;
-using strings::QEncodingUnescape;
-using strings::Base64Unescape;
-using strings::WebSafeBase64Unescape;
-using strings::CalculateBase64EscapedLen;
-using strings::Base64Escape;
-using strings::WebSafeBase64Escape;
-using strings::WebSafeBase64EscapeWithPadding;
-using strings::Base32Escape;
-using strings::Base32HexEscape;
-using strings::CalculateBase32EscapedLen;
-using strings::EightBase32DigitsToTenHexDigits;
-using strings::TenHexDigitsToEightBase32Digits;
-using strings::EightBase32DigitsToFiveBytes;
-using strings::FiveBytesToEightBase32Digits;
-using strings::int_to_hex_digit;
-using strings::int_to_lower_hex_digit;
-using strings::hex_digit_to_int;
-using strings::a2b_hex;
-using strings::a2b_bin;
-using strings::b2a_hex;
-using strings::b2a_bin;
-using strings::ShellEscape;
-using strings::ShellEscapeCommandLine;
-using strings::ByteStringFromAscii;
-using strings::ByteStringToAscii;
-using strings::CleanStringLineEndings;
-
 #endif  // STRINGS_ESCAPING_H_

http://git-wip-us.apache.org/repos/asf/kudu/blob/71454b69/src/kudu/gutil/strings/join.h
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/strings/join.h b/src/kudu/gutil/strings/join.h
index 1afc1f0..cb5e11d 100644
--- a/src/kudu/gutil/strings/join.h
+++ b/src/kudu/gutil/strings/join.h
@@ -9,12 +9,7 @@
 
 #include <stdio.h>
 #include <string.h>
-#include <ext/hash_map>
-using __gnu_cxx::hash;
-using __gnu_cxx::hash_map;  // Not used in this file.
-#include <ext/hash_set>
-using __gnu_cxx::hash;
-using __gnu_cxx::hash_set;  // Not used in this file.
+
 #include <iterator>
 #include <map>
 #include <string>

http://git-wip-us.apache.org/repos/asf/kudu/blob/71454b69/src/kudu/gutil/strings/serialize.cc
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/strings/serialize.cc 
b/src/kudu/gutil/strings/serialize.cc
index 5449ef7..1663d80 100644
--- a/src/kudu/gutil/strings/serialize.cc
+++ b/src/kudu/gutil/strings/serialize.cc
@@ -4,16 +4,11 @@
 
 #include <stddef.h>
 #include <stdlib.h>
+
 #include <ext/hash_map>
-using __gnu_cxx::hash;
-using __gnu_cxx::hash_map;
 #include <string>
-using std::string;
 #include <utility>
-using std::make_pair;
-using std::pair;
 #include <vector>
-using std::vector;
 
 #include "kudu/gutil/casts.h"
 #include "kudu/gutil/integral_types.h"
@@ -23,6 +18,12 @@ using std::vector;
 #include "kudu/gutil/strings/split.h"
 #include "kudu/gutil/hash/hash.h"
 
+using __gnu_cxx::hash_map;
+using std::make_pair;
+using std::pair;
+using std::string;
+using std::vector;
+
 // Convert a uint32 to a 4-byte string.
 string Uint32ToKey(uint32 u32) {
   string key;

http://git-wip-us.apache.org/repos/asf/kudu/blob/71454b69/src/kudu/gutil/strings/serialize.h
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/strings/serialize.h 
b/src/kudu/gutil/strings/serialize.h
index d8c5d0b..282e9eb 100644
--- a/src/kudu/gutil/strings/serialize.h
+++ b/src/kudu/gutil/strings/serialize.h
@@ -8,9 +8,8 @@
 #define STRINGS_SERIALIZE_H_
 
 #include <string.h>
+
 #include <ext/hash_map>
-using __gnu_cxx::hash;
-using __gnu_cxx::hash_map;
 #include <string>
 #include <utility>
 #include <vector>
@@ -324,15 +323,15 @@ bool DictionaryParse(const std::string& encoded_str,
 //   Note: these routines are not meant for use with very large dictionaries.
 //   They are written for convenience and not efficiency.
 // --------------------------------------------------------------------------
-std::string DictionaryInt32Encode(const hash_map<std::string, int32>* 
dictionary);
-std::string DictionaryInt64Encode(const hash_map<std::string, int64>* 
dictionary);
-std::string DictionaryDoubleEncode(const hash_map<std::string, double>* 
dictionary);
+std::string DictionaryInt32Encode(const __gnu_cxx::hash_map<std::string, 
int32>* dictionary);
+std::string DictionaryInt64Encode(const __gnu_cxx::hash_map<std::string, 
int64>* dictionary);
+std::string DictionaryDoubleEncode(const __gnu_cxx::hash_map<std::string, 
double>* dictionary);
 
-bool DictionaryInt32Decode(hash_map<std::string, int32>* dictionary,
+bool DictionaryInt32Decode(__gnu_cxx::hash_map<std::string, int32>* dictionary,
                            const std::string& encoded_str);
-bool DictionaryInt64Decode(hash_map<std::string, int64>* dictionary,
+bool DictionaryInt64Decode(__gnu_cxx::hash_map<std::string, int64>* dictionary,
                            const std::string& encoded_str);
-bool DictionaryDoubleDecode(hash_map<std::string, double>* dictionary,
+bool DictionaryDoubleDecode(__gnu_cxx::hash_map<std::string, double>* 
dictionary,
                             const std::string& encoded_str);
 
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/71454b69/src/kudu/gutil/strings/split.cc
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/strings/split.cc b/src/kudu/gutil/strings/split.cc
index f8de413..3262e6b 100644
--- a/src/kudu/gutil/strings/split.cc
+++ b/src/kudu/gutil/strings/split.cc
@@ -19,8 +19,9 @@
 #include "kudu/gutil/strings/util.h"
 #include "kudu/gutil/hash/hash.h"
 
+using __gnu_cxx::hash_map;
+using __gnu_cxx::hash_set;
 using std::back_insert_iterator;
-using std::iterator_traits;
 using std::map;
 using std::numeric_limits;
 using std::pair;

http://git-wip-us.apache.org/repos/asf/kudu/blob/71454b69/src/kudu/gutil/strings/split.h
----------------------------------------------------------------------
diff --git a/src/kudu/gutil/strings/split.h b/src/kudu/gutil/strings/split.h
index cdf59aa..4b32c84 100644
--- a/src/kudu/gutil/strings/split.h
+++ b/src/kudu/gutil/strings/split.h
@@ -21,13 +21,10 @@
 #define STRINGS_SPLIT_H_
 
 #include <stddef.h>
+
 #include <algorithm>
 #include <ext/hash_map>
-using __gnu_cxx::hash;
-using __gnu_cxx::hash_map;
 #include <ext/hash_set>
-using __gnu_cxx::hash;
-using __gnu_cxx::hash_set;
 #include <iterator>
 #include <map>
 #include <set>
@@ -663,7 +660,7 @@ void SplitStringPieceToVector(const StringPiece& full,
 void SplitStringUsing(const std::string& full, const char* delimiters,
                       std::vector<std::string>* result);
 void SplitStringToHashsetUsing(const std::string& full, const char* delimiters,
-                               hash_set<std::string>* result);
+                               __gnu_cxx::hash_set<std::string>* result);
 void SplitStringToSetUsing(const std::string& full, const char* delimiters,
                            std::set<std::string>* result);
 // The even-positioned (0-based) components become the keys for the
@@ -674,7 +671,7 @@ void SplitStringToSetUsing(const std::string& full, const 
char* delimiters,
 void SplitStringToMapUsing(const std::string& full, const char* delim,
                            std::map<std::string, std::string>* result);
 void SplitStringToHashmapUsing(const std::string& full, const char* delim,
-                               hash_map<std::string, std::string>* result);
+                               __gnu_cxx::hash_map<std::string, std::string>* 
result);
 
 // ----------------------------------------------------------------------
 // SplitStringAllowEmpty()
@@ -728,7 +725,7 @@ void SplitStringWithEscapingToSet(const std::string& full,
                                   std::set<std::string>* result);
 void SplitStringWithEscapingToHashset(const std::string& full,
                                       const strings::CharSet& delimiters,
-                                      hash_set<std::string>* result);
+                                      __gnu_cxx::hash_set<std::string>* 
result);
 
 // ----------------------------------------------------------------------
 // SplitStringIntoNPiecesAllowEmpty()

http://git-wip-us.apache.org/repos/asf/kudu/blob/71454b69/src/kudu/master/catalog_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/catalog_manager.cc 
b/src/kudu/master/catalog_manager.cc
index c198f4e..d6f4a51 100644
--- a/src/kudu/master/catalog_manager.cc
+++ b/src/kudu/master/catalog_manager.cc
@@ -4114,7 +4114,7 @@ void CatalogManager::DumpState(std::ostream* out) const {
     *out << "Orphaned tables (in by-name map, but not id map):\n";
     for (const TableInfoMap::value_type& e : names_copy) {
       *out << e.second->id() << ":\n";
-      *out << "  name: \"" << CHexEscape(e.first) << "\"\n";
+      *out << "  name: \"" << strings::CHexEscape(e.first) << "\"\n";
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/kudu/blob/71454b69/src/kudu/server/tracing-path-handlers.cc
----------------------------------------------------------------------
diff --git a/src/kudu/server/tracing-path-handlers.cc 
b/src/kudu/server/tracing-path-handlers.cc
index d8ada6d..dc3269c 100644
--- a/src/kudu/server/tracing-path-handlers.cc
+++ b/src/kudu/server/tracing-path-handlers.cc
@@ -66,7 +66,7 @@ namespace {
 Status ParseBase64JsonRequest(const string& json_base64,
                               rapidjson::Document* doc) {
   string json_str;
-  if (!Base64Unescape(json_base64, &json_str)) {
+  if (!strings::Base64Unescape(json_base64, &json_str)) {
     return Status::InvalidArgument("Invalid base64-encoded JSON");
   }
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/71454b69/src/kudu/tserver/tablet_server-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_server-test.cc 
b/src/kudu/tserver/tablet_server-test.cc
index 63e4f8a..001100f 100644
--- a/src/kudu/tserver/tablet_server-test.cc
+++ b/src/kudu/tserver/tablet_server-test.cc
@@ -230,7 +230,7 @@ TEST_F(TabletServerTest, TestWebPages) {
   string enable_req_json = "{\"categoryFilter\":\"*\", 
\"useContinuousTracing\": \"true\","
     " \"useSampling\": \"false\"}";
   string req_b64;
-  Base64Escape(enable_req_json, &req_b64);
+  strings::Base64Escape(enable_req_json, &req_b64);
 
   for (bool compressed : {false, true}) {
     
ASSERT_OK(c.FetchURL(Substitute("http://$0/tracing/json/begin_recording?$1";,

Reply via email to