renamed cloneObject to clone in IExternalLoadable [#CLICKHOUSE-3305]

This commit is contained in:
Nikolai Kochetov 2017-10-26 16:36:01 +03:00
parent c3d104f53b
commit 2e6b1dfd92
5 changed files with 5 additions and 12 deletions

View File

@ -469,7 +469,7 @@ bool CatBoostModel::isModified() const
return true; return true;
} }
std::unique_ptr<IExternalLoadable> CatBoostModel::cloneObject() const std::unique_ptr<IExternalLoadable> CatBoostModel::clone() const
{ {
return std::make_unique<CatBoostModel>(name, model_path, lib_path, lifetime, float_features_count, cat_features_count); return std::make_unique<CatBoostModel>(name, model_path, lib_path, lifetime, float_features_count, cat_features_count);
} }

View File

@ -55,7 +55,7 @@ public:
bool isModified() const override; bool isModified() const override;
std::unique_ptr<IExternalLoadable> cloneObject() const override; std::unique_ptr<IExternalLoadable> clone() const override;
std::exception_ptr getCreationException() const override { return creation_exception; } std::exception_ptr getCreationException() const override { return creation_exception; }

View File

@ -41,8 +41,6 @@ struct IDictionaryBase : public IExternalLoadable
virtual bool isCached() const = 0; virtual bool isCached() const = 0;
virtual std::unique_ptr<IExternalLoadable> clone() const = 0;
virtual const IDictionarySource * getSource() const = 0; virtual const IDictionarySource * getSource() const = 0;
virtual const DictionaryStructure & getStructure() const = 0; virtual const DictionaryStructure & getStructure() const = 0;
@ -61,11 +59,6 @@ struct IDictionaryBase : public IExternalLoadable
return source && source->isModified(); return source && source->isModified();
} }
std::unique_ptr<IExternalLoadable> cloneObject() const override
{
return clone();
}
std::shared_ptr<IDictionaryBase> shared_from_this() std::shared_ptr<IDictionaryBase> shared_from_this()
{ {
return std::static_pointer_cast<IDictionaryBase>(IExternalLoadable::shared_from_this()); return std::static_pointer_cast<IDictionaryBase>(IExternalLoadable::shared_from_this());

View File

@ -127,7 +127,7 @@ void ExternalLoader::reloadAndUpdate(bool throw_on_error)
try try
{ {
auto loadable_ptr = failed_loadable_object.second.loadable->cloneObject(); auto loadable_ptr = failed_loadable_object.second.loadable->clone();
if (const auto exception_ptr = loadable_ptr->getCreationException()) if (const auto exception_ptr = loadable_ptr->getCreationException())
{ {
/// recalculate next attempt time /// recalculate next attempt time
@ -211,7 +211,7 @@ void ExternalLoader::reloadAndUpdate(bool throw_on_error)
if (current->isModified()) if (current->isModified())
{ {
/// create new version of loadable object /// create new version of loadable object
auto new_version = current->cloneObject(); auto new_version = current->clone();
if (const auto exception_ptr = new_version->getCreationException()) if (const auto exception_ptr = new_version->getCreationException())
std::rethrow_exception(exception_ptr); std::rethrow_exception(exception_ptr);

View File

@ -35,7 +35,7 @@ public:
virtual bool isModified() const = 0; virtual bool isModified() const = 0;
virtual std::unique_ptr<IExternalLoadable> cloneObject() const = 0; virtual std::unique_ptr<IExternalLoadable> clone() const = 0;
virtual std::exception_ptr getCreationException() const = 0; virtual std::exception_ptr getCreationException() const = 0;
}; };