2018-04-17 17:59:42 +00:00
|
|
|
#pragma once
|
|
|
|
#include <Core/Types.h>
|
2017-04-01 09:19:00 +00:00
|
|
|
#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
|
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
String host;
|
|
|
|
UInt16 replication_port;
|
|
|
|
UInt16 queries_port;
|
|
|
|
String database;
|
|
|
|
String table;
|
2018-07-31 10:34:35 +00:00
|
|
|
String scheme;
|
2015-10-02 18:33:46 +00:00
|
|
|
|
2018-04-17 17:59:42 +00:00
|
|
|
ReplicatedMergeTreeAddress() = default;
|
|
|
|
explicit ReplicatedMergeTreeAddress(const String & str)
|
2017-04-01 07:20:54 +00:00
|
|
|
{
|
|
|
|
fromString(str);
|
|
|
|
}
|
2015-10-02 18:33:46 +00:00
|
|
|
|
2018-04-17 17:59:42 +00:00
|
|
|
void writeText(WriteBuffer & out) const;
|
2015-10-02 18:33:46 +00:00
|
|
|
|
2018-04-17 17:59:42 +00:00
|
|
|
void readText(ReadBuffer & in);
|
2015-10-02 18:33:46 +00:00
|
|
|
|
2018-04-17 17:59:42 +00:00
|
|
|
String toString() const;
|
2015-10-02 18:33:46 +00:00
|
|
|
|
2018-04-17 17:59:42 +00:00
|
|
|
void fromString(const String & str);
|
2015-10-02 18:33:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|