@@ -48,26 +48,16 @@ class TGateway : public IYtGateway {
48
48
{}
49
49
50
50
void OpenSession (TOpenSessionOptions&& options) final {
51
- with_lock (SessionGenerationsLock_) {
52
- SessionGenerations_[options.SessionId ()] = 0 ;
53
- }
54
-
51
+ SessionGenerations_[options.SessionId ()] = 0 ;
55
52
return Inner_->OpenSession (std::move (options));
56
53
}
57
54
58
55
NThreading::TFuture<void > CloseSession (TCloseSessionOptions&& options) final {
59
- with_lock (SessionGenerationsLock_) {
60
- SessionGenerations_.erase (options.SessionId ());
61
- }
62
-
63
56
return Inner_->CloseSession (std::move (options));
64
57
}
65
58
66
59
NThreading::TFuture<void > CleanupSession (TCleanupSessionOptions&& options) final {
67
- with_lock (SessionGenerationsLock_) {
68
- ++SessionGenerations_[options.SessionId ()];
69
- }
70
-
60
+ ++SessionGenerations_[options.SessionId ()];
71
61
return Inner_->CleanupSession (std::move (options));
72
62
}
73
63
@@ -212,11 +202,7 @@ class TGateway : public IYtGateway {
212
202
}
213
203
214
204
NThreading::TFuture<TTableInfoResult> GetTableInfo (TGetTableInfoOptions&& options) final {
215
- ui64 generation;
216
- with_lock (SessionGenerationsLock_) {
217
- generation = SessionGenerations_[options.SessionId ()];
218
- }
219
-
205
+ ui64 generation = SessionGenerations_[options.SessionId ()];
220
206
if (QContext_.CanRead ()) {
221
207
TTableInfoResult res;
222
208
res.SetSuccess ();
@@ -336,11 +322,7 @@ class TGateway : public IYtGateway {
336
322
}
337
323
338
324
NThreading::TFuture<TTableRangeResult> GetTableRange (TTableRangeOptions&& options) final {
339
- ui64 generation;
340
- with_lock (SessionGenerationsLock_) {
341
- generation = SessionGenerations_[options.SessionId ()];
342
- }
343
-
325
+ ui64 generation = SessionGenerations_[options.SessionId ()];
344
326
TString key;
345
327
if (QContext_) {
346
328
key = MakeGetTableRangeKey (options, generation);
@@ -517,11 +499,7 @@ class TGateway : public IYtGateway {
517
499
}
518
500
519
501
NThreading::TFuture<TFolderResult> GetFolder (TFolderOptions&& options) final {
520
- ui64 generation;
521
- with_lock (SessionGenerationsLock_) {
522
- generation = SessionGenerations_[options.SessionId ()];
523
- }
524
-
502
+ ui64 generation = SessionGenerations_[options.SessionId ()];
525
503
if (QContext_.CanRead ()) {
526
504
const auto & key = MakeGetFolderKey (options, generation);
527
505
auto item = QContext_.GetReader ()->Get ({YtGateway_GetFolder, key}).GetValueSync ();
@@ -582,11 +560,7 @@ class TGateway : public IYtGateway {
582
560
}
583
561
584
562
NThreading::TFuture<TBatchFolderResult> ResolveLinks (TResolveOptions&& options) final {
585
- ui64 generation;
586
- with_lock (SessionGenerationsLock_) {
587
- generation = SessionGenerations_[options.SessionId ()];
588
- }
589
-
563
+ ui64 generation = SessionGenerations_[options.SessionId ()];
590
564
if (QContext_.CanRead ()) {
591
565
TBatchFolderResult res;
592
566
res.SetSuccess ();
@@ -630,11 +604,7 @@ class TGateway : public IYtGateway {
630
604
}
631
605
632
606
NThreading::TFuture<TBatchFolderResult> GetFolders (TBatchFolderOptions&& options) final {
633
- ui64 generation;
634
- with_lock (SessionGenerationsLock_) {
635
- generation = SessionGenerations_[options.SessionId ()];
636
- }
637
-
607
+ ui64 generation = SessionGenerations_[options.SessionId ()];
638
608
if (QContext_.CanRead ()) {
639
609
TBatchFolderResult res;
640
610
res.SetSuccess ();
@@ -809,11 +779,7 @@ class TGateway : public IYtGateway {
809
779
}
810
780
811
781
NThreading::TFuture<TPathStatResult> PathStat (TPathStatOptions&& options) final {
812
- ui64 generation;
813
- with_lock (SessionGenerationsLock_) {
814
- generation = SessionGenerations_[options.SessionId ()];
815
- }
816
-
782
+ ui64 generation = SessionGenerations_[options.SessionId ()];
817
783
if (QContext_.CanRead ()) {
818
784
TPathStatResult res;
819
785
res.DataSize .resize (options.Paths ().size (), 0 );
@@ -856,11 +822,7 @@ class TGateway : public IYtGateway {
856
822
}
857
823
858
824
TPathStatResult TryPathStat (TPathStatOptions&& options) final {
859
- ui64 generation;
860
- with_lock (SessionGenerationsLock_) {
861
- generation = SessionGenerations_[options.SessionId ()];
862
- }
863
-
825
+ ui64 generation = SessionGenerations_[options.SessionId ()];
864
826
if (QContext_.CanRead ()) {
865
827
TPathStatResult res;
866
828
res.DataSize .resize (options.Paths ().size (), 0 );
@@ -991,7 +953,6 @@ class TGateway : public IYtGateway {
991
953
const TFileStoragePtr FileStorage_;
992
954
THashSet<TString> PathStatKeys_;
993
955
THashMap<TString, ui64> SessionGenerations_;
994
- TMutex SessionGenerationsLock_;
995
956
};
996
957
997
958
}
0 commit comments