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

TAP protocol - retrieve all keys from the bucket

2 replies [Last post]
  • Login or register to post comments
Fri, 03/23/2012 - 08:45
a.pintori
Offline
Joined: 04/14/2011
Groups: None

Hello,

I'm using Membase and I need to retrieve all keys from the bucket (using TAP protocol).

I've downloaded jtap and I've compiled this example to retrieve all keys:

--- TapRunner.java ---
import com.membase.jtap.*;
import com.membase.jtap.exporter.*;
import com.membase.jtap.ops.*;

public class TapRunner
{
public static void main(String args[])
{
TapStreamClient client = new TapStreamClient("localhost", 11210, "default", null);
Exporter exporter = new FileExporter("results.txt");
CustomStream tapListener = new CustomStream(exporter, "node1");
tapListener.keysOnly();
tapListener.doDump();
client.start(tapListener);
}
}
--- TapRunner.java ---

I can compile it with no errors with

# javac -cp .:jtap.jar TapRunner.java

But when I run it I receive these errors:

# java -cp .:jtap.jar TapRunner

Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at com.membase.jtap.TapStreamClient.(Unknown Source)
at TapRunner.main(TapRunner.java:11)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
... 2 more

Where is the problem?
Is this the only way to retrieve all keys with TAP protocol, in a txt file?
Can't I iterate all the keys in other ways?

Thanks.

Top
  • Login or register to post comments
Fri, 03/23/2012 - 15:21
dan
Offline
Joined: 01/05/2011
Groups: None

That error indicates that you need the slf4j library.

The jtap library isn't updated anymore since the TAP functionality has been added to the java client.

http://www.couchbase.com/develop/java/current

However, I've been running into issues of my own trying to pull keys where the client just disconnects before it's finished.

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

Hi
Can you pls share the jars needed for Couchbase Tap java.

thanks

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