Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

CBD-87: allow relevant sinks to handle GET commands

Change-Id: I8e4e24b599b737e6d0d46a1f63b236221ee77a40
Reviewed-on: http://review.couchbase.org/19011
Reviewed-by: Pavel Paulau <pavel.paulau@gmail.com>
Tested-by: Steve Yen <steve.yen@gmail.com>
  • Loading branch information...
commit 6852d2e52aa4195ca76df8e6523825254808e83b 1 parent 58c09c3
Steve Yen steveyen authored
Showing with 9 additions and 2 deletions.
  1. +2 −1  pump.py
  2. +2 −0  pump_csv.py
  3. +5 −1 pump_mc.py
3  pump.py
View
@@ -753,10 +753,11 @@ def consume_batch_async(self, batch):
stdout.write("\r\n")
elif op == 'get':
stdout.write("get %s\r\n" % (key))
-
elif cmd == memcacheConstants.CMD_TAP_DELETE:
if op_mutate:
stdout.write("delete %s\r\n" % (key))
+ elif cmd == memcacheConstants.CMD_GET:
+ stdout.write("get %s\r\n" % (key))
else:
return "error: StdOutSink - unknown cmd: " + str(cmd), None
except IOError:
2  pump_csv.py
View
@@ -123,6 +123,8 @@ def consume_batch_async(self, batch):
self.writer.writerow([key, flg, exp, cas, val])
elif cmd == memcacheConstants.CMD_TAP_DELETE:
pass
+ elif cmd == memcacheConstants.CMD_GET:
+ pass
else:
return "error: CSVSink - unknown cmd: " + str(cmd), None
except IOError:
6 pump_mc.py
View
@@ -177,7 +177,8 @@ def recv_msgs(self, conn, msgs, vbucket_id=None):
(self.spec, key))
continue
elif r_status == memcacheConstants.ERR_KEY_ENOENT:
- if cmd != memcacheConstants.CMD_TAP_DELETE:
+ if (cmd != memcacheConstants.CMD_TAP_DELETE and
+ cmd != memcacheConstants.CMD_GET):
logging.warn("item not found: %s, key: %s" %
(self.spec, key))
continue
@@ -237,6 +238,9 @@ def translate_cmd(self, cmd, op, meta):
return 0, memcacheConstants.CMD_NOOP
return 0, self.op_map['delete']
+ if cmd == memcacheConstants.CMD_GET:
+ return 0, cmd
+
return "error: MCSink - unknown cmd: %s, op: %s" % (cmd, op), None
def append_req(self, m, req):
Please sign in to comment.
Something went wrong with that request. Please try again.