libcouchbase 1.2.8 → 1.3.0
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/.travis.yml +4 -4
- data/README.md +16 -8
- data/ext/libcouchbase/CMakeLists.txt +34 -32
- data/ext/libcouchbase/RELEASE_NOTES.markdown +277 -6
- data/ext/libcouchbase/cmake/Modules/ConfigureDtrace.cmake +14 -0
- data/ext/libcouchbase/cmake/Modules/FindCouchbaseLibevent.cmake +2 -0
- data/ext/libcouchbase/cmake/Modules/FindCouchbaseLibuv.cmake +2 -1
- data/ext/libcouchbase/cmake/Modules/GenerateConfigDotH.cmake +2 -0
- data/ext/libcouchbase/cmake/Modules/GetLibcouchbaseFlags.cmake +8 -1
- data/ext/libcouchbase/cmake/Modules/GetVersionInfo.cmake +3 -3
- data/ext/libcouchbase/cmake/config-cmake.h.in +14 -0
- data/ext/libcouchbase/cmake/configure +8 -26
- data/ext/libcouchbase/cmake/defs.mk.in +2 -2
- data/ext/libcouchbase/cmake/libcouchbase.stp.in +829 -0
- data/ext/libcouchbase/cmake/source_files.cmake +11 -2
- data/ext/libcouchbase/contrib/cbsasl/CMakeLists.txt +18 -2
- data/ext/libcouchbase/contrib/cbsasl/include/cbsasl/cbsasl.h +44 -2
- data/ext/libcouchbase/contrib/cbsasl/src/client.c +285 -73
- data/ext/libcouchbase/contrib/cbsasl/src/common.c +4 -0
- data/ext/libcouchbase/contrib/cbsasl/src/scram-sha/scram_utils.c +500 -0
- data/ext/libcouchbase/contrib/cbsasl/src/scram-sha/scram_utils.h +99 -0
- data/ext/libcouchbase/contrib/cliopts/CMakeLists.txt +1 -1
- data/ext/libcouchbase/contrib/cliopts/cliopts.h +14 -1
- data/ext/libcouchbase/contrib/snappy/CMakeLists.txt +2 -3
- data/ext/libcouchbase/contrib/snappy/snappy-sinksource.cc +4 -0
- data/ext/libcouchbase/contrib/snappy/snappy-stubs-public.h +7 -5
- data/ext/libcouchbase/contrib/snappy/snappy.cc +7 -2
- data/ext/libcouchbase/example/crypto/.gitignore +2 -0
- data/ext/libcouchbase/example/crypto/Makefile +13 -0
- data/ext/libcouchbase/example/crypto/common_provider.c +24 -0
- data/ext/libcouchbase/example/crypto/common_provider.h +31 -0
- data/ext/libcouchbase/example/crypto/openssl_symmetric_decrypt.c +139 -0
- data/ext/libcouchbase/example/crypto/openssl_symmetric_encrypt.c +147 -0
- data/ext/libcouchbase/example/crypto/openssl_symmetric_provider.c +281 -0
- data/ext/libcouchbase/example/crypto/openssl_symmetric_provider.h +29 -0
- data/ext/libcouchbase/example/tracing/.gitignore +2 -0
- data/ext/libcouchbase/example/tracing/Makefile +8 -0
- data/ext/libcouchbase/example/tracing/cJSON.c +1 -0
- data/ext/libcouchbase/example/tracing/cJSON.h +1 -0
- data/ext/libcouchbase/example/tracing/tracing.c +439 -0
- data/ext/libcouchbase/example/tracing/views.c +444 -0
- data/ext/libcouchbase/include/libcouchbase/auth.h +56 -4
- data/ext/libcouchbase/include/libcouchbase/cbft.h +8 -0
- data/ext/libcouchbase/include/libcouchbase/cntl-private.h +55 -1
- data/ext/libcouchbase/include/libcouchbase/cntl.h +101 -1
- data/ext/libcouchbase/include/libcouchbase/configuration.h.in +6 -0
- data/ext/libcouchbase/include/libcouchbase/couchbase.h +109 -6
- data/ext/libcouchbase/include/libcouchbase/crypto.h +140 -0
- data/ext/libcouchbase/include/libcouchbase/error.h +38 -2
- data/ext/libcouchbase/include/libcouchbase/kvbuf.h +6 -1
- data/ext/libcouchbase/include/libcouchbase/metrics.h +79 -0
- data/ext/libcouchbase/include/libcouchbase/n1ql.h +9 -0
- data/ext/libcouchbase/include/libcouchbase/tracing.h +319 -0
- data/ext/libcouchbase/include/libcouchbase/vbucket.h +1 -1
- data/ext/libcouchbase/include/libcouchbase/views.h +8 -0
- data/ext/libcouchbase/include/memcached/protocol_binary.h +40 -10
- data/ext/libcouchbase/packaging/rpm/libcouchbase.spec.in +6 -14
- data/ext/libcouchbase/plugins/io/libuv/plugin-internal.h +3 -0
- data/ext/libcouchbase/plugins/io/libuv/plugin-libuv.c +1 -0
- data/ext/libcouchbase/plugins/io/select/plugin-select.c +4 -1
- data/ext/libcouchbase/src/auth-priv.h +36 -4
- data/ext/libcouchbase/src/auth.cc +66 -27
- data/ext/libcouchbase/src/bootstrap.cc +1 -1
- data/ext/libcouchbase/src/bucketconfig/bc_cccp.cc +12 -7
- data/ext/libcouchbase/src/bucketconfig/bc_http.cc +26 -17
- data/ext/libcouchbase/src/bucketconfig/bc_http.h +1 -1
- data/ext/libcouchbase/src/bucketconfig/clconfig.h +4 -2
- data/ext/libcouchbase/src/bucketconfig/confmon.cc +6 -3
- data/ext/libcouchbase/src/cbft.cc +48 -0
- data/ext/libcouchbase/src/cntl.cc +138 -2
- data/ext/libcouchbase/src/config_static.h +17 -0
- data/ext/libcouchbase/src/connspec.cc +54 -6
- data/ext/libcouchbase/src/connspec.h +9 -1
- data/ext/libcouchbase/src/crypto.cc +386 -0
- data/ext/libcouchbase/src/ctx-log-inl.h +23 -6
- data/ext/libcouchbase/src/dump.cc +4 -0
- data/ext/libcouchbase/src/getconfig.cc +1 -2
- data/ext/libcouchbase/src/handler.cc +65 -27
- data/ext/libcouchbase/src/hostlist.cc +35 -7
- data/ext/libcouchbase/src/hostlist.h +7 -0
- data/ext/libcouchbase/src/http/http-priv.h +2 -0
- data/ext/libcouchbase/src/http/http.cc +77 -37
- data/ext/libcouchbase/src/http/http_io.cc +19 -2
- data/ext/libcouchbase/src/instance.cc +90 -17
- data/ext/libcouchbase/src/internal.h +5 -0
- data/ext/libcouchbase/src/lcbio/connect.cc +39 -4
- data/ext/libcouchbase/src/lcbio/connect.h +27 -0
- data/ext/libcouchbase/src/lcbio/ctx.c +49 -23
- data/ext/libcouchbase/src/lcbio/ioutils.cc +30 -3
- data/ext/libcouchbase/src/lcbio/ioutils.h +2 -0
- data/ext/libcouchbase/src/lcbio/manager.cc +44 -8
- data/ext/libcouchbase/src/lcbio/manager.h +2 -0
- data/ext/libcouchbase/src/lcbio/rw-inl.h +1 -0
- data/ext/libcouchbase/src/lcbio/ssl.h +3 -5
- data/ext/libcouchbase/src/logging.c +1 -1
- data/ext/libcouchbase/src/logging.h +2 -0
- data/ext/libcouchbase/src/mc/compress.cc +164 -0
- data/ext/libcouchbase/src/mc/compress.h +7 -12
- data/ext/libcouchbase/src/mc/mcreq-flush-inl.h +5 -1
- data/ext/libcouchbase/src/mc/mcreq.c +11 -1
- data/ext/libcouchbase/src/mc/mcreq.h +35 -4
- data/ext/libcouchbase/src/mcserver/mcserver.cc +30 -7
- data/ext/libcouchbase/src/mcserver/mcserver.h +7 -0
- data/ext/libcouchbase/src/mcserver/negotiate.cc +103 -57
- data/ext/libcouchbase/src/mcserver/negotiate.h +2 -2
- data/ext/libcouchbase/src/mctx-helper.h +11 -0
- data/ext/libcouchbase/src/metrics.cc +132 -0
- data/ext/libcouchbase/src/n1ql/ixmgmt.cc +2 -1
- data/ext/libcouchbase/src/n1ql/n1ql.cc +66 -0
- data/ext/libcouchbase/src/newconfig.cc +9 -2
- data/ext/libcouchbase/src/operations/counter.cc +2 -1
- data/ext/libcouchbase/src/operations/durability-cas.cc +11 -0
- data/ext/libcouchbase/src/operations/durability-seqno.cc +3 -0
- data/ext/libcouchbase/src/operations/durability.cc +24 -2
- data/ext/libcouchbase/src/operations/durability_internal.h +19 -0
- data/ext/libcouchbase/src/operations/get.cc +4 -2
- data/ext/libcouchbase/src/operations/observe-seqno.cc +1 -0
- data/ext/libcouchbase/src/operations/observe.cc +113 -62
- data/ext/libcouchbase/src/operations/ping.cc +246 -67
- data/ext/libcouchbase/src/operations/remove.cc +2 -1
- data/ext/libcouchbase/src/operations/store.cc +17 -14
- data/ext/libcouchbase/src/operations/touch.cc +3 -0
- data/ext/libcouchbase/src/packetutils.h +68 -4
- data/ext/libcouchbase/src/probes.d +132 -161
- data/ext/libcouchbase/src/rdb/bigalloc.c +1 -1
- data/ext/libcouchbase/src/retryq.cc +6 -2
- data/ext/libcouchbase/src/rnd.cc +68 -0
- data/ext/libcouchbase/src/rnd.h +39 -0
- data/ext/libcouchbase/src/settings.c +27 -0
- data/ext/libcouchbase/src/settings.h +67 -3
- data/ext/libcouchbase/src/ssl/CMakeLists.txt +0 -12
- data/ext/libcouchbase/src/ssl/ssl_common.c +23 -4
- data/ext/libcouchbase/src/strcodecs/base64.c +141 -16
- data/ext/libcouchbase/src/strcodecs/strcodecs.h +16 -1
- data/ext/libcouchbase/src/trace.h +68 -61
- data/ext/libcouchbase/src/tracing/span.cc +289 -0
- data/ext/libcouchbase/src/tracing/threshold_logging_tracer.cc +171 -0
- data/ext/libcouchbase/src/tracing/tracer.cc +53 -0
- data/ext/libcouchbase/src/tracing/tracing-internal.h +213 -0
- data/ext/libcouchbase/src/utilities.c +5 -0
- data/ext/libcouchbase/src/vbucket/CMakeLists.txt +2 -2
- data/ext/libcouchbase/src/vbucket/vbucket.c +50 -18
- data/ext/libcouchbase/src/views/docreq.cc +26 -1
- data/ext/libcouchbase/src/views/docreq.h +17 -0
- data/ext/libcouchbase/src/views/viewreq.cc +64 -1
- data/ext/libcouchbase/src/views/viewreq.h +21 -0
- data/ext/libcouchbase/tests/CMakeLists.txt +6 -6
- data/ext/libcouchbase/tests/basic/t_base64.cc +34 -6
- data/ext/libcouchbase/tests/basic/t_connstr.cc +14 -0
- data/ext/libcouchbase/tests/basic/t_creds.cc +10 -10
- data/ext/libcouchbase/tests/basic/t_host.cc +22 -2
- data/ext/libcouchbase/tests/basic/t_scram.cc +514 -0
- data/ext/libcouchbase/tests/check-all.cc +6 -2
- data/ext/libcouchbase/tests/iotests/mock-environment.cc +64 -0
- data/ext/libcouchbase/tests/iotests/mock-environment.h +27 -1
- data/ext/libcouchbase/tests/iotests/t_confmon.cc +2 -2
- data/ext/libcouchbase/tests/iotests/t_forward.cc +8 -0
- data/ext/libcouchbase/tests/iotests/t_netfail.cc +124 -0
- data/ext/libcouchbase/tests/iotests/t_smoke.cc +1 -1
- data/ext/libcouchbase/tests/iotests/t_snappy.cc +316 -0
- data/ext/libcouchbase/tests/socktests/socktest.cc +2 -2
- data/ext/libcouchbase/tests/socktests/t_basic.cc +6 -6
- data/ext/libcouchbase/tests/socktests/t_manager.cc +1 -1
- data/ext/libcouchbase/tests/socktests/t_ssl.cc +1 -1
- data/ext/libcouchbase/tools/CMakeLists.txt +1 -1
- data/ext/libcouchbase/tools/cbc-handlers.h +17 -0
- data/ext/libcouchbase/tools/cbc-n1qlback.cc +7 -4
- data/ext/libcouchbase/tools/cbc-pillowfight.cc +408 -100
- data/ext/libcouchbase/tools/cbc-proxy.cc +134 -3
- data/ext/libcouchbase/tools/cbc-subdoc.cc +1 -2
- data/ext/libcouchbase/tools/cbc.cc +113 -8
- data/ext/libcouchbase/tools/common/histogram.cc +1 -0
- data/ext/libcouchbase/tools/common/options.cc +28 -1
- data/ext/libcouchbase/tools/common/options.h +5 -0
- data/ext/libcouchbase/tools/docgen/docgen.h +36 -10
- data/ext/libcouchbase/tools/docgen/loc.h +5 -4
- data/ext/libcouchbase/tools/docgen/seqgen.h +28 -0
- data/lib/libcouchbase/ext/libcouchbase/enums.rb +10 -0
- data/lib/libcouchbase/n1ql.rb +6 -1
- data/lib/libcouchbase/version.rb +1 -1
- data/spec/connection_spec.rb +6 -6
- metadata +38 -5
- data/ext/libcouchbase/cmake/Modules/FindCouchbaseSnappy.cmake +0 -11
- data/ext/libcouchbase/src/mc/compress.c +0 -90
- data/ext/libcouchbase/tools/common/my_inttypes.h +0 -22
|
@@ -24,11 +24,14 @@ namespace cbc {
|
|
|
24
24
|
X(String, saslmech, "force-sasl-mech", 'S') \
|
|
25
25
|
X(String, connstr, "spec", 'U') \
|
|
26
26
|
X(String, ssl, "ssl", '\0') \
|
|
27
|
+
X(String, truststorepath, "truststorepath", '\0') \
|
|
27
28
|
X(String, certpath, "certpath", '\0') \
|
|
29
|
+
X(String, keypath, "keypath", '\0') \
|
|
28
30
|
X(UInt, timeout, "timeout", '\0') \
|
|
29
31
|
X(Bool, timings, "timings", 'T') \
|
|
30
32
|
X(Bool, verbose, "verbose", 'v') \
|
|
31
33
|
X(Bool, dump, "dump", '\0') \
|
|
34
|
+
X(Bool, compress, "compress", 'y') \
|
|
32
35
|
X(List, cparams, "cparam", 'D')
|
|
33
36
|
|
|
34
37
|
|
|
@@ -61,6 +64,8 @@ public:
|
|
|
61
64
|
void addToParser(cliopts::Parser& parser);
|
|
62
65
|
lcb_error_t doCtls(lcb_t instance);
|
|
63
66
|
bool useTimings() { return o_timings.result(); }
|
|
67
|
+
int numTimings() { return o_timings.numSpecified(); }
|
|
68
|
+
cliopts::BoolOption& getTimings() { return o_timings; }
|
|
64
69
|
void setAdminMode();
|
|
65
70
|
bool shouldDump() { return o_dump.result(); }
|
|
66
71
|
void writeConfig(const std::string& dest = getConfigfileName());
|
|
@@ -69,6 +69,26 @@ public:
|
|
|
69
69
|
virtual ~DocGeneratorBase() {}
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
+
static const char alphabet[] = "0123456789 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
73
|
+
|
|
74
|
+
static void random_fill(std::string& str, int level) {
|
|
75
|
+
if (level > 1) {
|
|
76
|
+
for (size_t ii = 0; ii < str.size(); ii++) {
|
|
77
|
+
str[ii] = rand() % (0x7e - 0x20) + 0x20; // printable
|
|
78
|
+
switch (str[ii]) {
|
|
79
|
+
case 0x5c: // backslash
|
|
80
|
+
case 0x22: // double quote
|
|
81
|
+
str[ii]++;
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
} else if (level > 0) {
|
|
86
|
+
for (size_t ii = 0; ii < str.size(); ii++) {
|
|
87
|
+
str[ii] = alphabet[rand() % (sizeof(alphabet) - 1)];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
72
92
|
/**
|
|
73
93
|
* Generator class for raw objects. This contains a fixed buffer and will
|
|
74
94
|
* simply vary in how 'long' the buffer is
|
|
@@ -104,10 +124,13 @@ public:
|
|
|
104
124
|
return ret;
|
|
105
125
|
}
|
|
106
126
|
|
|
107
|
-
RawDocGenerator(uint32_t minsz, uint32_t maxsz)
|
|
127
|
+
RawDocGenerator(uint32_t minsz, uint32_t maxsz, int rnd)
|
|
108
128
|
: m_sizes(gen_graded_sizes(minsz, maxsz)) {
|
|
109
129
|
// Populate the buffer to its capacity
|
|
110
130
|
m_buf.insert(0, maxsz, '#');
|
|
131
|
+
if (rnd) {
|
|
132
|
+
random_fill(m_buf, rnd);
|
|
133
|
+
}
|
|
111
134
|
}
|
|
112
135
|
|
|
113
136
|
|
|
@@ -202,18 +225,18 @@ public:
|
|
|
202
225
|
* @param minsz Minimum JSON document size
|
|
203
226
|
* @param maxsz Maximum JSON document size
|
|
204
227
|
*/
|
|
205
|
-
JsonDocGenerator(uint32_t minsz, uint32_t maxsz)
|
|
228
|
+
JsonDocGenerator(uint32_t minsz, uint32_t maxsz, int rnd)
|
|
206
229
|
{
|
|
207
|
-
genDocuments(minsz, maxsz, m_docs);
|
|
230
|
+
genDocuments(minsz, maxsz, m_docs, rnd);
|
|
208
231
|
for (size_t ii = 0; ii < m_docs.size(); ++ii) {
|
|
209
232
|
m_bufs.push_back(m_docs[ii].m_doc);
|
|
210
233
|
}
|
|
211
234
|
}
|
|
212
235
|
|
|
213
|
-
static void genDocuments(uint32_t minsz, uint32_t maxsz, std::vector<std::string>& out)
|
|
236
|
+
static void genDocuments(uint32_t minsz, uint32_t maxsz, std::vector<std::string>& out, int rnd)
|
|
214
237
|
{
|
|
215
238
|
std::vector<Doc> docs;
|
|
216
|
-
genDocuments(minsz, maxsz, docs);
|
|
239
|
+
genDocuments(minsz, maxsz, docs, rnd);
|
|
217
240
|
for (size_t ii = 0; ii < docs.size(); ++ii) {
|
|
218
241
|
out.push_back(docs[ii].m_doc);
|
|
219
242
|
}
|
|
@@ -234,12 +257,12 @@ private:
|
|
|
234
257
|
}
|
|
235
258
|
|
|
236
259
|
static void
|
|
237
|
-
genDocuments(uint32_t minsz, uint32_t maxsz, std::vector<Doc>& out)
|
|
260
|
+
genDocuments(uint32_t minsz, uint32_t maxsz, std::vector<Doc>& out, int rnd)
|
|
238
261
|
{
|
|
239
262
|
std::vector<size_t> sizes = RawDocGenerator::gen_graded_sizes(minsz, maxsz);
|
|
240
263
|
for (std::vector<size_t>::iterator ii = sizes.begin();
|
|
241
264
|
ii != sizes.end(); ++ii) {
|
|
242
|
-
out.push_back(generate(*ii));
|
|
265
|
+
out.push_back(generate(*ii, rnd));
|
|
243
266
|
}
|
|
244
267
|
}
|
|
245
268
|
|
|
@@ -249,7 +272,7 @@ private:
|
|
|
249
272
|
* "Field_$incr" and values will be evenly distributed as fixed 16 byte
|
|
250
273
|
* strings. (See JSON_VALUE_SIZE)
|
|
251
274
|
*/
|
|
252
|
-
static Doc generate(int docsize)
|
|
275
|
+
static Doc generate(int docsize, int rnd)
|
|
253
276
|
{
|
|
254
277
|
int counter = 0;
|
|
255
278
|
char keybuf[128] = { 0 };
|
|
@@ -264,6 +287,9 @@ private:
|
|
|
264
287
|
valsize = 1;
|
|
265
288
|
}
|
|
266
289
|
std::string value(valsize, '*');
|
|
290
|
+
if (rnd) {
|
|
291
|
+
random_fill(value, rnd);
|
|
292
|
+
}
|
|
267
293
|
decrSize(&docsize, valsize + 3);
|
|
268
294
|
root[keybuf] = value;
|
|
269
295
|
value = '"' + value;
|
|
@@ -424,10 +450,10 @@ public:
|
|
|
424
450
|
* @param maxsz Maximum document size
|
|
425
451
|
*/
|
|
426
452
|
PlaceholderJsonGenerator(uint32_t minsz, uint32_t maxsz,
|
|
427
|
-
|
|
453
|
+
const std::vector<TemplateSpec>& specs, int rnd) {
|
|
428
454
|
|
|
429
455
|
std::vector<std::string> jsondocs;
|
|
430
|
-
JsonDocGenerator::genDocuments(minsz, maxsz, jsondocs);
|
|
456
|
+
JsonDocGenerator::genDocuments(minsz, maxsz, jsondocs, rnd);
|
|
431
457
|
initJsonPlaceholders(specs, jsondocs);
|
|
432
458
|
}
|
|
433
459
|
|
|
@@ -191,9 +191,9 @@ public:
|
|
|
191
191
|
dumpIovs(const std::vector<lcb_IOV>& vecs) {
|
|
192
192
|
for (size_t ii = 0; ii < vecs.size(); ii++) {
|
|
193
193
|
const lcb_IOV& iov = vecs[ii];
|
|
194
|
-
printf("IOV[%lu]. Buf=%p. Len=%lu. Content=%.*s\n",
|
|
195
|
-
|
|
196
|
-
|
|
194
|
+
printf("IOV[%lu]. Buf=%p. Len=%lu. Content=%.*s\n", (unsigned long int)ii,
|
|
195
|
+
(void *)iov.iov_base, (unsigned long int)iov.iov_len,
|
|
196
|
+
(int)iov.iov_len, (const char*)iov.iov_base);
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
static void
|
|
@@ -202,7 +202,8 @@ public:
|
|
|
202
202
|
const Loc& loc = vecs[ii];
|
|
203
203
|
std::string s = loc.to_string();
|
|
204
204
|
printf("Loc[%lu]. Buf=%p. Len=%lu. Content=%s\n",
|
|
205
|
-
|
|
205
|
+
(unsigned long int)ii, (void *)loc.at,
|
|
206
|
+
(unsigned long int)loc.length, s.c_str());
|
|
206
207
|
}
|
|
207
208
|
}
|
|
208
209
|
};
|
|
@@ -35,6 +35,8 @@ public:
|
|
|
35
35
|
offset = start;
|
|
36
36
|
uint32_t total = end - start;
|
|
37
37
|
total_self = total / num_workers;
|
|
38
|
+
locked = std::vector<bool>(total_self, false);
|
|
39
|
+
lnum = 0;
|
|
38
40
|
offset += total_self * cur_worker;
|
|
39
41
|
rnum = 0;
|
|
40
42
|
sequential = true;
|
|
@@ -44,6 +46,8 @@ public:
|
|
|
44
46
|
/** Initialize as a random range */
|
|
45
47
|
SeqGenerator(uint32_t start, uint32_t end) {
|
|
46
48
|
total_self = end - start;
|
|
49
|
+
locked = std::vector<bool>(total_self, false);
|
|
50
|
+
lnum = 0;
|
|
47
51
|
offset = start;
|
|
48
52
|
rnum = 0;
|
|
49
53
|
curr_seqno = 0;
|
|
@@ -78,6 +82,28 @@ public:
|
|
|
78
82
|
}
|
|
79
83
|
}
|
|
80
84
|
|
|
85
|
+
uint32_t checkout() {
|
|
86
|
+
uint32_t num;
|
|
87
|
+
num = next();
|
|
88
|
+
if (lnum == locked.size()) {
|
|
89
|
+
lnum = 0;
|
|
90
|
+
std::fill(locked.begin(), locked.end(), false);
|
|
91
|
+
} else {
|
|
92
|
+
while (locked[num - offset]) {
|
|
93
|
+
num = next();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
locked[num - offset] = true;
|
|
97
|
+
lnum++;
|
|
98
|
+
return num;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
void checkin(uint32_t num) {
|
|
102
|
+
if (num - offset < locked.size()) {
|
|
103
|
+
locked[num - offset] = 0;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
81
107
|
uint32_t maxItems() const {
|
|
82
108
|
return total_self;
|
|
83
109
|
}
|
|
@@ -85,6 +111,8 @@ public:
|
|
|
85
111
|
private:
|
|
86
112
|
bool sequential;
|
|
87
113
|
std::vector<uint32_t> seqpool;
|
|
114
|
+
std::vector<bool> locked; // lock markers
|
|
115
|
+
uint32_t lnum; // number of locked keys
|
|
88
116
|
uint32_t rnum; // internal iterator
|
|
89
117
|
uint32_t offset; // beginning numerical offset
|
|
90
118
|
uint32_t total_self; // maximum value of iterator
|
|
@@ -836,6 +836,16 @@ module Libcouchbase::Ext
|
|
|
836
836
|
:generic_constraint_err, 82,
|
|
837
837
|
:nameserver_error, 83,
|
|
838
838
|
:not_authorized, 84,
|
|
839
|
+
:subdoc_invalid_combo, 85,
|
|
840
|
+
:subdoc_multi_path_failure, 86,
|
|
841
|
+
:subdoc_success_deleted, 87,
|
|
842
|
+
:subdoc_xattr_invalid_flag_combo, 88,
|
|
843
|
+
:subdoc_xattr_invalid_key_combo, 89,
|
|
844
|
+
:subdoc_xattr_unknown_macro, 90,
|
|
845
|
+
:subdoc_xattr_unknown_vattr, 91,
|
|
846
|
+
:subdoc_xattr_cant_modify_vattr, 92,
|
|
847
|
+
:subdoc_multi_path_failure_deleted, 93,
|
|
848
|
+
:subdoc_invalid_xattr_order, 94,
|
|
839
849
|
:max_error, 4096
|
|
840
850
|
]
|
|
841
851
|
|
data/lib/libcouchbase/n1ql.rb
CHANGED
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
module Libcouchbase
|
|
4
4
|
class N1QL
|
|
5
|
-
Ordering = [
|
|
5
|
+
Ordering = [
|
|
6
|
+
:build_index, :create_index, :drop_index, :create_primary_index,
|
|
7
|
+
:drop_primary_index, :grant, :on, :to, :infer, :select, :insert_into,
|
|
8
|
+
:delete_from, :update, :from, :with, :use_keys, :unnest, :join, :where,
|
|
9
|
+
:group_by, :order_by, :limit, :offset, :upsert_into, :merge_into
|
|
10
|
+
]
|
|
6
11
|
|
|
7
12
|
def initialize(bucket, explain: false, **options)
|
|
8
13
|
@bucket = bucket
|
data/lib/libcouchbase/version.rb
CHANGED
data/spec/connection_spec.rb
CHANGED
|
@@ -111,8 +111,8 @@ describe Libcouchbase::Connection do
|
|
|
111
111
|
@reactor.run { |reactor|
|
|
112
112
|
connection = Libcouchbase::Connection.new
|
|
113
113
|
connection.connect.then do
|
|
114
|
-
expect(
|
|
115
|
-
expect {
|
|
114
|
+
expect(connection.configure(:operation_timeout, 1500000).value).to be(connection)
|
|
115
|
+
expect { connection.configure(:bob, 1500000).value }.to raise_error(Libcouchbase::Error)
|
|
116
116
|
@log << :success
|
|
117
117
|
connection.destroy
|
|
118
118
|
end
|
|
@@ -125,8 +125,8 @@ describe Libcouchbase::Connection do
|
|
|
125
125
|
@reactor.run { |reactor|
|
|
126
126
|
begin
|
|
127
127
|
connection = Libcouchbase::Connection.new
|
|
128
|
-
|
|
129
|
-
@log =
|
|
128
|
+
connection.connect.value
|
|
129
|
+
@log = connection.get_server_list.value
|
|
130
130
|
ensure
|
|
131
131
|
connection.destroy
|
|
132
132
|
end
|
|
@@ -163,9 +163,9 @@ describe Libcouchbase::Connection do
|
|
|
163
163
|
connection.touch('testtouch', expire_in: 1).then(proc {
|
|
164
164
|
@log << 'set'
|
|
165
165
|
sleep 2
|
|
166
|
-
connection.get('testtouch').catch
|
|
166
|
+
connection.get('testtouch').catch do |err|
|
|
167
167
|
@log << err.is_a?(Libcouchbase::Error::KeyNotFound)
|
|
168
|
-
|
|
168
|
+
end
|
|
169
169
|
})
|
|
170
170
|
}, proc { |error|
|
|
171
171
|
@log << error
|
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: 1.
|
|
4
|
+
version: 1.3.0
|
|
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: 2018-05-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ffi
|
|
@@ -161,7 +161,6 @@ files:
|
|
|
161
161
|
- ext/libcouchbase/cmake/Modules/FindCouchbaseLibev.cmake
|
|
162
162
|
- ext/libcouchbase/cmake/Modules/FindCouchbaseLibevent.cmake
|
|
163
163
|
- ext/libcouchbase/cmake/Modules/FindCouchbaseLibuv.cmake
|
|
164
|
-
- ext/libcouchbase/cmake/Modules/FindCouchbaseSnappy.cmake
|
|
165
164
|
- ext/libcouchbase/cmake/Modules/GenerateConfigDotH.cmake
|
|
166
165
|
- ext/libcouchbase/cmake/Modules/GetLibcouchbaseFlags.cmake
|
|
167
166
|
- ext/libcouchbase/cmake/Modules/GetPlatformCCInfo.cmake
|
|
@@ -170,6 +169,7 @@ files:
|
|
|
170
169
|
- ext/libcouchbase/cmake/configure
|
|
171
170
|
- ext/libcouchbase/cmake/defs.mk.in
|
|
172
171
|
- ext/libcouchbase/cmake/dtrace-instr-link.pl
|
|
172
|
+
- ext/libcouchbase/cmake/libcouchbase.stp.in
|
|
173
173
|
- ext/libcouchbase/cmake/source_files.cmake
|
|
174
174
|
- ext/libcouchbase/contrib/cJSON/cJSON.c
|
|
175
175
|
- ext/libcouchbase/contrib/cJSON/cJSON.h
|
|
@@ -184,6 +184,8 @@ files:
|
|
|
184
184
|
- ext/libcouchbase/contrib/cbsasl/src/cram-md5/md5.h
|
|
185
185
|
- ext/libcouchbase/contrib/cbsasl/src/hash.c
|
|
186
186
|
- ext/libcouchbase/contrib/cbsasl/src/hash.h
|
|
187
|
+
- ext/libcouchbase/contrib/cbsasl/src/scram-sha/scram_utils.c
|
|
188
|
+
- ext/libcouchbase/contrib/cbsasl/src/scram-sha/scram_utils.h
|
|
187
189
|
- ext/libcouchbase/contrib/cbsasl/src/util.h
|
|
188
190
|
- ext/libcouchbase/contrib/cliopts/CMakeLists.txt
|
|
189
191
|
- ext/libcouchbase/contrib/cliopts/cliopts.c
|
|
@@ -282,10 +284,14 @@ files:
|
|
|
282
284
|
- ext/libcouchbase/doc/man/cbc-connstr.1
|
|
283
285
|
- ext/libcouchbase/doc/man/cbc-cp.1
|
|
284
286
|
- ext/libcouchbase/doc/man/cbc-create.1
|
|
287
|
+
- ext/libcouchbase/doc/man/cbc-decr.1
|
|
285
288
|
- ext/libcouchbase/doc/man/cbc-dsn.1
|
|
286
289
|
- ext/libcouchbase/doc/man/cbc-flush.1
|
|
287
290
|
- ext/libcouchbase/doc/man/cbc-hash.1
|
|
291
|
+
- ext/libcouchbase/doc/man/cbc-incr.1
|
|
288
292
|
- ext/libcouchbase/doc/man/cbc-lock.1
|
|
293
|
+
- ext/libcouchbase/doc/man/cbc-mcflush.1
|
|
294
|
+
- ext/libcouchbase/doc/man/cbc-n1ql.1
|
|
289
295
|
- ext/libcouchbase/doc/man/cbc-n1qlback.1
|
|
290
296
|
- ext/libcouchbase/doc/man/cbc-observe.1
|
|
291
297
|
- ext/libcouchbase/doc/man/cbc-pillowfight.1
|
|
@@ -301,11 +307,20 @@ files:
|
|
|
301
307
|
- ext/libcouchbase/doc/man/cbc-verbosity.1
|
|
302
308
|
- ext/libcouchbase/doc/man/cbc-version.1
|
|
303
309
|
- ext/libcouchbase/doc/man/cbc-view.1
|
|
310
|
+
- ext/libcouchbase/doc/man/cbc-watch.1
|
|
304
311
|
- ext/libcouchbase/doc/man/cbc.1
|
|
305
312
|
- ext/libcouchbase/doc/man/cbcrc.4
|
|
306
313
|
- ext/libcouchbase/doc/style.css
|
|
307
314
|
- ext/libcouchbase/example/CMakeLists.txt
|
|
308
315
|
- ext/libcouchbase/example/README.markdown
|
|
316
|
+
- ext/libcouchbase/example/crypto/.gitignore
|
|
317
|
+
- ext/libcouchbase/example/crypto/Makefile
|
|
318
|
+
- ext/libcouchbase/example/crypto/common_provider.c
|
|
319
|
+
- ext/libcouchbase/example/crypto/common_provider.h
|
|
320
|
+
- ext/libcouchbase/example/crypto/openssl_symmetric_decrypt.c
|
|
321
|
+
- ext/libcouchbase/example/crypto/openssl_symmetric_encrypt.c
|
|
322
|
+
- ext/libcouchbase/example/crypto/openssl_symmetric_provider.c
|
|
323
|
+
- ext/libcouchbase/example/crypto/openssl_symmetric_provider.h
|
|
309
324
|
- ext/libcouchbase/example/db/db.c
|
|
310
325
|
- ext/libcouchbase/example/db/vb.c
|
|
311
326
|
- ext/libcouchbase/example/instancepool/main.cc
|
|
@@ -320,6 +335,12 @@ files:
|
|
|
320
335
|
- ext/libcouchbase/example/subdoc/subdoc-simple.cc
|
|
321
336
|
- ext/libcouchbase/example/subdoc/subdoc-xattrs.c
|
|
322
337
|
- ext/libcouchbase/example/tick/tick.c
|
|
338
|
+
- ext/libcouchbase/example/tracing/.gitignore
|
|
339
|
+
- ext/libcouchbase/example/tracing/Makefile
|
|
340
|
+
- ext/libcouchbase/example/tracing/cJSON.c
|
|
341
|
+
- ext/libcouchbase/example/tracing/cJSON.h
|
|
342
|
+
- ext/libcouchbase/example/tracing/tracing.c
|
|
343
|
+
- ext/libcouchbase/example/tracing/views.c
|
|
323
344
|
- ext/libcouchbase/example/users/README
|
|
324
345
|
- ext/libcouchbase/example/users/users.c
|
|
325
346
|
- ext/libcouchbase/example/views/views-example.cc
|
|
@@ -333,12 +354,14 @@ files:
|
|
|
333
354
|
- ext/libcouchbase/include/libcouchbase/cntl.h
|
|
334
355
|
- ext/libcouchbase/include/libcouchbase/configuration.h.in
|
|
335
356
|
- ext/libcouchbase/include/libcouchbase/couchbase.h
|
|
357
|
+
- ext/libcouchbase/include/libcouchbase/crypto.h
|
|
336
358
|
- ext/libcouchbase/include/libcouchbase/deprecated.h
|
|
337
359
|
- ext/libcouchbase/include/libcouchbase/error.h
|
|
338
360
|
- ext/libcouchbase/include/libcouchbase/http.h
|
|
339
361
|
- ext/libcouchbase/include/libcouchbase/iops.h
|
|
340
362
|
- ext/libcouchbase/include/libcouchbase/ixmgmt.h
|
|
341
363
|
- ext/libcouchbase/include/libcouchbase/kvbuf.h
|
|
364
|
+
- ext/libcouchbase/include/libcouchbase/metrics.h
|
|
342
365
|
- ext/libcouchbase/include/libcouchbase/n1ql.h
|
|
343
366
|
- ext/libcouchbase/include/libcouchbase/pktfwd.h
|
|
344
367
|
- ext/libcouchbase/include/libcouchbase/plugins/io/bsdio-inl.c
|
|
@@ -346,6 +369,7 @@ files:
|
|
|
346
369
|
- ext/libcouchbase/include/libcouchbase/plugins/io/wsaerr.h
|
|
347
370
|
- ext/libcouchbase/include/libcouchbase/subdoc.h
|
|
348
371
|
- ext/libcouchbase/include/libcouchbase/sysdefs.h
|
|
372
|
+
- ext/libcouchbase/include/libcouchbase/tracing.h
|
|
349
373
|
- ext/libcouchbase/include/libcouchbase/vbucket.h
|
|
350
374
|
- ext/libcouchbase/include/libcouchbase/views.h
|
|
351
375
|
- ext/libcouchbase/include/libcouchbase/visibility.h
|
|
@@ -411,6 +435,7 @@ files:
|
|
|
411
435
|
- ext/libcouchbase/src/config_static.h
|
|
412
436
|
- ext/libcouchbase/src/connspec.cc
|
|
413
437
|
- ext/libcouchbase/src/connspec.h
|
|
438
|
+
- ext/libcouchbase/src/crypto.cc
|
|
414
439
|
- ext/libcouchbase/src/ctx-log-inl.h
|
|
415
440
|
- ext/libcouchbase/src/dns-srv.cc
|
|
416
441
|
- ext/libcouchbase/src/dump.cc
|
|
@@ -456,7 +481,7 @@ files:
|
|
|
456
481
|
- ext/libcouchbase/src/list.h
|
|
457
482
|
- ext/libcouchbase/src/logging.c
|
|
458
483
|
- ext/libcouchbase/src/logging.h
|
|
459
|
-
- ext/libcouchbase/src/mc/compress.
|
|
484
|
+
- ext/libcouchbase/src/mc/compress.cc
|
|
460
485
|
- ext/libcouchbase/src/mc/compress.h
|
|
461
486
|
- ext/libcouchbase/src/mc/forward.c
|
|
462
487
|
- ext/libcouchbase/src/mc/forward.h
|
|
@@ -470,6 +495,7 @@ files:
|
|
|
470
495
|
- ext/libcouchbase/src/mcserver/negotiate.cc
|
|
471
496
|
- ext/libcouchbase/src/mcserver/negotiate.h
|
|
472
497
|
- ext/libcouchbase/src/mctx-helper.h
|
|
498
|
+
- ext/libcouchbase/src/metrics.cc
|
|
473
499
|
- ext/libcouchbase/src/n1ql/ixmgmt.cc
|
|
474
500
|
- ext/libcouchbase/src/n1ql/n1ql-internal.h
|
|
475
501
|
- ext/libcouchbase/src/n1ql/n1ql.cc
|
|
@@ -509,6 +535,8 @@ files:
|
|
|
509
535
|
- ext/libcouchbase/src/retryq.h
|
|
510
536
|
- ext/libcouchbase/src/ringbuffer.c
|
|
511
537
|
- ext/libcouchbase/src/ringbuffer.h
|
|
538
|
+
- ext/libcouchbase/src/rnd.cc
|
|
539
|
+
- ext/libcouchbase/src/rnd.h
|
|
512
540
|
- ext/libcouchbase/src/settings.c
|
|
513
541
|
- ext/libcouchbase/src/settings.h
|
|
514
542
|
- ext/libcouchbase/src/sllist-inl.h
|
|
@@ -522,6 +550,10 @@ files:
|
|
|
522
550
|
- ext/libcouchbase/src/strcodecs/strcodecs.h
|
|
523
551
|
- ext/libcouchbase/src/timings.c
|
|
524
552
|
- ext/libcouchbase/src/trace.h
|
|
553
|
+
- ext/libcouchbase/src/tracing/span.cc
|
|
554
|
+
- ext/libcouchbase/src/tracing/threshold_logging_tracer.cc
|
|
555
|
+
- ext/libcouchbase/src/tracing/tracer.cc
|
|
556
|
+
- ext/libcouchbase/src/tracing/tracing-internal.h
|
|
525
557
|
- ext/libcouchbase/src/utilities.c
|
|
526
558
|
- ext/libcouchbase/src/vbucket/CMakeLists.txt
|
|
527
559
|
- ext/libcouchbase/src/vbucket/aliases.h
|
|
@@ -554,6 +586,7 @@ files:
|
|
|
554
586
|
- ext/libcouchbase/tests/basic/t_netbuf.cc
|
|
555
587
|
- ext/libcouchbase/tests/basic/t_packet.cc
|
|
556
588
|
- ext/libcouchbase/tests/basic/t_ringbuffer.cc
|
|
589
|
+
- ext/libcouchbase/tests/basic/t_scram.cc
|
|
557
590
|
- ext/libcouchbase/tests/basic/t_slist.cc
|
|
558
591
|
- ext/libcouchbase/tests/basic/t_strerror.cc
|
|
559
592
|
- ext/libcouchbase/tests/basic/t_urlencode.cc
|
|
@@ -595,6 +628,7 @@ files:
|
|
|
595
628
|
- ext/libcouchbase/tests/iotests/t_sched.cc
|
|
596
629
|
- ext/libcouchbase/tests/iotests/t_serverops.cc
|
|
597
630
|
- ext/libcouchbase/tests/iotests/t_smoke.cc
|
|
631
|
+
- ext/libcouchbase/tests/iotests/t_snappy.cc
|
|
598
632
|
- ext/libcouchbase/tests/iotests/t_subdoc.cc
|
|
599
633
|
- ext/libcouchbase/tests/iotests/t_syncmode.cc
|
|
600
634
|
- ext/libcouchbase/tests/iotests/t_views.cc
|
|
@@ -650,7 +684,6 @@ files:
|
|
|
650
684
|
- ext/libcouchbase/tools/cbc.cc
|
|
651
685
|
- ext/libcouchbase/tools/common/histogram.cc
|
|
652
686
|
- ext/libcouchbase/tools/common/histogram.h
|
|
653
|
-
- ext/libcouchbase/tools/common/my_inttypes.h
|
|
654
687
|
- ext/libcouchbase/tools/common/options.cc
|
|
655
688
|
- ext/libcouchbase/tools/common/options.h
|
|
656
689
|
- ext/libcouchbase/tools/docgen/docgen.h
|