This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"storageTotals":{ | |
"ram":{ | |
"total":1042685952, | |
"quotaTotal":268435456, | |
"quotaUsed":171966464, | |
"used":975515648, | |
"usedByData":21565232, | |
"quotaUsedPerNode":171966464, | |
"quotaTotalPerNode":268435456 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Couchbase; | |
using Couchbase.Configuration.Client; | |
using Couchbase.Core; | |
using Couchbase.IO; | |
using Newtonsoft.Json; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using Couchbase; | |
using Couchbase.Authentication; | |
using Couchbase.Configuration.Client; | |
namespace memcached_example | |
{ | |
class Program | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INFO:couchbase:Initializing Couchbase logging. lcb_version=('2.7.5', 132869) | |
DEBUG:couchbase.confmon:[0] Preparing providers (this may be called multiple times) (L:83) | |
DEBUG:couchbase.confmon:[0] Provider CCCP is ENABLED (L:90) | |
DEBUG:couchbase.confmon:[0] Provider HTTP is ENABLED (L:90) | |
DEBUG:couchbase.confmon:[0] Refreshing current cluster map (L:252) | |
DEBUG:couchbase.confmon:[0] Attempting to retrieve cluster map via CCCP (L:239) | |
INFO:couchbase.cccp:[0] Requesting connection to node 10.112.170.101:11210 for CCCP configuration (L:149) | |
DEBUG:couchbase.lcbio_mgr:[0] <10.112.170.101:11210> (HE=0x7fba65f2ee80) Creating new connection because none are available in the pool (L:408) | |
DEBUG:couchbase.lcbio_mgr:[0] <10.112.170.101:11210> (HE=0x7fba65f2ee80) New pool entry: I=0x7fba65f2efd0 (L:323) | |
INFO:couchbase.connection:[0] <10.112.170.101:11210> (SOCK=0x7fba65e4c0f0) Starting. Timeout=2000000us (L:465) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Test] | |
public async Task Test_Enhanced_Error_Messages() | |
{ | |
// boostrap client | |
var config = TestConfiguration.GetConfiguration("basic"); | |
config.BucketConfigs = new Dictionary<string, BucketConfiguration> | |
{ | |
{"default", new BucketConfiguration {UseKvErrorMap = true}} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void Main(string[] args) | |
{ | |
var config = new ClientConfiguration {Servers = new List<Uri> {new Uri("http://10.112.170.191")}}; | |
using (var cluster = new Cluster(config)) | |
{ | |
var bucket = cluster.OpenBucket("default"); | |
var keys = new List<string> | |
{ | |
"test1", "test2", "test3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MemcachedBinprotConnection connection( | |
"127.0.0.1", | |
11210, | |
AF_INET, | |
false); | |
connection.authenticate("trond", "password", "PLAIN"); | |
connection.hello("rbac_demo", MEMCACHED_VERSION, "RBAC demo code"); | |
connection.setXerrorSupport(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"hash": 19069626, | |
"hostname": "192.168.1.104:11210" | |
}, | |
{ | |
"hash": 28439255, | |
"hostname": "192.168.1.101:11210" | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (var md5 = MD5.Create()) | |
{ | |
foreach (var server in _servers.Values.Where(x => x.IsDataNode)) | |
{ | |
const long repititions = 40; | |
for (long rep = 0; rep < repititions; rep++) | |
{ | |
var bytes = Encoding.UTF8.GetBytes(string.Format("{0}-{1}", server.EndPoint, rep)); | |
var hash = md5.ComputeHash(bytes); | |
for (var j = 0; j < 4; j++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var query = new SearchQuery | |
{ | |
Query = new PhraseQuery("inn").Field("name"), | |
Index = "idx_travel" | |
}; | |
query.Skip(0).Limit(10).Timeout(TimeSpan.FromSeconds(10)); | |
var result = bucket.Query(query); | |
foreach (var row in result.Hits) | |
{ |