#pragma once #include "structured_table_formats.h" #include namespace NYT::NDetail { //////////////////////////////////////////////////////////////////////////////// class TOperationPreparationContext : public IOperationPreparationContext { public: TOperationPreparationContext( const TStructuredJobTableList& structuredInputs, const TStructuredJobTableList& structuredOutputs, const TClientContext& context, const IClientRetryPolicyPtr& retryPolicy, TTransactionId transactionId); TOperationPreparationContext( TVector inputs, TVector outputs, const TClientContext& context, const IClientRetryPolicyPtr& retryPolicy, TTransactionId transactionId); int GetInputCount() const override; int GetOutputCount() const override; const TVector& GetInputSchemas() const override; const TTableSchema& GetInputSchema(int index) const override; TMaybe GetInputPath(int index) const override; TMaybe GetOutputPath(int index) const override; private: TVector> Inputs_; TVector> Outputs_; const TClientContext& Context_; const IClientRetryPolicyPtr RetryPolicy_; TTransactionId TransactionId_; mutable TVector InputSchemas_; mutable TVector InputSchemasLoaded_; }; //////////////////////////////////////////////////////////////////////////////// class TSpeculativeOperationPreparationContext : public IOperationPreparationContext { public: TSpeculativeOperationPreparationContext( const TVector& previousResult, TStructuredJobTableList inputs, TStructuredJobTableList outputs); int GetInputCount() const override; int GetOutputCount() const override; const TVector& GetInputSchemas() const override; const TTableSchema& GetInputSchema(int index) const override; TMaybe GetInputPath(int index) const override; TMaybe GetOutputPath(int index) const override; private: TVector InputSchemas_; TStructuredJobTableList Inputs_; TStructuredJobTableList Outputs_; }; //////////////////////////////////////////////////////////////////////////////// template TVector PrepareOperation( const IJob& job, const IOperationPreparationContext& context, TTables* inputsPtr, TTables* outputsPtr, TUserJobFormatHints& hints); //////////////////////////////////////////////////////////////////////////////// TJobOperationPreparer GetOperationPreparer( const IJob& job, const IOperationPreparationContext& context); //////////////////////////////////////////////////////////////////////////////// } // namespace NYT::NDetail