Apache Ignite C++ Client
Loading...
Searching...
No Matches
job_target.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/common/detail/config.h"
21#include "ignite/client/network/cluster_node.h"
22#include "ignite/client/table/qualified_name.h"
23#include "ignite/client/detail/compute/job_target_type.h"
24
25#include <set>
26#include <vector>
27#include <memory>
28
29namespace ignite {
30class ignite_tuple;
31class compute;
32class job_target;
33
37class job_target {
38 friend class compute;
39public:
40 // Default
41 virtual ~job_target() = default;
42
48 [[nodiscard]] IGNITE_API static std::shared_ptr<job_target> node(cluster_node node);
49
55 [[nodiscard]] IGNITE_API static std::shared_ptr<job_target> any_node(std::set<cluster_node> nodes);
56
62 [[nodiscard]] IGNITE_API static std::shared_ptr<job_target> any_node(const std::vector<cluster_node> &nodes);
63
70 [[nodiscard]] IGNITE_API static std::shared_ptr<job_target> colocated(std::string_view table_name, const ignite_tuple &key);
71
78 [[nodiscard]] IGNITE_API static std::shared_ptr<job_target> colocated(qualified_name table_name, const ignite_tuple &key);
79
80protected:
81 // Default
82 job_target() = default;
83
89 [[nodiscard]] virtual detail::job_target_type get_type() const = 0;
90};
91
92
93} // namespace ignite
Definition cluster_node.h:30
Definition compute.h:43
Definition ignite_tuple.h:40
Definition job_target.h:37
static IGNITE_API std::shared_ptr< job_target > node(cluster_node node)
Definition job_target.cpp:27
static IGNITE_API std::shared_ptr< job_target > colocated(std::string_view table_name, const ignite_tuple &key)
Definition job_target.cpp:44
static IGNITE_API std::shared_ptr< job_target > any_node(std::set< cluster_node > nodes)
Definition job_target.cpp:31
virtual detail::job_target_type get_type() const =0
Definition qualified_name.h:40