MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / get_sparse

Method get_sparse

tools/comdb2ar/db_wrap.cpp:91–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91bool DB_Wrap::get_sparse() const
92{
93 int rc;
94 struct stat statbuf;
95
96
97 rc = stat(m_filename.c_str(), &statbuf);
98 if (rc != 0)
99 {
100 std::ostringstream ss;
101 ss << "stat failed on " << m_filename;
102 throw Error(ss);
103 }
104
105
106
107 if (statbuf.st_size > (statbuf.st_blocks * statbuf.st_blksize))
108 return true;
109
110 return false;
111}
112
113bool DB_Wrap::get_swapped() const
114{

Callers 7

write_manifest_entryFunction · 0.45
serialise_fileFunction · 0.45
serialise_databaseFunction · 0.45
deserialise_databaseFunction · 0.45
update_treeFunction · 0.45
unpack_full_fileFunction · 0.45

Calls 2

ErrorClass · 0.85
statClass · 0.70

Tested by

no test coverage detected