sync_page_cache_file_creator.cpp 1.0 KB

12345678910111213141516171819202122232425262728
  1. #include "sync_page_cache_file_creator.h"
  2. #include "sync_page_cache_file.h"
  3. THolder<TLogBackend> TSyncPageCacheFileLogBackendCreator::DoCreateLogBackend() const {
  4. return MakeHolder<TSyncPageCacheFileLogBackend>(Path, MaxBufferSize, MaxPendingCacheSize);
  5. }
  6. TSyncPageCacheFileLogBackendCreator::TSyncPageCacheFileLogBackendCreator()
  7. : TFileLogBackendCreator("", "sync_page")
  8. {}
  9. bool TSyncPageCacheFileLogBackendCreator::Init(const IInitContext& ctx) {
  10. if (!TFileLogBackendCreator::Init(ctx)) {
  11. return false;
  12. }
  13. ctx.GetValue("MaxBufferSize", MaxBufferSize);
  14. ctx.GetValue("MaxPendingCacheSize", MaxPendingCacheSize);
  15. return true;
  16. }
  17. ILogBackendCreator::TFactory::TRegistrator<TSyncPageCacheFileLogBackendCreator> TSyncPageCacheFileLogBackendCreator::Registrar("sync_page");
  18. void TSyncPageCacheFileLogBackendCreator::DoToJson(NJson::TJsonValue& value) const {
  19. TFileLogBackendCreator::DoToJson(value);
  20. value["MaxBufferSize"] = MaxBufferSize;
  21. value["MaxPendingCacheSize"] = MaxPendingCacheSize;
  22. }