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