This document explains how the library handles TCP connections internally. This will cover both HTTP and Memcached connections
During initial bootstrap, the library effectively loops over the list of hosts twice,
#ifndef REDISMODULE_H | |
#define REDISMODULE_H | |
#include <sys/types.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#ifdef __cplusplus | |
extern "C" { | |
#endif |
# key: mutateIn_REPLACE_Test | |
# op[0]: SUBDOC_REPLACE(foo, "car") | |
# op[1]: SUBDOC_REPLACE(foo, "car") | |
Operation STORE: Success (Not an error) | |
performing mutations.. | |
Dumping packet..(kh_span: 45. val: 32 | |
[0]: {0x80 (h)} {128 (d)} | |
[1]: {0xD1 (h)} {209 (d)} | |
[2]: {0x0 (h)} {0 (d)} |
#!/usr/bin/env python | |
from argparse import ArgumentParser | |
import hashlib | |
import json | |
import sys | |
import os | |
from couchbase.bucket import Bucket | |
/* | |
* Copyright 2015 Couchbase, Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
#include <libcouchbase/couchbase++.h> | |
#include <libcouchbase/couchbase++/views.h> | |
#include <libcouchbase/couchbase++/endure.h> | |
#include <cassert> | |
#include <iostream> | |
#include <vector> | |
using std::cout; | |
using std::cerr; | |
using std::endl; |
/* | |
* Simple C "script" showing how to connect to Couchbase 4.0 cluster and | |
* execute a N1QL query. This also creates the primary index which should | |
* be executed only once. | |
* | |
* If you try to run this against an older cluster (e.g. 3.0.x) you will get | |
* an LCB_NOT_SUPPORTED error (Operation not supported). | |
* | |
* Compile and link with couchbase (-lcouchbase). This requires libcouchbase | |
* version 2.4.8 or greater |
#!/usr/bin/env python | |
""" | |
Connect to a Couchbase 4.0 cluster and issue a N1QL query. | |
Note that primary index creation will fail. | |
""" | |
import sys | |
from time import time | |
from pprint import pprint | |
from couchbase.bucket import Bucket |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <assert.h> | |
#include <libcouchbase/couchbase.h> | |
#include <libcouchbase/n1ql.h> | |
#define CONNSTR "couchbase://localhost:12000/beer-sample" | |
static void rowCallback(lcb_t instance, int cbtype, const lcb_RESPN1QL *resp) { | |
if (! (resp->rflags & LCB_RESP_F_FINAL)) { |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <assert.h> | |
#include <libcouchbase/couchbase.h> | |
#include <libcouchbase/views.h> | |
#define CONNSTR "couchbase://localhost:12000/beer-sample" | |
static void rowCallback(lcb_t instance, int cbtype, const lcb_RESPVIEWQUERY *resp) { | |
if (! (resp->rflags & LCB_RESP_F_FINAL)) { |