Definition at line 1904 of file mainUtil.cpp. References Impala::Util::Channel::Buffer(), Impala::Util::ChannelPool::Get(), Impala::CmdOptions::GetArg(), Impala::CmdOptions::GetInstance(), Impala::CmdOptions::GetNrArg(), Impala::CmdOptions::GetString(), ILOG_ERROR, ILOG_INFO, ILOG_VAR, Impala::Util::ChannelPool::Instance(), Impala::Util::Channel::LastSendHadError(), Impala::Util::Channel::SendRequest(), and Impala::Util::Channel::Valid(). Referenced by mainUtil(). 01905 { 01906 typedef Impala::Util::Channel Channel; 01907 typedef Impala::Util::ChannelPool ChannelPool; 01908 01909 ILOG_VAR(Impala.Application.Util.DoPing); 01910 CmdOptions& options = CmdOptions::GetInstance(); 01911 if (options.GetNrArg() < 2) 01912 { 01913 ILOG_ERROR("Need at least 2 arguments"); 01914 return; 01915 } 01916 String hostName = options.GetArg(1); 01917 String passFile = options.GetString("passwordFile"); 01918 Channel* channel = ChannelPool::Instance().Get(hostName, passFile);; 01919 if (! (channel && channel->Valid())) 01920 { 01921 ILOG_ERROR("Could not connect to server"); 01922 return; 01923 } 01924 char* buf = channel->Buffer(); 01925 sprintf(buf, "ping\0"); 01926 channel->SendRequest(strlen(buf)+1); 01927 if (channel->LastSendHadError()) 01928 { 01929 ILOG_ERROR("Failed to send message"); 01930 return; 01931 } 01932 ILOG_INFO("Server OK"); 01933 }
Here is the call graph for this function: ![]()
|