returns number of bytes read
Reimplemented from Impala::Util::IOBuffer. Definition at line 76 of file IOBufferChannel.h. References Impala::Util::Channel::Buffer(), Impala::Util::Channel::DATA_BUFFER_SIZE, Impala::Util::IOBuffer::GetPosition(), Impala::Util::Channel::LastSendHadError(), mId, mMyChannel, Impala::Util::Channel::SendRequest(), and SetPosition(). Referenced by DoNativeTypeRead(), Impala::Util::FileCopyRemoteToLocal(), Gets(), and ReadLine(). 00077 { 00078 char* chBuf = mMyChannel->Buffer(); 00079 Int64 nrRead = 0; 00080 char* bufPtr = (char*) buf; 00081 while (nrRead < bytesToRead) 00082 { 00083 int nrData = Min<Int64>(Channel::DATA_BUFFER_SIZE, bytesToRead); 00084 sprintf(chBuf, "readfilebuffer %d %d\0", mId, nrData); 00085 int len = mMyChannel->SendRequest(strlen(chBuf)+1); 00086 if (mMyChannel->LastSendHadError()) 00087 return 0; 00088 memcpy(bufPtr + nrRead, chBuf, len); 00089 if (len == 0) 00090 break; 00091 nrRead += len; 00092 } 00093 SetPosition(GetPosition() + nrRead); 00094 return nrRead; 00095 }
Here is the call graph for this function:
|