Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | SDKs | SDKs

how to use this TAP protocol?

3 replies [Last post]
  • Login or register to post comments
Mon, 07/09/2012 - 00:08
sjpark9
Offline
Joined: 03/01/2012
Groups: None

I am studying on this TAP protocol and was wondering if I coud get some help on this.

I've designed simple testing source

static void tap_mutation_callback( libcouchbase_t instance, const void *cookie, const void *key, libcouchbase_size_t nkey, const void *
data, libcouchbase_size_t nbytes, libcouchbase_uint32_t flags, libcouchbase_time_t exp, libcouchbase_cas_t cas, libcouchbase_vbucket_t 
vbucket, const void *es, libcouchbase_size_t nes )
{
    (void)instance;
    (void)cookie;
    (void)flags;
    (void)cas;
    (void)vbucket;
    (void)exp;
    string akey;
    string adata;
    string aes;
    akey.append( (char*)key, nkey );
    adata.append( (char*)data, nbytes);
    aes.append( (char*)es, nes );
 
    printf("[CALLBACK] key : %s, data : %s, es : %s \n", akey.c_str(), adata.c_str(), aes.c_str() );
 
}
 int main()
 {
     libcouchbase_t instance = libcouchbase_create( "172.16.0.117", "hi", "hello", "default", NULL );
 
     libcouchbase_set_tap_mutation_callback( instance, tap_mutation_callback );
 
     libcouchbase_connect( instance );
     printf("CONNECTED\n");
 
     libcouchbase_tap_filter_t filter = libcouchbase_tap_filter_create();
 
     libcouchbase_tap_filter_set_keys_only( filter, 0 );
//   while( 1 )
//   {}
 
     libcouchbase_tap_filter_destroy( filter );
 
     return 0;
 }

I think I am misunderstanding something since I ain't getting any callbacks. can anyone help me understand how this tap can be used?

Top
  • Login or register to post comments
Sun, 07/15/2012 - 14:09
ingenthr
Offline
Joined: 03/16/2010
Groups:

I'd recommend looking into the TAP unit tests built into the client.

See https://github.com/couchbase/couchbase-java-client/blob/master/src/test/...

Top
  • Login or register to post comments
Tue, 07/17/2012 - 17:32
sjpark9
Offline
Joined: 03/01/2012
Groups: None

are there any c examples? not java? using libcouchbase?

Top
  • Login or register to post comments
Wed, 07/18/2012 - 00:45
ingenthr
Offline
Joined: 03/16/2010
Groups:

Yes, I'd have a look at the cbc-send command. That should demonstrate it.

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