Пример #1
0
boost::optional<std::string>
PythonClient::get_cork_id(const std::string& nspace) const
{
    // Only for the side effect of checking namespace existence. YUCK!
    get_table_(nspace);

    vd::MDSMetaDataBackend backend(config_,
                                   be::Namespace(nspace),
                                   timeout_);
    const boost::optional<yt::UUID> cork(backend.lastCorkUUID());
    if (cork != boost::none)
    {
        return cork->str();
    }
    else
    {
        return boost::none;
    }
}
Пример #2
0
void
VolumeDriverError::report(events::VolumeDriverErrorCode code,
                          const std::string& desc,
                          const boost::optional<VolumeId>& volume) noexcept
{
    try
    {
        events::Event ev;
        auto msg = ev.MutableExtension(events::volumedriver_error);
        msg->set_code(code);
        msg->set_info(desc);
        if (volume)
        {
            msg->set_volume_name(volume->str());
        }

        report(ev);
    }
    CATCH_STD_ALL_LOG_IGNORE("Failed to report event code " << code <<
                             ", volume " << volume <<
                             ", info " << desc);

    TODO("AR: the logging could emit an exception, violating noexcept?");
}