Apache Ignite C++ Client
Loading...
Searching...
No Matches
compute.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/broadcast_execution.h"
21#include "ignite/client/compute/broadcast_job_target.h"
22#include "ignite/client/compute/job_descriptor.h"
23#include "ignite/client/compute/job_execution.h"
24#include "ignite/client/compute/job_target.h"
25#include "ignite/client/network/cluster_node.h"
26#include "ignite/common/binary_object.h"
27#include "ignite/common/detail/config.h"
28#include "ignite/common/ignite_result.h"
29
30#include <memory>
31#include <utility>
32
33
34namespace ignite {
35
36namespace detail {
37class compute_impl;
38}
39
43class compute {
44 friend class ignite_client;
45
46public:
47 // Delete
48 compute() = delete;
49
58 IGNITE_API void submit_async(std::shared_ptr<job_target> target, std::shared_ptr<job_descriptor> descriptor,
59 const binary_object &arg, ignite_callback<job_execution> callback);
60
69 IGNITE_API job_execution submit(std::shared_ptr<job_target> target, std::shared_ptr<job_descriptor> descriptor,
70 const binary_object &arg) {
71 return sync<job_execution>([&](auto callback) mutable {
72 submit_async(std::move(target), std::move(descriptor), arg, std::move(callback));
73 });
74 }
75
84 IGNITE_API void submit_broadcast_async(std::shared_ptr<broadcast_job_target> target,
85 std::shared_ptr<job_descriptor> descriptor, const binary_object &arg,
86 ignite_callback<broadcast_execution> callback);
87
97 std::shared_ptr<broadcast_job_target> target, std::shared_ptr<job_descriptor> descriptor,
98 const binary_object &arg) {
99 return sync<broadcast_execution>([&](auto callback) mutable {
100 submit_broadcast_async(std::move(target), std::move(descriptor), arg, std::move(callback));
101 });
102 }
103
104private:
110 explicit compute(std::shared_ptr<detail::compute_impl> impl)
111 : m_impl(std::move(impl)) {}
112
114 std::shared_ptr<detail::compute_impl> m_impl;
115};
116
117} // namespace ignite
Definition binary_object.h:27
Definition broadcast_execution.h:30
Definition compute.h:43
IGNITE_API void submit_async(std::shared_ptr< job_target > target, std::shared_ptr< job_descriptor > descriptor, const binary_object &arg, ignite_callback< job_execution > callback)
Definition compute.cpp:28
IGNITE_API void submit_broadcast_async(std::shared_ptr< broadcast_job_target > target, std::shared_ptr< job_descriptor > descriptor, const binary_object &arg, ignite_callback< broadcast_execution > callback)
Definition compute.cpp:53
IGNITE_API job_execution submit(std::shared_ptr< job_target > target, std::shared_ptr< job_descriptor > descriptor, const binary_object &arg)
Definition compute.h:69
IGNITE_API broadcast_execution submit_broadcast(std::shared_ptr< broadcast_job_target > target, std::shared_ptr< job_descriptor > descriptor, const binary_object &arg)
Definition compute.h:96
Definition job_execution.h:38