mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 13:13:36 +00:00
55 lines
1.3 KiB
C++
55 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include <unordered_set>
|
|
#include <unordered_map>
|
|
|
|
#include <Core/Types.h>
|
|
#include <Core/QualifiedTableName.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
namespace ErrorCodes
|
|
{
|
|
extern const int LOGICAL_ERROR;
|
|
extern const int TOO_LARGE_ARRAY_SIZE;
|
|
}
|
|
|
|
class ReadBuffer;
|
|
class WriteBuffer;
|
|
|
|
|
|
/// The following are request-response messages for TablesStatus request of the client-server protocol.
|
|
/// Client can ask for about a set of tables and the server will respond with the following information for each table:
|
|
/// - Is the table Replicated?
|
|
/// - If yes, replication delay for that table.
|
|
///
|
|
/// For nonexistent tables there will be no TableStatus entry in the response.
|
|
|
|
struct TableStatus
|
|
{
|
|
bool is_replicated = false;
|
|
UInt32 absolute_delay = 0;
|
|
|
|
void write(WriteBuffer & out) const;
|
|
void read(ReadBuffer & in);
|
|
};
|
|
|
|
struct TablesStatusRequest
|
|
{
|
|
std::unordered_set<QualifiedTableName> tables;
|
|
|
|
void write(WriteBuffer & out, UInt64 server_protocol_revision) const;
|
|
void read(ReadBuffer & in, UInt64 client_protocol_revision);
|
|
};
|
|
|
|
struct TablesStatusResponse
|
|
{
|
|
std::unordered_map<QualifiedTableName, TableStatus> table_states_by_id;
|
|
|
|
void write(WriteBuffer & out, UInt64 client_protocol_revision) const;
|
|
void read(ReadBuffer & in, UInt64 server_protocol_revision);
|
|
};
|
|
|
|
}
|