Skip to content

Commit 1bfd53d

Browse files
author
gryzlov-ad
committed
YT-23505: Introduce chaos lease. After revert
commit_hash:3b48c6649d1d04e7bf7daf8f05835def10082f2a
1 parent 07cda51 commit 1bfd53d

File tree

7 files changed

+41
-1
lines changed

7 files changed

+41
-1
lines changed

yt/yt/client/chaos_client/helpers.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ TReplicationCardId MakeReplicationCardId(TObjectId randomId)
2121
EntropyFromId(randomId) & 0xffff0000);
2222
}
2323

24+
TReplicationCardId MakeChaosLeaseId(TObjectId randomId)
25+
{
26+
return MakeId(
27+
EObjectType::ChaosLease,
28+
CellTagFromId(randomId),
29+
CounterFromId(randomId),
30+
EntropyFromId(randomId) & 0xffff0000);
31+
}
32+
2433
TReplicaId MakeReplicaId(TReplicationCardId replicationCardId, TReplicaIdIndex index)
2534
{
2635
return MakeId(

yt/yt/client/chaos_client/public.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ namespace NYT::NChaosClient {
1111
////////////////////////////////////////////////////////////////////////////////
1212

1313
using TReplicationCardId = NObjectClient::TObjectId;
14-
using TReplicationCardCollocationId = NObjectClient::TObjectId;
14+
using TChaosObjectId = NObjectClient::TObjectId;
15+
// using TReplicationCardId = TChaosObjectId;
16+
using TReplicationCardCollocationId = TChaosObjectId;
17+
using TChaosLeaseId = TChaosObjectId;
1518
using TReplicaId = NObjectClient::TObjectId;
1619
using TReplicationEra = ui64;
1720
using TReplicaIdIndex = ui16;

yt/yt/client/object_client/helpers.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,16 @@ bool IsChaosTableReplicaType(EObjectType type)
256256
return type == EObjectType::ChaosTableReplica;
257257
}
258258

259+
bool IsReplicationCardType(EObjectType type)
260+
{
261+
return type == EObjectType::ReplicationCard;
262+
}
263+
264+
bool IsChaosLeaseType(EObjectType type)
265+
{
266+
return type == EObjectType::ChaosLease;
267+
}
268+
259269
bool IsCollocationType(EObjectType type)
260270
{
261271
return

yt/yt/client/object_client/helpers.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ bool IsTableReplicaType(EObjectType type);
6767
//! Checks if the given type is a chaos replica.
6868
bool IsChaosTableReplicaType(EObjectType type);
6969

70+
//! Checks if the given type is a replication card.
71+
bool IsReplicationCardType(EObjectType type);
72+
73+
//! Checks if the given type is a chaos lease.
74+
bool IsChaosLeaseType(EObjectType type);
75+
7076
//! Checks if the given type is a collocation.
7177
bool IsCollocationType(EObjectType type);
7278

yt/yt/client/object_client/public.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ DEFINE_ENUM(EObjectType,
342342
((ChaosReplicatedTable) (1206))
343343
((ReplicationCardCollocation) (1207))
344344
((VirtualChaosCellMap) (1208))
345+
((ChaosLease) (1209))
345346

346347
// Other cluster components stuff
347348
((ClusterProxyNode) (1500))
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package NYT.NChaosClient.NProto;
2+
3+
import "yt_proto/yt/core/misc/proto/guid.proto";
4+
5+
////////////////////////////////////////////////////////////////////////////////
6+
7+
message TChaosLease
8+
{ }
9+
10+
////////////////////////////////////////////////////////////////////////////////

yt/yt_proto/yt/client/ya.make

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ SRCS(
1919
cell_master/proto/cell_directory.proto
2020

2121
chaos_client/proto/replication_card.proto
22+
chaos_client/proto/chaos_lease.proto
2223

2324
chunk_client/proto/data_statistics.proto
2425
chunk_client/proto/chunk_meta.proto

0 commit comments

Comments
 (0)