forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClusterFunctionReadTask.h
More file actions
41 lines (32 loc) · 1.41 KB
/
ClusterFunctionReadTask.h
File metadata and controls
41 lines (32 loc) · 1.41 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
#pragma once
#include <Core/Types.h>
#include <Storages/ObjectStorage/IObjectIterator.h>
#include <Storages/ObjectStorage/DataLakes/DataLakeObjectMetadata.h>
namespace DB
{
class ReadBuffer;
class WriteBuffer;
/// A response send from initiator in Cluster functions (S3Cluster, etc)
struct ClusterFunctionReadTaskResponse
{
ClusterFunctionReadTaskResponse() = default;
explicit ClusterFunctionReadTaskResponse(const std::string & path_);
explicit ClusterFunctionReadTaskResponse(ObjectInfoPtr object, const ContextPtr & context);
/// Data path (object path, in case of object storage).
String path;
/// Object metadata path, in case of data lake object.
DataLakeObjectMetadata data_lake_metadata;
/// Convert received response into ObjectInfo.
ObjectInfoPtr getObjectInfo() const;
/// Whether response is empty.
/// It is used to identify an end of processing.
bool isEmpty() const { return path.empty(); }
/// Serialize according to the protocol version.
void serialize(WriteBuffer & out, size_t protocol_version) const;
/// Deserialize. Protocol version will be received from `in`
/// and the result will be deserialized accordingly.
void deserialize(ReadBuffer & in);
};
using ClusterFunctionReadTaskResponsePtr = std::shared_ptr<ClusterFunctionReadTaskResponse>;
using ClusterFunctionReadTaskCallback = std::function<ClusterFunctionReadTaskResponsePtr()>;
}