MB-16181: Minimal update to the DCP engine methods 35/77835/4
authorJim Walker <jim@couchbase.com>
Mon, 8 May 2017 15:45:29 +0000 (16:45 +0100)
committerJim Walker <jim@couchbase.com>
Wed, 10 May 2017 08:53:59 +0000 (08:53 +0000)
Update the DCP methods to pass/accept a new collection length
parameter.

This is a minimal update as this patch needs to be linked to the
memcached change to pass CV.

Change-Id: Ied8d0eea1b4d0c17004aa606f96a427d184c1495
Reviewed-on: http://review.couchbase.org/77835
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>
src/dcp/producer.cc
tests/mock/mock_dcp.cc

index 7159dd3..9483d49 100644 (file)
@@ -506,15 +506,18 @@ ENGINE_ERROR_CODE DcpProducer::step(struct dcp_message_producers* producers) {
             if (mutationResponse->getExtMetaData()) {
                 meta = mutationResponse->getExtMetaData()->getExtMeta();
             }
-            ret = producers->mutation(getCookie(),
-                                      mutationResponse->getOpaque(),
-                                      itmCpy,
-                                      mutationResponse->getVBucket(),
-                                      *mutationResponse->getBySeqno(),
-                                      mutationResponse->getRevSeqno(),
-                                      0 /* lock time */,
-                                      meta.first, meta.second,
-                                      mutationResponse->getItem()->getNRUValue());
+            ret = producers->mutation(
+                    getCookie(),
+                    mutationResponse->getOpaque(),
+                    itmCpy,
+                    mutationResponse->getVBucket(),
+                    *mutationResponse->getBySeqno(),
+                    mutationResponse->getRevSeqno(),
+                    0 /* lock time */,
+                    meta.first,
+                    meta.second,
+                    mutationResponse->getItem()->getNRUValue(),
+                    0);
             break;
         }
         case DcpResponse::Event::Deletion:
@@ -533,7 +536,9 @@ ENGINE_ERROR_CODE DcpProducer::step(struct dcp_message_producers* producers) {
                                       mutationResponse->getVBucket(),
                                       *mutationResponse->getBySeqno(),
                                       mutationResponse->getRevSeqno(),
-                                      meta.first, meta.second);
+                                      meta.first,
+                                      meta.second,
+                                      0);
             break;
         }
         case DcpResponse::Event::SnapshotMarker:
index 55a6590..d583dc7 100644 (file)
@@ -165,14 +165,15 @@ static ENGINE_ERROR_CODE mock_marker(const void *cookie,
 
 static ENGINE_ERROR_CODE mock_mutation(const void* cookie,
                                        uint32_t opaque,
-                                       item *itm,
+                                       itemitm,
                                        uint16_t vbucket,
                                        uint64_t by_seqno,
                                        uint64_t rev_seqno,
                                        uint32_t lock_time,
-                                       const void *meta,
+                                       const voidmeta,
                                        uint16_t nmeta,
-                                       uint8_t nru) {
+                                       uint8_t nru,
+                                       uint8_t collectionLen) {
     (void) cookie;
     clear_dcp_data();
     Item* item = reinterpret_cast<Item*>(itm);
@@ -197,12 +198,13 @@ static ENGINE_ERROR_CODE mock_mutation(const void* cookie,
 
 static ENGINE_ERROR_CODE mock_deletion(const void* cookie,
                                        uint32_t opaque,
-                                       item *itm,
+                                       itemitm,
                                        uint16_t vbucket,
                                        uint64_t by_seqno,
                                        uint64_t rev_seqno,
-                                       const void *meta,
-                                       uint16_t nmeta) {
+                                       const void* meta,
+                                       uint16_t nmeta,
+                                       uint8_t collectionLen) {
     (void) cookie;
     clear_dcp_data();
     Item* item = reinterpret_cast<Item*>(itm);
@@ -233,7 +235,8 @@ static ENGINE_ERROR_CODE mock_expiration(const void*,
                                          uint64_t,
                                          uint64_t,
                                          const void*,
-                                         uint16_t) {
+                                         uint16_t,
+                                         uint8_t) {
     clear_dcp_data();
     if (engine_handle_v1 && engine_handle) {
         engine_handle_v1->release(engine_handle, nullptr, itm);