Apache Ignite C++ Client
Loading...
Searching...
No Matches
job_descriptor.h
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#pragma once
19
20#include "ignite/client/compute/deployment_unit.h"
21#include "ignite/client/compute/job_execution_options.h"
22
23#include <string>
24#include <utility>
25#include <vector>
26#include <memory>
27
28namespace ignite {
29
34public:
38 job_descriptor() = default;
39
45 [[nodiscard]] const std::string &get_job_class_name() const { return m_job_class_name; }
46
52 [[nodiscard]] const std::vector<deployment_unit> &get_deployment_units() const { return m_units; }
53
59 [[nodiscard]] const job_execution_options &get_execution_options() const { return m_options; }
60
64 class builder {
65 public:
71 explicit builder(std::string job_class_name) {
72 m_descriptor->m_job_class_name = std::move(job_class_name);
73 }
74
81 m_descriptor->m_job_class_name = std::move(job_class_name);
82 return *this;
83 }
84
90 builder& deployment_units(std::vector<deployment_unit> units) {
91 m_descriptor->m_units = std::move(units);
92 return *this;
93 }
94
101 m_descriptor->m_options = std::move(options); // NOLINT(*-move-const-arg)
102 return *this;
103 }
104
110 std::shared_ptr<job_descriptor> build() { return std::move(m_descriptor); }
111 private:
113 std::shared_ptr<job_descriptor> m_descriptor{std::make_shared<job_descriptor>()};
114 };
115private:
117 std::string m_job_class_name;
118
120 std::vector<deployment_unit> m_units;
121
123 job_execution_options m_options;
124};
125
126} // namespace ignite
builder & execution_options(job_execution_options options)
Definition job_descriptor.h:100
builder & job_class_name(std::string job_class_name)
Definition job_descriptor.h:80
builder(std::string job_class_name)
Definition job_descriptor.h:71
builder & deployment_units(std::vector< deployment_unit > units)
Definition job_descriptor.h:90
std::shared_ptr< job_descriptor > build()
Definition job_descriptor.h:110
const std::string & get_job_class_name() const
Definition job_descriptor.h:45
const std::vector< deployment_unit > & get_deployment_units() const
Definition job_descriptor.h:52
const job_execution_options & get_execution_options() const
Definition job_descriptor.h:59
Definition job_execution_options.h:27