1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
#pragma once
#include <yt/cpp/mapreduce/interface/batch_request.h>
#include <yt/cpp/mapreduce/interface/fwd.h>
#include <yt/cpp/mapreduce/interface/node.h>
#include <yt/cpp/mapreduce/http/requests.h>
#include <library/cpp/threading/future/future.h>
#include <util/generic/ptr.h>
#include <util/generic/deque.h>
#include <exception>
namespace NYT {
namespace NDetail {
////////////////////////////////////////////////////////////////////////////////
struct TResponseInfo;
class TClient;
using TClientPtr = ::TIntrusivePtr<TClient>;
namespace NRawClient {
class TRawBatchRequest;
}
////////////////////////////////////////////////////////////////////////////////
class TBatchRequest
: public IBatchRequest
{
public:
TBatchRequest(const TTransactionId& defaultTransaction, ::TIntrusivePtr<TClient> client);
~TBatchRequest();
virtual IBatchRequestBase& WithTransaction(const TTransactionId& transactionId) override;
virtual ::NThreading::TFuture<TLockId> Create(
const TYPath& path,
ENodeType type,
const TCreateOptions& options = TCreateOptions()) override;
virtual ::NThreading::TFuture<void> Remove(
const TYPath& path,
const TRemoveOptions& options = TRemoveOptions()) override;
virtual ::NThreading::TFuture<bool> Exists(
const TYPath& path,
const TExistsOptions& options = TExistsOptions()) override;
virtual ::NThreading::TFuture<TNode> Get(
const TYPath& path,
const TGetOptions& options = TGetOptions()) override;
virtual ::NThreading::TFuture<void> Set(
const TYPath& path,
const TNode& node,
const TSetOptions& options = TSetOptions()) override;
virtual ::NThreading::TFuture<TNode::TListType> List(
const TYPath& path,
const TListOptions& options = TListOptions()) override;
virtual ::NThreading::TFuture<TNodeId> Copy(
const TYPath& sourcePath,
const TYPath& destinationPath,
const TCopyOptions& options = TCopyOptions()) override;
virtual ::NThreading::TFuture<TNodeId> Move(
const TYPath& sourcePath,
const TYPath& destinationPath,
const TMoveOptions& options = TMoveOptions()) override;
virtual ::NThreading::TFuture<TNodeId> Link(
const TYPath& targetPath,
const TYPath& linkPath,
const TLinkOptions& options = TLinkOptions()) override;
virtual ::NThreading::TFuture<ILockPtr> Lock(
const TYPath& path,
ELockMode mode,
const TLockOptions& options) override;
virtual ::NThreading::TFuture<void> Unlock(
const TYPath& path,
const TUnlockOptions& options) override;
virtual ::NThreading::TFuture<void> AbortOperation(const TOperationId& operationId) override;
virtual ::NThreading::TFuture<void> CompleteOperation(const TOperationId& operationId) override;
::NThreading::TFuture<void> SuspendOperation(
const TOperationId& operationId,
const TSuspendOperationOptions& options) override;
::NThreading::TFuture<void> ResumeOperation(
const TOperationId& operationId,
const TResumeOperationOptions& options) override;
virtual ::NThreading::TFuture<void> UpdateOperationParameters(
const TOperationId& operationId,
const TUpdateOperationParametersOptions& options) override;
virtual ::NThreading::TFuture<TRichYPath> CanonizeYPath(const TRichYPath& path) override;
virtual ::NThreading::TFuture<TVector<TTableColumnarStatistics>> GetTableColumnarStatistics(
const TVector<TRichYPath>& paths,
const TGetTableColumnarStatisticsOptions& options) override;
::NThreading::TFuture<TCheckPermissionResponse> CheckPermission(
const TString& user,
EPermission permission,
const TYPath& path,
const TCheckPermissionOptions& options) override;
virtual void ExecuteBatch(const TExecuteBatchOptions& executeBatch) override;
private:
TBatchRequest(NDetail::NRawClient::TRawBatchRequest* impl, ::TIntrusivePtr<TClient> client);
private:
TTransactionId DefaultTransaction_;
::TIntrusivePtr<NDetail::NRawClient::TRawBatchRequest> Impl_;
THolder<TBatchRequest> TmpWithTransaction_;
::TIntrusivePtr<TClient> Client_;
private:
friend class NYT::NDetail::TClient;
};
////////////////////////////////////////////////////////////////////////////////
} // namespace NDetail
} // namespace NYT
|