Java TAP Stream API (jtap)
Hi,
I'm trying to use the Java TAP API (jtap) to dump all the key-value pairs from a membase server on to a file.
The key-value pairs are printing twice (not necessarily in the same order).
Example Dump:
Key: AA, Value: temp_valA
Key: BB, Value: temp_valB
Key: BB, Value: temp_valB
Key: AA, Value: temp_valA
Expected Output:
Key: AA, Value: temp_valA
Key: BB, Value: temp_valB
Has anybody else faced this issue ? Any help would be greatly appreciated.
Thanks,
John.
Hi Perry,
I used pretty much the same code used in the README file (at https://github.com/mikewied/jtap)
TapStreamClient client = new TapStreamClient(serverName, 11210, "default", null);
Exporter exporter = new FileExporter("results");
CustomStream tapListener = new CustomStream(exporter, "node1");
tapListener.doDump();
client.start(tapListener);
When I was debugging the code, I could see that it seems to be reading the entries twice from the SocketChannel at
bytesRead = channel.read(rbuf);
in TapStreamClient.java
Thanks,
John
Sorry, I just found out that this is a side-effect of our current backfill implementation. We send data from both the disk and RAM to ensure that all data gets sent over the wire appropriately. Our next major release is planned to improve this behavior and remove the need for duplicate entries to be sent.
Perry
Hi, I am trying to use C-Api to tap the cluster but I get a segmentation fault which points to Illegal Syntax on stream header. I am using examples on the source code:
struct event_base *evbase = event_init();
libmembase_t instance = libmembase_create(host, username, passwd, bucket, evbase);
libmembase_connect(instance);
libmembase_tap_filter_t filter;
libmembase_callback_t callbacks = {
.tap_mutation = tap_mutation
};
libmembase_set_callbacks(instance, &callbacks);
libmembase_tap_cluster(instance, filter, true);
I never get to callback function.
Other operations(to store or get data) work fine.
Any inputs about this problem?
This package has actually been updated to "libcouchbase": https://github.com/trondn/libcouchbase
Can you try that and see if the issue is resolved?
Perry
Hi,
I just tried libcouchbase. While store and get seem to work, tap causes a segmentation fault in one of the callback functions from libevent on event.c file.
libcouchbase_server_event_handler(evutil_socket_t sock, short which, void *arg) --->
---> do_read_data(libcouchbase_server_t *c) on line# 47
(case PROTOCOL_BINARY_REQ:
c->instance->request_handler[req->request.opcode](c, req);)
This is the sequence of calls I make:
struct event_base *evbase = event_init();
libcouchbase_t instance = libcouchbase_create(host, username,passwd, bucket, evbase);
if (libcouchbase_connect(instance) != LIBCOUCHBASE_SUCCESS) {
fprintf(stderr, "Failed to connect libcouchbase instance to server\n");
fprintf(stderr,"libcouchbase_connect returned error code %d\n", libcouchbase_connect(instance));
return 1;
}
libcouchbase_callback_t callbacks;
callbacks.tap_mutation = tap_mutation;
libcouchbase_tap_filter_t tap_filter;
libcouchbase_set_callbacks(instance, &callbacks);
libcouchbase_tap_cluster(instance, tap_filter, true);
Thanks
Thanks, I filed http://techzone.couchbase.com/issues/browse/MB-3805 for this issue.
Hi All
Can anyone give me the jars needed for TAP java. pls
Share the download link
Thanks in advance
Take a look at the official Couchbase Java Client:
https://github.com/couchbase/couchbase-java-client/
It includes a TapClient:
https://github.com/couchbase/couchbase-java-client/blob/master/src/main/...
jTap is deprecated and the functionality has been merged into the Java SDK.
Hey John, can you show a snippet of your code for connecting to the client and executing the dump?
Perry
Forum support is great for free but sometimes you need a guaranteed response time and dedicated resources for your questions or issues.
Consider purchasing enterprise-level support from Couchbase: http://www.couchbase.com/products-and-services/overview
Call or email "sales -at- couchbase-dot- com" today!