asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From luoc...@apache.org
Subject asterixdb git commit: [NO ISSUE][STO] Fix object creations during LSM operations
Date Sat, 02 Dec 2017 03:31:30 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master 50de6669f -> c04b47783


[NO ISSUE][STO] Fix object creations during LSM operations

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

Details:
- Replace LinkedList to ArrayList to avoid object creation everytime
when we enter a LSM index
- A small fix of LSMBTreePointSearchCursor to avoid object creation as
well

Change-Id: I4e796d1184a2d060a9514362cfc210f40393465f
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2189
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: abdullah alamoudi <bamousaa@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/c04b4778
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/c04b4778
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/c04b4778

Branch: refs/heads/master
Commit: c04b477832f05093231f9ba874bfe2bf072395ce
Parents: 50de666
Author: luochen01 <cluo8@uci.edu>
Authored: Wed Nov 29 23:07:32 2017 -0800
Committer: Luo Chen <cluo8@uci.edu>
Committed: Fri Dec 1 19:30:57 2017 -0800

----------------------------------------------------------------------
 .../am/lsm/btree/impls/LSMBTreePointSearchCursor.java        | 4 ++--
 .../lsm/common/impls/AbstractLSMIndexOperationContext.java   | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c04b4778/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreePointSearchCursor.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreePointSearchCursor.java
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreePointSearchCursor.java
index b84a172..211a233 100644
--- a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreePointSearchCursor.java
+++ b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreePointSearchCursor.java
@@ -163,7 +163,7 @@ public class LSMBTreePointSearchCursor implements ITreeIndexCursor {
         searchCallback = lsmInitialState.getSearchOperationCallback();
         predicate = (RangePredicate) lsmInitialState.getSearchPredicate();
         numBTrees = operationalComponents.size();
-        if (rangeCursors == null || rangeCursors.length != numBTrees) {
+        if (rangeCursors == null || rangeCursors.length < numBTrees) {
             // object creation: should be relatively low
             rangeCursors = new BTreeRangeSearchCursor[numBTrees];
             btreeAccessors = new BTreeAccessor[numBTrees];
@@ -270,7 +270,7 @@ public class LSMBTreePointSearchCursor implements ITreeIndexCursor {
 
     private void closeCursors() throws HyracksDataException {
         if (rangeCursors != null) {
-            for (int i = 0; i < rangeCursors.length; ++i) {
+            for (int i = 0; i < numBTrees; ++i) {
                 if (rangeCursors[i] != null) {
                     rangeCursors[i].close();
                 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c04b4778/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/AbstractLSMIndexOperationContext.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/AbstractLSMIndexOperationContext.java
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/AbstractLSMIndexOperationContext.java
index 0818b08..1b540b7 100644
--- a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/AbstractLSMIndexOperationContext.java
+++ b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/AbstractLSMIndexOperationContext.java
@@ -18,7 +18,7 @@
  */
 package org.apache.hyracks.storage.am.lsm.common.impls;
 
-import java.util.LinkedList;
+import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory;
@@ -61,9 +61,9 @@ public abstract class AbstractLSMIndexOperationContext implements ILSMIndexOpera
         this.index = index;
         this.searchCallback = searchCallback;
         this.modificationCallback = modificationCallback;
-        this.componentHolder = new LinkedList<>();
-        this.componentsToBeMerged = new LinkedList<>();
-        this.componentsToBeReplicated = new LinkedList<>();
+        this.componentHolder = new ArrayList<>();
+        this.componentsToBeMerged = new ArrayList<>();
+        this.componentsToBeReplicated = new ArrayList<>();
         if (filterFields != null) {
             indexTuple = new PermutingTupleReference(treeFields);
             filterCmp = MultiComparator.create(filterCmpFactories);


Mime
View raw message