Skip to content

Instantly share code, notes, and snippets.

View ingenthr's full-sized avatar

Matt Ingenthron ingenthr

View GitHub Profile
@ingenthr
ingenthr / CompressingJsonTranscoder.java
Created July 8, 2013 22:05
An untested example of how to set CouchbaseClient with a transccoder that will try to compress JSON.
/**
* Copyright (C) 2013 Couchbase, Inc.
*
*/
package com.couchbase.demo;
import java.util.Date;
import net.spy.memcached.CachedData;
@ingenthr
ingenthr / raiseTimeouts.sh
Created February 26, 2013 07:56
raising timeouts on ns_server in couchbase
set -xe
server=192.168.1.200
curl --data "ns_config:set({node, node(),{timeout, ns_memcached_outer}},300000)." -u Administrator:password http://$server:8091/diag/eval
curl --data "ns_config:set({node, node(),{timeout, memcached_recv}},300000)." -u Administrator:password http://$server:8091/diag/eval
curl --data "ns_config:set({node, node(),{timeout, memcached_stats_recv}},300000)." -u Administrator:password http://$server:8091/diag/eval
curl --data "ns_config:set({node, node(),{timeout, ns_memcached_outer_heavy}},300000)." -u Administrator:password http://$server:8091/diag/eval
curl --data "ns_config:set({node, node(),{timeout, ns_memcached_outer_very_heavy}},600000)." -u Administrator:password http://$server:8091/diag/eval
curl --data "ns_config:set({node, node(),{timeout, ebucketmigrator_connect}},1200000)." -u Administrator:password http://$server:8091/diag/eval
@ingenthr
ingenthr / installtest.sh
Created December 11, 2012 08:40
Testing libcouchbase 2.0 with diferent event backends
brew uninstall libcouchbase
brew uninstall libcouchbase
brew uninstall libev
brew uninstall libevent
# pass one, test with default libevent
brew install https://github.com/couchbase/homebrew/raw/stable/Library/Formula/libcouchbase.rb && \
cbc cp ~/.bashrc && cbc view _all_docs?stale=false | head && \
brew uninstall libcouchbase && brew uninstall libevent && \\
# pass two, install with just libev
brew install --with-libev-plugin --without-libevent-plugin https://github.com/couchbase/homebrew/raw/stable/Library/Formula/libcouchbase.rb && \
@ingenthr
ingenthr / libcouchbase.rb
Created December 5, 2012 01:24
libcouchbase GA formula
require 'formula'
def with_libev_plugin?
ARGV.include?('--with-libev-plugin')
end
def without_libevent_plugin?
ARGV.include?('--without-libevent-plugin')
end
@ingenthr
ingenthr / CouchbaseClientWrapper.java
Created November 3, 2012 02:55
Sample wrapper to deal with timeouts using a workaround
package com.couchbase.demo;
import com.couchbase.client.CouchbaseClient;
import java.io.IOException;
import java.net.URI;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
@ingenthr
ingenthr / gist:3718905
Last active October 10, 2015 16:28
Observe tester.
/*
* Copyright (C) 2011 Couchbase, Inc.
* All rights reserved.
*/
package com.couchbase.demo;
import com.couchbase.client.CouchbaseClient;
import java.util.ArrayList;
import java.util.Random;
import java.util.concurrent.ExecutionException;

Test Coverage

  • Increase test coverage to show coverage for at least 95% of defined functions. (PCBC-51)
  • Add test coverage for compression.
  • Add test coverage for error handling of encoded strings.
  • Add test coverage ensuring keys are handled as UTF-8.
  • Fix tests in 006.phpt and 007.phpt to work correctly with a cluster that has multiple nodes. (PCBC-97)
  • Develop and execute a test for whether persistent connections are maintained properly. This may be separate from the automated testing included in the project.

Development of 1.1 Extension Features

  • Develop a compatibility mode for working with JSON strings in Couchbase Server from Java and .NET.
@ingenthr
ingenthr / gist:3314476
Created August 10, 2012 14:11
diff of changes to add error handling and content-type
$ git show 32ae6c458ae10372954b55b83dfb6f23895ccc1a | cat
commit 32ae6c458ae10372954b55b83dfb6f23895ccc1a
Author: Matt Ingenthron <ingenthr@cep.net>
Date: Thu Jul 26 22:55:49 2012 -0700
WIP: fixed adding views in tests, now trying to make tests pass
Change-Id: I29e6c9894a6bc83b0a1ad5758d7ac609fcfe28b4
diff --git a/build.xml b/build.xml
@ingenthr
ingenthr / App.java
Created August 7, 2012 21:38
Example of adding a view to Couchbase Server 2.0 build 1495 and later
package com.couchbase.sample.designdlocloader;
import java.io.IOException;
import java.io.StringWriter;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.AuthCache;
@ingenthr
ingenthr / git-config
Created June 5, 2012 22:13
hook for adding reviewers
[remote "for-review-r"] 1:45
url = ssh://alk@review.membase.org:29418/ns_server.git 1:45
receivepack = git receive-pack --reviewer=aliaksiej.artamonau@gmail.com 1:45
push = HEAD:refs/for/branch-20