public
Description: A simple, asynchronous, single-threaded memcached client written in java.
Homepage: http://code.google.com/p/spymemcached/
Clone URL: git://github.com/dustin/java-memcached-client.git
Updated delete documentation.
dustin (author)
Tue May 13 22:41:39 -0700 2008
commit  9de48599d5a18cb5d59779e7c28713b517285aa4
tree    650180506dee0d0caf6d3470c80149565588642a
parent  f1969bf1f88b62a71dcc9f392c4c9f0756fcea09
...
1144
1145
1146
 
 
 
 
 
 
 
 
 
 
1147
1148
 
1149
1150
 
1151
1152
1153
1154
 
1155
1156
1157
...
1165
1166
1167
1168
 
1169
1170
1171
...
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
 
1158
1159
 
1160
1161
1162
1163
 
1164
1165
1166
1167
...
1175
1176
1177
 
1178
1179
1180
1181
0
@@ -1144,14 +1144,24 @@ public final class MemcachedClient extends SpyThread {
0
   /**
0
    * Delete the given key from the cache.
0
    *
0
+   * <p>
0
+   * The hold argument specifies the amount of time in seconds (or Unix time
0
+   * until which) the client wishes the server to refuse "add" and "replace"
0
+   * commands with this key. For this amount of item, the item is put into a
0
+   * delete queue, which means that it won't possible to retrieve it by the
0
+   * "get" command, but "add" and "replace" command with this key will also
0
+   * fail (the "set" command will succeed, however). After the time passes,
0
+   * the item is finally deleted from server memory.
0
+   * </p>
0
+   *
0
    * @param key the key to delete
0
-   * @param when when the deletion should take effect
0
+   * @param hold how long the key should be unavailable to add commands
0
    */
0
-  public Future<Boolean> delete(String key, int when) {
0
+  public Future<Boolean> delete(String key, int hold) {
0
     final CountDownLatch latch=new CountDownLatch(1);
0
     final OperationFuture<Boolean> rv=new OperationFuture<Boolean>(latch,
0
       operationTimeout);
0
-    DeleteOperation op=opFact.delete(key, when,
0
+    DeleteOperation op=opFact.delete(key, hold,
0
         new OperationCallback() {
0
           public void receivedStatus(OperationStatus s) {
0
             rv.set(s.isSuccess());
0
@@ -1165,7 +1175,7 @@ public final class MemcachedClient extends SpyThread {
0
   }
0
 
0
   /**
0
-   * Shortcut to delete that will immediately delete the item from the cache.
0
+   * Shortcut to delete that doesn't put a hold on the key.
0
    */
0
   public Future<Boolean> delete(String key) {
0
     return delete(key, 0);

Comments