#pragma once #include "config.h" #include #include namespace DB { using FinalizeCallback = std::function; /// Stores data in S3/HDFS and adds the object path and object size to metadata file on local FS. class WriteBufferWithFinalizeCallback final : public WriteBufferFromFileDecorator { public: WriteBufferWithFinalizeCallback( std::unique_ptr impl_, FinalizeCallback && create_callback_, const String & remote_path_); String getFileName() const override { return remote_path; } private: void finalizeImpl() override; FinalizeCallback create_metadata_callback; String remote_path; }; }