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

Flush cache on demand - tapDump

2 replies [Last post]
  • Login or register to post comments
Fri, 10/21/2011 - 13:19
abhihome
Offline
Joined: 03/14/2011
Groups: None

Hi,

Our current application is using EHCache and which allows our internal users to flush a portion of a cache, on demand, after making changes to the site.

While we are being migrated to Membase, we are hoping to use the TapClient to do the same functionality.
tapDump can get the full dump and we can find the keys from there, and flush them, and it works! But it pulls a lot of data, and the iteration is taking too long.
Is there a way I can apply a regular expression while doing a tapDump?

We are using Membase 1.7.1-1 and spymemcached-2.7.1.jar.

http://www.couchbase.org/wiki/display/membase/prerelease+spymemcached+vb... says I can, but the constructor seems to have changed.

The java-doc on tapCustom is not that clear. Can I use that to get the dump for a regex?

This is what I am trying to do, but it doesn't find any keys.

Operation op = client.tapCustom("TEST",new RequestMessage(), "(testkeys)", "");

Can someone please help?

Thanks
Abhilash

Top
  • Login or register to post comments
Sun, 10/23/2011 - 16:46
mikew
Offline
Joined: 03/14/2011
Groups:

When I originally wrote the tap stuff in Spymemcached I had added a way to do regex stuff on both the key and the value. We ended up taking this out (to be honest I don't think this was every officially released) because we decided that if we were going to have something to filter keys we would want something more powerful than just regex. Also our documentation is a bit out of date and we are in the process of updating everything.

My guess is that you are just creating a tap stream, iterating through keys, and filtering things yourself. I want to point out that when I had implemented regex on a tap stream I actually did the same thing. The only difference was I did it internally.

I also want to point out that there is no way to tell the server to send a specific set of keys in a tap dump. It will always send everything.

In the tapCustom function of some versions of Spy you will have the regex parameters in the signature. This is a bug. It won't break if you specify them, but they are not used in the function. In the latest version of Spy, 2.8 developer preview 3, they are not there.

My recommendation is just to write you own filter. If you have any questions on how to do this let me know.

Top
  • Login or register to post comments
Mon, 10/24/2011 - 13:08
abhihome
Offline
Joined: 03/14/2011
Groups: None

Thanks Mike!
I just wanted to double check before I spend time on writing a filter :)
tapDump itself is a great feature.

Abhilash

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