Definition at line 123 of file ImageArchiveFile.h. References Impala::Util::DatabaseReadNative(), Impala::Util::DatabaseWriteNative(), Impala::Util::IOBufferFile::FileExists(), Impala::CmdOptions::GetInstance(), Impala::Util::Database::GetIOBuffer(), ILOG_ERROR, ILOG_INFO, mFileOffset, and mIOBuffer. Referenced by ImageArchiveFile(). 00124 { 00125 mIOBuffer = 0; 00126 00127 if (db == 0) 00128 { 00129 ILOG_ERROR("No database given"); 00130 return; 00131 } 00132 if (fileName.empty()) 00133 { 00134 ILOG_ERROR("Empty fileName"); 00135 return; 00136 } 00137 00138 // fileName must be a resolved (absolute) file path 00139 mIOBuffer = db->GetIOBuffer(fileName, true, useMemory, "", 0, true); 00140 //mIOBuffer = db->GetIOBuffer(fileName, true, useMemory, ""); 00141 if (!mIOBuffer) 00142 return; 00143 00144 const String idxPath = fileName + ".idx"; 00145 if (CmdOptions::GetInstance().GetString("dataServer").empty()) 00146 { 00147 // SK,Oct'08: This approach does currently not work with a dataserver 00148 // (the path would be re-resolved at the dataserver side); 00149 // hence with dataservers we assume the presence of an index file. 00150 if (!Util::IOBufferFile::FileExists(idxPath)) 00151 { 00152 ReadRawListVarIndex<Array2dScalarUInt8>(mFileOffset, mIOBuffer); 00153 ILOG_INFO("saving index [" + idxPath + "]"); 00154 Util::DatabaseWriteNative(idxPath, db, mFileOffset.begin(), 00155 mFileOffset.end()); 00156 return; 00157 } 00158 } 00159 00160 Util::IOBuffer* indexBuffer = db->GetIOBuffer(idxPath, true, true, ""); 00161 Util::DatabaseReadNative(std::back_inserter(mFileOffset), indexBuffer); 00162 delete indexBuffer; 00163 if (mFileOffset.size() == 0) 00164 ILOG_ERROR("Empty .idx file"); 00165 }
Here is the call graph for this function:
|