Luo Chen has posted comments on this change. Change subject: [ASTERIXDB-2204][STO] Fix implementations and usages of IIndexCursor ......................................................................
Patch Set 6: (8 comments) Left a few comments about places I'm not sure of... Will go back to the details of Flush/Merge later. https://asterix-gerrit.ics.uci.edu/#/c/2324/6/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/api/IIndexOperationContext.java File hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/api/IIndexOperationContext.java: PS6, Line 38: /** : * Release resources associated with the context and prepare it for the next use : */ : void reset(); Do we need to change the name "reset" to align with "close" in cursors? https://asterix-gerrit.ics.uci.edu/#/c/2324/6/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTree.java File hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTree.java: PS6, Line 197: if (found) { : ctx.getCurrentMutableBTreeAccessor().upsertIfConditionElseInsert(tuple, : AntimatterAwareTupleAcceptor.INSTANCE); : return true; : } Why move these statements here? https://asterix-gerrit.ics.uci.edu/#/c/2324/6/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreeCursorInitialState.java File hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreeCursorInitialState.java: PS6, Line 42: private boolean isScan; What's the usage of this "isScan"? I remembered previous there is a similar functionality by checking the search predicate itself. https://asterix-gerrit.ics.uci.edu/#/c/2324/6/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreePointSearchCursor.java File hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreePointSearchCursor.java: PS6, Line 205: closeCursors why call closeCursors instead of destroyCursors here? https://asterix-gerrit.ics.uci.edu/#/c/2324/6/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreeSearchCursor.java File hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreeSearchCursor.java: PS6, Line 53: isScan I see the usage here...But I suggest we should change the name of isScan to make it more clear (this is very different from a normal index scan). For example, isDiskComponentScan. https://asterix-gerrit.ics.uci.edu/#/c/2324/6/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreeWithBuddySearchCursor.java File hyracks-fullstack/hyracks/hyracks-storage-am-lsm-btree/src/main/java/org/apache/hyracks/storage/am/lsm/btree/impls/LSMBTreeWithBuddySearchCursor.java: PS6, Line 41: super.doDestroy(); : currentCursor = 0; Do we need to destroy cursors here? https://asterix-gerrit.ics.uci.edu/#/c/2324/6/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/ComponentReplacementContext.java File hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/ComponentReplacementContext.java: PS6, Line 216: : @Override : public void destroy() throws HyracksDataException { : throw new UnsupportedOperationException(); : } : } why through exception here instead of no op? If destroy() is treated as part of the contract of op context usage, then this should be a no op? https://asterix-gerrit.ics.uci.edu/#/c/2324/6/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-rtree/src/main/java/org/apache/hyracks/storage/am/lsm/rtree/impls/LSMRTree.java File hyracks-fullstack/hyracks/hyracks-storage-am-lsm-rtree/src/main/java/org/apache/hyracks/storage/am/lsm/rtree/impls/LSMRTree.java: PS6, Line 111: public ILSMDiskComponent doFlush(ILSMIOOperation operation) throws HyracksDataException { This method seems to be too complicated after the change...I think we should do some refactoring to make its structure simpler...Otherwise it'll be difficult to maintain it in the future -- To view, visit https://asterix-gerrit.ics.uci.edu/2324 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98a7a8b931eb24dbe11bf2bdc61b754ca28ebdf9 Gerrit-PatchSet: 6 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: abdullah alamoudi <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Luo Chen <[email protected]> Gerrit-Reviewer: Michael Blow <[email protected]> Gerrit-Reviewer: Murtadha Hubail <[email protected]> Gerrit-Reviewer: Taewoo Kim <[email protected]> Gerrit-Reviewer: Taewoo Kim <[email protected]> Gerrit-Reviewer: Till Westmann <[email protected]> Gerrit-Reviewer: abdullah alamoudi <[email protected]> Gerrit-HasComments: Yes
