Skip to content

Commit 7d95c06

Browse files
committed
fix
1 parent 87dfbc1 commit 7d95c06

File tree

1 file changed

+9
-48
lines changed

1 file changed

+9
-48
lines changed

ydb/library/yql/providers/yt/gateway/qplayer/yql_yt_qplayer_gateway.cpp

Lines changed: 9 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,16 @@ class TGateway : public IYtGateway {
4848
{}
4949

5050
void OpenSession(TOpenSessionOptions&& options) final {
51-
with_lock(SessionGenerationsLock_) {
52-
SessionGenerations_[options.SessionId()] = 0;
53-
}
54-
51+
SessionGenerations_[options.SessionId()] = 0;
5552
return Inner_->OpenSession(std::move(options));
5653
}
5754

5855
NThreading::TFuture<void> CloseSession(TCloseSessionOptions&& options) final {
59-
with_lock(SessionGenerationsLock_) {
60-
SessionGenerations_.erase(options.SessionId());
61-
}
62-
6356
return Inner_->CloseSession(std::move(options));
6457
}
6558

6659
NThreading::TFuture<void> CleanupSession(TCleanupSessionOptions&& options) final {
67-
with_lock(SessionGenerationsLock_) {
68-
++SessionGenerations_[options.SessionId()];
69-
}
70-
60+
++SessionGenerations_[options.SessionId()];
7161
return Inner_->CleanupSession(std::move(options));
7262
}
7363

@@ -212,11 +202,7 @@ class TGateway : public IYtGateway {
212202
}
213203

214204
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()];
220206
if (QContext_.CanRead()) {
221207
TTableInfoResult res;
222208
res.SetSuccess();
@@ -336,11 +322,7 @@ class TGateway : public IYtGateway {
336322
}
337323

338324
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()];
344326
TString key;
345327
if (QContext_) {
346328
key = MakeGetTableRangeKey(options, generation);
@@ -517,11 +499,7 @@ class TGateway : public IYtGateway {
517499
}
518500

519501
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()];
525503
if (QContext_.CanRead()) {
526504
const auto& key = MakeGetFolderKey(options, generation);
527505
auto item = QContext_.GetReader()->Get({YtGateway_GetFolder, key}).GetValueSync();
@@ -582,11 +560,7 @@ class TGateway : public IYtGateway {
582560
}
583561

584562
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()];
590564
if (QContext_.CanRead()) {
591565
TBatchFolderResult res;
592566
res.SetSuccess();
@@ -630,11 +604,7 @@ class TGateway : public IYtGateway {
630604
}
631605

632606
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()];
638608
if (QContext_.CanRead()) {
639609
TBatchFolderResult res;
640610
res.SetSuccess();
@@ -809,11 +779,7 @@ class TGateway : public IYtGateway {
809779
}
810780

811781
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()];
817783
if (QContext_.CanRead()) {
818784
TPathStatResult res;
819785
res.DataSize.resize(options.Paths().size(), 0);
@@ -856,11 +822,7 @@ class TGateway : public IYtGateway {
856822
}
857823

858824
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()];
864826
if (QContext_.CanRead()) {
865827
TPathStatResult res;
866828
res.DataSize.resize(options.Paths().size(), 0);
@@ -991,7 +953,6 @@ class TGateway : public IYtGateway {
991953
const TFileStoragePtr FileStorage_;
992954
THashSet<TString> PathStatKeys_;
993955
THashMap<TString, ui64> SessionGenerations_;
994-
TMutex SessionGenerationsLock_;
995956
};
996957

997958
}

0 commit comments

Comments
 (0)