Remove default parameter from deleteItem 24/67624/6
authorDaniel Owen <owend@couchbase.com>
Tue, 13 Sep 2016 10:25:39 +0000 (11:25 +0100)
committerDave Rigby <daver@couchbase.com>
Wed, 28 Sep 2016 12:10:24 +0000 (12:10 +0000)
The EventuallyPersistentStore method deleteItem has a parameter
called tapBackfill, which is defaulted to false.  The parameter
is used to specify if an item deletion is from a TAP backfill
stream.

However the deleteItem method is never passed a tapBackfill
parameter and therefore the default of false is always used.

This patch removes the unrequired parameter from the deleteItem
definition and simpifies the body of the method.

Change-Id: Ic1aa9a41bd68411f9b29b61333f66b4c1ae35278
Reviewed-on: http://review.couchbase.org/67624
Reviewed-by: Jim Walker <jim@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
Well-Formed: buildbot <build@couchbase.com>

src/ep.cc
src/ep.h

index f207e45..31e1c9d 100644 (file)
--- a/src/ep.cc
+++ b/src/ep.cc
@@ -2803,8 +2803,8 @@ ENGINE_ERROR_CODE EventuallyPersistentStore::deleteItem(const std::string &key,
                                                         const void *cookie,
                                                         bool force,
                                                         ItemMetaData *itemMeta,
-                                                        mutation_descr_t *mutInfo,
-                                                        bool tapBackfill)
+                                                        mutation_descr_t
+                                                        *mutInfo)
 {
     RCPtr<VBucket> vb = getVBucket(vbucket);
     if (!vb || (vb->getState() == vbucket_state_dead && !force)) {
@@ -2922,12 +2922,12 @@ ENGINE_ERROR_CODE EventuallyPersistentStore::deleteItem(const std::string &key,
     case NOT_FOUND:
         ret = ENGINE_KEY_ENOENT;
         if (v) {
-            queueDirty(vb, v, &lh, NULL, tapBackfill);
+            queueDirty(vb, v, &lh, NULL, /*tapBackfill*/false);
         }
         break;
     case WAS_DIRTY:
     case WAS_CLEAN:
-        queueDirty(vb, v, &lh, &seqno, tapBackfill);
+        queueDirty(vb, v, &lh, &seqno, /*tapBackfill*/false);
         mutInfo->seqno = seqno;
         mutInfo->vbucket_uuid = vb->failovers->getLatestUUID();
         break;
index febe94d..8418a4f 100644 (file)
--- a/src/ep.h
+++ b/src/ep.h
@@ -388,7 +388,6 @@ public:
      * @param force override access to the vbucket even if the state of the
      *              vbucket would deny mutations.
      * @param itemMeta the pointer to the metadata memory.
-     * @param tapBackfill true if an item deletion is from TAP backfill stream
      *
      * (deleteWithMeta)
      * @param genBySeqno whether or not to generate sequence number
@@ -404,8 +403,7 @@ public:
                                  const void *cookie,
                                  bool force,
                                  ItemMetaData *itemMeta,
-                                 mutation_descr_t *mutInfo,
-                                 bool tapBackfill=false);
+                                 mutation_descr_t *mutInfo);
 
     ENGINE_ERROR_CODE deleteWithMeta(const std::string &key,
                                      uint64_t* cas,