Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Membase | Membase Server 1.6.x

Java TAP Stream API (jtap)

9 replies [Last post]
  • Login or register to post comments
Tue, 03/15/2011 - 08:20
johnSmith
Offline
Joined: 03/15/2011
Groups: None

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.

Top
  • Login or register to post comments
Tue, 03/15/2011 - 10:05
perry
Offline
Joined: 10/11/2010
Groups:

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!

Top
  • Login or register to post comments
Tue, 03/15/2011 - 10:54
johnSmith
Offline
Joined: 03/15/2011
Groups: None

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

Top
  • Login or register to post comments
Tue, 03/15/2011 - 11:04
perry
Offline
Joined: 10/11/2010
Groups:

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

__________________

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!

Top
  • Login or register to post comments
Wed, 05/04/2011 - 09:21
edvin
Offline
Joined: 05/04/2011
Groups: None

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?

Top
  • Login or register to post comments
Thu, 05/05/2011 - 20:52
perry
Offline
Joined: 10/11/2010
Groups:

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

__________________

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!

Top
  • Login or register to post comments
Tue, 05/10/2011 - 11:04
edvin
Offline
Joined: 05/04/2011
Groups: None

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

Top
  • Login or register to post comments
Wed, 05/11/2011 - 12:17
perry
Offline
Joined: 10/11/2010
Groups:

Thanks, I filed http://techzone.couchbase.com/issues/browse/MB-3805 for this issue.

__________________

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!

Top
  • Login or register to post comments
Mon, 04/16/2012 - 21:43
PraveenR
Offline
Joined: 04/11/2012
Groups: None

Hi All

Can anyone give me the jars needed for TAP java. pls
Share the download link

Thanks in advance

Top
  • Login or register to post comments
Wed, 06/20/2012 - 08:45
BigBlueHat
Offline
Joined: 01/28/2011
Groups: None

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.

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker