#pragma once #include #include namespace DB { /// Do not encode keys, store as-is, and do not require separate disk for metadata. /// But because of this does not support renames/hardlinks/attrs/... /// /// NOTE: This disk has excessive API calls. template class PlainObjectStorage : public BaseObjectStorage { public: template explicit PlainObjectStorage(Args && ...args) : BaseObjectStorage(std::forward(args)...) {} std::string getName() const override { return "" + BaseObjectStorage::getName(); } /// Notes: /// - supports BACKUP to this disk /// - does not support INSERT into MergeTree table on this disk bool isWriteOnce() const override { return true; } bool isPlain() const override { return true; } ObjectStorageKey generateObjectKeyForPath(const std::string & path, const std::optional & /* key_prefix */) const override { return ObjectStorageKey::createAsRelative(BaseObjectStorage::getCommonKeyPrefix(), path); } }; }