MCPcopy Create free account
hub / github.com/dmlc/xgboost / WriteCache

Method WriteCache

src/data/sparse_page_source.h:349–367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347 }
348
349 void WriteCache() {
350 CHECK(!cache_info_->written);
351 common::Timer timer;
352 timer.Start();
353 auto fmt{this->CreatePageFormat(this->param_)};
354
355 auto name = cache_info_->ShardName();
356 std::unique_ptr<typename FormatStreamPolicy::WriterT> fo{
357 this->CreateWriter(StringView{name}, this->Iter())};
358 auto bytes = fmt->Write(*page_, fo.get());
359
360 timer.Stop();
361 if (bytes != InvalidPageSize()) {
362 // Not entirely accurate, the kernel doesn't have to flush the data.
363 LOG(INFO) << common::HumanMemUnit(bytes) << " written in " << timer.ElapsedSeconds()
364 << " seconds.";
365 cache_info_->Push(bytes);
366 }
367 }
368
369 virtual void Fetch() = 0;
370

Callers 4

FetchMethod · 0.80
FetchMethod · 0.80
FetchMethod · 0.80
FetchMethod · 0.80

Calls 12

IterMethod · 0.95
InvalidPageSizeFunction · 0.85
HumanMemUnitFunction · 0.85
ShardNameMethod · 0.80
ElapsedSecondsMethod · 0.80
StartMethod · 0.45
CreatePageFormatMethod · 0.45
CreateWriterMethod · 0.45
WriteMethod · 0.45
getMethod · 0.45
StopMethod · 0.45
PushMethod · 0.45

Tested by

no test coverage detected