#pragma once #include #include #include #include #include /** * Implementations for transactional operations with metadata used by MetadataStorageFromDisk * and MetadataStorageFromPlainObjectStorage. */ namespace DB { class MetadataOperationsHolder { private: std::vector operations; MetadataStorageTransactionState state{MetadataStorageTransactionState::PREPARING}; void rollback(std::unique_lock & lock, size_t until_pos); protected: void addOperation(MetadataOperationPtr && operation); void commitImpl(SharedMutex & metadata_mutex); }; }