-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathdelta_sharing_client.hpp
More file actions
51 lines (44 loc) · 1.91 KB
/
delta_sharing_client.hpp
File metadata and controls
51 lines (44 loc) · 1.91 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
/* 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 <iostream>
#include <optional>
#include <arrow/table.h>
#include <villas/nodes/delta_sharing/delta_sharing_rest_client.hpp>
namespace DeltaSharing {
struct DeltaSharingClient {
public:
DeltaSharingClient(const std::string &filename,
std::optional<std::string> cacheLocation);
std::shared_ptr<arrow::Table> LoadAsArrowTable(std::string &url);
std::shared_ptr<arrow::Table> ReadTableFromCache(std::string &url);
const std::shared_ptr<std::vector<DeltaSharingProtocol::Share>>
ListShares(int maxResult, const std::string &pageToken) const;
const std::shared_ptr<std::vector<DeltaSharingProtocol::Schema>>
ListSchemas(const DeltaSharingProtocol::Share &share, int maxResult,
const std::string &pageToken) const;
const std::shared_ptr<std::vector<DeltaSharingProtocol::Table>>
ListTables(const DeltaSharingProtocol::Schema &schema, int maxResult,
const std::string &pageToken) const;
const std::shared_ptr<std::vector<DeltaSharingProtocol::Table>>
ListAllTables(const DeltaSharingProtocol::Share &share, int maxResult,
const std::string &pageToken) const;
const std::shared_ptr<std::vector<DeltaSharingProtocol::File>>
ListFilesInTable(const DeltaSharingProtocol::Table &) const;
const DeltaSharingProtocol::Metadata
QueryTableMetadata(const DeltaSharingProtocol::Table &table) const;
const int GetNumberOfThreads() { return this->maxThreads; };
void PopulateCache(const std::string &url) {
this->restClient.PopulateCache(url, this->cacheLocation);
};
protected:
private:
DeltaSharingRestClient restClient;
std::string cacheLocation;
int maxThreads;
};
}; // namespace DeltaSharing