Ticket #2957 (closed enhancement: fixed )

Opened 2 years ago

Last modified 1 year ago

Update memcache client with new commands of memcached 1.2.4

Reported by: therve Assigned to: therve
Type: enhancement Priority: highest
Milestone: Component: core
Keywords: Cc:
Branch: branches/memcache-update-2957 Author: therve
Launchpad Bug:

Description

There are 4 new commands: gets, append, prepend, cas.

Attachments

Change History

  2007-12-19 16:26:13+00:00 changed by therve

  • branch set to branches/memcache-update-2957
  • author set to therve

(In [22100]) Branching to 'memcache-update-2957'

  2007-12-19 16:35:38+00:00 changed by therve

(In [22102]) Add the 4 new methods and tests for them.

Refs #2957

  2007-12-19 16:44:29+00:00 changed by therve

  • keywords set to review
  • owner deleted
  • priority changed from normal to highest

This is ready to review. The gets and cas facility is not that awesome, but hey.

  2007-12-29 00:03:03+00:00 changed by exarkun

  • keywords deleted
  • owner set to therve

For the cas docstring, I'd say something like this:

Change the content of C{key} only if the C{cas} value matches the
current one associated with the key. Use this to store a value which
hasn't been modified since last time you fetched it.

Also, capitalize the first letter of the first word of a sentence (eg, for the @param docs). ;)

cas is a really opaque name. Even after reading the diff, I don't know what those letters in that order mean. Is there something more understandable we can use here? Likewise, the name gets doesn't really tell me that it differs from get in that it returns the cas value as well.

  • 64 bits value should probably be 64 bit value
  • if the operations has should probably be if the operation has (multiple places)
  • setUp docstring misspells protocol as protoco

  2007-12-29 10:07:21+00:00 changed by therve

(In [22180]) Fix the docstrings.

Refs #2957

  2007-12-29 13:31:21+00:00 changed by therve

I'm not sure what to do here. The memcached semantics is not really clear. The cas is a unique numerical identifier, that's all I know. Do you think docstring needs further enhancements?

  2008-01-12 11:16:23+00:00 changed by therve

  • keywords set to review
  • owner deleted

  2008-01-17 02:06:53+00:00 changed by exarkun

  • keywords deleted
  • owner set to therve

I found "cas" on google, it seems to mean "check and set", which is reasonable in context.

So perhaps the cas method can be renamed checkAndSet (it should still have cas in the docstring I guess, since most people seem to refer to this feature that way; I'm not sure if they know what it stands for either).

Maybe gets could be getWithIdentifier, or maybe get could take a flag that specifies this behavior. Just random ideas, I don't feel as strongly about this as about the cas method. I leave it up to your judgement.

I noticed there seems to be no direct coverage of the failure case for append or prepend. This is sort of tested by test_invalidCommand, but direct tests would be good.

  2008-01-17 09:21:39+00:00 changed by therve

(In [22340]) Process review comments.

Refs #2957

  2008-01-17 09:31:40+00:00 changed by therve

  • keywords set to review
  • owner deleted

Thanks for the search, I didn't manage to find something but checkAndSet is indeed clear in its goal. I think I've done all points.

  2008-02-02 15:03:44+00:00 changed by exarkun

  • keywords deleted
  • owner set to therve

The docstring for MemCacheProtocol.get is missing some text in the @param withIdentifier field.

Everything else looks fine, merge when that's fixed.

  2008-02-02 15:22:05+00:00 changed by therve

  • status changed from new to closed
  • resolution set to fixed

(In [22445]) Merge memcache-update-2957

Author: therve Reviewer: exarkun Fixes #2957

Update the memcache client protocol with the new commands of memcached 1.2.4.

Note: See TracTickets for help on using tickets.