ClickHouse/src/Disks/DiskDecorator.cpp

220 lines
5.1 KiB
C++
Raw Normal View History

2020-07-29 15:05:02 +00:00
#include "DiskDecorator.h"
#include <IO/ReadBufferFromFileBase.h>
#include <IO/WriteBufferFromFileBase.h>
namespace DB
{
DiskDecorator::DiskDecorator(const DiskPtr & delegate_) : delegate(delegate_)
{
}
const String & DiskDecorator::getName() const
{
return delegate->getName();
}
ReservationPtr DiskDecorator::reserve(UInt64 bytes)
{
return delegate->reserve(bytes);
}
const String & DiskDecorator::getPath() const
{
return delegate->getPath();
}
UInt64 DiskDecorator::getTotalSpace() const
{
return delegate->getTotalSpace();
}
UInt64 DiskDecorator::getAvailableSpace() const
{
return delegate->getAvailableSpace();
}
UInt64 DiskDecorator::getUnreservedSpace() const
{
return delegate->getUnreservedSpace();
}
UInt64 DiskDecorator::getKeepingFreeSpace() const
{
return delegate->getKeepingFreeSpace();
}
bool DiskDecorator::exists(const String & path) const
{
return delegate->exists(path);
}
bool DiskDecorator::isFile(const String & path) const
{
return delegate->isFile(path);
}
bool DiskDecorator::isDirectory(const String & path) const
{
return delegate->isDirectory(path);
}
size_t DiskDecorator::getFileSize(const String & path) const
{
return delegate->getFileSize(path);
}
void DiskDecorator::createDirectory(const String & path)
{
delegate->createDirectory(path);
}
void DiskDecorator::createDirectories(const String & path)
{
delegate->createDirectories(path);
}
void DiskDecorator::clearDirectory(const String & path)
2020-07-29 15:05:02 +00:00
{
delegate->clearDirectory(path);
2020-07-29 15:05:02 +00:00
}
void DiskDecorator::moveDirectory(const String & from_path, const String & to_path)
{
delegate->moveDirectory(from_path, to_path);
}
DiskDirectoryIteratorPtr DiskDecorator::iterateDirectory(const String & path)
{
return delegate->iterateDirectory(path);
}
void DiskDecorator::createFile(const String & path)
{
delegate->createFile(path);
}
void DiskDecorator::moveFile(const String & from_path, const String & to_path)
{
delegate->moveFile(from_path, to_path);
}
void DiskDecorator::replaceFile(const String & from_path, const String & to_path)
{
delegate->replaceFile(from_path, to_path);
}
void DiskDecorator::copy(const String & from_path, const std::shared_ptr<IDisk> & to_disk, const String & to_path)
{
delegate->copy(from_path, to_disk, to_path);
}
void DiskDecorator::listFiles(const String & path, std::vector<String> & file_names)
{
delegate->listFiles(path, file_names);
}
std::unique_ptr<ReadBufferFromFileBase>
DiskDecorator::readFile(
const String & path, const ReadSettings & settings, std::optional<size_t> read_hint, std::optional<size_t> file_size) const
2020-07-29 15:05:02 +00:00
{
return delegate->readFile(path, settings, read_hint, file_size);
2020-07-29 15:05:02 +00:00
}
std::unique_ptr<WriteBufferFromFileBase>
2022-03-14 18:40:53 +00:00
DiskDecorator::writeFile(const String & path, size_t buf_size, WriteMode mode, const WriteSettings & settings)
2020-07-29 15:05:02 +00:00
{
2022-03-14 18:40:53 +00:00
return delegate->writeFile(path, buf_size, mode, settings);
2020-07-29 15:05:02 +00:00
}
void DiskDecorator::removeFile(const String & path)
2020-07-29 15:05:02 +00:00
{
delegate->removeFile(path);
}
void DiskDecorator::removeFileIfExists(const String & path)
{
delegate->removeFileIfExists(path);
}
void DiskDecorator::removeDirectory(const String & path)
{
delegate->removeDirectory(path);
2020-07-29 15:05:02 +00:00
}
void DiskDecorator::removeRecursive(const String & path)
2020-07-29 15:05:02 +00:00
{
delegate->removeRecursive(path);
}
2021-01-20 09:48:22 +00:00
void DiskDecorator::removeSharedFile(const String & path, bool keep_s3)
{
2021-01-20 09:48:22 +00:00
delegate->removeSharedFile(path, keep_s3);
}
2022-04-18 23:09:09 +00:00
void DiskDecorator::removeSharedFiles(const RemoveBatchRequest & files, bool keep_all_batch_metadata, const NameSet & file_names_remove_metadata_only)
{
2022-04-18 23:09:09 +00:00
delegate->removeSharedFiles(files, keep_all_batch_metadata, file_names_remove_metadata_only);
}
2022-04-18 23:09:09 +00:00
void DiskDecorator::removeSharedRecursive(const String & path, bool keep_all_batch_metadata, const NameSet & file_names_remove_metadata_only)
{
2022-04-18 23:09:09 +00:00
delegate->removeSharedRecursive(path, keep_all_batch_metadata, file_names_remove_metadata_only);
2020-07-29 15:05:02 +00:00
}
void DiskDecorator::setLastModified(const String & path, const Poco::Timestamp & timestamp)
{
delegate->setLastModified(path, timestamp);
}
Poco::Timestamp DiskDecorator::getLastModified(const String & path)
{
return delegate->getLastModified(path);
}
void DiskDecorator::setReadOnly(const String & path)
{
delegate->setReadOnly(path);
}
void DiskDecorator::createHardLink(const String & src_path, const String & dst_path)
{
delegate->createHardLink(src_path, dst_path);
}
void DiskDecorator::truncateFile(const String & path, size_t size)
{
delegate->truncateFile(path, size);
}
2021-01-26 13:29:45 +00:00
Executor & DiskDecorator::getExecutor()
2020-08-24 13:09:23 +00:00
{
2021-01-26 13:29:45 +00:00
return delegate->getExecutor();
2020-08-24 13:09:23 +00:00
}
2021-01-26 13:29:45 +00:00
SyncGuardPtr DiskDecorator::getDirectorySyncGuard(const String & path) const
2020-08-24 13:09:23 +00:00
{
2021-01-26 13:29:45 +00:00
return delegate->getDirectorySyncGuard(path);
2020-08-24 13:09:23 +00:00
}
void DiskDecorator::onFreeze(const String & path)
{
delegate->onFreeze(path);
}
2021-04-20 18:29:03 +00:00
void DiskDecorator::shutdown()
{
delegate->shutdown();
}
void DiskDecorator::startup()
{
delegate->startup();
}
void DiskDecorator::applyNewSettings(const Poco::Util::AbstractConfiguration & config, ContextPtr context, const String & config_prefix, const DisksMap & map)
2021-04-20 18:29:03 +00:00
{
delegate->applyNewSettings(config, context, config_prefix, map);
2021-04-20 18:29:03 +00:00
}
2020-07-29 15:05:02 +00:00
}