asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ti...@apache.org
Subject asterixdb git commit: [NO ISSUE] Cleanup for commit b67505d
Date Sat, 30 Sep 2017 20:01:39 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master 8dd947bab -> 2a26c8408


[NO ISSUE] Cleanup for commit b67505d

Change-Id: I370bc289de4a281136e43a3985eb8fae367a6bc6
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2034
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <mblow@apache.org>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>


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

Branch: refs/heads/master
Commit: 2a26c84084829db0a33cdb2bb05cca4bdf5f9f1d
Parents: 8dd947b
Author: Till Westmann <tillw@apache.org>
Authored: Fri Sep 29 20:22:58 2017 -0700
Committer: Till Westmann <tillw@apache.org>
Committed: Sat Sep 30 13:01:23 2017 -0700

----------------------------------------------------------------------
 .../am/lsm/common/impls/TracedIOOperation.java  | 31 +++++++++++++++-----
 1 file changed, 23 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/2a26c840/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/TracedIOOperation.java
----------------------------------------------------------------------
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.storage.am.lsm.common.api.ILSMIOOperationCallback;
 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 @@ class ComparableTracedIOOperation extends TracedIOOperation implements
Comparabl
 
     protected ComparableTracedIOOperation(ILSMIOOperation ioOp, Tracer trace) {
         super(ioOp, trace);
-        System.err.println("COMPARE ComparableTracedIOOperation");
     }
 
+    @Override
+    public int hashCode() {
+        return this.ioOp.hashCode();
+    }
+
+    @Override
+    public boolean equals(Object other) {
+        return other instanceof ILSMIOOperation && compareTo((ILSMIOOperation) other)
== 0;
+    }
+
+    @Override
     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);
+        final ILSMIOOperation myIoOp = this.ioOp;
+        if (myIoOp instanceof Comparable && other instanceof ComparableTracedIOOperation)
{
+            return ((Comparable) myIoOp).compareTo(((ComparableTracedIOOperation) other).getIoOp());
         }
-        throw new IllegalArgumentException("Comparing ioOps of type " + this.ioOp.getClass().getSimpleName()
+ " and "
-                + other.getClass().getSimpleName());
+        LOGGER.warning("Comparing ioOps of type " + myIoOp.getClass().getSimpleName() + "
and "
+                + other.getClass().getSimpleName() + " in " + getClass().getSimpleName());
+        return Integer.signum(hashCode() - other.hashCode());
     }
-}
\ No newline at end of file
+}


Mime
View raw message