Apache Geode Native C++ Reference 1.15.0
FunctionService.hpp
Go to the documentation of this file.
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#ifndef GEODE_FUNCTIONSERVICE_H_
21#define GEODE_FUNCTIONSERVICE_H_
22
23#include <memory>
24
25#include "Execution.hpp"
26#include "internal/geode_globals.hpp"
27
32namespace apache {
33namespace geode {
34namespace client {
35class Pool;
36class Region;
37class RegionService;
38class Execution;
39
45class APACHE_GEODE_EXPORT FunctionService {
46 public:
65 static Execution onRegion(const std::shared_ptr<Region>& region);
66
80 inline static Execution onServer(const std::shared_ptr<Pool>& pool) {
81 return onServerWithPool(pool);
82 }
83
98 inline static Execution onServer(RegionService& regionService) {
99 return onServerWithCache(regionService);
100 }
101
115 inline static Execution onServers(const std::shared_ptr<Pool>& pool) {
116 return onServersWithPool(pool);
117 }
118
133 inline static Execution onServers(RegionService& regionService) {
134 return onServersWithCache(regionService);
135 }
136
137 virtual ~FunctionService() noexcept = default;
138
139 private:
140 static Execution onServerWithPool(const std::shared_ptr<Pool>& pool);
141
142 static Execution onServerWithCache(RegionService& regionService);
143
144 static Execution onServersWithPool(const std::shared_ptr<Pool>& pool);
145
146 static Execution onServersWithCache(RegionService& regionService);
147};
148} // namespace client
149} // namespace geode
150} // namespace apache
151
152#endif // GEODE_FUNCTIONSERVICE_H_
gathers results from function execution
Definition: Execution.hpp:47
entry point for function execution
Definition: FunctionService.hpp:45
static Execution onServers(const std::shared_ptr< Pool > &pool)
Returns a Execution object that can be used to execute a data independent function on all the servers...
Definition: FunctionService.hpp:115
static Execution onServer(RegionService &regionService)
Returns a Execution object that can be used to execute a data independent function on a server where ...
Definition: FunctionService.hpp:98
static Execution onRegion(const std::shared_ptr< Region > &region)
Returns a Execution object that can be used to execute a data dependent function on the specified Reg...
static Execution onServers(RegionService &regionService)
Returns a Execution object that can be used to execute a data independent function on all the servers...
Definition: FunctionService.hpp:133
static Execution onServer(const std::shared_ptr< Pool > &pool)
Returns a Execution object that can be used to execute a data independent function on a server in the...
Definition: FunctionService.hpp:80
A pool of connections to connect from a client to a set of Geode Cache Servers.
Definition: Pool.hpp:59
A RegionService provides access to existing regions that exist in a Geode cache.
Definition: RegionService.hpp:58

Apache Geode C++ Cache API Documentation