Murtadha Hubail has submitted this change and it was merged. Change subject: [NO ISSUE][STO] Ensure IFrameTupleProcessor Finish is Called ......................................................................
[NO ISSUE][STO] Ensure IFrameTupleProcessor Finish is Called - user model changes: no - storage format changes: no - interface changes: no Details: Currently when an exception is encountered while processing the frame in LSMHarness, IFrameTupleProcessor finish is not called which results in "Operation already has access to components of index" exception. Change-Id: I5f4188fa3de3c91f5f6aae95716db016a315ddd6 Reviewed-on: https://asterix-gerrit.ics.uci.edu/2083 Reviewed-by: abdullah alamoudi <[email protected]> Sonar-Qube: Jenkins <[email protected]> Tested-by: Jenkins <[email protected]> Contrib: Jenkins <[email protected]> Integration-Tests: Jenkins <[email protected]> --- M hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/LSMHarness.java 1 file changed, 23 insertions(+), 12 deletions(-) Approvals: Anon. E. Moose #1000171: abdullah alamoudi: Looks good to me, approved Jenkins: Verified; No violations found; ; Verified diff --git a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/LSMHarness.java b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/LSMHarness.java index c8be9b9..ac38cba 100644 --- a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/LSMHarness.java +++ b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/LSMHarness.java @@ -643,9 +643,9 @@ exitComponents(ctx, LSMOperationType.REPLICATE, null, false); } - protected void validateOperationEnterComponentsState(ILSMIndexOperationContext ctx) throws HyracksDataException { + protected void validateOperationEnterComponentsState(ILSMIndexOperationContext ctx) { if (ctx.isAccessingComponents()) { - throw new HyracksDataException("Opeartion already has access to components of index " + lsmIndex); + throw new IllegalStateException("Operation already has access to components of index " + lsmIndex); } } @@ -684,17 +684,17 @@ processor.start(); enter(ctx); try { - int tupleCount = accessor.getTupleCount(); - int i = 0; - while (i < tupleCount) { - tuple.reset(accessor, i); - processor.process(tuple, i); - i++; + try { + processFrame(accessor, tuple, processor); + frameOpCallback.frameCompleted(); + } finally { + processor.finish(); } - frameOpCallback.frameCompleted(); - processor.finish(); - } catch (Exception e) { - throw HyracksDataException.create(e); + } catch (HyracksDataException e) { + if (LOGGER.isLoggable(Level.SEVERE)) { + LOGGER.log(Level.SEVERE, "Failed to process frame", e); + } + throw e; } finally { exit(ctx); } @@ -853,6 +853,17 @@ return false; } + private static void processFrame(FrameTupleAccessor accessor, FrameTupleReference tuple, + IFrameTupleProcessor processor) throws HyracksDataException { + int tupleCount = accessor.getTupleCount(); + int i = 0; + while (i < tupleCount) { + tuple.reset(accessor, i); + processor.process(tuple, i); + i++; + } + } + @Override public String toString() { return getClass().getSimpleName() + ":" + lsmIndex; -- To view, visit https://asterix-gerrit.ics.uci.edu/2083 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5f4188fa3de3c91f5f6aae95716db016a315ddd6 Gerrit-PatchSet: 3 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Murtadha Hubail <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Murtadha Hubail <[email protected]> Gerrit-Reviewer: Till Westmann <[email protected]> Gerrit-Reviewer: abdullah alamoudi <[email protected]>
