本文整理汇总了C++中SharedVolumePtr::getClusterSize方法的典型用法代码示例。如果您正苦于以下问题:C++ SharedVolumePtr::getClusterSize方法的具体用法?C++ SharedVolumePtr::getClusterSize怎么用?C++ SharedVolumePtr::getClusterSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharedVolumePtr
的用法示例。
在下文中一共展示了SharedVolumePtr::getClusterSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wrns_parent
TEST_P(SnapshotRestoreTest, snapshot_restoration_on_a_clone)
{
const auto wrns_parent(make_random_namespace());
const std::string parent_name(wrns_parent->ns().str());
SharedVolumePtr parent = newVolume(VolumeId(parent_name),
be::Namespace(parent_name));
const std::string pattern1("before-parent-snapshot");
writeToVolume(*parent,
0,
parent->getClusterSize(),
pattern1);
const SnapshotName parent_snap("parent-snapshot");
parent->createSnapshot(parent_snap);
waitForThisBackendWrite(*parent);
const auto wrns_clone(make_random_namespace());
const std::string clone_name(wrns_clone->ns().str());
SharedVolumePtr clone = createClone(clone_name,
be::Namespace(clone_name),
be::Namespace(parent_name),
parent_snap);
const std::string pattern2("before-clone-snapshot");
writeToVolume(*clone,
0,
clone->getClusterSize(),
pattern2);
const SnapshotName clone_snap("clone-snapshot");
clone->createSnapshot(clone_snap);
waitForThisBackendWrite(*clone);
const std::string pattern3("after-clone-snapshot");
writeToVolume(*clone,
0,
clone->getClusterSize(),
pattern3);
checkVolume(*clone,
0,
clone->getClusterSize(),
pattern3);
restoreSnapshot(*clone,
clone_snap);
checkVolume(*clone,
0,
clone->getClusterSize(),
pattern2);
}
示例2: newVolume
TEST_P(BigReadWriteTest, bigReadsOnFull)
{
auto ns_ptr = make_random_namespace();
SharedVolumePtr v = newVolume(VolumeId("volume1"),
ns_ptr->ns());
SCOPED_BLOCK_BACKEND(*v);
size_t csz = v->getClusterSize();
size_t lba_size = v->getLBASize();
const std::string pattern(csz,'a');
size_t scoMul = v->getSCOMultiplier();
for(size_t i = 0;i < 50*scoMul; ++i)
{
writeToVolume(*v, i* csz / lba_size, csz, pattern);
}
// Stop here to manually delete sco's to check error handling
for(size_t i = 0; i < scoMul; ++i)
{
checkVolume(*v,0, csz*scoMul, pattern);
}
}
示例3: wrns
void
test_after_tlog(bool failover)
{
const auto wrns(make_random_namespace());
SharedVolumePtr v = make_volume(*wrns);
const std::string pattern1("Hairdresser On Fire");
{
SCOPED_BLOCK_BACKEND(*v);
writeToVolume(*v,
v->getClusterMultiplier() * CachePage::capacity(),
v->getClusterSize(),
pattern1);
}
v->scheduleBackendSync();
waitForThisBackendWrite(*v);
const std::string pattern2("Such A Little Thing Makes Such A Big Difference");
writeToVolume(*v,
2 * v->getClusterMultiplier() * CachePage::capacity(),
v->getClusterSize(),
pattern2);
const auto ncfgs(node_configs());
if (failover)
{
mds_manager_->stop_one(ncfgs[0]);
checkVolume(*v,
0,
v->getClusterSize(),
"");
}
else
{
const std::vector<MDSNodeConfig> ncfgs2{ ncfgs[1],
ncfgs[0] };
v->updateMetaDataBackendConfig(MDSMetaDataBackendConfig(ncfgs2,
ApplyRelocationsToSlaves::T));
}
check_config(*v,
ncfgs,
true);
checkVolume(*v,
v->getClusterMultiplier() * CachePage::capacity(),
v->getClusterSize(),
pattern1);
checkVolume(*v,
2 * v->getClusterMultiplier() * CachePage::capacity(),
v->getClusterSize(),
pattern2);
destroyVolume(v,
DeleteLocalData::F,
RemoveVolumeCompletely::F);
v = localRestart(wrns->ns());
check_config(*v,
ncfgs,
true);
checkVolume(*v,
v->getClusterMultiplier() * CachePage::capacity(),
v->getClusterSize(),
pattern1);
checkVolume(*v,
2 * v->getClusterMultiplier() * CachePage::capacity(),
v->getClusterSize(),
pattern2);
}