286 const int64_t requestedSuperTile = requestedTile /
fShrinkFactor;
289 const int64_t requestedSubTile = requestedTile %
fShrinkFactor;
296 const bool isNextTile = requestedTile==currentTile+1 || isFirstTile;
301 if (requestedTile!=currentTile || isFirstTile)
306 std::vector<size_t> offsets =
fTileOffsets[requestedSuperTile];
311 if (!isNextTile || isFirstTile)
317 for (uint32_t k=0; k<requestedSubTile; k++)
329 const int64_t subTileStart = tellg() -
fHeapOff;
337 size_t currentTileSize = 0;
341 if (requestedSubTile>0)
361 offsets[
i+1] = offsets[
i];
374 read(destBuffer, currentTileSize);
383 memset(destBuffer+currentTileSize, 0,
fCompressedBuffer.size()-currentTileSize-offset);
388 if (isNextTile &&
fCopy.is_open() &&
fCopy.good())
392 clear(rdstate()|std::ios::badbit);
396 clear(rdstate()|std::ios::badbit);
418 memcpy(dest, src, it->bytes);
425 for (
char *elem=buffer; elem<buffer+it->bytes; elem+=it->size)
429 memcpy(dest, src, it->size);
436 clear(rdstate()|std::ios::badbit);
438 std::ostringstream
str;
439 str <<
"Unkown column ordering scheme found (i=" << i <<
", " <<
fColumnOrdering[
i] <<
")";
441 throw std::runtime_error(str.str());
size_t fNumRowsPerTile
Number of rows per compressed tile.
std::vector< char > fTransposedBuffer
intermediate buffer to transpose the rows
streamoff fHeapOff
offset from the beginning of the file of the binary data
size_t GetNumRows() const
SortedColumns sorted_cols
void InitCompressionReading()
std::vector< char > fColumnOrdering
ordering of the column's rows. Can change from tile to tile.
std::vector< char > fCompressedBuffer
compressed rows
std::vector< std::vector< std::pair< int64_t, int64_t > > > fCatalog
Catalog, i.e. the main table that points to the compressed data.
std::vector< size_t > fTileSize
size in bytes of each compressed tile
bool UncompressBuffer(const std::vector< size_t > &offsets, const uint32_t &thisRoundNumRows, const uint32_t offset)
std::vector< std::vector< size_t > > fTileOffsets
offset from start of tile of a given compressed column
int64_t fCurrentRow
current row in memory signed because we need -1
streamoff fHeapFromDataStart
offset from the beginning of the data table
bool add(const char *buf, size_t len, bool big_endian=true)
size_t fShrinkFactor
shrink factor
std::vector< char > fBuffer
store the uncompressed rows