IceFlow NDN-based stream processing library written in C++
Loading...
Searching...
No Matches
node-instance-service.hpp
1/*
2 * Copyright 2024 The IceFlow Authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 * SPDX-License-Identifier: Apache-2.0
17 */
18
19#ifndef ICEFLOW_NODE_INSTANCE_SERVICE_H
20#define ICEFLOW_NODE_INSTANCE_SERVICE_H
21
22#ifdef USE_GRPC
23
24#include "iceflow.hpp"
25
26#include "node-instance.grpc.pb.h"
27#include "node-instance.pb.h"
28
29#include <grpc/grpc.h>
30#include <grpcpp/server_builder.h>
31
32namespace iceflow {
33
34class NodeInstanceService final : public NodeInstance::Service {
35public:
36 explicit NodeInstanceService(std::shared_ptr<IceFlow> iceflow);
37
38public:
39 virtual grpc::Status Repartition(grpc::ServerContext *context,
40 const RepartitionRequest *request,
41 RepartitionResponse *response);
42
43 virtual grpc::Status QueryStats(grpc::ServerContext *context,
44 const StatsRequest *request,
45 StatsResponse *response);
46
47private:
48 std::shared_ptr<IceFlow> m_iceflow;
49};
50} // namespace iceflow
51
52#endif // USE_GRPC
53
54#endif // ICEFLOW_NODE_INSTANCE_SERVICE_H