@@ -23,7 +23,7 @@ Y_UNIT_TEST_SUITE(TSourceIdTests) {
23
23
TSourceIdWriter writer (ESourceIdFormat::Raw);
24
24
25
25
const auto sourceId = TestSourceId (1 );
26
- const auto sourceIdInfo = TSourceIdInfo (1 , 0 , 10 , TInstant::Seconds (100 ));
26
+ const auto sourceIdInfo = TSourceIdInfo (1 , 10 , TInstant::Seconds (100 ));
27
27
28
28
writer.RegisterSourceId (sourceId, sourceIdInfo);
29
29
UNIT_ASSERT_VALUES_EQUAL (writer.GetSourceIdsToWrite ().size (), 1 );
@@ -35,7 +35,7 @@ Y_UNIT_TEST_SUITE(TSourceIdTests) {
35
35
}
36
36
37
37
const auto anotherSourceId = TestSourceId (2 );
38
- const auto anotherSourceIdInfo = TSourceIdInfo (2 , 0 , 20 , TInstant::Seconds (200 ));
38
+ const auto anotherSourceIdInfo = TSourceIdInfo (2 , 20 , TInstant::Seconds (200 ));
39
39
UNIT_ASSERT_VALUES_UNEQUAL (sourceIdInfo, anotherSourceIdInfo);
40
40
41
41
{
@@ -47,7 +47,7 @@ Y_UNIT_TEST_SUITE(TSourceIdTests) {
47
47
Y_UNIT_TEST (SourceIdWriterClean) {
48
48
TSourceIdWriter writer (ESourceIdFormat::Raw);
49
49
50
- writer.RegisterSourceId (TestSourceId (), 1 , 0 , 10 , TInstant::Seconds (100 ));
50
+ writer.RegisterSourceId (TestSourceId (), 1 , 10 , TInstant::Seconds (100 ));
51
51
UNIT_ASSERT_VALUES_EQUAL (writer.GetSourceIdsToWrite ().size (), 1 );
52
52
53
53
writer.Clear ();
@@ -60,7 +60,7 @@ Y_UNIT_TEST_SUITE(TSourceIdTests) {
60
60
auto expectedRequest = MakeHolder<TEvKeyValue::TEvRequest>();
61
61
62
62
const auto sourceId = TestSourceId (1 );
63
- const auto sourceIdInfo = TSourceIdInfo (1 , 1 , 10 , TInstant::Seconds (100 ));
63
+ const auto sourceIdInfo = TSourceIdInfo (1 , 10 , TInstant::Seconds (100 ));
64
64
writer.RegisterSourceId (sourceId, sourceIdInfo);
65
65
UNIT_ASSERT_VALUES_EQUAL (writer.GetSourceIdsToWrite ().size (), 1 );
66
66
{
@@ -78,7 +78,7 @@ Y_UNIT_TEST_SUITE(TSourceIdTests) {
78
78
}
79
79
80
80
const auto anotherSourceId = TestSourceId (2 );
81
- const auto anotherSourceIdInfo = TSourceIdInfo (2 , 0 , 20 , TInstant::Seconds (200 ));
81
+ const auto anotherSourceIdInfo = TSourceIdInfo (2 , 20 , TInstant::Seconds (200 ));
82
82
writer.RegisterSourceId (anotherSourceId, anotherSourceIdInfo);
83
83
UNIT_ASSERT_VALUES_EQUAL (writer.GetSourceIdsToWrite ().size (), 2 );
84
84
{
@@ -102,9 +102,9 @@ Y_UNIT_TEST_SUITE(TSourceIdTests) {
102
102
TSourceIdStorage storage;
103
103
104
104
const auto sourceId = TestSourceId (1 );
105
- const auto sourceIdInfo = TSourceIdInfo (1 , 0 , 10 , TInstant::Seconds (100 ));
105
+ const auto sourceIdInfo = TSourceIdInfo (1 , 10 , TInstant::Seconds (100 ));
106
106
const auto anotherSourceId = TestSourceId (2 );
107
- const auto anotherSourceIdInfo = TSourceIdInfo (2 , 0 , 20 , TInstant::Seconds (200 ));
107
+ const auto anotherSourceIdInfo = TSourceIdInfo (2 , 20 , TInstant::Seconds (200 ));
108
108
109
109
storage.RegisterSourceId (sourceId, sourceIdInfo);
110
110
UNIT_ASSERT_VALUES_EQUAL (storage.GetInMemorySourceIds ().size (), 1 );
@@ -130,7 +130,7 @@ Y_UNIT_TEST_SUITE(TSourceIdTests) {
130
130
131
131
void SourceIdStorageParseAndAdd (TKeyPrefix::EMark mark, ESourceIdFormat format) {
132
132
const auto sourceId = TestSourceId ();
133
- const auto sourceIdInfo = TSourceIdInfo (1 , 1 , 10 , TInstant::Seconds (100 ));
133
+ const auto sourceIdInfo = TSourceIdInfo (1 , 10 , TInstant::Seconds (100 ));
134
134
135
135
TKeyPrefix ikey (TKeyPrefix::TypeInfo, TPartitionId (TestPartition), mark);
136
136
TBuffer idata;
@@ -162,20 +162,20 @@ Y_UNIT_TEST_SUITE(TSourceIdTests) {
162
162
TSourceIdStorage storage;
163
163
164
164
const auto sourceId = TestSourceId (1 );
165
- storage.RegisterSourceId (sourceId, 1 , 0 , 10 , TInstant::Seconds (100 ));
165
+ storage.RegisterSourceId (sourceId, 1 , 10 , TInstant::Seconds (100 ));
166
166
{
167
167
auto ds = storage.MinAvailableTimestamp (now);
168
168
UNIT_ASSERT_VALUES_EQUAL (ds, TInstant::Seconds (100 ));
169
169
}
170
170
171
171
const auto anotherSourceId = TestSourceId (2 );
172
- storage.RegisterSourceId (anotherSourceId, 2 , 0 , 20 , TInstant::Seconds (200 ));
172
+ storage.RegisterSourceId (anotherSourceId, 2 , 20 , TInstant::Seconds (200 ));
173
173
{
174
174
auto ds = storage.MinAvailableTimestamp (now);
175
175
UNIT_ASSERT_VALUES_EQUAL (ds, TInstant::Seconds (100 ));
176
176
}
177
177
178
- storage.RegisterSourceId (sourceId, 3 , 0 , 30 , TInstant::Seconds (300 ));
178
+ storage.RegisterSourceId (sourceId, 3 , 30 , TInstant::Seconds (300 ));
179
179
{
180
180
auto ds = storage.MinAvailableTimestamp (now);
181
181
UNIT_ASSERT_VALUES_EQUAL (ds, TInstant::Seconds (200 ));
@@ -185,7 +185,7 @@ Y_UNIT_TEST_SUITE(TSourceIdTests) {
185
185
Y_UNIT_TEST (SourceIdStorageTestClean) {
186
186
TSourceIdStorage storage;
187
187
for (ui64 i = 1 ; i <= 10000 ; ++i) {
188
- storage.RegisterSourceId (TestSourceId (i), i, 0 , i, TInstant::Seconds (10 * i));
188
+ storage.RegisterSourceId (TestSourceId (i), i, i, TInstant::Seconds (10 * i));
189
189
}
190
190
191
191
NKikimrPQ::TPartitionConfig config;
@@ -226,7 +226,7 @@ Y_UNIT_TEST_SUITE(TSourceIdTests) {
226
226
Y_UNIT_TEST (SourceIdStorageDeleteByMaxCount) {
227
227
TSourceIdStorage storage;
228
228
for (ui64 i = 1 ; i <= 10000 ; ++i) {
229
- storage.RegisterSourceId (TestSourceId (i), i, 0 , i, TInstant::Seconds (10 * i));
229
+ storage.RegisterSourceId (TestSourceId (i), i, i, TInstant::Seconds (10 * i));
230
230
}
231
231
232
232
NKikimrPQ::TPartitionConfig config;
@@ -258,7 +258,7 @@ Y_UNIT_TEST_SUITE(TSourceIdTests) {
258
258
Y_UNIT_TEST (SourceIdStorageComplexDelete) {
259
259
TSourceIdStorage storage;
260
260
for (ui64 i = 1 ; i <= 10000 + 1 ; ++i) { // add 10000 + one extra sources
261
- storage.RegisterSourceId (TestSourceId (i), i, 1 , i , TInstant::Seconds (10 * i));
261
+ storage.RegisterSourceId (TestSourceId (i), i, i , TInstant::Seconds (10 * i));
262
262
}
263
263
264
264
NKikimrPQ::TPartitionConfig config;
@@ -297,7 +297,7 @@ Y_UNIT_TEST_SUITE(TSourceIdTests) {
297
297
const auto sourceId = TestSourceId (i);
298
298
const auto owner = TestOwner (sourceId);
299
299
300
- storage.RegisterSourceId (sourceId, i, 0 , i, TInstant::Hours (i));
300
+ storage.RegisterSourceId (sourceId, i, i, TInstant::Hours (i));
301
301
storage.RegisterSourceIdOwner (sourceId, owner);
302
302
owners[owner];
303
303
}
@@ -324,7 +324,7 @@ Y_UNIT_TEST_SUITE(TSourceIdTests) {
324
324
}
325
325
326
326
inline static TSourceIdInfo MakeExplicitSourceIdInfo (ui64 offset, const TMaybe<THeartbeat>& heartbeat = Nothing ()) {
327
- auto info = TSourceIdInfo (0 , 0 , offset, TInstant::Now ());
327
+ auto info = TSourceIdInfo (0 , offset, TInstant::Now ());
328
328
329
329
info.Explicit = true ;
330
330
if (heartbeat) {
@@ -460,33 +460,6 @@ Y_UNIT_TEST_SUITE(TSourceIdTests) {
460
460
}
461
461
}
462
462
463
- Y_UNIT_TEST (SourceIdMinSeqNo) {
464
- TSourceIdStorage storage;
465
-
466
- const auto sourceId = TestSourceId (1 );
467
- const auto sourceIdInfo = TSourceIdInfo (1 , 0 , 10 , TInstant::Seconds (100 ));
468
- const auto anotherSourceId = TestSourceId (2 );
469
- const auto anotherSourceIdInfo = TSourceIdInfo (2 , 1 , 20 , TInstant::Seconds (200 ));
470
-
471
- storage.RegisterSourceId (sourceId, sourceIdInfo);
472
- storage.RegisterSourceId (sourceId, anotherSourceIdInfo);
473
- storage.RegisterSourceId (sourceId, sourceIdInfo.Updated (2 , 2 , 11 , TInstant::Seconds (100 )));
474
- {
475
- auto it = storage.GetInMemorySourceIds ().find (sourceId);
476
- UNIT_ASSERT_VALUES_EQUAL (it->second .MinSeqNo , 2 );
477
- }
478
- storage.RegisterSourceId (sourceId, sourceIdInfo.Updated (2 , 1 , 12 , TInstant::Seconds (100 )));
479
- {
480
- auto it = storage.GetInMemorySourceIds ().find (sourceId);
481
- UNIT_ASSERT_VALUES_EQUAL (it->second .MinSeqNo , 1 );
482
- }
483
- storage.RegisterSourceId (anotherSourceId, anotherSourceIdInfo.Updated (2 , 0 , 12 , TInstant::Seconds (100 )));
484
- {
485
- auto it = storage.GetInMemorySourceIds ().find (anotherSourceId);
486
- UNIT_ASSERT_VALUES_EQUAL (it->second .MinSeqNo , 1 );
487
- }
488
- }
489
-
490
463
} // TSourceIdTests
491
464
492
465
} // namespace NKikimr::NPQ
0 commit comments