aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/logger/sync_page_cache_file_creator.cpp
blob: bf91d20c23299f658dbb887da7d1294766ff2949 (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
25
26
27
28
#include "sync_page_cache_file_creator.h"
#include "sync_page_cache_file.h"

THolder<TLogBackend> TSyncPageCacheFileLogBackendCreator::DoCreateLogBackend() const {
    return MakeHolder<TSyncPageCacheFileLogBackend>(Path, MaxBufferSize, MaxPendingCacheSize);
}


TSyncPageCacheFileLogBackendCreator::TSyncPageCacheFileLogBackendCreator()
    : TFileLogBackendCreator("", "sync_page")
{}

bool TSyncPageCacheFileLogBackendCreator::Init(const IInitContext& ctx) {
    if (!TFileLogBackendCreator::Init(ctx)) {
        return false;
    }
    ctx.GetValue("MaxBufferSize", MaxBufferSize);
    ctx.GetValue("MaxPendingCacheSize", MaxPendingCacheSize);
    return true;
}

ILogBackendCreator::TFactory::TRegistrator<TSyncPageCacheFileLogBackendCreator> TSyncPageCacheFileLogBackendCreator::Registrar("sync_page");

void TSyncPageCacheFileLogBackendCreator::DoToJson(NJson::TJsonValue& value) const {
    TFileLogBackendCreator::DoToJson(value);
    value["MaxBufferSize"] = MaxBufferSize;
    value["MaxPendingCacheSize"] = MaxPendingCacheSize;
}