DESCRIPTION

Added getl operation

Getl works with both ascii and binary. Unit test will be added in a future commit
but this code has been tested thoughly.

Change-Id: I9859d8e3752c519bd0bcf67009a0a3999f5cbbf2


COMMENTS

author: Kenny Maynard
date: 2011-06-05 20:58:41.649000000

Uploaded patch set 5.

-------------------------------------
author: Noah Dean
date: 2011-06-05 21:00:33.654000000

Patch Set 5: Looks good to me, but someone else must approve



-------------------------------------
author: Andreas Short
date: 2011-06-06 04:30:50.882000000

Patch Set 5: (4 inline comments)

There's nothing majorly wrong in here, but I do have a question that I'm slightly concerned about.  What would the behavior be if someone else holds the lock?  Using this kind of pessimistic lock is pretty indicative that you'll run into that situation somewhat regularly.  Should that be handled with an exception path?  I don't think so... 

Thinking about it API wise, one might want to write something like this...

if (getl("thingA", 30)) {
  if (getl("thingB", 10) && getl("thingC", 10)) { 
    set("thingA", something, cas);
    set("thingB", somethingalso, casalso);
    set("thingB", somethingmore, casmore);
  }
}

(yeah, not getting the cas to re-set it later, but you get the point)

What do you think?  I'm open to arguments to the contrary.

Line:68, src/main/java/net/spy/memcached/protocol/binary/GetOperationImpl.java -> Another case where instanceof would be okay I think.

Better would possibly be a more polymorphic approach where the slightly-different-operation impl strips off the key for you, so the caller can just get the data in the format expected.

Line:990, src/main/java/net/spy/memcached/MemcachedClient.java -> Missing space after the period, and there's a whitespace issue here at the end of the line.  There are a few more in the file too.

Line:112, src/main/java/net/spy/memcached/protocol/ascii/BaseGetOpImpl.java -> Hm.  I didn't read this very well the first time.  Might it not be better to use instanceof here?  Not a big deal since I said it was okay earlier, but exception handling is more expensive, I believe.

Line:74, src/main/java/net/spy/memcached/OperationFactory.java -> would be nice to add "in seconds" here too, but it's really minor.

-------------------------------------
author: Andreas Short
date: 2011-06-06 04:35:03.366000000

Patch Set 5:

Thinking more about the last comment, maybe a method to return a boolean on whether or not the lock was obtained would be a step in the right direction.  What do you think?

-------------------------------------
author: Andreas Short
date: 2011-06-06 04:37:05.174000000

Patch Set 5:

Sorry to pepper you with questions here, but doesn't the unlock have to have the CAS?  Shouldn't this be more modeled off of a gets()?

-------------------------------------
