libcouchbase 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/libcouchbase/.gitignore +2 -0
- data/ext/libcouchbase/CMakeLists.txt +5 -7
- data/ext/libcouchbase/README.markdown +2 -2
- data/ext/libcouchbase/RELEASE_NOTES.markdown +49 -0
- data/ext/libcouchbase/cmake/Modules/ConfigureDtrace.cmake +11 -0
- data/ext/libcouchbase/cmake/Modules/GenerateConfigDotH.cmake +2 -0
- data/ext/libcouchbase/cmake/Modules/GetLibcouchbaseFlags.cmake +2 -1
- data/ext/libcouchbase/cmake/Modules/GetVersionInfo.cmake +3 -3
- data/ext/libcouchbase/cmake/config-cmake.h.in +2 -0
- data/ext/libcouchbase/cmake/defs.mk.in +0 -2
- data/ext/libcouchbase/cmake/source_files.cmake +34 -14
- data/ext/libcouchbase/configure.pl +1 -1
- data/ext/libcouchbase/contrib/genhash/genhash.h +6 -0
- data/ext/libcouchbase/include/libcouchbase/auth.h +10 -0
- data/ext/libcouchbase/include/libcouchbase/couchbase.h +10 -0
- data/ext/libcouchbase/include/libcouchbase/error.h +7 -0
- data/ext/libcouchbase/include/libcouchbase/n1ql.h +13 -1
- data/ext/libcouchbase/include/libcouchbase/plugins/io/bsdio-inl.c +1 -1
- data/ext/libcouchbase/include/libcouchbase/subdoc.h +9 -0
- data/ext/libcouchbase/include/libcouchbase/views.h +7 -1
- data/ext/libcouchbase/include/libcouchbase/visibility.h +1 -0
- data/ext/libcouchbase/include/memcached/protocol_binary.h +21 -1132
- data/ext/libcouchbase/packaging/parse-git-describe.pl +1 -1
- data/ext/libcouchbase/plugins/io/libev/libev_io_opts.h +3 -2
- data/ext/libcouchbase/src/README.md +0 -2
- data/ext/libcouchbase/src/auth-priv.h +1 -0
- data/ext/libcouchbase/src/auth.cc +10 -0
- data/ext/libcouchbase/src/bootstrap.cc +216 -0
- data/ext/libcouchbase/src/bootstrap.h +50 -39
- data/ext/libcouchbase/src/bucketconfig/bc_cccp.cc +455 -0
- data/ext/libcouchbase/src/bucketconfig/bc_file.cc +281 -0
- data/ext/libcouchbase/src/bucketconfig/bc_http.cc +528 -0
- data/ext/libcouchbase/src/bucketconfig/bc_http.h +50 -25
- data/ext/libcouchbase/src/bucketconfig/bc_mcraw.cc +115 -0
- data/ext/libcouchbase/src/bucketconfig/clconfig.h +407 -386
- data/ext/libcouchbase/src/bucketconfig/confmon.cc +378 -0
- data/ext/libcouchbase/src/cbft.cc +22 -27
- data/ext/libcouchbase/src/cntl.cc +24 -24
- data/ext/libcouchbase/src/connspec.cc +30 -1
- data/ext/libcouchbase/src/connspec.h +17 -0
- data/ext/libcouchbase/src/dns-srv.cc +143 -0
- data/ext/libcouchbase/src/{dump.c → dump.cc} +8 -11
- data/ext/libcouchbase/src/getconfig.cc +73 -0
- data/ext/libcouchbase/src/handler.cc +84 -85
- data/ext/libcouchbase/src/hostlist.cc +0 -1
- data/ext/libcouchbase/src/hostlist.h +6 -1
- data/ext/libcouchbase/src/http/http-priv.h +125 -112
- data/ext/libcouchbase/src/http/http.cc +9 -29
- data/ext/libcouchbase/src/http/http.h +1 -34
- data/ext/libcouchbase/src/http/http_io.cc +22 -26
- data/ext/libcouchbase/src/instance.cc +102 -28
- data/ext/libcouchbase/src/internal.h +47 -29
- data/ext/libcouchbase/src/jsparse/parser.cc +146 -202
- data/ext/libcouchbase/src/jsparse/parser.h +91 -98
- data/ext/libcouchbase/src/lcbht/lcbht.cc +177 -0
- data/ext/libcouchbase/src/lcbht/lcbht.h +174 -163
- data/ext/libcouchbase/src/lcbio/connect.cc +562 -0
- data/ext/libcouchbase/src/lcbio/connect.h +9 -2
- data/ext/libcouchbase/src/lcbio/ctx.c +1 -1
- data/ext/libcouchbase/src/lcbio/iotable.h +61 -16
- data/ext/libcouchbase/src/lcbio/ioutils.h +1 -1
- data/ext/libcouchbase/src/lcbio/manager.c +2 -2
- data/ext/libcouchbase/src/lcbio/timer-cxx.h +87 -0
- data/ext/libcouchbase/src/mc/mcreq.h +9 -2
- data/ext/libcouchbase/src/mcserver/mcserver.cc +723 -0
- data/ext/libcouchbase/src/mcserver/mcserver.h +160 -70
- data/ext/libcouchbase/src/mcserver/negotiate.cc +118 -152
- data/ext/libcouchbase/src/mcserver/negotiate.h +85 -74
- data/ext/libcouchbase/src/mctx-helper.h +51 -0
- data/ext/libcouchbase/src/n1ql/ixmgmt.cc +1 -2
- data/ext/libcouchbase/src/n1ql/n1ql.cc +56 -32
- data/ext/libcouchbase/src/{newconfig.c → newconfig.cc} +42 -70
- data/ext/libcouchbase/src/nodeinfo.cc +4 -8
- data/ext/libcouchbase/src/operations/{cbflush.c → cbflush.cc} +7 -15
- data/ext/libcouchbase/src/operations/{counter.c → counter.cc} +0 -0
- data/ext/libcouchbase/src/operations/{durability-cas.c → durability-cas.cc} +92 -76
- data/ext/libcouchbase/src/operations/{durability-seqno.c → durability-seqno.cc} +55 -49
- data/ext/libcouchbase/src/operations/durability.cc +643 -0
- data/ext/libcouchbase/src/operations/durability_internal.h +212 -124
- data/ext/libcouchbase/src/operations/{get.c → get.cc} +24 -26
- data/ext/libcouchbase/src/operations/{observe-seqno.c → observe-seqno.cc} +5 -8
- data/ext/libcouchbase/src/operations/{observe.c → observe.cc} +69 -94
- data/ext/libcouchbase/src/operations/{pktfwd.c → pktfwd.cc} +0 -0
- data/ext/libcouchbase/src/operations/{remove.c → remove.cc} +0 -0
- data/ext/libcouchbase/src/operations/{stats.c → stats.cc} +66 -78
- data/ext/libcouchbase/src/operations/{store.c → store.cc} +27 -32
- data/ext/libcouchbase/src/operations/subdoc.cc +38 -18
- data/ext/libcouchbase/src/operations/{touch.c → touch.cc} +0 -0
- data/ext/libcouchbase/src/packetutils.h +200 -137
- data/ext/libcouchbase/src/probes.d +1 -1
- data/ext/libcouchbase/src/{retrychk.c → retrychk.cc} +3 -4
- data/ext/libcouchbase/src/retryq.cc +394 -0
- data/ext/libcouchbase/src/retryq.h +116 -104
- data/ext/libcouchbase/src/settings.h +2 -1
- data/ext/libcouchbase/src/ssl/ssl_c.c +1 -0
- data/ext/libcouchbase/src/ssl/ssl_e.c +0 -1
- data/ext/libcouchbase/src/trace.h +8 -8
- data/ext/libcouchbase/src/vbucket/vbucket.c +0 -1
- data/ext/libcouchbase/src/views/{docreq.c → docreq.cc} +48 -54
- data/ext/libcouchbase/src/views/docreq.h +24 -30
- data/ext/libcouchbase/src/views/viewreq.cc +318 -0
- data/ext/libcouchbase/src/views/viewreq.h +43 -13
- data/ext/libcouchbase/src/{wait.c → wait.cc} +12 -17
- data/ext/libcouchbase/tests/basic/t_connstr.cc +89 -50
- data/ext/libcouchbase/tests/basic/t_jsparse.cc +27 -78
- data/ext/libcouchbase/tests/basic/t_packet.cc +35 -42
- data/ext/libcouchbase/tests/htparse/t_basic.cc +58 -78
- data/ext/libcouchbase/tests/iotests/t_confmon.cc +94 -111
- data/ext/libcouchbase/tests/iotests/t_sched.cc +1 -2
- data/ext/libcouchbase/tests/mc/t_alloc.cc +9 -9
- data/ext/libcouchbase/tools/cbc-pillowfight.cc +1 -1
- data/lib/libcouchbase/version.rb +1 -1
- metadata +36 -39
- data/ext/libcouchbase/include/memcached/vbucket.h +0 -42
- data/ext/libcouchbase/src/bootstrap.c +0 -269
- data/ext/libcouchbase/src/bucketconfig/bc_cccp.c +0 -495
- data/ext/libcouchbase/src/bucketconfig/bc_file.c +0 -347
- data/ext/libcouchbase/src/bucketconfig/bc_http.c +0 -630
- data/ext/libcouchbase/src/bucketconfig/bc_mcraw.c +0 -150
- data/ext/libcouchbase/src/bucketconfig/confmon.c +0 -474
- data/ext/libcouchbase/src/getconfig.c +0 -100
- data/ext/libcouchbase/src/lcbht/lcbht.c +0 -282
- data/ext/libcouchbase/src/lcbio/connect.c +0 -557
- data/ext/libcouchbase/src/mcserver/mcserver.c +0 -784
- data/ext/libcouchbase/src/operations/durability.c +0 -668
- data/ext/libcouchbase/src/packetutils.c +0 -60
- data/ext/libcouchbase/src/retryq.c +0 -424
- data/ext/libcouchbase/src/simplestring.c +0 -211
- data/ext/libcouchbase/src/simplestring.h +0 -228
- data/ext/libcouchbase/src/ssobuf.h +0 -82
- data/ext/libcouchbase/src/views/viewreq.c +0 -358
- data/ext/libcouchbase/tests/basic/t_string.cc +0 -112
|
@@ -7,130 +7,115 @@
|
|
|
7
7
|
#include <lcbio/iotable.h>
|
|
8
8
|
#include <set>
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
using namespace lcb::clconfig;
|
|
11
|
+
|
|
12
|
+
class ConfmonTest : public ::testing::Test
|
|
11
13
|
{
|
|
12
14
|
void SetUp() {
|
|
13
15
|
MockEnvironment::Reset();
|
|
14
16
|
}
|
|
15
17
|
};
|
|
16
18
|
|
|
17
|
-
struct evstop_listener {
|
|
18
|
-
clconfig_listener base;
|
|
19
|
+
struct evstop_listener : Listener {
|
|
19
20
|
lcbio_pTABLE io;
|
|
20
21
|
int called;
|
|
22
|
+
|
|
23
|
+
void clconfig_lsn(EventType event, ConfigInfo*) {
|
|
24
|
+
if (event != CLCONFIG_EVENT_GOT_NEW_CONFIG) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
called = 1;
|
|
28
|
+
IOT_STOP(io);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
evstop_listener() : Listener(), io(NULL), called(0) {
|
|
32
|
+
}
|
|
21
33
|
};
|
|
22
34
|
|
|
23
35
|
extern "C" {
|
|
24
|
-
static void listen_callback1(
|
|
25
|
-
|
|
36
|
+
static void listen_callback1(Listener *lsn, EventType event,
|
|
37
|
+
ConfigInfo *info)
|
|
26
38
|
{
|
|
27
|
-
if (event != CLCONFIG_EVENT_GOT_NEW_CONFIG) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
evstop_listener *me = reinterpret_cast<evstop_listener*>(lsn);
|
|
32
|
-
me->called = 1;
|
|
33
|
-
IOT_STOP(me->io);
|
|
34
39
|
}
|
|
35
40
|
}
|
|
36
41
|
|
|
37
|
-
TEST_F(
|
|
42
|
+
TEST_F(ConfmonTest, testBasic)
|
|
38
43
|
{
|
|
39
44
|
HandleWrap hw;
|
|
40
45
|
lcb_t instance;
|
|
41
46
|
MockEnvironment::getInstance()->createConnection(hw, instance);
|
|
42
47
|
|
|
43
48
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
49
|
+
Confmon *mon = new Confmon(instance->settings, instance->iotable);
|
|
50
|
+
Provider *http = mon->get_provider(CLCONFIG_HTTP);
|
|
51
|
+
http->enable();
|
|
52
|
+
http->configure_nodes(*instance->ht_nodes);
|
|
48
53
|
|
|
49
|
-
|
|
54
|
+
mon->prepare();
|
|
50
55
|
|
|
51
|
-
EXPECT_EQ(NULL,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
EXPECT_EQ(NULL, mon->get_config());
|
|
57
|
+
mon->start();
|
|
58
|
+
mon->start(); // Twice!
|
|
59
|
+
mon->stop();
|
|
60
|
+
mon->stop();
|
|
56
61
|
|
|
57
62
|
// Try to find a provider..
|
|
58
|
-
|
|
63
|
+
Provider *provider = mon->get_provider(CLCONFIG_HTTP);
|
|
59
64
|
ASSERT_NE(0, provider->enabled);
|
|
60
65
|
|
|
61
|
-
|
|
62
|
-
memset(&listener, 0, sizeof(listener));
|
|
63
|
-
|
|
64
|
-
listener.base.callback = listen_callback1;
|
|
65
|
-
listener.base.parent = mon;
|
|
66
|
+
evstop_listener listener;
|
|
66
67
|
listener.io = instance->iotable;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
lcb_confmon_start(mon);
|
|
68
|
+
mon->add_listener(&listener);
|
|
69
|
+
mon->start();
|
|
70
70
|
IOT_START(instance->iotable);
|
|
71
71
|
ASSERT_NE(0, listener.called);
|
|
72
|
-
|
|
73
|
-
lcb_confmon_destroy(mon);
|
|
72
|
+
delete mon;
|
|
74
73
|
}
|
|
75
74
|
|
|
76
75
|
|
|
77
|
-
struct listener2 {
|
|
78
|
-
clconfig_listener base;
|
|
76
|
+
struct listener2 : Listener {
|
|
79
77
|
int call_count;
|
|
80
78
|
lcbio_pTABLE io;
|
|
81
|
-
|
|
82
|
-
std::set<
|
|
79
|
+
Method last_source;
|
|
80
|
+
std::set<EventType> expected_events;
|
|
83
81
|
|
|
84
82
|
void reset() {
|
|
85
83
|
call_count = 0;
|
|
86
|
-
last_source =
|
|
84
|
+
last_source = CLCONFIG_PHONY;
|
|
87
85
|
expected_events.clear();
|
|
88
86
|
}
|
|
89
87
|
|
|
90
|
-
listener2() {
|
|
91
|
-
memset(&base, 0, sizeof(base));
|
|
88
|
+
listener2() : Listener() {
|
|
92
89
|
io = NULL;
|
|
93
90
|
reset();
|
|
94
91
|
}
|
|
95
|
-
};
|
|
96
92
|
|
|
97
|
-
|
|
98
|
-
{
|
|
99
|
-
|
|
100
|
-
|
|
93
|
+
void clconfig_lsn(EventType event, ConfigInfo *info) {
|
|
94
|
+
if (event == CLCONFIG_EVENT_MONITOR_STOPPED) {
|
|
95
|
+
IOT_START(io);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
101
98
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
struct listener2* lsn = getListener2(prov);
|
|
99
|
+
if (!expected_events.empty()) {
|
|
100
|
+
if (expected_events.end() ==
|
|
101
|
+
expected_events.find(event)) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
109
105
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
106
|
+
call_count++;
|
|
107
|
+
last_source = info->get_origin();
|
|
108
|
+
IOT_STOP(io);
|
|
114
109
|
|
|
115
|
-
if (!lsn->expected_events.empty()) {
|
|
116
|
-
if (lsn->expected_events.end() ==
|
|
117
|
-
lsn->expected_events.find(event)) {
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
110
|
}
|
|
111
|
+
};
|
|
121
112
|
|
|
122
|
-
|
|
123
|
-
lsn->last_source = info->origin;
|
|
124
|
-
IOT_STOP(lsn->io);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
static void runConfmon(lcbio_pTABLE io, lcb_confmon *mon)
|
|
113
|
+
static void runConfmonTest(lcbio_pTABLE io, Confmon *mon)
|
|
129
114
|
{
|
|
130
115
|
IOT_START(io);
|
|
131
116
|
}
|
|
132
117
|
|
|
133
|
-
TEST_F(
|
|
118
|
+
TEST_F(ConfmonTest, testCycle)
|
|
134
119
|
{
|
|
135
120
|
HandleWrap hw;
|
|
136
121
|
lcb_t instance;
|
|
@@ -145,57 +130,55 @@ TEST_F(Confmon, testCycle)
|
|
|
145
130
|
instance->settings->bc_http_stream_time = 100000;
|
|
146
131
|
instance->memd_sockpool->tmoidle = 100000;
|
|
147
132
|
|
|
148
|
-
|
|
133
|
+
Confmon *mon = new Confmon(instance->settings, instance->iotable);
|
|
149
134
|
|
|
150
135
|
struct listener2 lsn;
|
|
151
|
-
lsn.base.callback = listen_callback2;
|
|
152
136
|
lsn.io = instance->iotable;
|
|
153
137
|
lsn.reset();
|
|
154
|
-
|
|
155
|
-
lcb_confmon_add_listener(mon, &lsn.base);
|
|
138
|
+
mon->add_listener(&lsn);
|
|
156
139
|
|
|
157
140
|
mock->makeConnectParams(cropts, NULL);
|
|
158
|
-
|
|
159
|
-
|
|
141
|
+
Provider *cccp = mon->get_provider(CLCONFIG_CCCP);
|
|
142
|
+
Provider *http = mon->get_provider(CLCONFIG_HTTP);
|
|
160
143
|
|
|
161
144
|
hostlist_t hl = hostlist_create();
|
|
162
145
|
hostlist_add_stringz(hl, cropts.v.v2.mchosts, 11210);
|
|
163
|
-
|
|
164
|
-
|
|
146
|
+
cccp->enable(instance);
|
|
147
|
+
cccp->configure_nodes(*hl);
|
|
165
148
|
|
|
166
|
-
|
|
167
|
-
|
|
149
|
+
http->enable();
|
|
150
|
+
http->configure_nodes(*instance->ht_nodes);
|
|
168
151
|
hostlist_destroy(hl);
|
|
169
152
|
|
|
170
|
-
|
|
171
|
-
|
|
153
|
+
mon->prepare();
|
|
154
|
+
mon->start();
|
|
172
155
|
lsn.expected_events.insert(CLCONFIG_EVENT_GOT_NEW_CONFIG);
|
|
173
|
-
|
|
156
|
+
runConfmonTest(lsn.io, mon);
|
|
174
157
|
|
|
175
158
|
// Ensure CCCP is functioning properly and we're called only once.
|
|
176
159
|
ASSERT_EQ(1, lsn.call_count);
|
|
177
|
-
ASSERT_EQ(
|
|
160
|
+
ASSERT_EQ(CLCONFIG_CCCP, lsn.last_source);
|
|
178
161
|
|
|
179
|
-
|
|
162
|
+
mon->start();
|
|
180
163
|
lsn.reset();
|
|
181
164
|
lsn.expected_events.insert(CLCONFIG_EVENT_GOT_ANY_CONFIG);
|
|
182
|
-
|
|
165
|
+
runConfmonTest(lsn.io, mon);
|
|
183
166
|
ASSERT_EQ(1, lsn.call_count);
|
|
184
|
-
ASSERT_EQ(
|
|
167
|
+
ASSERT_EQ(CLCONFIG_CCCP, lsn.last_source);
|
|
185
168
|
|
|
186
169
|
mock->setCCCP(false);
|
|
187
170
|
mock->failoverNode(5);
|
|
188
171
|
lsn.reset();
|
|
189
|
-
|
|
172
|
+
mon->start();
|
|
190
173
|
lsn.expected_events.insert(CLCONFIG_EVENT_GOT_ANY_CONFIG);
|
|
191
174
|
lsn.expected_events.insert(CLCONFIG_EVENT_GOT_NEW_CONFIG);
|
|
192
|
-
|
|
193
|
-
ASSERT_EQ(
|
|
175
|
+
runConfmonTest(lsn.io, mon);
|
|
176
|
+
ASSERT_EQ(CLCONFIG_HTTP, lsn.last_source);
|
|
194
177
|
ASSERT_EQ(1, lsn.call_count);
|
|
195
|
-
|
|
178
|
+
delete mon;
|
|
196
179
|
}
|
|
197
180
|
|
|
198
|
-
TEST_F(
|
|
181
|
+
TEST_F(ConfmonTest, testBootstrapMethods)
|
|
199
182
|
{
|
|
200
183
|
lcb_t instance;
|
|
201
184
|
HandleWrap hw;
|
|
@@ -204,38 +187,38 @@ TEST_F(Confmon, testBootstrapMethods)
|
|
|
204
187
|
ASSERT_EQ(LCB_SUCCESS, err);
|
|
205
188
|
|
|
206
189
|
// Try the various bootstrap times
|
|
207
|
-
|
|
208
|
-
hrtime_t last = bs->
|
|
190
|
+
lcb::Bootstrap* bs = instance->bs_state;
|
|
191
|
+
hrtime_t last = bs->get_last_refresh(), cur = 0;
|
|
209
192
|
|
|
210
193
|
// Reset it for the time being
|
|
211
|
-
bs->
|
|
212
|
-
|
|
194
|
+
bs->reset_last_refresh();
|
|
195
|
+
instance->confmon->stop();
|
|
213
196
|
|
|
214
197
|
// Refreshing now should work
|
|
215
|
-
|
|
216
|
-
|
|
198
|
+
instance->bootstrap(lcb::BS_REFRESH_THROTTLE);
|
|
199
|
+
ASSERT_TRUE(instance->confmon->is_refreshing());
|
|
217
200
|
|
|
218
|
-
cur = bs->
|
|
201
|
+
cur = bs->get_last_refresh();
|
|
219
202
|
ASSERT_GT(cur, 0);
|
|
220
|
-
ASSERT_EQ(0, bs->
|
|
203
|
+
ASSERT_EQ(0, bs->get_errcounter());
|
|
221
204
|
last = cur;
|
|
222
205
|
|
|
223
206
|
// Stop it, so the state is reset
|
|
224
|
-
|
|
225
|
-
|
|
207
|
+
instance->confmon->stop();
|
|
208
|
+
ASSERT_FALSE(instance->confmon->is_refreshing());
|
|
226
209
|
|
|
227
|
-
|
|
228
|
-
ASSERT_EQ(last, bs->
|
|
229
|
-
ASSERT_EQ(1, bs->
|
|
210
|
+
instance->bootstrap(lcb::BS_REFRESH_THROTTLE|lcb::BS_REFRESH_INCRERR);
|
|
211
|
+
ASSERT_EQ(last, bs->get_last_refresh());
|
|
212
|
+
ASSERT_EQ(1, bs->get_errcounter());
|
|
230
213
|
|
|
231
214
|
// Ensure that a throttled-without-incr doesn't actually incr
|
|
232
|
-
|
|
233
|
-
ASSERT_EQ(1, bs->
|
|
215
|
+
instance->bootstrap(lcb::BS_REFRESH_THROTTLE);
|
|
216
|
+
ASSERT_EQ(1, bs->get_errcounter());
|
|
234
217
|
|
|
235
218
|
// No refresh yet
|
|
236
|
-
|
|
219
|
+
ASSERT_FALSE(instance->confmon->is_refreshing());
|
|
237
220
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
221
|
+
instance->bootstrap(lcb::BS_REFRESH_ALWAYS);
|
|
222
|
+
ASSERT_TRUE(instance->confmon->is_refreshing());
|
|
223
|
+
instance->confmon->stop();
|
|
241
224
|
}
|
|
@@ -28,8 +28,7 @@ static bool
|
|
|
28
28
|
hasPendingOps(lcb_t instance)
|
|
29
29
|
{
|
|
30
30
|
for (size_t ii = 0; ii < LCBT_NSERVERS(instance); ++ii) {
|
|
31
|
-
|
|
32
|
-
if (mcserver_has_pending(ss)) {
|
|
31
|
+
if (instance->get_server(ii)->has_pending()) {
|
|
33
32
|
return true;
|
|
34
33
|
}
|
|
35
34
|
}
|
|
@@ -223,15 +223,16 @@ TEST_F(McAlloc, testValueAlloc)
|
|
|
223
223
|
mcreq_release_packet(pipeline, packet);
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
-
struct ExtraCookie {
|
|
227
|
-
mc_REQDATAEX base;
|
|
226
|
+
struct ExtraCookie : mc_REQDATAEX {
|
|
228
227
|
int remaining;
|
|
228
|
+
ExtraCookie(const mc_REQDATAPROCS& procs_)
|
|
229
|
+
: mc_REQDATAEX(NULL, procs_, 0), remaining(0) {
|
|
230
|
+
}
|
|
229
231
|
};
|
|
230
232
|
|
|
231
233
|
extern "C" {
|
|
232
234
|
static void pkt_dtor(mc_PACKET *pkt) {
|
|
233
|
-
|
|
234
|
-
ExtraCookie *ec = (ExtraCookie *)rd;
|
|
235
|
+
ExtraCookie *ec = static_cast<ExtraCookie*>(pkt->u_rdata.exdata);
|
|
235
236
|
ec->remaining--;
|
|
236
237
|
}
|
|
237
238
|
}
|
|
@@ -240,18 +241,17 @@ TEST_F(McAlloc, testRdataExDtor)
|
|
|
240
241
|
{
|
|
241
242
|
CQWrap q;
|
|
242
243
|
lcb_CMDBASE basecmd;
|
|
243
|
-
|
|
244
|
+
const static mc_REQDATAPROCS procs = { NULL, pkt_dtor };
|
|
244
245
|
protocol_binary_request_header hdr;
|
|
245
246
|
|
|
246
247
|
memset(&hdr, 0, sizeof hdr);
|
|
247
248
|
memset(&basecmd, 0, sizeof basecmd);
|
|
248
|
-
memset(&ec, 0, sizeof ec);
|
|
249
249
|
|
|
250
|
-
mc_REQDATAPROCS procs = { NULL, pkt_dtor };
|
|
251
|
-
ec.base.procs = &procs;
|
|
252
250
|
basecmd.key.contig.bytes = "foo";
|
|
253
251
|
basecmd.key.contig.nbytes = 3;
|
|
254
252
|
|
|
253
|
+
ExtraCookie ec(procs);
|
|
254
|
+
|
|
255
255
|
mcreq_sched_enter(&q);
|
|
256
256
|
for (unsigned ii = 0; ii < 5; ii++) {
|
|
257
257
|
lcb_error_t err;
|
|
@@ -260,7 +260,7 @@ TEST_F(McAlloc, testRdataExDtor)
|
|
|
260
260
|
err = mcreq_basic_packet(&q, &basecmd, &hdr, 0, &pkt, &pl, 0);
|
|
261
261
|
ASSERT_EQ(LCB_SUCCESS, err);
|
|
262
262
|
pkt->flags |= MCREQ_F_REQEXT;
|
|
263
|
-
pkt->u_rdata.exdata = &ec
|
|
263
|
+
pkt->u_rdata.exdata = &ec;
|
|
264
264
|
mcreq_sched_add(pl, pkt);
|
|
265
265
|
ec.remaining++;
|
|
266
266
|
}
|
|
@@ -630,7 +630,7 @@ private:
|
|
|
630
630
|
|
|
631
631
|
const lcb_U64 elapsed_ns = now - previous_time;
|
|
632
632
|
const lcb_U64 wanted_duration_ns =
|
|
633
|
-
config.opsPerCycle * 1e9 / config.getRateLimit();
|
|
633
|
+
(config.opsPerCycle * 1e9) / (config.getRateLimit() * config.getNumThreads());
|
|
634
634
|
// On first invocation no previous_time, so skip attempting to sleep.
|
|
635
635
|
if (elapsed_ns > 0 && elapsed_ns < wanted_duration_ns) {
|
|
636
636
|
// Dampen the sleep time by averaging with the previous
|
data/lib/libcouchbase/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: libcouchbase
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stephen von Takach
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2017-03-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ffi
|
|
@@ -342,7 +342,6 @@ files:
|
|
|
342
342
|
- ext/libcouchbase/include/memcached/COPYING
|
|
343
343
|
- ext/libcouchbase/include/memcached/README
|
|
344
344
|
- ext/libcouchbase/include/memcached/protocol_binary.h
|
|
345
|
-
- ext/libcouchbase/include/memcached/vbucket.h
|
|
346
345
|
- ext/libcouchbase/packaging/README
|
|
347
346
|
- ext/libcouchbase/packaging/abicheck/.gitignore
|
|
348
347
|
- ext/libcouchbase/packaging/abicheck/Makefile
|
|
@@ -387,15 +386,15 @@ files:
|
|
|
387
386
|
- ext/libcouchbase/src/aspend.h
|
|
388
387
|
- ext/libcouchbase/src/auth-priv.h
|
|
389
388
|
- ext/libcouchbase/src/auth.cc
|
|
390
|
-
- ext/libcouchbase/src/bootstrap.
|
|
389
|
+
- ext/libcouchbase/src/bootstrap.cc
|
|
391
390
|
- ext/libcouchbase/src/bootstrap.h
|
|
392
|
-
- ext/libcouchbase/src/bucketconfig/bc_cccp.
|
|
393
|
-
- ext/libcouchbase/src/bucketconfig/bc_file.
|
|
394
|
-
- ext/libcouchbase/src/bucketconfig/bc_http.
|
|
391
|
+
- ext/libcouchbase/src/bucketconfig/bc_cccp.cc
|
|
392
|
+
- ext/libcouchbase/src/bucketconfig/bc_file.cc
|
|
393
|
+
- ext/libcouchbase/src/bucketconfig/bc_http.cc
|
|
395
394
|
- ext/libcouchbase/src/bucketconfig/bc_http.h
|
|
396
|
-
- ext/libcouchbase/src/bucketconfig/bc_mcraw.
|
|
395
|
+
- ext/libcouchbase/src/bucketconfig/bc_mcraw.cc
|
|
397
396
|
- ext/libcouchbase/src/bucketconfig/clconfig.h
|
|
398
|
-
- ext/libcouchbase/src/bucketconfig/confmon.
|
|
397
|
+
- ext/libcouchbase/src/bucketconfig/confmon.cc
|
|
399
398
|
- ext/libcouchbase/src/callbacks.c
|
|
400
399
|
- ext/libcouchbase/src/cbft.cc
|
|
401
400
|
- ext/libcouchbase/src/cntl.cc
|
|
@@ -403,8 +402,9 @@ files:
|
|
|
403
402
|
- ext/libcouchbase/src/connspec.cc
|
|
404
403
|
- ext/libcouchbase/src/connspec.h
|
|
405
404
|
- ext/libcouchbase/src/ctx-log-inl.h
|
|
406
|
-
- ext/libcouchbase/src/
|
|
407
|
-
- ext/libcouchbase/src/
|
|
405
|
+
- ext/libcouchbase/src/dns-srv.cc
|
|
406
|
+
- ext/libcouchbase/src/dump.cc
|
|
407
|
+
- ext/libcouchbase/src/getconfig.cc
|
|
408
408
|
- ext/libcouchbase/src/gethrtime.c
|
|
409
409
|
- ext/libcouchbase/src/handler.cc
|
|
410
410
|
- ext/libcouchbase/src/hashtable.c
|
|
@@ -420,9 +420,9 @@ files:
|
|
|
420
420
|
- ext/libcouchbase/src/iofactory.c
|
|
421
421
|
- ext/libcouchbase/src/jsparse/parser.cc
|
|
422
422
|
- ext/libcouchbase/src/jsparse/parser.h
|
|
423
|
-
- ext/libcouchbase/src/lcbht/lcbht.
|
|
423
|
+
- ext/libcouchbase/src/lcbht/lcbht.cc
|
|
424
424
|
- ext/libcouchbase/src/lcbht/lcbht.h
|
|
425
|
-
- ext/libcouchbase/src/lcbio/connect.
|
|
425
|
+
- ext/libcouchbase/src/lcbio/connect.cc
|
|
426
426
|
- ext/libcouchbase/src/lcbio/connect.h
|
|
427
427
|
- ext/libcouchbase/src/lcbio/ctx.c
|
|
428
428
|
- ext/libcouchbase/src/lcbio/ctx.h
|
|
@@ -436,6 +436,7 @@ files:
|
|
|
436
436
|
- ext/libcouchbase/src/lcbio/protoctx.c
|
|
437
437
|
- ext/libcouchbase/src/lcbio/rw-inl.h
|
|
438
438
|
- ext/libcouchbase/src/lcbio/ssl.h
|
|
439
|
+
- ext/libcouchbase/src/lcbio/timer-cxx.h
|
|
439
440
|
- ext/libcouchbase/src/lcbio/timer-ng.h
|
|
440
441
|
- ext/libcouchbase/src/lcbio/timer.c
|
|
441
442
|
- ext/libcouchbase/src/legacy.c
|
|
@@ -452,10 +453,11 @@ files:
|
|
|
452
453
|
- ext/libcouchbase/src/mc/mcreq-flush-inl.h
|
|
453
454
|
- ext/libcouchbase/src/mc/mcreq.c
|
|
454
455
|
- ext/libcouchbase/src/mc/mcreq.h
|
|
455
|
-
- ext/libcouchbase/src/mcserver/mcserver.
|
|
456
|
+
- ext/libcouchbase/src/mcserver/mcserver.cc
|
|
456
457
|
- ext/libcouchbase/src/mcserver/mcserver.h
|
|
457
458
|
- ext/libcouchbase/src/mcserver/negotiate.cc
|
|
458
459
|
- ext/libcouchbase/src/mcserver/negotiate.h
|
|
460
|
+
- ext/libcouchbase/src/mctx-helper.h
|
|
459
461
|
- ext/libcouchbase/src/n1ql/ixmgmt.cc
|
|
460
462
|
- ext/libcouchbase/src/n1ql/n1ql-internal.h
|
|
461
463
|
- ext/libcouchbase/src/n1ql/n1ql.cc
|
|
@@ -464,24 +466,23 @@ files:
|
|
|
464
466
|
- ext/libcouchbase/src/netbuf/netbuf-mblock.h
|
|
465
467
|
- ext/libcouchbase/src/netbuf/netbuf.c
|
|
466
468
|
- ext/libcouchbase/src/netbuf/netbuf.h
|
|
467
|
-
- ext/libcouchbase/src/newconfig.
|
|
469
|
+
- ext/libcouchbase/src/newconfig.cc
|
|
468
470
|
- ext/libcouchbase/src/nodeinfo.cc
|
|
469
|
-
- ext/libcouchbase/src/operations/cbflush.
|
|
470
|
-
- ext/libcouchbase/src/operations/counter.
|
|
471
|
-
- ext/libcouchbase/src/operations/durability-cas.
|
|
472
|
-
- ext/libcouchbase/src/operations/durability-seqno.
|
|
473
|
-
- ext/libcouchbase/src/operations/durability.
|
|
471
|
+
- ext/libcouchbase/src/operations/cbflush.cc
|
|
472
|
+
- ext/libcouchbase/src/operations/counter.cc
|
|
473
|
+
- ext/libcouchbase/src/operations/durability-cas.cc
|
|
474
|
+
- ext/libcouchbase/src/operations/durability-seqno.cc
|
|
475
|
+
- ext/libcouchbase/src/operations/durability.cc
|
|
474
476
|
- ext/libcouchbase/src/operations/durability_internal.h
|
|
475
|
-
- ext/libcouchbase/src/operations/get.
|
|
476
|
-
- ext/libcouchbase/src/operations/observe-seqno.
|
|
477
|
-
- ext/libcouchbase/src/operations/observe.
|
|
478
|
-
- ext/libcouchbase/src/operations/pktfwd.
|
|
479
|
-
- ext/libcouchbase/src/operations/remove.
|
|
480
|
-
- ext/libcouchbase/src/operations/stats.
|
|
481
|
-
- ext/libcouchbase/src/operations/store.
|
|
477
|
+
- ext/libcouchbase/src/operations/get.cc
|
|
478
|
+
- ext/libcouchbase/src/operations/observe-seqno.cc
|
|
479
|
+
- ext/libcouchbase/src/operations/observe.cc
|
|
480
|
+
- ext/libcouchbase/src/operations/pktfwd.cc
|
|
481
|
+
- ext/libcouchbase/src/operations/remove.cc
|
|
482
|
+
- ext/libcouchbase/src/operations/stats.cc
|
|
483
|
+
- ext/libcouchbase/src/operations/store.cc
|
|
482
484
|
- ext/libcouchbase/src/operations/subdoc.cc
|
|
483
|
-
- ext/libcouchbase/src/operations/touch.
|
|
484
|
-
- ext/libcouchbase/src/packetutils.c
|
|
485
|
+
- ext/libcouchbase/src/operations/touch.cc
|
|
485
486
|
- ext/libcouchbase/src/packetutils.h
|
|
486
487
|
- ext/libcouchbase/src/probes.d
|
|
487
488
|
- ext/libcouchbase/src/rdb/bigalloc.c
|
|
@@ -490,15 +491,13 @@ files:
|
|
|
490
491
|
- ext/libcouchbase/src/rdb/libcalloc.c
|
|
491
492
|
- ext/libcouchbase/src/rdb/rope.c
|
|
492
493
|
- ext/libcouchbase/src/rdb/rope.h
|
|
493
|
-
- ext/libcouchbase/src/retrychk.
|
|
494
|
-
- ext/libcouchbase/src/retryq.
|
|
494
|
+
- ext/libcouchbase/src/retrychk.cc
|
|
495
|
+
- ext/libcouchbase/src/retryq.cc
|
|
495
496
|
- ext/libcouchbase/src/retryq.h
|
|
496
497
|
- ext/libcouchbase/src/ringbuffer.c
|
|
497
498
|
- ext/libcouchbase/src/ringbuffer.h
|
|
498
499
|
- ext/libcouchbase/src/settings.c
|
|
499
500
|
- ext/libcouchbase/src/settings.h
|
|
500
|
-
- ext/libcouchbase/src/simplestring.c
|
|
501
|
-
- ext/libcouchbase/src/simplestring.h
|
|
502
501
|
- ext/libcouchbase/src/sllist-inl.h
|
|
503
502
|
- ext/libcouchbase/src/sllist.h
|
|
504
503
|
- ext/libcouchbase/src/ssl/CMakeLists.txt
|
|
@@ -506,7 +505,6 @@ files:
|
|
|
506
505
|
- ext/libcouchbase/src/ssl/ssl_common.c
|
|
507
506
|
- ext/libcouchbase/src/ssl/ssl_e.c
|
|
508
507
|
- ext/libcouchbase/src/ssl/ssl_iot_common.h
|
|
509
|
-
- ext/libcouchbase/src/ssobuf.h
|
|
510
508
|
- ext/libcouchbase/src/strcodecs/base64.c
|
|
511
509
|
- ext/libcouchbase/src/strcodecs/strcodecs.h
|
|
512
510
|
- ext/libcouchbase/src/timings.c
|
|
@@ -522,11 +520,11 @@ files:
|
|
|
522
520
|
- ext/libcouchbase/src/vbucket/rfc1321/md5.h
|
|
523
521
|
- ext/libcouchbase/src/vbucket/rfc1321/md5c-inl.h
|
|
524
522
|
- ext/libcouchbase/src/vbucket/vbucket.c
|
|
525
|
-
- ext/libcouchbase/src/views/docreq.
|
|
523
|
+
- ext/libcouchbase/src/views/docreq.cc
|
|
526
524
|
- ext/libcouchbase/src/views/docreq.h
|
|
527
|
-
- ext/libcouchbase/src/views/viewreq.
|
|
525
|
+
- ext/libcouchbase/src/views/viewreq.cc
|
|
528
526
|
- ext/libcouchbase/src/views/viewreq.h
|
|
529
|
-
- ext/libcouchbase/src/wait.
|
|
527
|
+
- ext/libcouchbase/src/wait.cc
|
|
530
528
|
- ext/libcouchbase/tests/CMakeLists.txt
|
|
531
529
|
- ext/libcouchbase/tests/basic/t_base64.cc
|
|
532
530
|
- ext/libcouchbase/tests/basic/t_ccbc103.cc
|
|
@@ -545,7 +543,6 @@ files:
|
|
|
545
543
|
- ext/libcouchbase/tests/basic/t_ringbuffer.cc
|
|
546
544
|
- ext/libcouchbase/tests/basic/t_slist.cc
|
|
547
545
|
- ext/libcouchbase/tests/basic/t_strerror.cc
|
|
548
|
-
- ext/libcouchbase/tests/basic/t_string.cc
|
|
549
546
|
- ext/libcouchbase/tests/basic/t_urlencode.cc
|
|
550
547
|
- ext/libcouchbase/tests/check-all.cc
|
|
551
548
|
- ext/libcouchbase/tests/htparse/t_basic.cc
|
|
@@ -751,7 +748,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
751
748
|
version: '0'
|
|
752
749
|
requirements: []
|
|
753
750
|
rubyforge_project:
|
|
754
|
-
rubygems_version: 2.
|
|
751
|
+
rubygems_version: 2.6.10
|
|
755
752
|
signing_key:
|
|
756
753
|
specification_version: 4
|
|
757
754
|
summary: libcouchbase bindings for Ruby
|