| 1 | #pragma once |
| 2 | #include <Core/Types.h> |
| 3 | #include <vector> |
| 4 | namespace DB |
| 5 | { |
| 6 | /* Parse a string that generates shards and replicas. Separator - one of two characters | or , |
| 7 | * depending on whether shards or replicas are generated. |
| 8 | * For example: |
| 9 | * host1,host2,... - generates set of shards from host1, host2, ... |
| 10 | * host1|host2|... - generates set of replicas from host1, host2, ... |
| 11 | * abc{8..10}def - generates set of shards abc8def, abc9def, abc10def. |
| 12 | * abc{08..10}def - generates set of shards abc08def, abc09def, abc10def. |
| 13 | * abc{x,yy,z}def - generates set of shards abcxdef, abcyydef, abczdef. |
| 14 | * abc{x|yy|z} def - generates set of replicas abcxdef, abcyydef, abczdef. |
| 15 | * abc{1..9}de{f,g,h} - is a direct product, 27 shards. |
| 16 | * abc{1..9}de{0|1} - is a direct product, 9 shards, in each 2 replicas. |
| 17 | */ |
| 18 | std::vector<String> parseRemoteDescription(const String & description, size_t l, size_t r, char separator, size_t max_addresses); |
| 19 | |
| 20 | } |
| 21 | |