asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luo Chen (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: [ASTERIXDB-2176] Fix deletion on LSMRTree
Date Thu, 30 Nov 2017 22:08:22 GMT
Luo Chen has submitted this change and it was merged.

Change subject: [ASTERIXDB-2176] Fix deletion on LSMRTree
......................................................................


[ASTERIXDB-2176] Fix deletion on LSMRTree

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- The deletion on LSMRTree is not working on master, because initially
we insert anti-matter tuples into the memory BTree, and during flush
these tuples are copied to the RTree again. However, we forgot to
set these tuples from the in-memory BTree as anti-matter tuples. This
patch fixes this.
- Also modifies the test case to cover this case.

Change-Id: I3d9417e56f06044f585e019089004efd2b2af3b7
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2188
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Taewoo Kim <wangsaeu@gmail.com>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
---
M hyracks-fullstack/hyracks/hyracks-storage-am-lsm-rtree/src/main/java/org/apache/hyracks/storage/am/lsm/rtree/utils/LSMRTreeUtils.java
M hyracks-fullstack/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/storage/am/rtree/AbstractRTreeDeleteTest.java
M hyracks-fullstack/hyracks/hyracks-tests/hyracks-storage-am-lsm-rtree-test/src/test/java/org/apache/hyracks/storage/am/lsm/rtree/LSMRTreeWithAntiMatterTuplesDeleteTest.java
3 files changed, 30 insertions(+), 1 deletion(-)

Approvals:
  Taewoo Kim: Looks good to me, approved
  Jenkins: Verified; No violations found; Verified

Objections:
  Anon. E. Moose #1000171: Violations found



diff --git a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-rtree/src/main/java/org/apache/hyracks/storage/am/lsm/rtree/utils/LSMRTreeUtils.java
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-rtree/src/main/java/org/apache/hyracks/storage/am/lsm/rtree/utils/LSMRTreeUtils.java
index 451b122..4b851e4 100644
--- a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-rtree/src/main/java/org/apache/hyracks/storage/am/lsm/rtree/utils/LSMRTreeUtils.java
+++ b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-rtree/src/main/java/org/apache/hyracks/storage/am/lsm/rtree/utils/LSMRTreeUtils.java
@@ -174,7 +174,7 @@
             rtreeLeafFrameBulkLoadWriterFactory = new LSMRTreeTupleWriterFactory(typeTraits,
false);
         }
 
-        LSMRTreeTupleWriterFactory btreeTupleWriterFactory = new LSMRTreeTupleWriterFactory(typeTraits,
false);
+        LSMRTreeTupleWriterFactory btreeTupleWriterFactory = new LSMRTreeTupleWriterFactory(typeTraits,
true);
 
         RTreeFrameFactory rtreeInteriorFrameFactory = new RTreeNSMInteriorFrameFactory(
                 rtreeInteriorFrameTupleWriterFactory, valueProviderFactories, rtreePolicyType,
isPointMBR);
diff --git a/hyracks-fullstack/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/storage/am/rtree/AbstractRTreeDeleteTest.java
b/hyracks-fullstack/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/storage/am/rtree/AbstractRTreeDeleteTest.java
index b53f0dc..ce486fd 100644
--- a/hyracks-fullstack/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/storage/am/rtree/AbstractRTreeDeleteTest.java
+++ b/hyracks-fullstack/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/storage/am/rtree/AbstractRTreeDeleteTest.java
@@ -20,6 +20,7 @@
 package org.apache.hyracks.storage.am.rtree;
 
 import org.apache.hyracks.api.dataflow.value.ISerializerDeserializer;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.dataflow.common.data.accessors.ITupleReference;
 import org.apache.hyracks.dataflow.common.data.marshalling.DoubleSerializerDeserializer;
 import org.apache.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
@@ -62,12 +63,22 @@
                 rTreeTestUtils.checkScan(ctx);
                 rTreeTestUtils.checkDiskOrderScan(ctx);
                 rTreeTestUtils.checkRangeSearch(ctx, key);
+                afterDeleteRound(ctx);
             }
+            afterInsertRound(ctx);
         }
         ctx.getIndex().deactivate();
         ctx.getIndex().destroy();
     }
 
+    protected void afterInsertRound(AbstractRTreeTestContext ctx) throws HyracksDataException
{
+
+    }
+
+    protected void afterDeleteRound(AbstractRTreeTestContext ctx) throws HyracksDataException
{
+
+    }
+
     @Override
     protected String getTestOpName() {
         return "Delete";
diff --git a/hyracks-fullstack/hyracks/hyracks-tests/hyracks-storage-am-lsm-rtree-test/src/test/java/org/apache/hyracks/storage/am/lsm/rtree/LSMRTreeWithAntiMatterTuplesDeleteTest.java
b/hyracks-fullstack/hyracks/hyracks-tests/hyracks-storage-am-lsm-rtree-test/src/test/java/org/apache/hyracks/storage/am/lsm/rtree/LSMRTreeWithAntiMatterTuplesDeleteTest.java
index a4d67a9..581dbf7 100644
--- a/hyracks-fullstack/hyracks/hyracks-tests/hyracks-storage-am-lsm-rtree-test/src/test/java/org/apache/hyracks/storage/am/lsm/rtree/LSMRTreeWithAntiMatterTuplesDeleteTest.java
+++ b/hyracks-fullstack/hyracks/hyracks-tests/hyracks-storage-am-lsm-rtree-test/src/test/java/org/apache/hyracks/storage/am/lsm/rtree/LSMRTreeWithAntiMatterTuplesDeleteTest.java
@@ -25,6 +25,8 @@
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.storage.am.common.api.IPrimitiveValueProviderFactory;
 import org.apache.hyracks.storage.am.config.AccessMethodTestsConfig;
+import org.apache.hyracks.storage.am.lsm.common.api.ILSMIndex;
+import org.apache.hyracks.storage.am.lsm.common.api.ILSMIndexAccessor;
 import org.apache.hyracks.storage.am.lsm.rtree.util.LSMRTreeTestHarness;
 import org.apache.hyracks.storage.am.lsm.rtree.util.LSMRTreeWithAntiMatterTuplesTestContext;
 import org.apache.hyracks.storage.am.rtree.AbstractRTreeDeleteTest;
@@ -63,6 +65,22 @@
     }
 
     @Override
+    protected void afterDeleteRound(AbstractRTreeTestContext ctx) throws HyracksDataException
{
+        flush(ctx);
+    }
+
+    @Override
+    protected void afterInsertRound(AbstractRTreeTestContext ctx) throws HyracksDataException
{
+        flush(ctx);
+    }
+
+    protected void flush(AbstractRTreeTestContext ctx) throws HyracksDataException {
+        ILSMIndex lsmIndex = (ILSMIndex) ctx.getIndex();
+        ILSMIndexAccessor accessor = (ILSMIndexAccessor) ctx.getIndexAccessor();
+        accessor.scheduleFlush(lsmIndex.getIOOperationCallback());
+    }
+
+    @Override
     protected Random getRandom() {
         return harness.getRandom();
     }

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/2188
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3d9417e56f06044f585e019089004efd2b2af3b7
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Luo Chen <cluo8@uci.edu>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Luo Chen <cluo8@uci.edu>
Gerrit-Reviewer: Taewoo Kim <taewok2@uci.edu>
Gerrit-Reviewer: Taewoo Kim <wangsaeu@gmail.com>
Gerrit-Reviewer: abdullah alamoudi <bamousaa@gmail.com>

Mime
View raw message