Skip to content

Instantly share code, notes, and snippets.

public interface BucketManager {
Observable<Boolean> flush();
Observable<DesignDocument> getDesignDocuments();
Observable<DesignDocument> getDesignDocuments(boolean development);
Observable<DesignDocument> getDesignDocument(String name);
Observable<DesignDocument> getDesignDocument(String name, boolean development);
@daschl
daschl / alldocs
Created August 7, 2014 10:24
language missing
{
rows: [
{
doc: {
meta: {
id: "_design/beer",
rev: "1-5d0a1739"
},
json: {
language: "javascript",
  1. Getting Started ==================

This getting started guide acts as a foundational introduction into the Couchbase Java SDK. You learn how to install it properly and write a basic sample application that highlights important aspects. At the end of this guide you are able to start exploring further documentation on your own or proceed with a tutorial where a full-blown, production grade application is built.

2.a Installation

Currently, the Java SDK is in a beta release state, so you need to include the Couchbase Maven Repository if you want to pull it in automatically. Here is a typical pom.xml that you can copy and paste:

@daschl
daschl / format.java
Created August 26, 2014 13:23
collect and format
Diagnostics {
gc.ps marksweep.collectionCount=0,
gc.ps marksweep.collectionTime=0,
gc.ps scavenge.collectionCount=2,
gc.ps scavenge.collectionTime=1,
heap.pendingFinalize=0,
heap.used=init = 268435456(262144K) used = 1095344(1069K) committed = 268435456(262144K) max = 3817865216(3728384K),
mem.physical.free=1653268480,
mem.physical.total=17179869184,
mem.swap.free=1567358976,
queryTemplate = ViewQuery.from("design", "view");
processViewOptions(queryTemplate, vopts.getInner());
long iterRemaining = getPrivopts().iterCount;
while (isCancelled == false) {
boolean gotException = false;
long beginTime = System.currentTimeMillis();
String curView;
/**
* Copyright (C) 2014 Couchbase, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
List<JsonDocument> foundDocs = Observable
.from(Arrays.asList("id1", "id2"))
.flatMap(new Func1<String, Observable<JsonDocument>>() {
@Override
public Observable<JsonDocument> call(String id) {
return bucket.async().get(id);
}
})
.toList()
.timeout(5, TimeUnit.SECONDS)
@daschl
daschl / gist:90ff8a66635d2ee3cbcc
Created October 8, 2014 00:46
GC Logging flags
Mandatory:
----------
-XX:+PrintGCDetails
-XX:+PrintGCApplicationStoppedTime
-XX:+PrintGCApplicationConcurrentTime
-XX:+PrintTenuringDistribution
-XX:+PrintGCDateStamps
-Xloggc:<pathtofile>
/**
* Copyright (C) 2014 Couchbase, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@daschl
daschl / gist:8c6a935d8cb596a2f230
Created December 1, 2014 11:09
stack swallowed
Stack Trace Count
java.lang.Throwable.<init>(String) 686,336
java.lang.Exception.<init>(String) 686,336
java.lang.RuntimeException.<init>(String) 686,336
java.lang.IllegalStateException.<init>(String) 686,336
com.couchbase.client.deps.io.netty.util.IllegalReferenceCountException.<init>(String) 686,336
com.couchbase.client.deps.io.netty.util.IllegalReferenceCountException.<init>(int, int) 686,336
com.couchbase.client.deps.io.netty.buffer.AbstractReferenceCountedByteBuf.release() 686,336
com.couchbase.client.deps.io.netty.handler.codec.memcache.binary.AbstractBinaryMemcacheMessage.release() 680,263
com.couchbase.client.deps.io.netty.handler.codec.memcache.binary.DefaultFullBinaryMemcacheRequest.release() 680,263