C++ YT Wrapper
C++ library for working with YT clusters
Loading...
Searching...
No Matches
operation.h
Go to the documentation of this file.
1#pragma once
2
9
11#include "errors.h"
12#include "io.h"
13#include "job_statistics.h"
14#include "job_counters.h"
15
16#include <library/cpp/threading/future/future.h>
17#include <library/cpp/type_info/type_info.h>
18
19#include <util/datetime/base.h>
20#include <util/generic/vector.h>
21#include <util/generic/maybe.h>
22#include <util/system/file.h>
23#include <util/system/types.h>
24
25#include <variant>
26
27namespace NYT {
28
30
34
37{
42 const ::google::protobuf::Descriptor* Descriptor = nullptr;
43};
44
45
47using TTableStructure = std::variant<
50>;
51
54
56struct TStructuredTablePath
57{
58 TStructuredTablePath(TRichYPath richYPath = TRichYPath(), TTableStructure description = TUnspecifiedTableStructure())
59 : RichYPath(std::move(richYPath))
60 , Description(std::move(description))
61 { }
62
63 TStructuredTablePath(TRichYPath richYPath, const ::google::protobuf::Descriptor* descriptor)
64 : RichYPath(std::move(richYPath))
65 , Description(TProtobufTableStructure({descriptor}))
66 { }
67
68 TStructuredTablePath(TYPath path)
69 : RichYPath(std::move(path))
70 , Description(TUnspecifiedTableStructure())
71 { }
72
73 TStructuredTablePath(const char* path)
74 : RichYPath(path)
75 , Description(TUnspecifiedTableStructure())
76 { }
77
78 TRichYPath RichYPath;
79 TTableStructure Description;
80};
81
83template <typename TRow>
85
87template <typename TRow>
89
91
95
99
103
106{
110 const ::google::protobuf::Descriptor* Descriptor = nullptr;
111};
112
119>;
120
122
125{ };
126
129{
130 TString Path;
131 TMaybe<TString> MD5CheckSum;
132};
133
136{
137 TYPath Path;
138 TMaybe<TTransactionId> TransactionId;
139};
140
142
143
145namespace NDetail {
146 extern i64 OutputTableCount;
147} // namespace NDetail
149
151
157{
159 Disabled /* "disabled" */,
160
162 Relaxed /* "relaxed" */,
163
165 Economy /* "economy" */,
166
171 Manual /* "manual" */,
172};
173
179{
180public:
182 using TSelf = TAutoMergeSpec;
184
186 FLUENT_FIELD_OPTION(EAutoMergeMode, Mode);
187
191 FLUENT_FIELD_OPTION(i64, MaxIntermediateChunkCount);
192
196 FLUENT_FIELD_OPTION(i64, ChunkCountPerMergeJob);
197
201 FLUENT_FIELD_OPTION(i64, ChunkSizeThreshold);
202};
203
205template <class TDerived>
207{
208public:
210 using TSelf = TDerived;
212
216 FLUENT_FIELD_OPTION(TAutoMergeSpec, AutoMerge);
217};
218
239
241template <class TDerived>
243{
244public:
246 using TSelf = TDerived;
248
250 FLUENT_FIELD_OPTION(TFormatHints, InputFormatHints);
251};
252
254template <class TDerived>
256{
257public:
259 using TSelf = TDerived;
261
263 FLUENT_FIELD_OPTION(TFormatHints, OutputFormatHints);
264};
265
267template <class TDerived>
269 : public TUserJobInputFormatHintsBase<TDerived>
270 , public TUserJobOutputFormatHintsBase<TDerived>
271{
272public:
274 using TSelf = TDerived;
276};
277
280 : public TUserJobFormatHintsBase<TUserJobFormatHints>
281{ };
282
284template <class TDerived>
286{
287public:
289 using TSelf = TDerived;
291
293 TDerived& AddInput(const TRichYPath& path);
294
296 TDerived& SetInput(size_t tableIndex, const TRichYPath& path);
297
299 TDerived& AddOutput(const TRichYPath& path);
300
302 TDerived& SetOutput(size_t tableIndex, const TRichYPath& path);
303
305 const TVector<TRichYPath>& GetInputs() const;
306
308 const TVector<TRichYPath>& GetOutputs() const;
309
310private:
311 TVector<TRichYPath> Inputs_;
312 TVector<TRichYPath> Outputs_;
313};
314
316template <class TDerived>
318 : public TRawOperationIoTableSpec<TDerived>
319{
321 using TSelf = TDerived;
323
327 FLUENT_FIELD_OPTION(TFormat, Format);
328
330 FLUENT_FIELD_OPTION(TFormat, InputFormat);
331
333 FLUENT_FIELD_OPTION(TFormat, OutputFormat);
334};
335
337template <class TDerived>
339 : public TRawOperationIoTableSpec<TDerived>
340{
341public:
343 using TSelf = TDerived;
345
349 FLUENT_FIELD_OPTION(TFormat, MapperFormat);
350
352 FLUENT_FIELD_OPTION(TFormat, MapperInputFormat);
353
355 FLUENT_FIELD_OPTION(TFormat, MapperOutputFormat);
356
360 FLUENT_FIELD_OPTION(TFormat, ReduceCombinerFormat);
361
363 FLUENT_FIELD_OPTION(TFormat, ReduceCombinerInputFormat);
364
366 FLUENT_FIELD_OPTION(TFormat, ReduceCombinerOutputFormat);
367
371 FLUENT_FIELD_OPTION(TFormat, ReducerFormat);
372
374 FLUENT_FIELD_OPTION(TFormat, ReducerInputFormat);
375
377 FLUENT_FIELD_OPTION(TFormat, ReducerOutputFormat);
378
380 TDerived& AddMapOutput(const TRichYPath& path);
381
383 TDerived& SetMapOutput(size_t tableIndex, const TRichYPath& path);
384
386 const TVector<TRichYPath>& GetMapOutputs() const;
387
388private:
389 TVector<TRichYPath> MapOutputs_;
390};
391
395{
396public:
397 template <class T, class = void>
399
402 template <class T>
403 void AddInput(const TRichYPath& path);
404
408
411 template <class T>
412 void SetInput(size_t tableIndex, const TRichYPath& path);
413
416 TVector<TRichYPath> Inputs_;
417
420 const TVector<TStructuredTablePath>& GetStructuredInputs() const;
421
422private:
423 TVector<TStructuredTablePath> StructuredInputs_;
424 friend struct TOperationIOSpecBase;
425 template <class T>
426 friend struct TOperationIOSpec;
427};
428
432{
433public:
434 template <class T, class = void>
436
439 template <class T>
440 void AddOutput(const TRichYPath& path);
441
445
448 template <class T>
449 void SetOutput(size_t tableIndex, const TRichYPath& path);
450
453 TVector<TRichYPath> Outputs_;
454
457 const TVector<TStructuredTablePath>& GetStructuredOutputs() const;
458
459private:
460 TVector<TStructuredTablePath> StructuredOutputs_;
461 friend struct TOperationIOSpecBase;
462 template <class T>
463 friend struct TOperationIOSpec;
464};
465
468struct TOperationIOSpecBase
471{ };
472
475template <class TDerived>
477 : public TOperationIOSpecBase
478{
480 using TSelf = TDerived;
482
483 template <class T>
484 TDerived& AddInput(const TRichYPath& path);
485
486 TDerived& AddStructuredInput(TStructuredTablePath path);
487
488 template <class T>
489 TDerived& SetInput(size_t tableIndex, const TRichYPath& path);
490
491 template <class T>
492 TDerived& AddOutput(const TRichYPath& path);
493
494 TDerived& AddStructuredOutput(TStructuredTablePath path);
495
496 template <class T>
497 TDerived& SetOutput(size_t tableIndex, const TRichYPath& path);
498
499
500 // DON'T USE THESE METHODS! They are left solely for backward compatibility.
501 // These methods are the only way to do equivalent of (Add/Set)(Input/Output)<Message>
502 // but please consider using (Add/Set)(Input/Output)<TConcreteMessage>
503 // (where TConcreteMessage is some descendant of Message)
504 // because they are faster and better (see https://st.yandex-team.ru/YT-6967)
505 TDerived& AddProtobufInput_VerySlow_Deprecated(const TRichYPath& path);
506 TDerived& AddProtobufOutput_VerySlow_Deprecated(const TRichYPath& path);
507};
508
513template <class TDerived>
515{
517 using TSelf = TDerived;
519
524 FLUENT_FIELD_OPTION(TDuration, TimeLimit);
525
527 FLUENT_FIELD_OPTION(TString, Alias);
528
530 FLUENT_FIELD_OPTION(TString, Title);
531
533 FLUENT_FIELD_OPTION(TString, Pool);
534
538 FLUENT_FIELD_OPTION(double, Weight);
539
542
545
547 FLUENT_FIELD_OPTION(ui64, MaxFailedJobCount);
548
549 // Arbitrary structured information related to the operation.
550 FLUENT_FIELD_OPTION(TNode, Annotations);
551
552 // Similar to Annotations, shown on the operation page. Recommends concise, human-readable entries to prevent clutter.
553 FLUENT_FIELD_OPTION(TNode, Description);
554};
555
558template <class TDerived>
560 : TOperationSpecBase<TDerived>
561{
563 using TSelf = TDerived;
565
567 FLUENT_FIELD_OPTION(bool, FailOnJobRestart);
568
573 FLUENT_FIELD_OPTION(TYPath, StderrTablePath);
574
579 FLUENT_FIELD_OPTION(TYPath, CoreTablePath);
580
590 FLUENT_FIELD_OPTION(TDuration, WaitingJobTimeout);
591};
592
607template <class TDerived>
609{
611 template <class T>
612 TDerived& HintMapOutput();
613
615 template <class T>
617
619 template <class T>
621
623 template <class T>
624 TDerived& HintReduceInput();
625
631 template <class T>
632 TDerived& AddMapOutput(const TRichYPath& path);
633
634 TVector<TRichYPath> MapOutputs_;
635
636 const TVector<TStructuredTablePath>& GetStructuredMapOutputs() const;
637 const TMaybe<TTableStructure>& GetIntermediateMapOutputDescription() const;
638 const TMaybe<TTableStructure>& GetIntermediateReduceCombinerInputDescription() const;
639 const TMaybe<TTableStructure>& GetIntermediateReduceCombinerOutputDescription() const;
640 const TMaybe<TTableStructure>& GetIntermediateReducerInputDescription() const;
641
642private:
643 TVector<TStructuredTablePath> StructuredMapOutputs_;
644 TMaybe<TTableStructure> IntermediateMapOutputDescription_;
645 TMaybe<TTableStructure> IntermediateReduceCombinerInputDescription_;
646 TMaybe<TTableStructure> IntermediateReduceCombinerOutputDescription_;
647 TMaybe<TTableStructure> IntermediateReducerInputDescription_;
648};
649
651
653{
655 using TSelf = TAddLocalFileOptions;
657
662 FLUENT_FIELD_OPTION(TString, PathInJob);
663
669 FLUENT_FIELD_OPTION(TString, MD5CheckSum);
670
675 FLUENT_FIELD_OPTION(bool, BypassArtifactCache);
676};
677
679
682{
684 JobProxy /* "job_proxy" */,
685
687 UserJob /* "user_job" */,
688};
689
692{
694 Cpu /* "cpu" */,
695
697 Memory /* "memory" */,
698
700 PeakMemory /* "peak_memory" */,
701};
702
705{
707 using TSelf = TJobProfilerSpec;
709
711 FLUENT_FIELD_OPTION(EProfilingBinary, ProfilingBinary);
712
714 FLUENT_FIELD_OPTION(EProfilerType, ProfilerType);
715
717 FLUENT_FIELD_OPTION(double, ProfilingProbability);
718
720 FLUENT_FIELD_OPTION(int, SamplingFrequency);
721};
722
724
731{
733 using TSelf = TDiskRequest;
735
737 FLUENT_FIELD_OPTION(i64, DiskSpace);
738
740 FLUENT_FIELD_OPTION(i64, InodeCount);
741
744 FLUENT_FIELD_OPTION(TString, Account);
745
747 FLUENT_FIELD_OPTION(TString, MediumName);
748};
749
751
757{
759 using TSelf = TUserJobSpec;
761
764 TSelf& AddLocalFile(const TLocalFilePath& path, const TAddLocalFileOptions& options = TAddLocalFileOptions());
765
768 TVector<std::tuple<TLocalFilePath, TAddLocalFileOptions>> GetLocalFiles() const;
769
772
774 FLUENT_VECTOR_FIELD(TYPath, Layer);
775
777 FLUENT_FIELD_OPTION(TString, DockerImage);
778
802 FLUENT_FIELD_OPTION(i64, MemoryLimit);
803
816 FLUENT_FIELD_OPTION(i64, ExtraTmpfsSize);
817
820 FLUENT_FIELD_OPTION(double, CpuLimit);
821
826 FLUENT_FIELD_OPTION(double, MemoryReserveFactor);
827
840 TUserJobSpec& JobBinaryLocalPath(TString path, TMaybe<TString> md5 = Nothing());
841
844 TUserJobSpec& JobBinaryCypressPath(TString path, TMaybe<TTransactionId> transactionId = Nothing());
845
850 FLUENT_FIELD(TString, JobCommandPrefix);
851
856 FLUENT_FIELD(TString, JobCommandSuffix);
857
860 FLUENT_MAP_FIELD(TString, TString, Environment);
861
864 FLUENT_FIELD_OPTION(ui64, DiskSpaceLimit);
865
868 FLUENT_FIELD_OPTION(ui16, PortCount);
869
872 FLUENT_FIELD_OPTION(TString, NetworkProject);
873
878 FLUENT_FIELD_OPTION(TDuration, JobTimeLimit);
879
882 const TJobBinaryConfig& GetJobBinary() const;
883
887
892 FLUENT_FIELD_OPTION(TDiskRequest, DiskRequest);
893
901 FLUENT_FIELD_DEFAULT(bool, EnableRpcProxyInJobProxy, false);
902
903private:
904 TVector<std::tuple<TLocalFilePath, TAddLocalFileOptions>> LocalFiles_;
905 TJobBinaryConfig JobBinary_;
906};
907
909
914template <typename TDerived>
916 : public TUserOperationSpecBase<TDerived>
917 , public TWithAutoMergeSpec<TDerived>
918{
920 using TSelf = TDerived;
922
925 FLUENT_FIELD(TUserJobSpec, MapperSpec);
926
934 FLUENT_FIELD_OPTION(bool, Ordered);
935
941 FLUENT_FIELD_OPTION(ui32, JobCount);
942
948 FLUENT_FIELD_OPTION(ui64, DataSizePerJob);
949};
950
956 : public TMapOperationSpecBase<TMapOperationSpec>
957 , public TOperationIOSpec<TMapOperationSpec>
958 , public TUserJobFormatHintsBase<TMapOperationSpec>
959{ };
960
966 : public TMapOperationSpecBase<TRawMapOperationSpec>
967 , public TSimpleRawOperationIoSpec<TRawMapOperationSpec>
968{ };
969
971
976template <typename TDerived>
978 : public TUserOperationSpecBase<TDerived>
979 , public TWithAutoMergeSpec<TDerived>
980{
982 using TSelf = TDerived;
984
987 FLUENT_FIELD(TUserJobSpec, ReducerSpec);
988
991 FLUENT_FIELD(TSortColumns, SortBy);
992
995 FLUENT_FIELD(TSortColumns, ReduceBy);
996
1001 FLUENT_FIELD_OPTION(TSortColumns, JoinBy);
1002
1005 FLUENT_FIELD_OPTION(bool, EnableKeyGuarantee);
1006
1012 FLUENT_FIELD_OPTION(ui32, JobCount);
1013
1019 FLUENT_FIELD_OPTION(ui64, DataSizePerJob);
1020};
1021
1027 : public TReduceOperationSpecBase<TReduceOperationSpec>
1028 , public TOperationIOSpec<TReduceOperationSpec>
1029 , public TUserJobFormatHintsBase<TReduceOperationSpec>
1030{ };
1031
1037 : public TReduceOperationSpecBase<TRawReduceOperationSpec>
1038 , public TSimpleRawOperationIoSpec<TRawReduceOperationSpec>
1039{ };
1040
1042
1050template <typename TDerived>
1052 : public TUserOperationSpecBase<TDerived>
1053{
1055 using TSelf = TDerived;
1057
1061
1066 FLUENT_FIELD(TSortColumns, JoinBy);
1067
1073 FLUENT_FIELD_OPTION(ui32, JobCount);
1074
1080 FLUENT_FIELD_OPTION(ui64, DataSizePerJob);
1081};
1082
1091 : public TJoinReduceOperationSpecBase<TJoinReduceOperationSpec>
1092 , public TOperationIOSpec<TJoinReduceOperationSpec>
1093 , public TUserJobFormatHintsBase<TJoinReduceOperationSpec>
1094{ };
1095
1104 : public TJoinReduceOperationSpecBase<TRawJoinReduceOperationSpec>
1105 , public TSimpleRawOperationIoSpec<TRawJoinReduceOperationSpec>
1106{ };
1107
1109
1114template <typename TDerived>
1116 : public TUserOperationSpecBase<TDerived>
1117{
1119 using TSelf = TDerived;
1121
1124 FLUENT_FIELD(TUserJobSpec, MapperSpec);
1125
1129
1133
1136 FLUENT_FIELD(TSortColumns, SortBy);
1137
1140 FLUENT_FIELD(TSortColumns, ReduceBy);
1141
1147 FLUENT_FIELD_OPTION(ui32, MapJobCount);
1148
1154 FLUENT_FIELD_OPTION(ui64, DataSizePerMapJob);
1155
1158 FLUENT_FIELD_OPTION(ui64, PartitionCount);
1159
1162 FLUENT_FIELD_OPTION(ui64, PartitionDataSize);
1163
1166 FLUENT_FIELD_OPTION(TString, IntermediateDataAccount);
1167
1170 FLUENT_FIELD_OPTION(ui64, IntermediateDataReplicationFactor);
1171
1174 FLUENT_FIELD_OPTION(ui64, DataSizePerSortJob);
1175
1180 FLUENT_FIELD_OPTION(bool, Ordered);
1181
1184 FLUENT_FIELD_OPTION(bool, ForceReduceCombiners);
1185};
1186
1192 : public TMapReduceOperationSpecBase<TMapReduceOperationSpec>
1193 , public TOperationIOSpec<TMapReduceOperationSpec>
1194 , public TIntermediateTablesHintSpec<TMapReduceOperationSpec>
1195{
1197 using TSelf = TMapReduceOperationSpec;
1199
1203
1207
1211};
1212
1218 : public TMapReduceOperationSpecBase<TRawMapReduceOperationSpec>
1219 , public TRawMapReduceOperationIoSpec<TRawMapReduceOperationSpec>
1220{ };
1221
1223
1228enum class ESchemaInferenceMode : int
1229{
1230 FromInput /* "from_input" */,
1231 FromOutput /* "from_output" */,
1232 Auto /* "auto" */,
1233};
1234
1240 : TOperationSpecBase<TSortOperationSpec>
1241{
1243 using TSelf = TSortOperationSpec;
1245
1249
1252 FLUENT_FIELD(TRichYPath, Output);
1253
1256 FLUENT_FIELD(TSortColumns, SortBy);
1257
1260 FLUENT_FIELD_OPTION(ui64, PartitionCount);
1261
1264 FLUENT_FIELD_OPTION(ui64, PartitionDataSize);
1265
1271 FLUENT_FIELD_OPTION(ui64, PartitionJobCount);
1272
1278 FLUENT_FIELD_OPTION(ui64, DataSizePerPartitionJob);
1279
1285
1288 FLUENT_FIELD_OPTION(TString, IntermediateDataAccount);
1289
1292 FLUENT_FIELD_OPTION(ui64, IntermediateDataReplicationFactor);
1293};
1294
1295
1298enum EMergeMode : int
1299{
1300 MM_UNORDERED /* "unordered" */,
1301 MM_ORDERED /* "ordered" */,
1302 MM_SORTED /* "sorted" */,
1303};
1304
1310 : TOperationSpecBase<TMergeOperationSpec>
1311{
1313 using TSelf = TMergeOperationSpec;
1315
1319
1322 FLUENT_FIELD(TRichYPath, Output);
1323
1326 FLUENT_FIELD(TSortColumns, MergeBy);
1327
1330 FLUENT_FIELD_DEFAULT(EMergeMode, Mode, MM_UNORDERED);
1331
1334 FLUENT_FIELD_DEFAULT(bool, CombineChunks, false);
1335
1338 FLUENT_FIELD_DEFAULT(bool, ForceTransform, false);
1339
1345 FLUENT_FIELD_OPTION(ui32, JobCount);
1346
1352 FLUENT_FIELD_OPTION(ui64, DataSizePerJob);
1353
1359};
1360
1366 : TOperationSpecBase<TEraseOperationSpec>
1367{
1369 using TSelf = TEraseOperationSpec;
1371
1374 FLUENT_FIELD(TRichYPath, TablePath);
1375
1378 FLUENT_FIELD_DEFAULT(bool, CombineChunks, false);
1379
1385};
1386
1392 : TOperationSpecBase<TRemoteCopyOperationSpec>
1393{
1395 using TSelf = TRemoteCopyOperationSpec;
1397
1400 FLUENT_FIELD(TString, ClusterName);
1401
1404 FLUENT_FIELD_OPTION(TString, NetworkName);
1405
1409
1412 FLUENT_FIELD(TRichYPath, Output);
1413
1419
1422 FLUENT_FIELD_DEFAULT(bool, CopyAttributes, false);
1423
1428 FLUENT_VECTOR_FIELD(TString, AttributeKey);
1429
1430private:
1431
1434 FLUENT_FIELD_OPTION(TNode, ClusterConnection);
1435};
1436
1437class IVanillaJobBase;
1438
1445 , public TUserJobOutputFormatHintsBase<TVanillaTask>
1446{
1448 using TSelf = TVanillaTask;
1450
1453 template <class T>
1454 TSelf& AddOutput(const TRichYPath& path);
1455
1459
1462 template <class T>
1463 TSelf& SetOutput(size_t tableIndex, const TRichYPath& path);
1464
1467 FLUENT_FIELD(TString, Name);
1468
1471 FLUENT_FIELD(::TIntrusivePtr<IVanillaJobBase>, Job);
1472
1475 FLUENT_FIELD(TUserJobSpec, Spec);
1476
1482 FLUENT_FIELD(ui64, JobCount);
1483
1486 FLUENT_FIELD(TMaybe<TString>, NetworkProject);
1487
1488};
1489
1495 : TUserOperationSpecBase<TVanillaOperationSpec>
1496{
1498 using TSelf = TVanillaOperationSpec;
1500
1504};
1505
1507
1511{
1513 using TSelf = TOperationOptions;
1515
1518 FLUENT_FIELD_OPTION(TNode, Spec);
1519
1522 enum class EStartOperationMode : int
1523 {
1527
1531
1535
1539 };
1540
1544
1549 TSelf& Wait(bool value) {
1550 StartOperationMode_ = value ? EStartOperationMode::SyncWait : EStartOperationMode::SyncStart;
1551 return static_cast<TSelf&>(*this);
1552 }
1553
1559 FLUENT_FIELD_DEFAULT(bool, UseTableFormats, false);
1560
1565 FLUENT_FIELD(TString, JobCommandPrefix);
1566
1571 FLUENT_FIELD(TString, JobCommandSuffix);
1572
1578 FLUENT_FIELD_DEFAULT(bool, MountSandboxInTmpfs, false);
1579
1583 FLUENT_FIELD_OPTION(TString, FileStorage);
1584
1593 FLUENT_FIELD_OPTION(TDuration, FileExpirationTimeout);
1594
1597 FLUENT_FIELD_OPTION(TNode, SecureVault);
1598
1611
1615
1624 FLUENT_FIELD(TTransactionId, FileStorageTransactionId);
1625
1630 FLUENT_FIELD_DEFAULT(bool, CreateDebugOutputTables, true);
1631
1636 FLUENT_FIELD_DEFAULT(bool, CreateOutputTables, true);
1637
1643 FLUENT_FIELD_OPTION(bool, InferOutputSchema);
1644
1649 FLUENT_FIELD_DEFAULT(i64, MinJobStateSizeToPassViaFile, 0);
1650};
1651
1653
1656const TNode& GetJobSecureVault();
1657
1659
1662class TRawJobContext
1663{
1664public:
1665 explicit TRawJobContext(size_t outputTableCount);
1666
1669 const TFile& GetInputFile() const;
1670
1673 const TVector<TFile>& GetOutputFileList() const;
1674
1675private:
1676 TFile InputFile_;
1677 TVector<TFile> OutputFileList_;
1678};
1679
1681
1685{
1686public:
1687 virtual ~ISerializableForJob() = default;
1688
1691 virtual void Save(IOutputStream& stream) const = 0;
1692
1695 virtual void Load(IInputStream& stream) = 0;
1696};
1697
1699
1703{
1704public:
1705 virtual ~IOperationPreparationContext() = default;
1706
1708 virtual int GetInputCount() const = 0;
1709
1711 virtual int GetOutputCount() const = 0;
1712
1714 virtual const TTableSchema& GetInputSchema(int index) const = 0;
1715
1717 virtual const TVector<TTableSchema>& GetInputSchemas() const = 0;
1718
1720 virtual TMaybe<TYPath> GetInputPath(int index) const = 0;
1721
1723 virtual TMaybe<TYPath> GetOutputPath(int index) const = 0;
1724};
1725
1730class TJobOperationPreparer
1731{
1732public:
1733
1738 class TInputGroup
1739 {
1740 public:
1741 TInputGroup(TJobOperationPreparer& preparer, TVector<int> indices);
1742
1744 template <typename TRow>
1745 TInputGroup& Description();
1746
1748 TInputGroup& ColumnRenaming(const THashMap<TString, TString>& renaming);
1749
1753 TInputGroup& ColumnFilter(const TVector<TString>& columns);
1754
1756 TJobOperationPreparer& EndInputGroup();
1757
1758 private:
1759 TJobOperationPreparer& Preparer_;
1760 TVector<int> Indices_;
1761 };
1762
1767 class TOutputGroup
1768 {
1769 public:
1770 TOutputGroup(TJobOperationPreparer& preparer, TVector<int> indices);
1771
1776 template <typename TRow>
1777 TOutputGroup& Description(bool inferSchema = true);
1778
1780 TOutputGroup& Schema(const TTableSchema& schema);
1781
1785 TOutputGroup& NoSchema();
1786
1788 TJobOperationPreparer& EndOutputGroup();
1789
1790 private:
1791 TJobOperationPreparer& Preparer_;
1792 TVector<int> Indices_;
1793 };
1794
1795public:
1796 explicit TJobOperationPreparer(const IOperationPreparationContext& context);
1797
1803
1808 template <typename TCont>
1809 TInputGroup BeginInputGroup(const TCont& indices);
1810
1816
1821 template <typename TCont>
1822 TOutputGroup BeginOutputGroup(const TCont& indices);
1823
1827 TJobOperationPreparer& OutputSchema(int tableIndex, TTableSchema schema);
1828
1830 TJobOperationPreparer& NoOutputSchema(int tableIndex);
1831
1833 TJobOperationPreparer& InputColumnRenaming(int tableIndex, const THashMap<TString, TString>& renaming);
1834
1838 TJobOperationPreparer& InputColumnFilter(int tableIndex, const TVector<TString>& columns);
1839
1843 template <typename TRow>
1844 TJobOperationPreparer& InputDescription(int tableIndex);
1845
1850 template <typename TRow>
1851 TJobOperationPreparer& OutputDescription(int tableIndex, bool inferSchema = true);
1852
1856 TJobOperationPreparer& NodeOutput(int tableIndex);
1857
1861 TJobOperationPreparer& InputFormatHints(TFormatHints hints);
1862
1866 TJobOperationPreparer& OutputFormatHints(TFormatHints hints);
1867
1871 TJobOperationPreparer& FormatHints(TUserJobFormatHints newFormatHints);
1872
1876
1878 void Finish();
1879
1881 TVector<TTableSchema> GetOutputSchemas();
1882
1884 const TVector<THashMap<TString, TString>>& GetInputColumnRenamings() const;
1885
1887 const TVector<TMaybe<TVector<TString>>>& GetInputColumnFilters() const;
1888
1890 const TVector<TMaybe<TTableStructure>>& GetInputDescriptions() const;
1891
1893 const TVector<TMaybe<TTableStructure>>& GetOutputDescriptions() const;
1894
1897
1899private:
1900
1902 void ValidateMissingOutputSchema(int tableIndex) const;
1903
1905 void ValidateMissingInputDescription(int tableIndex) const;
1906
1908 void ValidateMissingOutputDescription(int tableIndex) const;
1909
1913 void ValidateInputTableIndex(int tableIndex, TStringBuf message) const;
1914
1918 void ValidateOutputTableIndex(int tableIndex, TStringBuf message) const;
1919
1921 void FinallyValidate() const;
1922
1923 static TTableSchema EmptyNonstrictSchema();
1924
1925private:
1926 const IOperationPreparationContext& Context_;
1927
1928 TVector<TMaybe<TTableSchema>> OutputSchemas_;
1929 TVector<THashMap<TString, TString>> InputColumnRenamings_;
1930 TVector<TMaybe<TVector<TString>>> InputColumnFilters_;
1931 TVector<TMaybe<TTableStructure>> InputTableDescriptions_;
1932 TVector<TMaybe<TTableStructure>> OutputTableDescriptions_;
1933 TUserJobFormatHints FormatHints_ = {};
1934};
1935
1937
1940class IJob
1941 : public TThrRefBase
1942{
1943public:
1944
1948 {
1949 Mapper,
1950 Reducer,
1951 ReducerAggregator,
1952 RawJob,
1953 VanillaJob,
1954 };
1955
1958 virtual void Save(IOutputStream& stream) const
1959 {
1960 Y_UNUSED(stream);
1961 }
1962
1965 virtual void Load(IInputStream& stream)
1966 {
1967 Y_UNUSED(stream);
1968 }
1969
1972 const TNode& SecureVault() const
1973 {
1974 return GetJobSecureVault();
1975 }
1976
1980 {
1981 Y_ABORT_UNLESS(NDetail::OutputTableCount > 0);
1982
1983 return NDetail::OutputTableCount;
1984 }
1985
2018 virtual void PrepareOperation(const IOperationPreparationContext& context, TJobOperationPreparer& preparer) const;
2019};
2020
2023#define Y_SAVELOAD_JOB(...) \
2024 virtual void Save(IOutputStream& stream) const override { Save(&stream); } \
2025 virtual void Load(IInputStream& stream) override { Load(&stream); } \
2026 Y_PASS_VA_ARGS(Y_SAVELOAD_DEFINE(__VA_ARGS__))
2027
2030#define Y_SAVELOAD_JOB_DERIVED(Base, ...) \
2031 virtual void Save(IOutputStream& stream) const override { \
2032 Base::Save(stream); \
2033 Save(&stream); \
2034 } \
2035 virtual void Load(IInputStream& stream) override { \
2036 Base::Load(stream); \
2037 Load(&stream); \
2038 } \
2039 Y_PASS_VA_ARGS(Y_SAVELOAD_DEFINE(__VA_ARGS__))
2040
2042
2046 : public IJob
2047{
2048public:
2053 virtual TRawTableReaderPtr CreateCustomRawJobReader(int fd) const;
2054 virtual THolder<IProxyOutput> CreateCustomRawJobWriter(size_t outputTableCount) const;
2055
2056 virtual TStructuredRowStreamDescription GetInputRowStreamDescription() const = 0;
2057 virtual TStructuredRowStreamDescription GetOutputRowStreamDescription() const = 0;
2058};
2059
2061
2064TRawTableReaderPtr CreateRawJobReader(int fd = 0);
2065
2068THolder<IProxyOutput> CreateRawJobWriter(size_t outputTableCount);
2069
2071
2075 : public IStructuredJob
2076{ };
2077
2080template <class TR, class TW>
2082 : public IMapperBase
2083{
2084public:
2085 using TReader = TR;
2086 using TWriter = TW;
2087
2088public:
2090 static constexpr EType JobType = EType::Mapper;
2091
2094 virtual void Start(TWriter* writer)
2095 {
2096 Y_UNUSED(writer);
2097 }
2098
2103 virtual void Do(TReader* reader, TWriter* writer) = 0;
2104
2107 virtual void Finish(TWriter* writer)
2108 {
2109 Y_UNUSED(writer);
2110 }
2111
2112 virtual TStructuredRowStreamDescription GetInputRowStreamDescription() const override;
2113 virtual TStructuredRowStreamDescription GetOutputRowStreamDescription() const override;
2114};
2115
2117
2123 : public IStructuredJob
2124{ };
2125
2128template <class TR, class TW>
2130 : public IReducerBase
2131{
2132public:
2133 using TReader = TR;
2134 using TWriter = TW;
2135
2136public:
2138 static constexpr EType JobType = EType::Reducer;
2139
2140public:
2141
2144 virtual void Start(TWriter* writer)
2145 {
2146 Y_UNUSED(writer);
2147 }
2148
2151 virtual void Do(TReader* reader, TWriter* writer) = 0;
2152
2155 virtual void Finish(TWriter* writer)
2156 {
2157 Y_UNUSED(writer);
2158 }
2159
2162 void Break();
2163
2164 virtual TStructuredRowStreamDescription GetInputRowStreamDescription() const override;
2165 virtual TStructuredRowStreamDescription GetOutputRowStreamDescription() const override;
2166};
2167
2169
2177template <class TR, class TW>
2178class IAggregatorReducer
2179 : public IReducerBase
2180{
2181public:
2182 using TReader = TR;
2183 using TWriter = TW;
2184
2185public:
2187 static constexpr EType JobType = EType::ReducerAggregator;
2188
2189public:
2192 virtual void Start(TWriter* writer)
2193 {
2194 Y_UNUSED(writer);
2195 }
2196
2199 virtual void Do(TReader* reader, TWriter* writer) = 0;
2200
2203 virtual void Finish(TWriter* writer)
2204 {
2205 Y_UNUSED(writer);
2206 }
2207
2208 virtual TStructuredRowStreamDescription GetInputRowStreamDescription() const override;
2209 virtual TStructuredRowStreamDescription GetOutputRowStreamDescription() const override;
2210};
2211
2213
2217 : public IJob
2218{
2219public:
2221 static constexpr EType JobType = EType::RawJob;
2222
2225 virtual void Do(const TRawJobContext& jobContext) = 0;
2226};
2227
2231 : public IJob
2232{
2233public:
2238 virtual const TString& GetCommand() const = 0;
2239};
2240
2246 : public IRawJob
2247 , public ICommandJob
2248{
2249public:
2254 explicit TCommandRawJob(TStringBuf command = {});
2255
2256 const TString& GetCommand() const override;
2257 void Do(const TRawJobContext& jobContext) override;
2258
2259private:
2260 TString Command_;
2261};
2262
2264
2270 : public virtual IStructuredJob
2271{
2272public:
2274 static constexpr EType JobType = EType::VanillaJob;
2275};
2276
2277template <class TW = void>
2278class IVanillaJob;
2279
2282template <>
2283class IVanillaJob<void>
2284 : public IVanillaJobBase
2285{
2286public:
2289 virtual void Do() = 0;
2290
2291 virtual TStructuredRowStreamDescription GetInputRowStreamDescription() const override;
2292 virtual TStructuredRowStreamDescription GetOutputRowStreamDescription() const override;
2293};
2294
2300 : public IVanillaJob<>
2301 , public ICommandJob
2302{
2303public:
2308 explicit TCommandVanillaJob(TStringBuf command = {});
2309
2310 const TString& GetCommand() const override;
2311 void Do() override;
2312
2313private:
2314 TString Command_;
2315};
2316
2319template <class TW>
2321 : public IVanillaJobBase
2322{
2323public:
2324 using TWriter = TW;
2325
2326public:
2329 virtual void Start(TWriter* /* writer */)
2330 { }
2331
2336 virtual void Do(TWriter* writer) = 0;
2337
2340 virtual void Finish(TWriter* /* writer */)
2341 { }
2342
2343 virtual TStructuredRowStreamDescription GetInputRowStreamDescription() const override;
2344 virtual TStructuredRowStreamDescription GetOutputRowStreamDescription() const override;
2345};
2346
2348
2351enum class EOperationAttribute : int
2352{
2353 Id /* "id" */,
2354 Type /* "type" */,
2355 State /* "state" */,
2356 AuthenticatedUser /* "authenticated_user" */,
2357 StartTime /* "start_time" */,
2358 FinishTime /* "finish_time" */,
2359 BriefProgress /* "brief_progress" */,
2360 BriefSpec /* "brief_spec" */,
2361 Suspended /* "suspended" */,
2362 Result /* "result" */,
2363 Progress /* "progress" */,
2364 Events /* "events" */,
2365 Spec /* "spec" */,
2366 FullSpec /* "full_spec" */,
2367 UnrecognizedSpec /* "unrecognized_spec" */,
2368 Alerts /* "alerts" */,
2369};
2370
2374{
2376 using TSelf = TOperationAttributeFilter;
2378
2379 TVector<EOperationAttribute> Attributes_;
2380
2383 TSelf& Add(EOperationAttribute attribute)
2384 {
2385 Attributes_.push_back(attribute);
2386 return *this;
2387 }
2388};
2389
2393{
2395 using TSelf = TGetOperationOptions;
2397
2401
2402 FLUENT_FIELD_OPTION(bool, IncludeRuntime);
2403};
2404
2407enum class EOperationBriefState : int
2408{
2409 InProgress /* "in_progress" */,
2410 Completed /* "completed" */,
2411 Aborted /* "aborted" */,
2412
2414 Failed /* "failed" */,
2415};
2416
2417
2420enum class EOperationState : int
2421{
2422 None /* "none" */,
2423 Starting /* "starting" */,
2424 Orphaned /* "orphaned" */,
2425 WaitingForAgent /* "waiting_for_agent" */,
2426 Initializing /* "initializing" */,
2427 Preparing /* "preparing" */,
2428 Materializing /* "orphaned" */,
2429 ReviveInitializing /* "revive_initializing" */,
2430 Reviving /* "reviving" */,
2431 RevivingJobs /* "reviving_jobs" */,
2432 Pending /* "pending" */,
2433 Running /* "running" */,
2434 Completing /* "completing" */,
2435 Completed /* "completed" */,
2436 Aborting /* "aborting" */,
2437 Aborted /* "aborted" */,
2438 Failing /* "failing" */,
2439 Failed /* "failed" */,
2440};
2441
2444enum class EOperationType : int
2445{
2446 Map /* "map" */,
2447 Merge /* "merge" */,
2448 Erase /* "erase" */,
2449 Sort /* "sort" */,
2450 Reduce /* "reduce" */,
2451 MapReduce /* "map_reduce" */,
2452 RemoteCopy /* "remote_copy" */,
2453 JoinReduce /* "join_reduce" */,
2454 Vanilla /* "vanilla" */,
2455};
2456
2473
2477{
2478 i64 Aborted = 0;
2479 i64 Completed = 0;
2480 i64 Failed = 0;
2481 i64 Lost = 0;
2482 i64 Pending = 0;
2483 i64 Running = 0;
2484 i64 Total = 0;
2485};
2486
2490{
2493 TMaybe<TYtError> Error;
2494};
2495
2499{
2502 TString State;
2503
2506 TInstant Time;
2507};
2508
2516{
2519 TMaybe<TOperationId> Id;
2520
2523 TMaybe<EOperationType> Type;
2524
2527 TMaybe<TString> State;
2528
2531 TMaybe<EOperationBriefState> BriefState;
2532
2535 TMaybe<TString> AuthenticatedUser;
2536
2539 TMaybe<TInstant> StartTime;
2540
2543 TMaybe<TInstant> FinishTime;
2544
2547 TMaybe<TOperationBriefProgress> BriefProgress;
2548
2551 TMaybe<TNode> BriefSpec;
2552
2555 TMaybe<TNode> Spec;
2556
2559 TMaybe<TNode> FullSpec;
2560
2563 TMaybe<TNode> UnrecognizedSpec;
2564
2567 TMaybe<bool> Suspended;
2568
2571 TMaybe<TOperationResult> Result;
2572
2575 TMaybe<TOperationProgress> Progress;
2576
2579 TMaybe<TVector<TOperationEvent>> Events;
2580
2583 TMaybe<THashMap<TString, TYtError>> Alerts;
2584};
2585
2589{
2590 Past /* "past" */,
2591 Future /* "future" */,
2592};
2593
2599{
2601 using TSelf = TListOperationsOptions;
2603
2611
2614 FLUENT_FIELD_OPTION(TInstant, FromTime);
2615
2618 FLUENT_FIELD_OPTION(TInstant, ToTime);
2619
2625 FLUENT_FIELD_OPTION(TInstant, CursorTime);
2626
2629 FLUENT_FIELD_OPTION(ECursorDirection, CursorDirection);
2630
2632
2637
2641 FLUENT_FIELD_OPTION(TString, Filter);
2642
2645 FLUENT_FIELD_OPTION(TString, Pool);
2646
2649 FLUENT_FIELD_OPTION(TString, User);
2650
2653 FLUENT_FIELD_OPTION(EOperationState, State);
2654
2657 FLUENT_FIELD_OPTION(EOperationType, Type);
2658
2661 FLUENT_FIELD_OPTION(bool, WithFailedJobs);
2662
2664
2667 FLUENT_FIELD_OPTION(bool, IncludeArchive);
2668
2674 FLUENT_FIELD_OPTION(bool, IncludeCounters);
2675
2678 FLUENT_FIELD_OPTION(i64, Limit);
2679};
2680
2684{
2687 TVector<TOperationAttributes> Operations;
2688
2701
2704 TMaybe<THashMap<TString, i64>> PoolCounts;
2705
2708 TMaybe<THashMap<TString, i64>> UserCounts;
2709
2712 TMaybe<THashMap<TString, i64>> StateCounts;
2713
2716 TMaybe<THashMap<EOperationType, i64>> TypeCounts;
2717
2721
2723
2732};
2733
2735
2738enum class EListJobsDataSource : int
2739{
2740 Runtime /* "runtime" */,
2741 Archive /* "archive" */,
2742 Auto /* "auto" */,
2743 Manual /* "manual" */,
2744};
2745
2748enum class EJobType : int
2749{
2750 Map /* "map" */,
2751 PartitionMap /* "partition_map" */,
2752 SortedMerge /* "sorted_merge" */,
2753 OrderedMerge /* "ordered_merge" */,
2754 UnorderedMerge /* "unordered_merge" */,
2755 Partition /* "partition" */,
2756 SimpleSort /* "simple_sort" */,
2757 FinalSort /* "final_sort" */,
2758 SortedReduce /* "sorted_reduce" */,
2759 PartitionReduce /* "partition_reduce" */,
2760 ReduceCombiner /* "reduce_combiner" */,
2761 RemoteCopy /* "remote_copy" */,
2762 IntermediateSort /* "intermediate_sort" */,
2763 OrderedMap /* "ordered_map" */,
2764 JoinReduce /* "join_reduce" */,
2765 Vanilla /* "vanilla" */,
2766 SchedulerUnknown /* "scheduler_unknown" */,
2767 ReplicateChunk /* "replicate_chunk" */,
2768 RemoveChunk /* "remove_chunk" */,
2769 RepairChunk /* "repair_chunk" */,
2770 SealChunk /* "seal_chunk" */,
2771 ShallowMerge /* "shallow_merge" */,
2772 MergeChunks /* "merge_chunks" */,
2773 AutotomizeChunk /* "autotomize_chunk" */,
2774 ReincarnateChunk /* "reincarnate_chunk" */,
2775};
2776
2779enum class ETaskName : int
2780{
2781 Map /* "map" */,
2782 PartitionMap0 /* "partition_map(0)" */,
2783 SortedMerge /* "sorted_merge" */,
2784 OrderedMerge /* "ordered_merge" */,
2785 UnorderedMerge /* "unordered_merge" */,
2786 Partition0 /* "partition(0)" */,
2787 Partition1 /* "partition(1)" */,
2788 Partition2 /* "partition(2)" */,
2789 SimpleSort /* "simple_sort" */,
2790 FinalSort /* "final_sort" */,
2791 SortedReduce /* "sorted_reduce" */,
2792 PartitionReduce /* "partition_reduce" */,
2793 ReduceCombiner /* "reduce_combiner" */,
2794 RemoteCopy /* "remote_copy" */,
2795 IntermediateSort /* "intermediate_sort" */,
2796 OrderedMap /* "ordered_map" */,
2797 JoinReduce /* "join_reduce" */,
2798};
2799
2803{
2804public:
2805
2806 // Constructors are implicit by design.
2807
2810 TTaskName(TString taskName);
2811
2814 TTaskName(const char* taskName);
2815
2819
2820 const TString& Get() const;
2821
2822private:
2823 TString TaskName_;
2824};
2825
2828enum class EJobState : int
2829{
2830 None /* "none" */,
2831 Waiting /* "waiting" */,
2832 Running /* "running" */,
2833 Aborting /* "aborting" */,
2834 Completed /* "completed" */,
2835 Failed /* "failed" */,
2836 Aborted /* "aborted" */,
2837 Lost /* "lost" */,
2838};
2839
2844enum class EJobSortField : int
2845{
2846 Type /* "type" */,
2847 State /* "state" */,
2848 StartTime /* "start_time" */,
2849 FinishTime /* "finish_time" */,
2850 Address /* "address" */,
2851 Duration /* "duration" */,
2852 Progress /* "progress" */,
2853 Id /* "id" */,
2854 TaskName /* "task_name" */,
2855};
2856
2861enum class EJobSortDirection : int
2862{
2863 Ascending /* "ascending" */,
2864 Descending /* "descending" */,
2865};
2866
2869enum class EJobAttribute : int
2870{
2871 Id /* "id" */,
2872 Type /* "type" */,
2873 State /* "state" */,
2874 Address /* "address" */,
2875 TaskName /* "task_name" */,
2876 StartTime /* "start_time" */,
2877 FinishTime /* "finish_time" */,
2878 Progress /* "progress" */,
2879 StderrSize /* "stderr_size" */,
2880 Error /* "error" */,
2881 Result /* "result" */,
2882 BriefStatistics /* "brief_statistics" */,
2883 InputPaths /* "input_paths" */,
2884 CoreInfos /* "core_infos" */,
2885};
2886
2890{
2892 using TSelf = TJobAttributeFilter;
2894
2895 THashSet<EJobAttribute> Attributes_;
2896
2899 TSelf& Add(EJobAttribute attribute)
2900 {
2901 Attributes_.insert(attribute);
2902 return *this;
2903 }
2904};
2905
2911{
2913 using TSelf = TListJobsOptions;
2915
2921
2924 FLUENT_FIELD_OPTION(EJobType, Type);
2925
2928 FLUENT_FIELD_OPTION(EJobState, State);
2929
2932 FLUENT_FIELD_OPTION(TString, Address);
2933
2936 FLUENT_FIELD_OPTION(bool, WithStderr);
2937
2940 FLUENT_FIELD_OPTION(bool, WithSpec);
2941
2944 FLUENT_FIELD_OPTION(bool, WithFailContext);
2945
2948 FLUENT_FIELD_OPTION(bool, WithMonitoringDescriptor);
2949
2952 FLUENT_FIELD_OPTION(bool, WithInterruptionInfo);
2953
2956 FLUENT_FIELD_OPTION(TString, OperationIncarnation);
2957
2960 FLUENT_FIELD_OPTION(TString, MonitoringDescriptor);
2961
2964 FLUENT_FIELD_OPTION(TInstant, FromTime);
2965
2968 FLUENT_FIELD_OPTION(TInstant, ToTime);
2969
2972 FLUENT_FIELD_OPTION(TString, ContinuationToken);
2973
2977
2979
2983
2986 FLUENT_FIELD_OPTION(EJobSortField, SortField);
2987
2990 FLUENT_FIELD_OPTION(ESortOrder, SortOrder);
2991
2993
2999 FLUENT_FIELD_OPTION(EListJobsDataSource, DataSource);
3000
3002 FLUENT_FIELD_OPTION(bool, IncludeCypress);
3003
3005 FLUENT_FIELD_OPTION(bool, IncludeControllerAgent);
3006
3008 FLUENT_FIELD_OPTION(bool, IncludeArchive);
3009
3012 FLUENT_FIELD_OPTION(i64, Limit);
3013
3018 FLUENT_FIELD_OPTION(i64, Offset);
3019};
3020
3024{
3025 i64 ProcessId;
3026 TString ExecutableName;
3027 TMaybe<ui64> Size;
3028 TMaybe<TYtError> Error;
3029};
3030
3038{
3041 TMaybe<TJobId> Id;
3042
3045 TMaybe<EJobType> Type;
3046
3049 TMaybe<EJobState> State;
3050
3053 TMaybe<TString> Address;
3054
3057 TMaybe<TString> TaskName;
3058
3061 TMaybe<TInstant> StartTime;
3062
3065 TMaybe<TInstant> FinishTime;
3066
3069 TMaybe<double> Progress;
3070
3073 TMaybe<i64> StderrSize;
3074
3077 TMaybe<TYtError> Error;
3078
3081 TMaybe<TNode> BriefStatistics;
3082
3085 TMaybe<TVector<TRichYPath>> InputPaths;
3086
3089 TMaybe<TVector<TCoreInfo>> CoreInfos;
3090
3093 TMaybe<TNode> ExecAttributes;
3094
3097 TMaybe<ui64> Cookie;
3098};
3099
3103{
3106 TVector<TJobAttributes> Jobs;
3107
3110 TMaybe<i64> CypressJobCount;
3111
3115
3118 TMaybe<i64> ArchiveJobCount;
3119};
3120
3122
3126{
3128 using TSelf = TGetJobOptions;
3130
3134};
3135
3139{
3141 using TSelf = TGetJobInputOptions;
3143};
3144
3148{
3150 using TSelf = TGetJobFailContextOptions;
3152};
3153
3157{
3159 using TSelf = TGetJobStderrOptions;
3161};
3162
3164
3168{
3170 using TSelf = TGetFailedJobInfoOptions;
3172
3175 FLUENT_FIELD_DEFAULT(ui64, MaxJobCount, 10);
3176
3179 FLUENT_FIELD_DEFAULT(ui64, StderrTailSize, 64 * 1024);
3180};
3181
3183
3187{
3189 using TSelf = TGetJobTraceOptions;
3191
3194 FLUENT_FIELD_OPTION(TJobId, JobId);
3195
3198 FLUENT_FIELD_OPTION(TJobTraceId, TraceId);
3199
3202 FLUENT_FIELD_OPTION(TInstant, FromTime);
3203
3206 FLUENT_FIELD_OPTION(TInstant, ToTime);
3207};
3208
3212{
3215 TOperationId OperationId;
3216
3219 TJobId JobId;
3220
3223 TJobTraceId TraceId;
3224
3227 i64 EventIndex = 0;
3228
3231 std::string Event;
3232
3235 TInstant EventTime;
3236};
3237
3239
3243 : public TThrRefBase
3244{
3245 ~IOperation() override = default;
3246
3249 virtual const TOperationId& GetId() const = 0;
3250
3253 virtual TString GetWebInterfaceUrl() const = 0;
3254
3260 virtual TString GetStatus() const = 0;
3261
3266 virtual ::NThreading::TFuture<void> GetPreparedFuture() = 0;
3267
3275 virtual void Start() = 0;
3276
3281 virtual bool IsStarted() const = 0;
3282
3287 virtual ::NThreading::TFuture<void> GetStartedFuture() = 0;
3288
3304 virtual ::NThreading::TFuture<void> Watch() = 0;
3305
3313 virtual TVector<TFailedJobInfo> GetFailedJobInfo(const TGetFailedJobInfoOptions& options = TGetFailedJobInfoOptions()) = 0;
3314
3318
3323 virtual TMaybe<TYtError> GetError() = 0;
3324
3328
3333 virtual TMaybe<TOperationBriefProgress> GetBriefProgress() = 0;
3334
3337 virtual TMaybe<THashMap<TString, TYtError>> GetAlerts() = 0;
3338
3346 virtual void AbortOperation() = 0;
3347
3356 virtual void CompleteOperation() = 0;
3357
3364 virtual void SuspendOperation(
3365 const TSuspendOperationOptions& options = TSuspendOperationOptions()) = 0;
3366
3371 virtual void ResumeOperation(
3372 const TResumeOperationOptions& options = TResumeOperationOptions()) = 0;
3373
3379 const TGetOperationOptions& options = TGetOperationOptions()) = 0;
3380
3385 virtual void UpdateParameters(
3387
3393 const TJobId& jobId,
3394 const TGetJobOptions& options = TGetJobOptions()) = 0;
3395
3401 const TListJobsOptions& options = TListJobsOptions()) = 0;
3402};
3403
3407{
3416 IOperationPtr Map(
3417 const TMapOperationSpec& spec,
3418 ::TIntrusivePtr<IMapperBase> mapper,
3419 const TOperationOptions& options = TOperationOptions());
3420
3431 IOperationPtr Map(
3432 ::TIntrusivePtr<IMapperBase> mapper,
3435 const TMapOperationSpec& spec = TMapOperationSpec(),
3436 const TOperationOptions& options = TOperationOptions());
3437
3446 virtual IOperationPtr RawMap(
3447 const TRawMapOperationSpec& spec,
3448 ::TIntrusivePtr<IRawJob> rawJob,
3449 const TOperationOptions& options = TOperationOptions()) = 0;
3450
3459 IOperationPtr Reduce(
3460 const TReduceOperationSpec& spec,
3461 ::TIntrusivePtr<IReducerBase> reducer,
3462 const TOperationOptions& options = TOperationOptions());
3463
3475 IOperationPtr Reduce(
3476 ::TIntrusivePtr<IReducerBase> reducer,
3479 const TSortColumns& reduceBy,
3481 const TOperationOptions& options = TOperationOptions());
3482
3491 virtual IOperationPtr RawReduce(
3492 const TRawReduceOperationSpec& spec,
3493 ::TIntrusivePtr<IRawJob> rawJob,
3494 const TOperationOptions& options = TOperationOptions()) = 0;
3495
3504 IOperationPtr JoinReduce(
3505 const TJoinReduceOperationSpec& spec,
3506 ::TIntrusivePtr<IReducerBase> reducer,
3507 const TOperationOptions& options = TOperationOptions());
3508
3517 virtual IOperationPtr RawJoinReduce(
3518 const TRawJoinReduceOperationSpec& spec,
3519 ::TIntrusivePtr<IRawJob> rawJob,
3520 const TOperationOptions& options = TOperationOptions()) = 0;
3521
3531 IOperationPtr MapReduce(
3532 const TMapReduceOperationSpec& spec,
3533 ::TIntrusivePtr<IMapperBase> mapper,
3534 ::TIntrusivePtr<IReducerBase> reducer,
3535 const TOperationOptions& options = TOperationOptions());
3536
3547 IOperationPtr MapReduce(
3548 const TMapReduceOperationSpec& spec,
3549 ::TIntrusivePtr<IMapperBase> mapper,
3550 ::TIntrusivePtr<IReducerBase> reduceCombiner,
3551 ::TIntrusivePtr<IReducerBase> reducer,
3552 const TOperationOptions& options = TOperationOptions());
3553
3566 IOperationPtr MapReduce(
3567 ::TIntrusivePtr<IMapperBase> mapper,
3568 ::TIntrusivePtr<IReducerBase> reducer,
3571 const TSortColumns& reduceBy,
3573 const TOperationOptions& options = TOperationOptions());
3574
3588 IOperationPtr MapReduce(
3589 ::TIntrusivePtr<IMapperBase> mapper,
3590 ::TIntrusivePtr<IReducerBase> reduceCombiner,
3591 ::TIntrusivePtr<IReducerBase> reducer,
3594 const TSortColumns& reduceBy,
3596 const TOperationOptions& options = TOperationOptions());
3597
3608 virtual IOperationPtr RawMapReduce(
3609 const TRawMapReduceOperationSpec& spec,
3610 ::TIntrusivePtr<IRawJob> mapper,
3611 ::TIntrusivePtr<IRawJob> reduceCombiner,
3612 ::TIntrusivePtr<IRawJob> reducer,
3613 const TOperationOptions& options = TOperationOptions()) = 0;
3614
3622 virtual IOperationPtr Sort(
3623 const TSortOperationSpec& spec,
3624 const TOperationOptions& options = TOperationOptions()) = 0;
3625
3636 IOperationPtr Sort(
3637 const TOneOrMany<TRichYPath>& input,
3638 const TRichYPath& output,
3639 const TSortColumns& sortBy,
3640 const TSortOperationSpec& spec = TSortOperationSpec(),
3641 const TOperationOptions& options = TOperationOptions());
3642
3650 virtual IOperationPtr Merge(
3651 const TMergeOperationSpec& spec,
3652 const TOperationOptions& options = TOperationOptions()) = 0;
3653
3661 virtual IOperationPtr Erase(
3662 const TEraseOperationSpec& spec,
3663 const TOperationOptions& options = TOperationOptions()) = 0;
3664
3672 virtual IOperationPtr RemoteCopy(
3673 const TRemoteCopyOperationSpec& spec,
3674 const TOperationOptions& options = TOperationOptions()) = 0;
3675
3683 virtual IOperationPtr RunVanilla(
3684 const TVanillaOperationSpec& spec,
3685 const TOperationOptions& options = TOperationOptions()) = 0;
3686
3691 virtual void AbortOperation(
3692 const TOperationId& operationId) = 0;
3693
3698 virtual void CompleteOperation(
3699 const TOperationId& operationId) = 0;
3700
3703 virtual void WaitForOperation(
3704 const TOperationId& operationId) = 0;
3705
3712 const TOperationId& operationId) = 0;
3713
3718 virtual IOperationPtr AttachOperation(const TOperationId& operationId) = 0;
3719
3720private:
3721 virtual IOperationPtr DoMap(
3722 const TMapOperationSpec& spec,
3723 ::TIntrusivePtr<IStructuredJob> mapper,
3724 const TOperationOptions& options) = 0;
3725
3726 virtual IOperationPtr DoReduce(
3727 const TReduceOperationSpec& spec,
3728 ::TIntrusivePtr<IStructuredJob> reducer,
3729 const TOperationOptions& options) = 0;
3730
3731 virtual IOperationPtr DoJoinReduce(
3732 const TJoinReduceOperationSpec& spec,
3733 ::TIntrusivePtr<IStructuredJob> reducer,
3734 const TOperationOptions& options) = 0;
3735
3736 virtual IOperationPtr DoMapReduce(
3737 const TMapReduceOperationSpec& spec,
3738 ::TIntrusivePtr<IStructuredJob> mapper,
3739 ::TIntrusivePtr<IStructuredJob> reduceCombiner,
3740 ::TIntrusivePtr<IStructuredJob> reducer,
3741 const TOperationOptions& options) = 0;
3742};
3743
3745
3746} // namespace NYT
3747
3748#define OPERATION_INL_H_
3749#include "operation-inl.h"
3750#undef OPERATION_INL_H_
Interface of jobs that run the given bash command.
Definition operation.h:2232
virtual const TString & GetCommand() const =0
Get bash command to run.
Interface for all user jobs.
Definition operation.h:1942
virtual void PrepareOperation(const IOperationPreparationContext &context, TJobOperationPreparer &preparer) const
Method allowing user to control some properties of input and output tables and formats.
virtual void Save(IOutputStream &stream) const
Save job state to stream to be restored on cluster nodes.
Definition operation.h:1958
i64 GetOutputTableCount() const
Get number of output tables.
Definition operation.h:1979
virtual void Load(IInputStream &stream)
Restore job state from a stream.
Definition operation.h:1965
EType
Type of job.
Definition operation.h:1948
const TNode & SecureVault() const
Get operation secure vault (specified in NYT::TOperationOptions::SecureVault) inside a job.
Definition operation.h:1972
Base interface for structured (typed) map jobs.
Definition operation.h:2076
Base interface for structured (typed) map jobs with given reader and writer.
Definition operation.h:2083
virtual void Start(TWriter *writer)
This method is called before feeding input rows to mapper (before Do method).
Definition operation.h:2094
virtual void Do(TReader *reader, TWriter *writer)=0
This method is called exactly once for the whole job input.
virtual void Finish(TWriter *writer)
This method is called after feeding input rows to mapper (after Do method).
Definition operation.h:2107
static constexpr EType JobType
Type of job implemented by this class.
Definition operation.h:2090
Provider of information about operation inputs/outputs during NYT::IJob::PrepareOperation.
Definition operation.h:1703
virtual TMaybe< TYPath > GetInputPath(int index) const =0
Path to the input table if available (Nothing() for intermediate tables).
virtual int GetOutputCount() const =0
Get the number of output tables.
virtual const TVector< TTableSchema > & GetInputSchemas() const =0
Get all the input table schemas.
virtual const TTableSchema & GetInputSchema(int index) const =0
Get the schema of input table no. index.
virtual TMaybe< TYPath > GetOutputPath(int index) const =0
Path to the output table if available (Nothing() for intermediate tables).
virtual int GetInputCount() const =0
Get the number of input tables.
This method is called before feeding input rows to reducer (before Do method). virtual void Start(TWr...
Definition operation.h:2218
static constexpr EType JobType
Type of job implemented by this class.
Definition operation.h:2221
virtual void Do(const TRawJobContext &jobContext)=0
This method is called exactly once for the whole job input.
Base interface for structured (typed) reduce jobs.
Definition operation.h:2124
Base interface for structured (typed) reduce jobs with given reader and writer.
Definition operation.h:2131
virtual void Start(TWriter *writer)
This method is called before feeding input rows to reducer (before Do method).
Definition operation.h:2144
virtual void Do(TReader *reader, TWriter *writer)=0
This method is called exactly once for each range with same value of ReduceBy (or JoinBy) keys.
void Break()
Refuse to process the remaining row ranges and finish the job (successfully).
virtual void Finish(TWriter *writer)
This method is called after feeding input rows to reducer (after Do method).
Definition operation.h:2155
static constexpr EType JobType
Type of job implemented by this class.
Definition operation.h:2138
Interface for classes that can be Saved/Loaded (to be used with Y_SAVELOAD_JOB).
Definition operation.h:1685
virtual void Save(IOutputStream &stream) const =0
Dump state to output stream to be restored in job.
virtual void Load(IInputStream &stream)=0
Load state from a stream.
Interface for jobs with typed inputs and outputs.
Definition operation.h:2047
virtual TRawTableReaderPtr CreateCustomRawJobReader(int fd) const
This methods are called when creating table reader and writer for the job.
Base interface for vanilla jobs.
Definition operation.h:2271
static constexpr EType JobType
Type of job implemented by this class.
Definition operation.h:2274
virtual void Do()=0
This method is called exactly once for each vanilla job.
Interface for vanilla jobs with output tables.
Definition operation.h:2322
virtual void Do(TWriter *writer)=0
This method is called exactly once for each vanilla job.
virtual void Finish(TWriter *)
This method is called after Do method.
Definition operation.h:2340
virtual void Start(TWriter *)
This method is called before Do method.
Definition operation.h:2329
Options for auto merge operation stage.
Definition operation.h:179
TSelf & Mode(EAutoMergeMode)
Mode of the auto merge.
TSelf & MaxIntermediateChunkCount(i64)
Upper limit for number of intermediate chunks.
TSelf & ChunkCountPerMergeJob(i64)
Number of chunks limit to merge in one job.
TSelf & ChunkSizeThreshold(i64)
Automerge will not merge chunks that are larger than DesiredChunkSize * (ChunkSizeThreshold / 100....
TCommandRawJob(TStringBuf command={})
Create job with specified command.
void Do(const TRawJobContext &jobContext) override
This method is called exactly once for the whole job input.
const TString & GetCommand() const override
Get bash command to run.
const TString & GetCommand() const override
Get bash command to run.
TCommandVanillaJob(TStringBuf command={})
Create job with specified command.
Options that control how C++ objects represent table rows when reading or writing a table.
Definition client_method_options.h:701
Class representing a collection of job counters.
Definition job_counters.h:28
Group of input tables that allows to specify properties on all of them at once.
Definition operation.h:1739
TInputGroup & Description()
Specify the type of input rows.
TInputGroup & ColumnRenaming(const THashMap< TString, TString > &renaming)
Specify renaming of input columns.
TInputGroup & ColumnFilter(const TVector< TString > &columns)
Specify what input columns to send to job.
TJobOperationPreparer & EndInputGroup()
Finish describing the input group.
Group of output tables that allows to specify properties on all of them at once.
Definition operation.h:1768
TJobOperationPreparer & EndOutputGroup()
Finish describing the output group.
TOutputGroup & NoSchema()
Specify that all the the tables in this group are unschematized.
TOutputGroup & Description(bool inferSchema=true)
Specify the type of output rows.
TOutputGroup & Schema(const TTableSchema &schema)
Specify schema for these tables.
Fluent builder class for NYT::IJob::PrepareOperation.
Definition operation.h:1731
const TVector< TMaybe< TTableStructure > > & GetOutputDescriptions() const
Get output column descriptions as specified by the user.
const TVector< TMaybe< TVector< TString > > > & GetInputColumnFilters() const
Get input column filters as specified by the user.
TInputGroup BeginInputGroup(const TCont &indices)
Begin input group consisting of tables with indices from indices.
TOutputGroup BeginOutputGroup(const TCont &indices)
Begin input group consisting of tables with indices from indices.
TJobOperationPreparer & OutputSchema(int tableIndex, TTableSchema schema)
Specify the schema for output table no tableIndex.
const TVector< THashMap< TString, TString > > & GetInputColumnRenamings() const
Get input column renamings as specified by the user.
TJobOperationPreparer & OutputDescription(int tableIndex, bool inferSchema=true)
Specify the type of output rows for table no. tableIndex.
const TVector< TMaybe< TTableStructure > > & GetInputDescriptions() const
Get input column descriptions as specified by the user.
TJobOperationPreparer & NoOutputSchema(int tableIndex)
Mark the output table no. tableIndex as unschematized.
TJobOperationPreparer & InputFormatHints(TFormatHints hints)
Specify input format hints.
void Finish()
Finish the building process.
TVector< TTableSchema > GetOutputSchemas()
Get output table schemas as specified by the user.
const TUserJobFormatHints & GetFormatHints() const
Get format hints as specified by the user.
TJobOperationPreparer & OutputFormatHints(TFormatHints hints)
Specify output format hints.
TJobOperationPreparer & FormatHints(TUserJobFormatHints newFormatHints)
Specify format hints.
TInputGroup BeginInputGroup(int begin, int end)
Begin input group consisting of tables with indices [begin, end).
TOutputGroup BeginOutputGroup(int begin, int end)
Begin output group consisting of tables with indices [begin, end).
TJobOperationPreparer & InputDescription(int tableIndex)
Specify the type of input rows for table no. tableIndex.
TJobOperationPreparer & NodeOutput(int tableIndex)
Set type of output rows for table no. tableIndex to TNode.
TJobOperationPreparer & InputColumnRenaming(int tableIndex, const THashMap< TString, TString > &renaming)
Specify renaming of input columns for table no. tableIndex.
TJobOperationPreparer & InputColumnFilter(int tableIndex, const TVector< TString > &columns)
Specify what input columns of table no. tableIndex to send to job.
Class representing a collection of job statistics.
Definition job_statistics.h:35
Base spec of operations with input tables.
Definition operation.h:395
void SetInput(size_t tableIndex, const TRichYPath &path)
Set input table path and type.
TVector< TRichYPath > Inputs_
All input paths.
Definition operation.h:416
const TVector< TStructuredTablePath > & GetStructuredInputs() const
Get all input structured paths.
void AddInput(const TRichYPath &path)
Add input table path to input path list and specify type of rows.
void AddStructuredInput(TStructuredTablePath path)
Add input table path as structured paths.
Base spec of operations with output tables.
Definition operation.h:432
void SetOutput(size_t tableIndex, const TRichYPath &path)
Set output table path and type.
TVector< TRichYPath > Outputs_
All output paths.
Definition operation.h:453
void AddOutput(const TRichYPath &path)
Add output table path to output path list and specify type of rows.
const TVector< TStructuredTablePath > & GetStructuredOutputs() const
Get all output structured paths.
void AddStructuredOutput(TStructuredTablePath path)
Add output table path as structured paths.
Context passed to NYT::IRawJob::Do.
Definition operation.h:1663
const TVector< TFile > & GetOutputFileList() const
Get files corresponding to output streams.
const TFile & GetInputFile() const
Get file corresponding to input stream.
Spec for IO in MapReduce operation.
Definition operation.h:340
Spec of input and output tables of a raw operation.
Definition operation.h:286
TDerived & SetOutput(size_t tableIndex, const TRichYPath &path)
Set output table path no. tableIndex.
TDerived & AddInput(const TRichYPath &path)
Add input table path to input path list.
const TVector< TRichYPath > & GetOutputs() const
Get all output table paths.
TDerived & SetInput(size_t tableIndex, const TRichYPath &path)
Set input table path no. tableIndex.
const TVector< TRichYPath > & GetInputs() const
Get all input table paths.
TDerived & AddOutput(const TRichYPath &path)
Add output table path to output path list.
Resources controlled by scheduler and used by running operations.
Definition operation.h:224
FLUENT_FIELD_OPTION_ENCAPSULATED(i64, UserSlots)
Each job consumes exactly one user slot.
FLUENT_FIELD_OPTION_ENCAPSULATED(i64, Cpu)
Number of (virtual) cpu cores consumed by all jobs.
FLUENT_FIELD_OPTION_ENCAPSULATED(i64, Memory)
Amount of memory in bytes.
List of TSortColumn.
Definition common.h:558
Description of table schema.
Definition common.h:771
TTaskName(TString taskName)
Construct a custom task name.
TTaskName(ETaskName taskName)
Construct a well-known task name.
TTaskName(const char *taskName)
Construct a custom task name.
Base for format hints of a user job.
Definition operation.h:271
User job format hints.
Definition operation.h:281
Base for input format hints of a user job.
Definition operation.h:243
TSelf & InputFormatHints(TFormatHints)
Fine tune input format of the job.
Base for output format hints of a user job.
Definition operation.h:256
TSelf & OutputFormatHints(TFormatHints)
Fine tune output format of the job.
Base for operations with auto merge options.
Definition operation.h:207
TSelf & AutoMerge(TAutoMergeSpec)
Options for auto merge operation stage.
Main namespace of YT client.
Definition abortable_stream.h:7
@ None
Transactions are non atomic (might reduce latency of write requests).
Definition client_method_options.h:1330
ECursorDirection
Direction of cursor for paging, see NYT::TListOperationsOptions::CursorDirection.
Definition operation.h:2589
ETaskName
Well-known task names.
Definition operation.h:2780
TTableStructure StructuredTableDescription()
Create tag class from row type.
EOperationAttribute
Attributes to request for an operation.
Definition operation.h:2352
EJobType
Job type.
Definition operation.h:2749
EOperationBriefState
"Coarse-grained" state of an operation.
Definition operation.h:2408
@ Failed
Failed.
Definition operation.h:2414
EOperationState
Operation state.
Definition operation.h:2421
EProfilingBinary
Binary to run job profiler on.
Definition operation.h:682
@ JobProxy
Profile job proxy.
Definition operation.h:684
@ UserJob
Profile user job.
Definition operation.h:687
THolder< IProxyOutput > CreateRawJobWriter(size_t outputTableCount)
Create default raw job writer.
EListJobsDataSource
Data source for NYT::IClient::ListJobs command.
Definition operation.h:2739
bool operator==(const TColumnSchema &lhs, const TColumnSchema &rhs)
Equality check checks all fields of column schema.
const TNode & GetJobSecureVault()
Get operation secure vault (specified in NYT::TOperationOptions::SecureVault) inside a job.
EJobState
Job state.
Definition operation.h:2829
EJobSortDirection
Job sort direction.
Definition operation.h:2862
std::variant< TUnspecifiedTableStructure, TProtobufTableStructure > TTableStructure
Tag class to specify table row type.
Definition operation.h:47
TTableReaderIterator< T > end(TTableReader< T > &)
Function to facilitate range-based-for for NYT::TTableReader.
Definition io.h:359
TStructuredTablePath Structured(TRichYPath richYPath)
Create marked table path from row type.
EMergeMode
Merge mode.
Definition operation.h:1299
std::variant< TVoidStructuredRowStream, TTNodeStructuredRowStream, TTYaMRRowStructuredRowStream, TProtobufStructuredRowStream > TStructuredRowStreamDescription
Tag class to specify type of rows in an operation row stream.
Definition operation.h:114
ESchemaInferenceMode
Schema inference mode.
Definition operation.h:1229
TRawTableReaderPtr CreateRawJobReader(int fd=0)
Create default raw job reader.
EJobSortField
Job sort field.
Definition operation.h:2845
EProfilerType
Type of job profiler.
Definition operation.h:692
@ Memory
Profile memory usage.
Definition operation.h:697
@ PeakMemory
Profiler peak memory usage.
Definition operation.h:700
@ Cpu
Profile CPU usage.
Definition operation.h:694
EAutoMergeMode
Auto merge mode.
Definition operation.h:157
@ Relaxed
Mode that tries to achieve good chunk sizes and doesn't limit usage of chunk quota for intermediate c...
Definition operation.h:162
@ Economy
Mode that tries to optimize usage of chunk quota for intermediate chunks, operation might run slower.
Definition operation.h:165
@ Disabled
Auto merge is disabled.
Definition operation.h:159
@ Manual
Manual configuration of automerge parameters.
Definition operation.h:171
ESortOrder
Sort order.
Definition common.h:431
EOperationType
Operation type.
Definition operation.h:2445
TTableReaderIterator< T > begin(TTableReader< T > &reader)
Function to facilitate range-based-for for NYT::TTableReader.
Definition io.h:350
EJobAttribute
Attributes to request for a job.
Definition operation.h:2870
Interface of client capable of managing operations.
Definition operation.h:3407
IOperationPtr MapReduce(const TMapReduceOperationSpec &spec, ::TIntrusivePtr< IMapperBase > mapper, ::TIntrusivePtr< IReducerBase > reducer, const TOperationOptions &options=TOperationOptions())
Run JoinReduce operation.
virtual void CompleteOperation(const TOperationId &operationId)=0
Complete operation.
virtual IOperationPtr AttachOperation(const TOperationId &operationId)=0
Create an operation object given operation id.
IOperationPtr Reduce(const TReduceOperationSpec &spec, ::TIntrusivePtr< IReducerBase > reducer, const TOperationOptions &options=TOperationOptions())
Run Reduce operation.
IOperationPtr Map(const TMapOperationSpec &spec, ::TIntrusivePtr< IMapperBase > mapper, const TOperationOptions &options=TOperationOptions())
Run Map operation.
virtual IOperationPtr Sort(const TSortOperationSpec &spec, const TOperationOptions &options=TOperationOptions())=0
Run Sort operation.
virtual IOperationPtr Merge(const TMergeOperationSpec &spec, const TOperationOptions &options=TOperationOptions())=0
Run Merge operation.
virtual IOperationPtr RemoteCopy(const TRemoteCopyOperationSpec &spec, const TOperationOptions &options=TOperationOptions())=0
Run RemoteCopy operation.
virtual IOperationPtr Erase(const TEraseOperationSpec &spec, const TOperationOptions &options=TOperationOptions())=0
Run Erase operation.
IOperationPtr Reduce(::TIntrusivePtr< IReducerBase > reducer, const TOneOrMany< TStructuredTablePath > &input, const TOneOrMany< TStructuredTablePath > &output, const TSortColumns &reduceBy, const TReduceOperationSpec &spec=TReduceOperationSpec(), const TOperationOptions &options=TOperationOptions())
Run Reduce operation.
virtual IOperationPtr RawReduce(const TRawReduceOperationSpec &spec, ::TIntrusivePtr< IRawJob > rawJob, const TOperationOptions &options=TOperationOptions())=0
Run raw Reduce operation.
IOperationPtr MapReduce(const TMapReduceOperationSpec &spec, ::TIntrusivePtr< IMapperBase > mapper, ::TIntrusivePtr< IReducerBase > reduceCombiner, ::TIntrusivePtr< IReducerBase > reducer, const TOperationOptions &options=TOperationOptions())
Run MapReduce operation.
virtual void WaitForOperation(const TOperationId &operationId)=0
Wait for operation to finish.
virtual IOperationPtr RawMapReduce(const TRawMapReduceOperationSpec &spec, ::TIntrusivePtr< IRawJob > mapper, ::TIntrusivePtr< IRawJob > reduceCombiner, ::TIntrusivePtr< IRawJob > reducer, const TOperationOptions &options=TOperationOptions())=0
Run raw MapReduce operation.
IOperationPtr Map(::TIntrusivePtr< IMapperBase > mapper, const TOneOrMany< TStructuredTablePath > &input, const TOneOrMany< TStructuredTablePath > &output, const TMapOperationSpec &spec=TMapOperationSpec(), const TOperationOptions &options=TOperationOptions())
Run Map operation.
virtual IOperationPtr RawMap(const TRawMapOperationSpec &spec, ::TIntrusivePtr< IRawJob > rawJob, const TOperationOptions &options=TOperationOptions())=0
Run raw Map operation.
virtual EOperationBriefState CheckOperation(const TOperationId &operationId)=0
Check and return operation status.
IOperationPtr MapReduce(::TIntrusivePtr< IMapperBase > mapper, ::TIntrusivePtr< IReducerBase > reducer, const TOneOrMany< TStructuredTablePath > &input, const TOneOrMany< TStructuredTablePath > &output, const TSortColumns &reduceBy, TMapReduceOperationSpec spec=TMapReduceOperationSpec(), const TOperationOptions &options=TOperationOptions())
Run MapReduce operation.
virtual void AbortOperation(const TOperationId &operationId)=0
Abort operation.
IOperationPtr Sort(const TOneOrMany< TRichYPath > &input, const TRichYPath &output, const TSortColumns &sortBy, const TSortOperationSpec &spec=TSortOperationSpec(), const TOperationOptions &options=TOperationOptions())
Run Sort operation.
virtual IOperationPtr RunVanilla(const TVanillaOperationSpec &spec, const TOperationOptions &options=TOperationOptions())=0
Run Vanilla operation.
IOperationPtr MapReduce(::TIntrusivePtr< IMapperBase > mapper, ::TIntrusivePtr< IReducerBase > reduceCombiner, ::TIntrusivePtr< IReducerBase > reducer, const TOneOrMany< TStructuredTablePath > &input, const TOneOrMany< TStructuredTablePath > &output, const TSortColumns &reduceBy, TMapReduceOperationSpec spec=TMapReduceOperationSpec(), const TOperationOptions &options=TOperationOptions())
Run MapReduce operation.
Interface representing an operation.
Definition operation.h:3244
virtual void SuspendOperation(const TSuspendOperationOptions &options=TSuspendOperationOptions())=0
Suspend operation.
virtual void ResumeOperation(const TResumeOperationOptions &options=TResumeOperationOptions())=0
Resume previously suspended operation.
virtual TListJobsResult ListJobs(const TListJobsOptions &options=TListJobsOptions())=0
virtual TJobAttributes GetJob(const TJobId &jobId, const TGetJobOptions &options=TGetJobOptions())=0
Get job attributes.
virtual void CompleteOperation()=0
Complete operation.
virtual bool IsStarted() const =0
Is the operation started.
virtual ::NThreading::TFuture< void > Watch()=0
Start watching operation.
virtual TString GetWebInterfaceUrl() const =0
Get URL of the operation in YT Web UI.
virtual TVector< TFailedJobInfo > GetFailedJobInfo(const TGetFailedJobInfoOptions &options=TGetFailedJobInfoOptions())=0
Get information about failed jobs.
virtual void Start()=0
Start operation synchronously.
virtual const TOperationId & GetId() const =0
Get operation id.
virtual ::NThreading::TFuture< void > GetPreparedFuture()=0
Get preparation future.
virtual EOperationBriefState GetBriefState()=0
Get operation brief state.
virtual void AbortOperation()=0
Abort operation.
virtual void UpdateParameters(const TUpdateOperationParametersOptions &options=TUpdateOperationParametersOptions())=0
Update operation runtime parameters.
virtual TMaybe< TYtError > GetError()=0
Get error (if operation has failed).
virtual TString GetStatus() const =0
Get last error for not started operations. Get state on YT cluster for started operations.
virtual TMaybe< TOperationBriefProgress > GetBriefProgress()=0
virtual ::NThreading::TFuture< void > GetStartedFuture()=0
Get start future.
virtual TOperationAttributes GetAttributes(const TGetOperationOptions &options=TGetOperationOptions())=0
Get operation attributes.
virtual TMaybe< THashMap< TString, TYtError > > GetAlerts()=0
Get operation alerts.
virtual TJobStatistics GetJobStatistics()=0
Get job statistics.
Definition operation.h:653
TSelf & MD5CheckSum(TString)
MD5 checksum of uploaded file.
TSelf & PathInJob(TString)
Path by which job will see the uploaded file.
TSelf & BypassArtifactCache(bool)
Do not put file into node cache.
Description of a core dump that happened in the job.
Definition operation.h:3024
Specification of a disk that will be available in job.
Definition operation.h:731
TSelf & MediumName(TString)
Name of the medium corresponding to required disk type.
TSelf & DiskSpace(i64)
Required disk space in bytes.
TSelf & Account(TString)
TSelf & InodeCount(i64)
Limit for inodes.
Spec of Erase operation.
Definition operation.h:1367
TSelf & CombineChunks(bool)
Combine output chunks to larger ones.
TSelf & SchemaInferenceMode(ESchemaInferenceMode)
Inference mode for output table schema.
TSelf & TablePath(TRichYPath)
Which table (or row range) to erase.
Class representing YT data format.
Definition format.h:38
Options for NYT::IOperation::GetFailedJobInfo.
Definition operation.h:3168
TSelf & StderrTailSize(ui64)
How much of stderr tail should be downloaded.
TSelf & MaxJobCount(ui64)
How many jobs to download. Which jobs will be chosen is undefined.
Options for NYT::IClient::GetJobFailContext.
Definition operation.h:3148
Options for NYT::IClient::GetJobInput.
Definition operation.h:3139
Options for NYT::IClient::GetJob.
Definition operation.h:3126
TSelf & AttributeFilter(TJobAttributeFilter)
Return only requested job attributes.
Options for NYT::IClient::GetJobStderr.
Definition operation.h:3157
Options for NYT::IClient::GetJobTrace.
Definition operation.h:3187
TSelf & ToTime(TInstant)
Search for traces with time <= ToTime.
TSelf & FromTime(TInstant)
Search for traces with time >= FromTime.
TSelf & JobId(TJobId)
Id of the job.
TSelf & TraceId(TJobTraceId)
Id of the trace.
Options for NYT::IClient::GetOperation call.
Definition operation.h:2393
TSelf & AttributeFilter(TOperationAttributeFilter)
What attributes to request (if omitted, the default set of attributes will be requested).
Class to provide information on intermediate mapreduce stream protobuf types.
Definition operation.h:609
TDerived & HintReduceInput()
Specify reducer input.
TDerived & AddMapOutput(const TRichYPath &path)
Add output of map stage.
TDerived & HintReduceCombinerOutput()
Specify reduce combiner output.
TDerived & HintMapOutput()
Specify intermediate map output type.
TDerived & HintReduceCombinerInput()
Specify reduce combiner input.
A class that specifies which attributes to request when using NYT::IClient::GetJob or NYT::IClient::L...
Definition operation.h:2890
TSelf & Add(EJobAttribute attribute)
Add attribute to the filter. Calls are supposed to be chained.
Definition operation.h:2899
Job attributes.
Definition operation.h:3038
TMaybe< TYtError > Error
Error for a unsuccessfully finished job.
Definition operation.h:3077
TMaybe< double > Progress
Estimated ratio of job's completed work.
Definition operation.h:3069
TMaybe< EJobType > Type
Job type.
Definition operation.h:3045
TMaybe< TInstant > FinishTime
Job finish time (for a finished job).
Definition operation.h:3065
TMaybe< TJobId > Id
Job id.
Definition operation.h:3041
TMaybe< TNode > BriefStatistics
Job brief statistics.
Definition operation.h:3081
TMaybe< TNode > ExecAttributes
Job exec attributes.
Definition operation.h:3093
TMaybe< TString > Address
Address of a cluster node where job was running.
Definition operation.h:3053
TMaybe< EJobState > State
Job state.
Definition operation.h:3049
TMaybe< TInstant > StartTime
Job start time.
Definition operation.h:3061
TMaybe< TVector< TCoreInfo > > CoreInfos
Infos for core dumps produced by job.
Definition operation.h:3089
TMaybe< i64 > StderrSize
Size of saved job stderr.
Definition operation.h:3073
TMaybe< TString > TaskName
The name of the task that job corresponds to.
Definition operation.h:3057
TMaybe< TVector< TRichYPath > > InputPaths
Job input paths (with ranges).
Definition operation.h:3085
TMaybe< ui64 > Cookie
Job cookie.
Definition operation.h:3097
Tag class marking that binary from specified Cypress path should be used in operation.
Definition operation.h:136
Tag class marking that current binary should be used in operation.
Definition operation.h:125
Tag class marking that binary from specified local path should be used in operation.
Definition operation.h:129
Specifies a job profiler.
Definition operation.h:705
TSelf & ProfilerType(EProfilerType)
Type of the profiler.
TSelf & SamplingFrequency(int)
For sampling profilers, sets the number of samples per second.
TSelf & ProfilingBinary(EProfilingBinary)
Binary to profile.
TSelf & ProfilingProbability(double)
Probability of the job being selected for profiling.
Response for NYT::IOperation::GetJobTrace.
Definition operation.h:3212
TOperationId OperationId
Id of the operation.
Definition operation.h:3215
TJobId JobId
Id of the job.
Definition operation.h:3219
TJobTraceId TraceId
Id of the trace.
Definition operation.h:3223
TInstant EventTime
Time of the event.
Definition operation.h:3235
i64 EventIndex
Index of the trace event.
Definition operation.h:3227
std::string Event
Raw event in json format.
Definition operation.h:3231
Spec of JoinReduce operation.
Definition operation.h:1053
TSelf & JoinBy(TSortColumns)
Columns to join foreign tables by (must be prefix of ReduceBy).
TSelf & DataSizePerJob(ui64)
Recommended number of jobs to run.
TSelf & ReducerSpec(TUserJobSpec)
Spec of reduce job.
Spec of JoinReduce operation.
Definition operation.h:1094
Options for NYT::IClient::ListJobs.
Definition operation.h:2911
TSelf & Address(TString)
Address of the cluster node where job was running.
TSelf & WithFailContext(bool)
Return only jobs whose fail context has been saved.
TSelf & AttributeFilter(TJobAttributeFilter)
Return only requested job attributes.
TSelf & WithSpec(bool)
Return only jobs whose spec has been saved.
TSelf & SortOrder(ESortOrder)
Sort order.
TSelf & WithStderr(bool)
Return only jobs whose stderr has been saved.
TSelf & ContinuationToken(TString)
Search for jobs with filters encoded in token.
TSelf & ToTime(TInstant)
Search for jobs with start time <= ToTime.
TSelf & WithInterruptionInfo(bool)
Return only jobs with interruption info.
TSelf & Type(EJobType)
Job type.
TSelf & OperationIncarnation(TString)
Return only jobs with given operation incarnation.
TSelf & Offset(i64)
Data source.
TSelf & SortField(EJobSortField)
Sort by this field.
TSelf & MonitoringDescriptor(TString)
Return only jobs with given monitoring descriptor.
TSelf & State(EJobState)
Job state.
TSelf & FromTime(TInstant)
Search for jobs with start time >= FromTime.
TSelf & WithMonitoringDescriptor(bool)
Return only jobs with monitoring descriptor.
Response for NYT::IOperation::ListJobs.
Definition operation.h:3103
TMaybe< i64 > ArchiveJobCount
Number of jobs retrieved from archive.
Definition operation.h:3118
TVector< TJobAttributes > Jobs
Jobs.
Definition operation.h:3106
TMaybe< i64 > ControllerAgentJobCount
Number of jobs retrieved from controller agent.
Definition operation.h:3114
TMaybe< i64 > CypressJobCount
Definition operation.h:3110
Options of NYT::IClient::ListOperations command.
Definition operation.h:2599
TSelf & WithFailedJobs(bool)
Choose operations having (or not having) any failed jobs.
TSelf & Limit(i64)
Return no more than Limit operations (current default and maximum value is 1000).
TSelf & ToTime(TInstant)
Search for operations with start time < ToTime.
TSelf & CursorDirection(ECursorDirection)
Direction of pagination (see NYT::TListOperationsOptions::CursorTime).
TSelf & IncludeArchive(bool)
Search for operations in the archive in addition to Cypress.
TSelf & State(EOperationState)
Choose operations with given NYT::TOperationAttributes::State.
TSelf & Type(EOperationType)
Choose operations with given NYT::TOperationAttributes::Type.
TSelf & Filter(TString)
Search for Filter as a substring in operation text factors (e.g. title or input/output table paths).
TSelf & User(TString)
Choose operations with given NYT::TOperationAttributes::AuthenticatedUser.
TSelf & FromTime(TInstant)
Search for operations with start time >= FromTime.
TSelf & IncludeCounters(bool)
Include the counters for different filter parameters in the response.
TSelf & CursorTime(TInstant)
Additional restriction on operation start time (useful for pagination).
TSelf & Pool(TString)
Choose operations whose pools include Pool.
Response for NYT::IClient::ListOperations command.
Definition operation.h:2684
TMaybe< THashMap< TString, i64 > > StateCounts
Number of operations for each state (subject to previous filters).
Definition operation.h:2712
TMaybe< THashMap< TString, i64 > > UserCounts
Number of operations for each user (subject to previous filters).
Definition operation.h:2708
bool Incomplete
Whether some operations were not returned due to NYT::TListOperationsOptions::Limit.
Definition operation.h:2731
TMaybe< i64 > WithFailedJobsCount
Number of operations having failed jobs (subject to all previous filters).
Definition operation.h:2720
TVector< TOperationAttributes > Operations
Found operations' attributes.
Definition operation.h:2687
TMaybe< THashMap< EOperationType, i64 > > TypeCounts
Number of operations for each type (subject to previous filters).
Definition operation.h:2716
TMaybe< THashMap< TString, i64 > > PoolCounts
Number of operations for each pool.
Definition operation.h:2704
Spec of Map operation.
Definition operation.h:918
TSelf & DataSizePerJob(ui64)
Recommended number of jobs to run.
TSelf & Ordered(bool)
Whether to guarantee the order of rows passed to mapper matches the order in the table.
TSelf & MapperSpec(TUserJobSpec)
Spec of mapper job.
Spec of Map operation.
Definition operation.h:959
Spec of MapReduce operation.
Definition operation.h:1117
TSelf & ReduceCombinerSpec(TUserJobSpec)
Spec of reduce combiner.
TSelf & ReduceBy(TSortColumns)
Columns to group rows by.
TSelf & IntermediateDataReplicationFactor(ui64)
Replication factor for intermediate data (1 by default).
TSelf & PartitionCount(ui64)
Recommended number of intermediate data partitions.
TSelf & SortBy(TSortColumns)
Columns to sort rows by (must include ReduceBy as prefix).
TSelf & ReducerSpec(TUserJobSpec)
Spec of reduce job.
TSelf & DataSizePerSortJob(ui64)
Recommended size of data to be passed to a single reduce combiner.
TSelf & MapperSpec(TUserJobSpec)
Spec of map job.
TSelf & ForceReduceCombiners(bool)
Guarantee to run reduce combiner before reducer.
TSelf & DataSizePerMapJob(ui64)
Recommended number of map jobs to run.
TSelf & IntermediateDataAccount(TString)
Account to use for intermediate data.
TSelf & Ordered(bool)
Whether to guarantee the order of rows passed to mapper matches the order in the table.
TSelf & PartitionDataSize(ui64)
Recommended size of intermediate data partitions.
Spec of MapReduce operation.
Definition operation.h:1195
TSelf & MapperFormatHints(TUserJobFormatHints)
Format hints for mapper.
TSelf & ReduceCombinerFormatHints(TUserJobFormatHints)
Format hints for reduce combiner.
TSelf & ReducerFormatHints(TUserJobFormatHints)
Format hints for reducer.
Spec of Merge operation.
Definition operation.h:1311
TSelf & SchemaInferenceMode(ESchemaInferenceMode)
Inference mode for output table schema.
TSelf & CombineChunks(bool)
Combine output chunks to larger ones.
TSelf & ForceTransform(bool)
Guarantee that all input chunks will be read.
TSelf & Output(TRichYPath)
Path to output table.
TSelf & Mode(EMergeMode)
Merge mode.
FLUENT_VECTOR_FIELD(TRichYPath, Input)
Paths to input tables.
TSelf & DataSizePerJob(ui64)
Recommended number of jobs to run.
TSelf & MergeBy(TSortColumns)
Columns by which to merge (for NYT::EMergeMode::MM_SORTED).
Convenience class that keeps sequence of items.
Definition common.h:280
Class describing which attributes to request in NYT::IClient::GetOperation or NYT::IClient::ListOpera...
Definition operation.h:2374
TSelf & Add(EOperationAttribute attribute)
Add attribute to the filter. Calls are supposed to be chained.
Definition operation.h:2383
Operation info.
Definition operation.h:2516
TMaybe< TOperationId > Id
Operation id.
Definition operation.h:2519
TMaybe< TVector< TOperationEvent > > Events
List of operation events (changes of state).
Definition operation.h:2579
TMaybe< THashMap< TString, TYtError > > Alerts
Map from alert name to its description.
Definition operation.h:2583
TMaybe< EOperationType > Type
Operation type.
Definition operation.h:2523
TMaybe< TNode > Spec
Spec of the operation as provided by the user.
Definition operation.h:2555
TMaybe< TNode > BriefSpec
Brief spec of operation (light-weight fields only).
Definition operation.h:2551
TMaybe< bool > Suspended
Is operation suspended.
Definition operation.h:2567
TMaybe< TInstant > StartTime
Operation start time.
Definition operation.h:2539
TMaybe< TOperationBriefProgress > BriefProgress
Brief progress of the operation.
Definition operation.h:2547
TMaybe< TOperationResult > Result
Operation result.
Definition operation.h:2571
TMaybe< TNode > UnrecognizedSpec
Fields not recognized by scheduler.
Definition operation.h:2563
TMaybe< TInstant > FinishTime
Operation finish time (if the operation has finished).
Definition operation.h:2543
TMaybe< EOperationBriefState > BriefState
"Coarse-grained" operation state.
Definition operation.h:2531
TMaybe< TOperationProgress > Progress
Operation progress.
Definition operation.h:2575
TMaybe< TString > State
Operation state.
Definition operation.h:2527
TMaybe< TString > AuthenticatedUser
Name of user that started the operation.
Definition operation.h:2535
TMaybe< TNode > FullSpec
Full spec of operation (all fields not specified by user are filled with default values).
Definition operation.h:2559
Brief operation progress (numbers of jobs in these states).
Definition operation.h:2477
Operation event (change of state).
Definition operation.h:2499
TString State
New state of operation.
Definition operation.h:2502
TInstant Time
Time of state change.
Definition operation.h:2506
Base spec for operations with inputs and outputs.
Definition operation.h:471
Base spec for operations with inputs and outputs.
Definition operation.h:478
Options for NYT::IOperationClient::Map and other operation start commands.
Definition operation.h:1511
TSelf & StartOperationMode(EStartOperationMode)
Start operation mode.
TSelf & FileExpirationTimeout(TDuration)
Expiration timeout for uploaded files.
TSelf & MinJobStateSizeToPassViaFile(i64)
If job state size is less than specified value, job state will be passed via environment variable in ...
TSelf & FileStorageTransactionId(TTransactionId)
Id of transaction within which all Cypress file storage entries will be checked/created.
EStartOperationMode
Start operation mode.
Definition operation.h:1523
@ AsyncStart
Prepare and start operation asynchronously. Don't wait for operation completion.
Definition operation.h:1530
@ SyncWait
Prepare, start and wait for operation completion synchronously.
Definition operation.h:1538
@ AsyncPrepare
Prepare operation asynchronously. Call IOperation::Start() to start operation.
Definition operation.h:1526
@ SyncStart
Prepare and start operation synchronously. Don't wait for operation completion.
Definition operation.h:1534
TSelf & CreateDebugOutputTables(bool)
Ensure stderr and core tables exist before starting operation.
TSelf & Wait(bool value)
Wait for operation finish synchronously.
Definition operation.h:1549
EFileCacheMode
File cache mode.
Definition operation.h:1602
@ CachelessRandomPathUpload
Upload files to random paths inside NYT::TOperationOptions::FileStorage without caching.
Definition operation.h:1609
@ ApiCommandBased
Use YT API commands "get_file_from_cache" and "put_file_to_cache".
Definition operation.h:1605
TSelf & JobCommandSuffix(TString)
Suffix for bash command running the jobs.
TSelf & InferOutputSchema(bool)
Try to infer schema of inexistent table from the type of written rows.
TSelf & Spec(TNode)
Additional field to put to operation spec.
TSelf & FileCacheMode(EFileCacheMode)
File cache mode.
TSelf & JobCommandPrefix(TString)
Prefix for bash command running the jobs.
TSelf & SecureVault(TNode)
Info to be passed securely to the job.
TSelf & CreateOutputTables(bool)
Ensure output tables exist before starting operation.
TSelf & MountSandboxInTmpfs(bool)
Put all files required by the job into tmpfs.
TSelf & FileStorage(TString)
Path to directory to store temporary files. Useful if you want to control how lifetime of uploaded fi...
TSelf & UseTableFormats(bool)
Use format from table attribute (for YAMR-like format).
Operation progress.
Definition operation.h:2460
TMaybe< TInstant > BuildTime
Time when this progress was built on scheduler or CA.
Definition operation.h:2471
TJobStatistics JobStatistics
Total job statistics.
Definition operation.h:2463
TJobCounters JobCounters
Job counter for various job states with hierarchy.
Definition operation.h:2467
Operation result.
Definition operation.h:2490
TMaybe< TYtError > Error
For a unsuccessfully finished operation: description of error.
Definition operation.h:2493
Base spec for all operations.
Definition operation.h:515
TSelf & Weight(double)
Weight of operation.
TSelf & Alias(TString)
Alias for searching for an operation in the future.
TSelf & Pool(TString)
Pool to be used for this operation.
TSelf & MaxFailedJobCount(ui64)
How many jobs can fail before operation is failed.
FLUENT_FIELD_OPTION_ENCAPSULATED(TSchedulerResources, ResourceLimits)
How much resources can be consumed by operation.
FLUENT_OPTIONAL_VECTOR_FIELD_ENCAPSULATED(TString, PoolTree)
Pool tree list that operation will use.
TSelf & Title(TString)
Title to be shown in web interface.
TSelf & TimeLimit(TDuration)
Limit on operation execution time.
Tag class marking that row stream consists of protobuf rows of given type.
Definition operation.h:106
const ::google::protobuf::Descriptor * Descriptor
Descriptor of the protobuf type of table rows.
Definition operation.h:110
Tag class marking that table rows have protobuf type.
Definition operation.h:37
const ::google::protobuf::Descriptor * Descriptor
Descriptor of the protobuf type of table rows.
Definition operation.h:42
Spec of raw JoinReduce operation.
Definition operation.h:1106
Spec of raw Map operation.
Definition operation.h:968
Spec of raw MapReduce operation.
Definition operation.h:1220
Spec of raw Reduce operation.
Definition operation.h:1039
Spec of Reduce operation.
Definition operation.h:980
TSelf & JoinBy(TSortColumns)
Columns to join foreign tables by (must be prefix of ReduceBy).
TSelf & ReduceBy(TSortColumns)
Columns to group rows by.
TSelf & ReducerSpec(TUserJobSpec)
Spec of reduce job.
TSelf & EnableKeyGuarantee(bool)
Guarantee to feed all rows with same ReduceBy columns to a single job (true by default).
TSelf & DataSizePerJob(ui64)
Recommended number of jobs to run.
TSelf & SortBy(TSortColumns)
Columns to sort rows by (must include ReduceBy as prefix).
Spec of Reduce operation.
Definition operation.h:1030
Spec of RemoteCopy operation.
Definition operation.h:1393
FLUENT_VECTOR_FIELD(TString, AttributeKey)
Names of user attributes to copy from input to output table.
TSelf & ClusterName(TString)
Source cluster name.
TSelf & NetworkName(TString)
Network to use for copy (all remote cluster nodes must have it configured).
TSelf & Output(TRichYPath)
Path to output table.
TSelf & CopyAttributes(bool)
Copy user attributes from input to output table (allowed only for single input table).
TSelf & SchemaInferenceMode(ESchemaInferenceMode)
Inference mode for output table schema.
FLUENT_VECTOR_FIELD(TRichYPath, Input)
Paths to input tables.
Options for NYT::IOperation::ResumeOperation.
Definition client_method_options.h:493
Path with additional attributes.
Definition common.h:1040
Base spec for IO in "simple" raw operations (Map, Reduce etc.).
Definition operation.h:319
Spec of Sort operation.
Definition operation.h:1241
TSelf & IntermediateDataReplicationFactor(ui64)
Replication factor for intermediate data (1 by default).
TSelf & PartitionCount(ui64)
Recommended number of intermediate data partitions.
TSelf & PartitionDataSize(ui64)
Recommended size of intermediate data partitions.
TSelf & SortBy(TSortColumns)
Columns to sort table by.
TSelf & IntermediateDataAccount(TString)
Account to use for intermediate data.
TSelf & DataSizePerPartitionJob(ui64)
Recommended number of partition jobs to run.
TSelf & Output(TRichYPath)
Path to output table.
TSelf & SchemaInferenceMode(ESchemaInferenceMode)
Inference mode for output table schema.
FLUENT_VECTOR_FIELD(TRichYPath, Input)
Paths to input tables.
Table path marked with NYT::TTableStructure tag.
Definition operation.h:57
Options for NYT::IOperation::SuspendOperation.
Definition client_method_options.h:469
Tag class marking that row stream consists of NYT::TNode.
Definition operation.h:98
Tag class marking that row stream consists of NYT::TYaMRRow.
Definition operation.h:102
Tag class marking that the row type for table is not specified.
Definition operation.h:33
Options for NYT::IOperation::UpdateParameters.
Definition client_method_options.h:504
Spec of user job.
Definition operation.h:757
FLUENT_MAP_FIELD(TString, TString, Environment)
Map of environment variables that will be set for jobs.
TSelf & CpuLimit(double)
Maximum number of CPU cores for a single job to use.
TVector< std::tuple< TLocalFilePath, TAddLocalFileOptions > > GetLocalFiles() const
Get the list of all added local files.
TSelf & EnableRpcProxyInJobProxy(bool)
Activates the RPC proxy within the job proxy.
TSelf & MemoryReserveFactor(double)
Fraction of NYT::TUserJobSpec::MemoryLimit that job gets at start.
const TJobBinaryConfig & GetJobBinary() const
Get job binary config.
TSelf & JobCommandPrefix(TString)
String that will be prepended to the command.
TSelf & JobCommandSuffix(TString)
String that will be appended to the command.
FLUENT_VECTOR_FIELD(TYPath, Layer)
Porto layers to use in the job. Layers are listed from top to bottom.
TSelf & DockerImage(TString)
Docker image to use in the job.
TSelf & PortCount(ui16)
Number of ports reserved for the job (passed through environment in YT_PORT_0, YT_PORT_1,...
FLUENT_VECTOR_FIELD(TJobProfilerSpec, JobProfiler)
List of profilers to run.
TSelf & DiskRequest(TDiskRequest)
Specification of a disk required for job.
TSelf & ExtraTmpfsSize(i64)
Size of data that is going to be written to tmpfs.
TSelf & NetworkProject(TString)
Network project used to isolate job network.
TSelf & DiskSpaceLimit(ui64)
Limit for all files inside job sandbox (in bytes).
TSelf & JobTimeLimit(TDuration)
Limit on job execution time.
TUserJobSpec & JobBinaryLocalPath(TString path, TMaybe< TString > md5=Nothing())
Local path to executable to be used inside jobs.
TSelf & AddLocalFile(const TLocalFilePath &path, const TAddLocalFileOptions &options=TAddLocalFileOptions())
Specify a local file to upload to Cypress and prepare for use in job.
TUserJobSpec & JobBinaryCypressPath(TString path, TMaybe< TTransactionId > transactionId=Nothing())
Cypress path to executable to be used inside jobs.
FLUENT_VECTOR_FIELD(TRichYPath, File)
Paths to files in Cypress to use in job.
TSelf & MemoryLimit(i64)
MemoryLimit specifies how much memory job process can use.
Base spec for all operations with user jobs.
Definition operation.h:561
TSelf & CoreTablePath(TYPath)
Table to save coredumps of operation.
TSelf & WaitingJobTimeout(TDuration)
How long should the scheduler wait for the job to be started on a node.
TSelf & FailOnJobRestart(bool)
On any unsuccessful job completion (i.e. abortion or failure) force the whole operation to fail.
TSelf & StderrTablePath(TYPath)
Table to save whole stderr of operation.
Spec of Vanilla operation.
Definition operation.h:1496
FLUENT_VECTOR_FIELD(TVanillaTask, Task)
Description of tasks to run in this operation.
Task of Vanilla operation.
Definition operation.h:1446
TSelf & Name(TString)
Task name.
TSelf & Job(::TIntrusivePtr< IVanillaJobBase >)
Job to be executed in this task.
TSelf & JobCount(ui64)
Number of jobs to run and wait for successful completion.
TSelf & NetworkProject(TMaybe< TString >)
Network project name.
TSelf & AddOutput(const TRichYPath &path)
Add output table path and specify the task output type (i.e. TMyProtoMessage).
TSelf & AddStructuredOutput(TStructuredTablePath path)
Add output table path as structured path.
TSelf & Spec(TUserJobSpec)
User job spec.
TSelf & SetOutput(size_t tableIndex, const TRichYPath &path)
Set output table path and specify the task output type (i.e. TMyProtoMessage).
Tag class marking that row stream is empty.
Definition operation.h:94