Skip to content

Commit 829b5eb

Browse files
committed
updated version to SWC-DB v0.4.11
1 parent 6a1d664 commit 829b5eb

25 files changed

+2561
-273
lines changed

CHANGELOG.md

+15-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@
88

99
### [SWC-DB master](https://github.com/kashirin-alex/swc-db/tree/master) (upcoming-release)
1010

11+
12+
13+
[_Full Changelog_](https://github.com/kashirin-alex/swc-db/compare/v0.4.11...master)
14+
******
15+
16+
17+
18+
19+
### [SWC-DB v0.4.11](https://github.com/kashirin-alex/swc-db/releases/tag/v0.4.11) (2020-10-14)
20+
1121
added Encoder support to Communications Protocol, old Proto not compatible
1222
added configuration properties:
1323
- swc.client.Mngr.comm.encoder
@@ -22,8 +32,8 @@
2232
added separate AppContext for Ranger and Manager in client::Clients
2333
changed Clients ctor from AppContext::Ptr to Context{Manager,Ranger}::Ptr
2434
added cfg_encoder init by role to all AppContext based on Comm::AppContext
25-
added struct Buffer as sub-class of Comm::Header
26-
changed buffers details storage in class Comm::Header to Buffer type
35+
added struct Comm::BufferInfo file comm/HeaderBufferInfo.h/cc
36+
changed buffers details storage in class Comm::Header to BufferInfo type
2737
added Core::Encoder::Type ConnHandler::get_encoder()
2838
added call to cbuf->prepare in ConnHandler::write_or_queue
2939
added void Event::decode_buffers()
@@ -37,8 +47,10 @@
3747
added case for Error::RANGE_BAD_CELLS_INPUT in client::Query::Update
3848
fixed Resend Cells Count in load_generator and in SWC-DB(client) shell
3949
added Encoder::encode(.., bool no_plain_out=false) option
50+
fixed Ranger/s shutdown process sequence
51+
added configuration property swc.fs.hadoop_jvm.reconnect.delay.ms
4052

41-
[_Full Changelog_](https://github.com/kashirin-alex/swc-db/compare/v0.4.10...master)
53+
[_Full Changelog_](https://github.com/kashirin-alex/swc-db/compare/v0.4.10...v0.4.11)
4254
******
4355

4456

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ endif ()
1414
project(SWCDB)
1515
set(VERSION_MAJOR "0")
1616
set(VERSION_MINOR "4")
17-
set(VERSION_MICRO "10")
17+
set(VERSION_MICRO "11")
1818
set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO}")
1919
set(VERSION_PATCH )
2020
set(VERSION_MISC_SUFFIX "")

cmake/Doxyfile-cpp.doxy

+2,200-5
Large diffs are not rendered by default.

docs/configure/properties/libswcdb.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ _default_ **```swc.cfg.dyn.period=600000```**
3434
The Manager Host/s. The value format ```{ROLES}```|```{COLUMNS}```|```{ENDPOINTS}```|```PORT``` delimitted with ```|``` and aligned groupings of Role & Columns is require. The order is part of used configuration defnition to assign host-priority, 1st has initial preference for Active-State.
3535
> **_The Full Format Description_**: \
3636
```{ROLES}``` - In curly-brackets comma-seperated-value, roles options: ```rangers```(manages Rangers), ```schemas``` {manages Schemas}. example ```{rangers,schemas}``` \
37-
```[COLUMNS]``` - In square-brackets, an interval(by Hyphen ```-```) of column-ids, NoValue/Zero on either side is from/to Any. example ```[10-]``` = from 10 to Any. \
37+
```[COLUMNS]``` - In square-brackets, an interval(by Hyphen ```-```) of column-ids, From and NoValue/Zero is to Any. example ```[10-]``` = from 10 to Any. \
3838
```{ENDPOINTS}``` - A ```FQDN``` hostname or a comma-seperated-value of address ```(IPv4 & IPv6)```. example ```192.168.0.1,::2``` \
3939
```PORT``` - optional, If set use this Port with the listed endpoints. \
4040
Multiple ```swc.mngr.host``` require aligment of Role/s and the Column-Intervals.
@@ -57,9 +57,9 @@ Multiple ```swc.mngr.host``` require aligment of Role/s and the Column-Intervals
5757
```swc.mngr.host={schemas}|host-name-2``` \
5858
```swc.mngr.host={rangers}|host-name-3``` \
5959
```swc.mngr.host={rangers}|host-name-4``` \
60-
```swc.mngr.host=host-name-5``` \
61-
```swc.mngr.host=host-name-6``` \
62-
```swc.mngr.host=host-name-7``` \
60+
```swc.mngr.host=[1-]|host-name-5``` \
61+
```swc.mngr.host=[1-]|host-name-6``` \
62+
```swc.mngr.host=[1-]|host-name-7``` \
6363
> _Option 3_: to the example - 1-group, 4-hosts managers of all Roles and all columns, one-host is a configuration for a single-manager \
6464
```swc.mngr.host=host-name-1``` \
6565
```swc.mngr.host=host-name-2``` \

docs/configure/properties/swcdb_cluster.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ These configuration properties are for sbin/swcdb_cluster a python script based
1313
The Full-Path or Uri to the SWC-DB `tar` archive package. An archive package from [available SWC-DB releases]({{ site.baseurl }}/install/getting_swcdb/#available-for-download) is suitable for the type of archive required.
1414
> The source-host SWC-DB installation files are copied if the property is not set.
1515
16-
_default_ **```swc.install.archive=https://github.com/kashirin-alex/swc-db/releases/download/v0.4.10/swcdb-0.4.10.debug.amd64.tar.xz```**
16+
_default_ **```swc.install.archive=https://github.com/kashirin-alex/swc-db/releases/download/v0.4.11/swcdb-0.4.11.debug.amd64.tar.xz```**
1717

1818

1919
* ### swc.cluster.rgr.host

docs/install/getting_swcdb/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ sort: 2
99

1010
| Version | Version-Specific | Package Types | Build Types | Compiler | Architectures / Platforms | Link |
1111
| --- | --- | --- | --- | --- | --- | --- |
12+
| 0.4.11 | .install-pack | tar.xz | | | | [download](https://github.com/kashirin-alex/swc-db/releases/download/v0.4.11/swcdb-0.4.11.install-pack.tar.xz) |
13+
| 0.4.11 | .debug.amd64 | tar.xz | debug | GCC-9.3 | GLIBC-2.27 amd64 | [download](https://github.com/kashirin-alex/swc-db/releases/download/v0.4.11/swcdb-0.4.11.debug.amd64.tar.xz) |
14+
| 0.4.11 | .amd64 | tar.xz | optimized | GCC-9.3 | GLIBC-2.27 amd64 | [download](https://github.com/kashirin-alex/swc-db/releases/download/v0.4.11/swcdb-0.4.11.amd64.tar.xz) |
15+
| | | | | | | |
1216
| 0.4.10 | .install-pack | tar.xz | | | | [download](https://github.com/kashirin-alex/swc-db/releases/download/v0.4.10/swcdb-0.4.10.install-pack.tar.xz) |
1317
| 0.4.10 | .debug.amd64 | tar.xz | debug | GCC-9.3 | GLIBC-2.27 amd64 | [download](https://github.com/kashirin-alex/swc-db/releases/download/v0.4.10/swcdb-0.4.10.debug.amd64.tar.xz) |
1418
| 0.4.10 | .amd64 | tar.xz | optimized | GCC-9.3 | GLIBC-2.27 amd64 | [download](https://github.com/kashirin-alex/swc-db/releases/download/v0.4.10/swcdb-0.4.10.amd64.tar.xz) |

src/cc/include/swcdb/core/Buffer.h

+13-12
Original file line numberDiff line numberDiff line change
@@ -239,18 +239,8 @@ class BufferDyn : public BufferT {
239239
};
240240

241241

242-
} // namespace Core
243-
244-
245-
246-
/*!
247-
* \addtogroup Core
248-
* @{
249-
*/
250-
251-
252-
typedef Core::Buffer <uint8_t> StaticBuffer;
253-
typedef Core::BufferDyn <StaticBuffer> DynamicBuffer;
242+
typedef Buffer <uint8_t> StaticBuffer;
243+
typedef BufferDyn <StaticBuffer> DynamicBuffer;
254244

255245

256246
// StaticBuffer specializations to SizeOf
@@ -296,7 +286,18 @@ void StaticBuffer::set(DynamicBuffer& other) SWC_NOEXCEPT {
296286
}
297287
}
298288

289+
} // namespace Core
290+
291+
292+
293+
294+
/*!
295+
* \addtogroup Core
296+
* @{
297+
*/
299298

299+
using StaticBuffer = Core::StaticBuffer;
300+
using DynamicBuffer = Core::DynamicBuffer;
300301

301302
/*! @} End of Core Group*/
302303

src/cc/include/swcdb/core/comm/Event.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
#ifndef swcdb_core_comm_Event_h
88
#define swcdb_core_comm_Event_h
99

10-
#include "swcdb/core/comm/Header.h"
1110

1211
#include "swcdb/core/Time.h"
1312
#include "swcdb/core/Buffer.h"
13+
#include "swcdb/core/comm/Header.h"
1414

1515
#include <memory>
1616

src/cc/include/swcdb/core/comm/Header.h

+14-42
Original file line numberDiff line numberDiff line change
@@ -6,53 +6,25 @@
66
#ifndef swcdb_core_comm_Header_h
77
#define swcdb_core_comm_Header_h
88

9-
#include "swcdb/core/Compat.h"
10-
#include "swcdb/core/Encoder.h"
9+
10+
#include "swcdb/core/comm/HeaderBufferInfo.h"
11+
1112

1213
namespace SWC { namespace Comm {
1314

14-
class Header final {
1515

16-
public:
16+
struct Header final {
1717

1818
static const uint8_t PROTOCOL_VERSION = 1;
1919
static const uint8_t PREFIX_LENGTH = 2;
2020
static const uint8_t FIXED_LENGTH = PREFIX_LENGTH + 16;
2121

22-
23-
struct Buffer final {
24-
25-
Buffer();
26-
27-
void reset();
28-
29-
size_t encoded_length() const;
30-
31-
void encode(uint8_t** bufp) const;
32-
33-
void decode(const uint8_t** bufp, size_t* remainp);
34-
35-
void encode(Core::Encoder::Type encoder, StaticBuffer& data);
36-
37-
void decode(int& err, StaticBuffer& data) const;
38-
39-
void print(std::ostream& out) const;
40-
41-
uint32_t size; //!< Buffer size
42-
Core::Encoder::Type encoder; //!< Buffer Encoder
43-
uint32_t size_plain; //!< Buffer set if Encoder not PLAIN
44-
uint32_t chksum; //!< Buffer checksum
45-
46-
} __attribute__((packed));
47-
48-
4922
enum Flags : uint8_t {
5023
FLAGS_BIT_REQUEST = 0x1, //!< Request message
5124
FLAGS_BIT_IGNORE_RESPONSE = 0x2, //!< Response should be ignored
5225
FLAGS_BIT_URGENT = 0x4, //!< Request is urgent
5326
};
5427

55-
5628
enum FlagMask : uint8_t {
5729
FLAGS_MASK_REQUEST = 0xE, //!< Request message bit
5830
FLAGS_MASK_IGNORE_RESPONSE = 0xD, //!< Response should be ignored bit
@@ -78,19 +50,19 @@ class Header final {
7850

7951
void print(std::ostream& out) const;
8052

81-
uint8_t version; //!< Protocol version
82-
uint8_t header_len; //!< Length of header
53+
uint8_t version; //!< Protocol version
54+
uint8_t header_len; //!< Length of header
8355

84-
uint8_t flags; //!< Flags
85-
uint32_t id; //!< Request ID
86-
uint32_t timeout_ms; //!< Request timeout
87-
uint16_t command; //!< Request command number
88-
uint8_t buffers; //!< number of buffers from 0 to 2 (data+data_ext)
56+
uint8_t flags; //!< Flags
57+
uint32_t id; //!< Request ID
58+
uint32_t timeout_ms; //!< Request timeout
59+
uint16_t command; //!< Request command number
60+
uint8_t buffers; //!< number of buffers from 0 to 2 (data+data_ext)
8961

90-
Buffer data; //!< Data Buffer
91-
Buffer data_ext; //!< Data Extended Buffer
62+
BufferInfo data; //!< Data Buffer
63+
BufferInfo data_ext; //!< Data Extended Buffer
9264

93-
uint32_t checksum; //!< Header checksum (excl. it self)
65+
uint32_t checksum; //!< Header checksum (excl. it self)
9466

9567
} __attribute__((packed));
9668

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* SWC-DB© Copyright since 2019 Alex Kashirin <[email protected]>
3+
* License details at <https://github.com/kashirin-alex/swc-db/#license>
4+
*/
5+
6+
#ifndef swcdb_core_comm_HeaderBufferInfo_h
7+
#define swcdb_core_comm_HeaderBufferInfo_h
8+
9+
10+
#include "swcdb/core/Compat.h"
11+
#include "swcdb/core/Encoder.h"
12+
13+
14+
namespace SWC { namespace Comm {
15+
16+
17+
struct BufferInfo final {
18+
19+
BufferInfo();
20+
21+
void reset();
22+
23+
size_t encoded_length() const;
24+
25+
void encode(uint8_t** bufp) const;
26+
27+
void decode(const uint8_t** bufp, size_t* remainp);
28+
29+
void encode(Core::Encoder::Type encoder, StaticBuffer& data);
30+
31+
void decode(int& err, StaticBuffer& data) const;
32+
33+
void print(std::ostream& out) const;
34+
35+
uint32_t size; //!< Buffer size
36+
Core::Encoder::Type encoder; //!< Buffer Encoder
37+
uint32_t size_plain; //!< Buffer set if Encoder not PLAIN
38+
uint32_t chksum; //!< Buffer checksum
39+
40+
} __attribute__((packed));
41+
42+
43+
}}
44+
45+
46+
47+
#ifdef SWC_IMPL_SOURCE
48+
#include "swcdb/core/comm/HeaderBufferInfo.cc"
49+
#endif
50+
51+
#endif // swcdb_core_comm_HeaderBufferInfo_h

src/cc/include/swcdb/core/comm/Resolver.h

+6-4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ struct Network {
2929
Network(const Network& net);
3030
};
3131

32+
typedef std::vector<Network> Networks;
33+
3234
} //namespace Comm
3335

3436

@@ -69,14 +71,14 @@ bool is_ipv6_address(const std::string& str);
6971
EndPoints get_endpoints(uint16_t defaul_port,
7072
const Config::Strings& addrs,
7173
const std::string& host,
72-
const std::vector<Network>& nets,
74+
const Networks& nets,
7375
bool srv=false);
7476

75-
void sort(const std::vector<Network>& nets, const EndPoints& endpoints,
77+
void sort(const Networks& nets, const EndPoints& endpoints,
7678
EndPoints& sorted);
7779

7880
void get_networks(const Config::Strings& networks,
79-
std::vector<Network>& nets, asio::error_code& ec);
81+
Networks& nets, asio::error_code& ec);
8082

8183
void get_networks(const Config::Strings& networks,
8284
std::vector<asio::ip::network_v4>& nets_v4,
@@ -92,7 +94,7 @@ bool is_network(const EndPoint& endpoint, const asio::ip::network_v4& net);
9294
bool is_network(const EndPoint& endpoint, const asio::ip::network_v6& net);
9395

9496

95-
}} // namespace :Comm::Resolver
97+
}} // namespace Comm::Resolver
9698

9799

98100
} // namespace SWC

src/cc/include/swcdb/ranger/db/Column.h

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010

1111
#include "swcdb/ranger/db/Range.h"
12+
#include "swcdb/common/Stats/CompletionCounter.h"
1213

1314
#include <unordered_map>
1415

src/cc/lib/swcdb/core/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ set(swcdb_core_comm_sources
5858
comm/ConfigSSL.cc
5959
comm/Resolver.cc
6060
comm/Event.cc
61+
comm/HeaderBufferInfo.cc
6162
comm/Header.cc
6263
comm/Buffers.cc
6364
comm/ConnHandler.cc

0 commit comments

Comments
 (0)