183 std::vector<char> readBuf(16);
186 const streampos catalogStart = tellg();
194 read(readBuf.data(), 2*
sizeof(int64_t));
197 int64_t tempValues[2] = {0,0};
198 revcpy<8>(
reinterpret_cast<char*
>(tempValues), readBuf.data(), 2);
199 if (tempValues[0] < 0 || tempValues[1] < 0)
201 clear(rdstate()|std::ios::badbit);
203 throw std::runtime_error(
"Negative value in the catalog");
205 gLog <<
___err___ <<
"ERROR - negative value in the catalog" << std::endl;
210 fCatalog[
i].emplace_back(tempValues[0], tempValues[1]);
222 clear(rdstate()|std::ios::badbit);
224 throw std::runtime_error(
"Rows per tile and shrink factor do not match");
226 gLog <<
___err___ <<
"ERROR - Rows per tile and shrink factor do not match" << std::endl;
247 if (!
fCopy.is_open())
255 std::vector<char> buf(catSize);
256 read(buf.data(), catSize);
258 fCopy.write(buf.data(), catSize);
260 clear(rdstate()|std::ios::badbit);
size_t fNumRowsPerTile
Number of rows per compressed tile.
bool HasKey(const std::string &key) const
uint64_t GetUInt(const std::string &key) const
streamoff fHeapOff
offset from the beginning of the file of the binary data
int64_t second
offset of this column in the tile, from the start of the heap area
std::vector< std::vector< std::pair< int64_t, int64_t > > > fCatalog
Catalog, i.e. the main table that points to the compressed data.
streamoff GetHeapShift() const
std::vector< size_t > fTileSize
size in bytes of each compressed tile
std::vector< std::vector< size_t > > fTileOffsets
offset from start of tile of a given compressed column
size_t fNumTiles
Total number of tiles.
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