11
11
12
12
#include < ydb/library/actors/core/actor.h>
13
13
#include < ydb/library/actors/core/actor_bootstrapped.h>
14
+ #include < ydb/library/actors/core/log.h>
14
15
#include < ydb/library/services/services.pb.h>
15
16
#include < ydb/library/yverify_stream/yverify_stream.h>
16
17
@@ -34,7 +35,6 @@ class TOffloadActor
34
35
const TActorId ParentTablet;
35
36
const ui32 Partition;
36
37
const NKikimrPQ::TOffloadConfig Config;
37
- const TPathId DstPathId;
38
38
39
39
mutable TMaybe<TString> LogPrefix;
40
40
TActorId Worker;
@@ -60,14 +60,27 @@ class TOffloadActor
60
60
: ParentTablet(parentTablet)
61
61
, Partition(partition)
62
62
, Config(config)
63
- , DstPathId(PathIdFromPathId(config.GetIncrementalBackup().GetDstPathId()))
64
63
{}
65
64
65
+ auto CreateReaderFactory () {
66
+ return [=]() -> IActor* {
67
+ return NBackup::NImpl::CreateLocalPartitionReader (ParentTablet, Partition);
68
+ };
69
+ }
70
+
71
+ auto CreateWriterFactory () {
72
+ return [=]() -> IActor* {
73
+ return NBackup::NImpl::CreateLocalTableWriter (
74
+ PathIdFromPathId (Config.GetIncrementalBackup ().GetDstPathId ()));
75
+ };
76
+ }
77
+
66
78
void Bootstrap () {
67
79
auto * workerActor = CreateWorker (
68
80
SelfId (),
69
- [=]() -> IActor* { return NBackup::NImpl::CreateLocalPartitionReader (ParentTablet, Partition); },
70
- [=]() -> IActor* { return NBackup::NImpl::CreateLocalTableWriter (DstPathId); });
81
+ CreateReaderFactory (),
82
+ CreateWriterFactory ());
83
+
71
84
Worker = TActivationContext::Register (workerActor);
72
85
73
86
Become (&TOffloadActor::StateWork);
@@ -76,8 +89,7 @@ class TOffloadActor
76
89
STATEFN (StateWork) {
77
90
switch (ev->GetTypeRewrite ()) {
78
91
default :
79
- Y_VERIFY_S (false , " Unhandled event type: " << ev->GetTypeRewrite ()
80
- << " event: " << ev->ToString ());
92
+ LOG_W (" Unhandled event type: " << ev->GetTypeRewrite () << " event: " << ev->ToString ());
81
93
}
82
94
}
83
95
};
0 commit comments