Definition at line 91 of file VirtualFeatureTableIOBufferWriter.h. References Impala::Util::IOBuffer::GetPosition(), ILOG_ERROR, IMPALA_VERSION_STR, mBaseOffset, mIOBuffer, mMatrix, mOutputElemSize, mOwnBuffer, mQuidsOffset, mSize, mVectorLength, Impala::Core::Array::SetVal(), SVN_VERSION_STR, Impala::Util::IOBuffer::Write(), and Impala::Core::Array::WriteRaw(). Referenced by VirtualFeatureTableIOBufferWriter(). 00093 { 00094 mSize = nrVectors; 00095 mVectorLength = vectorLength; 00096 mIOBuffer = buffer; 00097 mOwnBuffer = ownBuffer; 00098 mOutputElemSize = (write32) ? 4 : 8; 00099 00100 mBaseOffset = buffer->GetPosition(); 00101 mQuidsOffset = mBaseOffset + 1024 + 128; 00102 00103 // construct table header 00104 const int TABLEHEADERSIZE = 1024; 00105 std::ostringstream oss; 00106 oss << "incompletexxxxxxxx: 2, columns: 2, size: " << nrVectors << "\n"; 00107 oss << "column1: object\ncolumn2: kerneldata\ninfo: no info\n"; 00108 std::time_t rawtime; 00109 std::time ( &rawtime ); 00110 oss << "computedon: " << std::ctime (&rawtime); // ctime comes with \n 00111 oss << "computedby: Impala " << IMPALA_VERSION_STR 00112 << " (svnversion " << SVN_VERSION_STR << ") compiled " 00113 << __DATE__ << " " << __TIME__ << "\n"; 00114 while(oss.tellp() < TABLEHEADERSIZE) 00115 oss << ' '; 00116 oss.seekp(TABLEHEADERSIZE - 1, std::ios::beg); 00117 oss << '\n'; 00118 00119 // write the table header 00120 mIOBuffer->Write(oss.str().c_str(), TABLEHEADERSIZE); 00121 00122 // write footer 00123 Int64 footer[16]; 00124 footer[0] = 0x6F66616C61706D69LL; 00125 footer[1] = 0x000000017265746FLL; 00126 footer[2] = 2; 00127 footer[3] = nrVectors; 00128 footer[4] = mQuidsOffset; 00129 footer[5] = footer[4] + 200 + nrVectors * sizeof(Int64); 00130 footer[6] = footer[5] + nrVectors * vectorLength * mOutputElemSize; 00131 for (int i=7 ; i<14 ; i++) 00132 footer[i] = footer[6]; 00133 footer[14] = 0; 00134 footer[15] = 0; 00135 mIOBuffer->Write(footer, sizeof(Int64) * 16); 00136 00137 // write quid space 00138 Array::Array2dScalarUInt64 quids(nrVectors, 1, 0, 0); 00139 Array::SetVal(&quids, 0); 00140 Array::WriteRaw(&quids, mIOBuffer, 1); 00141 00142 if (mIOBuffer->GetPosition() != footer[5]) 00143 ILOG_ERROR("Should be the same!"); 00144 00145 mMatrix = new Matrix::VirtualMatrixIOBufferWriter 00146 (mSize, mVectorLength, mIOBuffer, false, write32, true); 00147 }
Here is the call graph for this function:
|