Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

void Impala::Application::DataTransfer::TransferLocalToServer ( std::string  localFilename,
std::string  serverFilename 
)

Definition at line 23 of file mainDataTransfer.cpp.

References Impala::Util::IOBuffer::AvailableInt32(), BUF_SIZE, Impala::Util::Database::GetInstance(), ILOG_INFO, ILOG_VAR, Impala::Util::IOBuffer::Read(), and Impala::Util::IOBuffer::Write().

Referenced by mainDataTransfer().

00024 {
00025     ILOG_VAR(Impala.Application.DataTransfer.TransferLocalToServer);
00026 
00027     // copy local file to its final destination
00028     Util::IOBuffer* zip = new Util::IOBufferFile(localFilename, true, false);
00029     Impala::Util::Database& database(Impala::Util::Database::GetInstance());
00030     Util::IOBuffer* destination = database.GetIOBuffer(serverFilename, false, false, "", zip->AvailableInt32());
00031     ILOG_INFO("File to copy to dataserver has " << zip->AvailableInt32() << " bytes");
00032     static unsigned char buffer[BUF_SIZE];
00033     while(true) 
00034     {
00035         int bytesread = zip->Read(buffer, BUF_SIZE);
00036         if(bytesread == 0) break;
00037         destination->Write(buffer, bytesread);
00038     }
00039     delete zip;
00040     // this will force a write through a channel, if needed
00041     delete destination;
00042 }

Here is the call graph for this function:


Generated on Fri Mar 19 10:39:04 2010 for ImpalaSrc by  doxygen 1.5.1