aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Disks/IO/WriteBufferWithFinalizeCallback.cpp
blob: 8703eae4913cd8f457a7194c52ed0fa5ea43b192 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "WriteBufferWithFinalizeCallback.h"

namespace DB
{

WriteBufferWithFinalizeCallback::WriteBufferWithFinalizeCallback(
    std::unique_ptr<WriteBuffer> impl_,
    FinalizeCallback && create_callback_,
    const String & remote_path_)
    : WriteBufferFromFileDecorator(std::move(impl_))
    , create_metadata_callback(std::move(create_callback_))
    , remote_path(remote_path_)
{
}

void WriteBufferWithFinalizeCallback::finalizeImpl()
{
    WriteBufferFromFileDecorator::finalizeImpl();
    if (create_metadata_callback)
        create_metadata_callback(count());
}


}