-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathdelta_sharing.hpp
More file actions
75 lines (54 loc) · 1.77 KB
/
delta_sharing.hpp
File metadata and controls
75 lines (54 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/* Node type: Delta Sharing.
*
* Author: Ritesh Karki <ritesh.karki@rwth-aachen.de>
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <cstddef>
#include <memory>
#include <string>
#include <vector>
#include <jansson.h>
#include <villas/nodes/delta_sharing/delta_sharing_client.hpp>
#include <villas/nodes/delta_sharing/protocol.hpp>
namespace arrow {
class Table;
}
namespace villas {
namespace node {
// Forward declarations
class NodeCompat;
struct delta_sharing {
// Configuration
std::string profilePath;
std::string cacheDir;
std::string tablePath;
size_t batchSize;
std::string schema;
std::string share;
std::string table;
// Client and state
std::shared_ptr<DeltaSharing::DeltaSharingClient> client;
std::shared_ptr<std::vector<DeltaSharing::DeltaSharingProtocol::Schema>>
schemas;
std::shared_ptr<arrow::Table> table_ptr;
std::shared_ptr<std::vector<DeltaSharing::DeltaSharingProtocol::Table>>
tables;
std::shared_ptr<std::vector<DeltaSharing::DeltaSharingProtocol::Share>>
shares;
enum class TableOp { TABLE_NOOP, TABLE_READ, TABLE_WRITE } table_op;
size_t current_row;
};
char *deltaSharing_print(NodeCompat *n);
int deltaSharing_parse(NodeCompat *n, json_t *json);
int deltaSharing_start(NodeCompat *n);
int deltaSharing_stop(NodeCompat *n);
int deltaSharing_init(NodeCompat *n);
int deltaSharing_destroy(NodeCompat *n);
int deltaSharing_poll_fds(NodeCompat *n, int fds[]);
int deltaSharing_read(NodeCompat *n, struct Sample *const smps[], unsigned cnt);
int deltaSharing_write(NodeCompat *n, struct Sample *const smps[],
unsigned cnt);
} // namespace node
} // namespace villas