ClickHouse/dbms/src/Storages/MergeTree/ReplicatedMergeTreeAddress.h

36 lines
624 B
C++
Raw Normal View History

#pragma once
#include <Core/Types.h>
#include <IO/ReadBuffer.h>
#include <IO/WriteBuffer.h>
2015-10-02 18:33:46 +00:00
namespace DB
{
2017-04-16 15:00:33 +00:00
/// Lets you know where to send requests to get to the replica.
2015-10-02 18:33:46 +00:00
struct ReplicatedMergeTreeAddress
{
String host;
UInt16 replication_port;
UInt16 queries_port;
String database;
String table;
2015-10-02 18:33:46 +00:00
ReplicatedMergeTreeAddress() = default;
explicit ReplicatedMergeTreeAddress(const String & str)
{
fromString(str);
}
2015-10-02 18:33:46 +00:00
void writeText(WriteBuffer & out) const;
2015-10-02 18:33:46 +00:00
void readText(ReadBuffer & in);
2015-10-02 18:33:46 +00:00
String toString() const;
2015-10-02 18:33:46 +00:00
void fromString(const String & str);
2015-10-02 18:33:46 +00:00
};
}