Definition at line 20 of file mainFileClient.cpp. References Impala::Util::Channel::Buffer(), Impala::Util::Channel::DATA_BUFFER_SIZE, gChannel, and Impala::Util::Channel::SendRequest(). Referenced by mainFileClient(). 00021 { 00022 std::cout << "Getting " << fileName << " ... " << std::flush; 00023 Timer timer(1); 00024 char* buf = gChannel->Buffer(); 00025 sprintf(buf, "get %s\0", fileName.c_str()); 00026 int len = gChannel->SendRequest(strlen(buf)+1); 00027 buf[len] = 0; 00028 if ((len > 5) && (strncmp(buf, "ERROR", 5) == 0)) 00029 return; 00030 IOBufferFile ioBuf(fileName, false, false); 00031 ioBuf.Write(buf, len); 00032 double b = len; 00033 while (len == Channel::DATA_BUFFER_SIZE) 00034 { 00035 sprintf(buf, "getmore\0"); 00036 len = gChannel->SendRequest(strlen(buf)+1); 00037 buf[len] = 0; 00038 ioBuf.Write(buf, len); 00039 b += len; 00040 std::cout << "#" << std::flush; 00041 } 00042 double timeVal = timer.SplitTime(); 00043 double bps = b / (1024.0*1024.0 * timeVal); 00044 std::cout << " done (in " << timeVal << " sec = " << bps << " Mb/sec)" 00045 << std::endl; 00046 }
Here is the call graph for this function:
|