本文整理汇总了C++中stripedio::managed_pwritea_now方法的典型用法代码示例。如果您正苦于以下问题:C++ stripedio::managed_pwritea_now方法的具体用法?C++ stripedio::managed_pwritea_now怎么用?C++ stripedio::managed_pwritea_now使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stripedio
的用法示例。
在下文中一共展示了stripedio::managed_pwritea_now方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: commit
void commit(bool all) {
if (edgedata == NULL || only_adjacency) return;
assert(is_loaded);
metrics_entry cm = m.start_time();
/**
* This is an optimization that is relevant only if memory shard
* has been used in a case where only out-edges are considered.
* Out-edges are in a continuous "window", while in-edges are
* scattered all over the shard
*/
if (all) {
iomgr->managed_pwritea_now(edata_iosession, &edgedata, edatafilesize, 0);
} else {
size_t last = streaming_offset_edge_ptr;
if (last == 0){
// rollback
last = edatafilesize;
}
char * bufp = ((char*)edgedata + range_start_edge_ptr);
iomgr->managed_pwritea_now(edata_iosession, &bufp, last - range_start_edge_ptr, range_start_edge_ptr);
}
m.stop_time(cm, "memshard_commit");
iomgr->managed_release(adj_session, &adjdata);
iomgr->managed_release(edata_iosession, &edgedata);
is_loaded = false;
}
示例2: save
void save() {
if (!use_mmap) {
size_t datasize = (vertex_en - vertex_st + 1) * sizeof(degree);
size_t datastart = vertex_st * sizeof(degree);
iomgr->managed_pwritea_now(filedesc, &loaded_chunk, datasize, datastart);
}
}
示例3: write_block
void write_block(vdblock &block) {
int realsize;
uint8_t * outdata;
block.dblock->write(&outdata, realsize);
std::string blockfname = blockfilename(block.blockid);
iomgr->managed_pwritea_now(block.fd, &outdata, realsize, 0); /* Need to write whole block in the compressed regime */
write_block_uncompressed_size(blockfname, realsize);
}
示例4: save
/**
* Saves the current chunk of vertex values
*/
virtual void save(bool async=false) {
if (!use_mmap) {
assert(loaded_chunk != NULL);
size_t datasize = (vertex_en - vertex_st + 1) * sizeof(VertexDataType);
size_t datastart = vertex_st * sizeof(VertexDataType);
if (async) {
iomgr->managed_pwritea_async(filedesc, &loaded_chunk, datasize, datastart, false);
} else {
iomgr->managed_pwritea_now(filedesc, &loaded_chunk, datasize, datastart);
}
} else {
// do nothing
}
}