@@ -210,22 +210,19 @@ TRichYPath TOperationPreparer::LockFile(const TRichYPath& path)
210210{
211211 CheckValidity ();
212212
213- auto lockRequest = Client_->GetRawClient ()->CreateRawBatchRequest ();
214- auto lockIdFuture = lockRequest->Lock (
213+ auto fileTx = Client_->AttachTransaction (
215214 FileTransaction_->GetId (),
216- path. Path_ ,
217- ELockMode::LM_SNAPSHOT,
218- TLockOptions (). Waitable ( true ));
215+ TAttachTransactionOptions ()
216+ . AbortOnTermination ( false )
217+ . AutoPingable ( false ));
219218
220- lockRequest-> ExecuteBatch ( );
219+ auto lock = fileTx-> Lock (path. Path_ , ELockMode::LM_SNAPSHOT );
221220
222- auto nodeIdFuture = Client_->GetRawClient ()->Get (
223- FileTransaction_->GetId (),
224- ::TStringBuilder () << '#' << GetGuidAsString(lockIdFuture.GetValue()) << "/@node_id");
221+ auto nodeId = lock->GetLockedNodeId ();
225222
226223 auto result = path;
227224 result.OriginalPath (path.Path_ );
228- result.Path("#" + nodeIdFuture.AsString ());
225+ result.Path (" #" + nodeId. AsGuidString ());
229226
230227 YT_LOG_DEBUG (" Locked file %v, new path is %v" ,
231228 *result.OriginalPath_ ,
@@ -380,8 +377,7 @@ const TVector<TRichYPath>& TJobPreparer::TEagerLockingFileCache::GetFiles() cons
380377
381378void TJobPreparer::TEagerLockingFileCache::InsertFile (const TRichYPath& path)
382379{
383- LockedFiles_.emplace_back(
384- OperationPreparer_.LockFile(path));
380+ LockedFiles_.emplace_back (OperationPreparer_.LockFile (path));
385381}
386382
387383// //////////////////////////////////////////////////////////////////////////////
0 commit comments