Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
network-util.h
Go to the documentation of this file.
1 // Copyright 2013 Cloudera Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #include "common/status.h"
16 #include "gen-cpp/Types_types.h"
17 #include <vector>
18 
19 namespace impala {
20 
24 Status HostnameToIpAddrs(const std::string& name, std::vector<std::string>* addresses);
25 
28 bool FindFirstNonLocalhost(const std::vector<std::string>& addresses, std::string* addr);
29 
32 Status GetHostname(std::string* hostname);
33 
35 TNetworkAddress MakeNetworkAddress(const std::string& hostname, int port);
36 
41 TNetworkAddress MakeNetworkAddress(const std::string& address);
42 
44 bool IsWildcardAddress(const std::string& ipaddress);
45 
47 std::string TNetworkAddressToString(const TNetworkAddress& address);
48 
50 std::ostream& operator<<(std::ostream& out, const TNetworkAddress& hostport);
51 
52 }
string TNetworkAddressToString(const TNetworkAddress &address)
Utility method to print address as address:port.
bool FindFirstNonLocalhost(const vector< string > &addresses, string *addr)
Definition: network-util.cc:85
TNetworkAddress MakeNetworkAddress(const string &hostname, int port)
Definition: network-util.cc:96
bool IsWildcardAddress(const string &ipaddress)
Status HostnameToIpAddrs(const string &name, vector< string > *addresses)
Definition: network-util.cc:53
Status GetHostname(string *hostname)
Definition: network-util.cc:40
ostream & operator<<(ostream &os, const map< TNetworkAddress, llama::TAllocatedResource > &resources)
string name
Definition: cpu-info.cc:50