close an open file.
496 int64_t heap_size = 0;
497 int64_t compressed_offset = 0;
502 for (uint32_t j=0; j<it->size(); j++)
504 heap_size += (*it)[j].first;
505 (*it)[j].second = compressed_offset;
506 compressed_offset += (*it)[j].first;
507 if ((*it)[j].first == 0)
521 const uint32_t total_catalog_width = 2*
sizeof(int64_t)*
fTable.
num_cols;
523 SetInt(
"THEAP", total_num_tiles_written*total_catalog_width);
524 SetInt(
"NAXIS1", total_catalog_width);
525 SetInt(
"NAXIS2", total_num_tiles_written);
529 SetFloat(
"ZRATIO", compression_ratio);
534 SetInt(
"PCOUNT", heap_size,
"size of special data area");
544 setstate(ios_base::failbit);
549 if (shrink_factor != 1)
555 std::ostringstream sout;
556 sout <<
"Checksum (" << std::hex << checksm.
val() <<
") invalid.";
558 throw std::runtime_error(sout.str());
bool SetInt(const std::string &key, int64_t i, const std::string &comment="")
Checksum UpdateHeaderChecksum()
uint32_t fNumRowsPerTile
Number of rows per tile.
uint32_t fCatalogSize
Actual catalog size (.size() is slow on large lists)
Checksum fRawSum
Raw sum (specific to FACT)
Checksum fCatalogSum
Checksum of the catalog.
std::vector< Queue< CompressionTarget > > fCompressionQueues
Processing queues (=threads)
bool SetStr(const std::string &key, std::string s, const std::string &comment="")
uint32_t ShrinkCatalog()
Shrinks a catalog that is too long to fit into the reserved space at the beginning of the file...
Queue< WriteTarget, QueueMin< WriteTarget > > fWriteToDiskQueue
Writing queue (=thread)
int fErrno
propagate errno to main thread
bool SetFloat(const std::string &key, double f, int p, const std::string &comment="")
uint32_t fRealRowWidth
Width in bytes of one uncompressed row.
std::exception_ptr fThreadsException
exception pointer to store exceptions coming from the threads
CatalogType fCatalog
Catalog for this file.
CompressionTarget InitNextCompression()
std::shared_ptr< char > fSmartBuffer
Smart pointer to the buffer where the incoming rows are written.