Changeset 615 for trunk/server/doc/protocol.txt
- Timestamp:
- 10/03/07 19:59:11 (2 years ago)
- Files:
-
- 1 modified
-
trunk/server/doc/protocol.txt (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/doc/protocol.txt
r609 r615 54 54 There are three types of commands. 55 55 56 Storage commands (there are three: "set", "add" and "replace") ask the57 server to store some data identified by a key. The client sends a 58 command line, and then a data block; after that the client expects one 59 line of response, which will indicate success or faulure.60 61 Retrieval commands (there is only one: "get") ask the server to56 Storage commands (there are four: "set", "add", "replace", and "cas") 57 ask the server to store some data identified by a key. The client 58 sends a command line, and then a data block; after that the client 59 expects one line of response, which will indicate success or faulure. 60 61 Retrieval commands (there are two: "get" and "gets") ask the server to 62 62 retrieve data corresponding to a set of keys (one or more keys in one 63 63 request). The client sends a command line, which includes all the … … 126 126 First, the client sends a command line which looks like this: 127 127 128 <command name> <key> <flags> <exptime> <bytes> \r\n129 130 - <command name> is "set", "add" or "replace"128 <command name> <key> <flags> <exptime> <bytes> [<unqiue>]\r\n 129 130 - <command name> is "set", "add", "replace", or "cas" 131 131 132 132 "set" means "store this data". … … 137 137 "replace" means "store this data, but only if the server *does* 138 138 already hold data for this key". 139 140 "cas" is a check and set operation which means "store this data but 141 only if no one else has updated since I last fetched it." 139 142 140 143 - <key> is the key under which the client asks to store the data … … 159 162 it's followed by an empty data block). 160 163 164 - <cas unique> is a unique 64-bit value of an existing entry. 165 161 166 After this line, the client sends the data block: 162 167 … … 176 181 item is in a delete queue (see the "delete" command below). 177 182 183 - "EXISTS\r\n" to indicate that the item you are trying to store with 184 a "cas" command has been modified since you last fetched it. 178 185 179 186 Retrieval command: 180 187 ------------------ 181 188 182 The retrieval command looks like this:189 The retrieval commands "get" and "gets" operates like this: 183 190 184 191 get <key>*\r\n 192 gets <key>*\r\n 185 193 186 194 - <key>* means one or more key strings separated by whitespace. … … 196 204 Each item sent by the server looks like this: 197 205 198 VALUE <key> <flags> <bytes> \r\n206 VALUE <key> <flags> <bytes> [<cas unique>]\r\n 199 207 <data block>\r\n 200 208 … … 205 213 - <bytes> is the length of the data block to follow, *not* including 206 214 its delimiting \r\n 215 216 - <cas unique> is a unique 64-bit integer that uniquely identifies 217 this specific item. 207 218 208 219 - <data block> is the data for this item. … … 213 224 but deleted to make space for more items, or expired, or explicitly 214 225 deleted by a client). 215 216 226 217 227
