Greetings ,
We are in the processing of extending YCSB benchmark tool to use new Couchbase 2 SDK.
Below is the legacy code used to insert a record:
@Override
public int insert(Map<Object, Object> context, String table, String key, Map<String, ByteIterator> values) {
try {
OperationFuture<Boolean> future = client.add(key, 0, JsonByteIterator.fromMap(values), transcoder);
if (future.getStatus().isSuccess())
return observe(context, future, false);
return getReturnCode(future);
} catch (Exception e) {
if (log.isErrorEnabled()) {
log.error("Error inserting value", e);
}
return ERROR;
}
}
New code with Couchbase 2 SDK :
@Override
public int insert(Map<Object, Object> context, String table, String key,
Map<String, ByteIterator> values) {
try {
JsonNode jsonNode = JsonByteIterator.fromMap(values);
RawJsonDocument rawJsonDoc = RawJsonDocument.create(key, OM.writeValueAsString(jsonNode));
bucket.insert(rawJsonDoc);
return OK;
} catch (Exception e) {
if (log.isErrorEnabled()) {
log.error("Error inserting value",e);
}
return ERROR;
}
}
But when we run this with 20k record inserts , new code throws following exception after about 15K records ,while the previous code runs successfully even with millions of insertions.
What could be causing this error ?
[2015-03-27 14:22:33,582] ERROR com.rakuten.gep.ycsb.couchbase.v3.Couchbase3DB Error inserting value
com.couchbase.client.java.error.TemporaryFailureException
at com.couchbase.client.java.CouchbaseAsyncBucket$12.call(CouchbaseAsyncBucket.java:434)
at com.couchbase.client.java.CouchbaseAsyncBucket$12.call(CouchbaseAsyncBucket.java:415)
at rx.internal.operators.OperatorMap$1.onNext(OperatorMap.java:55)
at rx.subjects.SubjectSubscriptionManager$SubjectObserver.onNext(SubjectSubscriptionManager.java:224)
at rx.subjects.AsyncSubject.onCompleted(AsyncSubject.java:101)
at com.couchbase.client.core.endpoint.AbstractGenericHandler$1.call(AbstractGenericHandler.java:198)
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: rx.exceptions.OnErrorThrowable$OnNextValue: OnError while emitting onNext value: com.couchbase.client.core.message.kv.InsertResponse.class
at rx.exceptions.OnErrorThrowable.addValueAsLastCause(OnErrorThrowable.java:98)
at rx.internal.operators.OperatorMap$1.onNext(OperatorMap.java:58)
… 11 more