Till Westmann has submitted this change and it was merged. Change subject: [NO ISSUE] Cleanup for commit b67505d ......................................................................
[NO ISSUE] Cleanup for commit b67505d Change-Id: I370bc289de4a281136e43a3985eb8fae367a6bc6 Reviewed-on: https://asterix-gerrit.ics.uci.edu/2034 Sonar-Qube: Jenkins <[email protected]> Reviewed-by: Michael Blow <[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/TracedIOOperation.java 1 file changed, 25 insertions(+), 10 deletions(-) Approvals: Anon. E. Moose #1000171: Jenkins: Verified; No violations found; ; Verified Michael Blow: Looks good to me, approved diff --git a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/TracedIOOperation.java b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/TracedIOOperation.java index a58b0b1..b4b846d 100644 --- a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/TracedIOOperation.java +++ b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/TracedIOOperation.java @@ -19,6 +19,8 @@ package org.apache.hyracks.storage.am.lsm.common.impls; +import java.util.logging.Logger; + import org.apache.hyracks.api.exceptions.HyracksDataException; import org.apache.hyracks.api.io.IODeviceHandle; import org.apache.hyracks.storage.am.lsm.common.api.ILSMIOOperation; @@ -26,6 +28,9 @@ import org.apache.hyracks.util.trace.Tracer; class TracedIOOperation implements ILSMIOOperation { + + static final Logger LOGGER = Logger.getLogger(TracedIOOperation.class.getName()); + protected final ILSMIOOperation ioOp; private final LSMIOOpertionType ioOpType; private final Tracer tracer; @@ -81,16 +86,26 @@ protected ComparableTracedIOOperation(ILSMIOOperation ioOp, Tracer trace) { super(ioOp, trace); - System.err.println("COMPARE ComparableTracedIOOperation"); } - public int compareTo(ILSMIOOperation other) { - System.err.println("COMPARE compareTo " + other.getClass().getSimpleName()); - if (other instanceof ComparableTracedIOOperation) { - other = ((ComparableTracedIOOperation) other).getIoOp(); - return ((Comparable) this.ioOp).compareTo(other); - } - throw new IllegalArgumentException("Comparing ioOps of type " + this.ioOp.getClass().getSimpleName() + " and " - + other.getClass().getSimpleName()); + @Override + public int hashCode() { + return this.ioOp.hashCode(); } -} \ No newline at end of file + + @Override + public boolean equals(Object other) { + return other instanceof ILSMIOOperation && compareTo((ILSMIOOperation) other) == 0; + } + + @Override + public int compareTo(ILSMIOOperation other) { + final ILSMIOOperation myIoOp = this.ioOp; + if (myIoOp instanceof Comparable && other instanceof ComparableTracedIOOperation) { + return ((Comparable) myIoOp).compareTo(((ComparableTracedIOOperation) other).getIoOp()); + } + LOGGER.warning("Comparing ioOps of type " + myIoOp.getClass().getSimpleName() + " and " + + other.getClass().getSimpleName() + " in " + getClass().getSimpleName()); + return Integer.signum(hashCode() - other.hashCode()); + } +} -- To view, visit https://asterix-gerrit.ics.uci.edu/2034 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: merged Gerrit-Change-Id: I370bc289de4a281136e43a3985eb8fae367a6bc6 Gerrit-PatchSet: 5 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Till Westmann <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Michael Blow <[email protected]> Gerrit-Reviewer: Murtadha Hubail <[email protected]> Gerrit-Reviewer: Till Westmann <[email protected]> Gerrit-Reviewer: abdullah alamoudi <[email protected]>
