asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mb...@apache.org
Subject asterixdb git commit: Misc Cleanup, SonarQube Fixes
Date Sat, 27 Aug 2016 06:36:06 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master f4d0984b3 -> 018ba9dbc


Misc Cleanup, SonarQube Fixes

Change-Id: If87126cdd435067a50087e339522a36021fbc2c0
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1108
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: Till Westmann <tillw@apache.org>


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

Branch: refs/heads/master
Commit: 018ba9dbcffae030a18f71e6f5ad912f0107ec42
Parents: f4d0984
Author: Michael Blow <mblow@apache.org>
Authored: Sat Aug 27 00:40:40 2016 -0400
Committer: Michael Blow <mblow@apache.org>
Committed: Fri Aug 26 23:35:23 2016 -0700

----------------------------------------------------------------------
 .../asterix/fuzzyjoin/FuzzyJoinMemory.java      | 63 +++++++++-----------
 .../recordgroup/RecordGroupLengthCount.java     |  3 +-
 .../org/apache/asterix/om/base/ADouble.java     |  2 +-
 .../java/org/apache/asterix/om/base/AFloat.java |  2 +-
 .../asterix/om/types/AbstractComplexType.java   |  2 +-
 .../apache/asterix/om/types/BuiltinType.java    |  2 +-
 .../management/ReplicaStateChecker.java         | 10 +---
 .../hyracks/api/client/HyracksConnection.java   | 43 ++++++-------
 .../cc/dataset/DatasetDirectoryService.java     |  2 +-
 .../hyracks/control/cc/work/TriggerNCWork.java  | 18 +++---
 .../common/dataset/ResultStateSweeper.java      |  4 +-
 11 files changed, 68 insertions(+), 83 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/018ba9db/asterixdb/asterix-fuzzyjoin/src/main/java/org/apache/asterix/fuzzyjoin/FuzzyJoinMemory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-fuzzyjoin/src/main/java/org/apache/asterix/fuzzyjoin/FuzzyJoinMemory.java
b/asterixdb/asterix-fuzzyjoin/src/main/java/org/apache/asterix/fuzzyjoin/FuzzyJoinMemory.java
index 0e6164b..9107f63 100644
--- a/asterixdb/asterix-fuzzyjoin/src/main/java/org/apache/asterix/fuzzyjoin/FuzzyJoinMemory.java
+++ b/asterixdb/asterix-fuzzyjoin/src/main/java/org/apache/asterix/fuzzyjoin/FuzzyJoinMemory.java
@@ -21,7 +21,6 @@ package org.apache.asterix.fuzzyjoin;
 
 import java.io.BufferedInputStream;
 import java.io.FileInputStream;
-import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -35,13 +34,13 @@ import org.apache.asterix.fuzzyjoin.invertedlist.InvertedListsLengthList;
 import org.apache.asterix.fuzzyjoin.similarity.SimilarityFiltersJaccard;
 
 public class FuzzyJoinMemory {
-    public static void main(String[] args) {
+    public static void main(String[] args) throws IOException {
         if (args.length < 2) {
             System.err.println("Usage: <threshold> <file> [no runs, e.g., 1]
[warm-up factor, e.g., 1]");
             System.exit(2);
         }
 
-        float similarityThreshold = Float.valueOf(args[0]);
+        float similarityThreshold = Float.parseFloat(args[0]);
         String fileName = args[1];
 
         int noRuns = 1, warmUpFactor = 1;
@@ -55,8 +54,8 @@ public class FuzzyJoinMemory {
         System.err.println("Document: " + fileName);
         System.err.println("... LOADING DATASET ...");
 
-        ArrayList<int[]> records = new ArrayList<int[]>();
-        ArrayList<Integer> rids = new ArrayList<Integer>();
+        ArrayList<int[]> records = new ArrayList<>();
+        ArrayList<Integer> rids = new ArrayList<>();
 
         FuzzyJoinMemory fj = new FuzzyJoinMemory(similarityThreshold);
 
@@ -79,38 +78,32 @@ public class FuzzyJoinMemory {
         }
     }
 
-    public static void readRecords(String fileName, List<int[]> records, List<Integer>
rids) {
-        LittleEndianIntInputStream in;
-        try {
-            in = new LittleEndianIntInputStream(new BufferedInputStream(new FileInputStream(fileName)));
-        } catch (FileNotFoundException e) {
-            throw new RuntimeException(e);
-        }
-
-        while (true) {
-            int rid = 0;
-            try {
-                rid = in.readInt();
-            } catch (IOException e) {
-                // FILE_EXPECTED reach of EOF
-                break;
-            }
+    @SuppressWarnings("squid:S1166") // Either log or rethrow this exception
+    public static void readRecords(String fileName, List<int[]> records, List<Integer>
rids) throws IOException {
+        try (LittleEndianIntInputStream in =
+                     new LittleEndianIntInputStream(new BufferedInputStream(new FileInputStream(fileName))))
{
+
+            while (true) {
+                int rid = 0;
+                try {
+                    rid = in.readInt();
+                } catch (IOException e) {
+                    // FILE_EXPECTED reach of EOF
+                    break;
+                }
 
-            rids.add(rid);
-            int[] record;
+                rids.add(rid);
+                int[] record;
 
-            try {
                 int size = in.readInt();
                 record = new int[size];
                 for (int j = 0; j < size; j++) {
                     int token = in.readInt();
                     record[j] = token;
                 }
-            } catch (IOException e) {
-                throw new RuntimeException(e);
-            }
 
-            records.add(record);
+                records.add(record);
+            }
         }
     }
 
@@ -122,7 +115,7 @@ public class FuzzyJoinMemory {
     public FuzzyJoinMemory(float similarityThreshold) {
         invertedLists = new InvertedListsLengthList();
         similarityFilters = new SimilarityFiltersJaccard(similarityThreshold);
-        records = new ArrayList<int[]>();
+        records = new ArrayList<>();
     }
 
     public void add(final int[] tokens) {
@@ -142,7 +135,7 @@ public class FuzzyJoinMemory {
         //
         // self join
         //
-        final HashMap<Integer, Integer> counts = new HashMap<Integer, Integer>();
+        final HashMap<Integer, Integer> counts = new HashMap<>();
         for (int indexToken = 0; indexToken < Math.min(prefixLength, tokens.length); indexToken++)
{
             final int token = tokens[indexToken];
             //
@@ -182,7 +175,7 @@ public class FuzzyJoinMemory {
         //
         // verify candidates
         //
-        ArrayList<ResultJoin> results = new ArrayList<ResultJoin>();
+        ArrayList<ResultJoin> results = new ArrayList<>();
         for (Map.Entry<Integer, Integer> cand : counts.entrySet()) {
             int count = cand.getValue();
             int indexProbe = cand.getKey();
@@ -205,12 +198,12 @@ public class FuzzyJoinMemory {
 
     public List<ResultSelfJoin> runs(Collection<int[]> records, int noRuns, int
warmupFactor) {
         if (records.size() < 2) {
-            return new ArrayList<ResultSelfJoin>();
+            return new ArrayList<>();
         }
 
         int noRunsTotal = noRuns * warmupFactor;
         float runtime = 0, runtimeAverage = 0;
-        ArrayList<ResultSelfJoin> results = new ArrayList<ResultSelfJoin>();
+        ArrayList<ResultSelfJoin> results = new ArrayList<>();
 
         System.err.println("# Records: " + records.size());
         System.err.print("=== BEGIN JOIN (TIMER STARTED) === ");
@@ -249,7 +242,7 @@ public class FuzzyJoinMemory {
         //
         // self join
         //
-        final HashMap<Integer, Integer> counts = new HashMap<Integer, Integer>();
+        final HashMap<Integer, Integer> counts = new HashMap<>();
         for (int indexToken = 0; indexToken < prefixLength; indexToken++) {
             final int token = tokens[indexToken];
             //
@@ -299,7 +292,7 @@ public class FuzzyJoinMemory {
         //
         // verify candidates
         //
-        ArrayList<ResultSelfJoin> results = new ArrayList<ResultSelfJoin>();
+        ArrayList<ResultSelfJoin> results = new ArrayList<>();
         for (Map.Entry<Integer, Integer> cand : counts.entrySet()) {
             int count = cand.getValue();
             int indexProbe = cand.getKey();

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/018ba9db/asterixdb/asterix-fuzzyjoin/src/main/java/org/apache/asterix/fuzzyjoin/recordgroup/RecordGroupLengthCount.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-fuzzyjoin/src/main/java/org/apache/asterix/fuzzyjoin/recordgroup/RecordGroupLengthCount.java
b/asterixdb/asterix-fuzzyjoin/src/main/java/org/apache/asterix/fuzzyjoin/recordgroup/RecordGroupLengthCount.java
index 5cd7994..0095d14 100644
--- a/asterixdb/asterix-fuzzyjoin/src/main/java/org/apache/asterix/fuzzyjoin/recordgroup/RecordGroupLengthCount.java
+++ b/asterixdb/asterix-fuzzyjoin/src/main/java/org/apache/asterix/fuzzyjoin/recordgroup/RecordGroupLengthCount.java
@@ -38,8 +38,7 @@ public class RecordGroupLengthCount extends RecordGroup {
         int sum = 0;
         int range = 0;
 
-        try {
-            DataInputStream in = new DataInputStream(new FileInputStream(lengthstatsPath.toString()));
+        try (DataInputStream in = new DataInputStream(new FileInputStream(lengthstatsPath)))
{
             min = in.readInt();
             max = in.readInt();
             range = max - min + 1;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/018ba9db/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADouble.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADouble.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADouble.java
index 3817160..4746773 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADouble.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADouble.java
@@ -53,7 +53,7 @@ public class ADouble implements IAObject {
     public boolean equals(Object obj) {
         if (!(obj instanceof ADouble))
             return false;
-        return value == (((ADouble) obj).getDoubleValue());
+        return Double.doubleToLongBits(value) == Double.doubleToLongBits(((ADouble) obj).getDoubleValue());
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/018ba9db/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AFloat.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AFloat.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AFloat.java
index d73ab48..50d1825 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AFloat.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AFloat.java
@@ -48,7 +48,7 @@ public class AFloat implements IAObject {
         if (!(o instanceof AFloat)) {
             return false;
         } else {
-            return value == (((AFloat) o).getFloatValue());
+            return Float.floatToIntBits(value) == Float.floatToIntBits(((AFloat) o).getFloatValue());
         }
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/018ba9db/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/AbstractComplexType.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/AbstractComplexType.java
b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/AbstractComplexType.java
index 9eddd7f..f8b1d60 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/AbstractComplexType.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/AbstractComplexType.java
@@ -42,7 +42,7 @@ public abstract class AbstractComplexType implements IAType {
 
     @Override
     public boolean equals(Object object) {
-        return this.deepEqual((IAObject) object);
+        return object instanceof IAObject && deepEqual((IAObject) object);
     }
 
     public abstract boolean containsType(IAType type);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/018ba9db/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/BuiltinType.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/BuiltinType.java
b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/BuiltinType.java
index f556de5..809578b 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/BuiltinType.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/BuiltinType.java
@@ -863,7 +863,7 @@ public abstract class BuiltinType implements IAType {
 
     @Override
     public boolean equals(Object object) {
-        return this.deepEqual((IAObject) object);
+        return object instanceof IAObject && deepEqual((IAObject) object);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/018ba9db/asterixdb/asterix-replication/src/main/java/org/apache/asterix/replication/management/ReplicaStateChecker.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-replication/src/main/java/org/apache/asterix/replication/management/ReplicaStateChecker.java
b/asterixdb/asterix-replication/src/main/java/org/apache/asterix/replication/management/ReplicaStateChecker.java
index 0c94c61..de287e0 100644
--- a/asterixdb/asterix-replication/src/main/java/org/apache/asterix/replication/management/ReplicaStateChecker.java
+++ b/asterixdb/asterix-replication/src/main/java/org/apache/asterix/replication/management/ReplicaStateChecker.java
@@ -54,11 +54,9 @@ public class ReplicaStateChecker implements Callable<Void> {
 
         long startTime = System.currentTimeMillis();
         InetSocketAddress replicaAddress = replica.getAddress(asterixReplicationProperties);
-        SocketChannel connection = null;
 
         while (true) {
-            try {
-                connection = SocketChannel.open();
+            try (SocketChannel connection = SocketChannel.open()) {
                 connection.configureBlocking(true);
                 connection.connect(new InetSocketAddress(replicaAddress.getHostString(),
replicaAddress.getPort()));
                 ByteBuffer buffer = ReplicationProtocol.getGoodbyeBuffer();
@@ -72,12 +70,6 @@ public class ReplicaStateChecker implements Callable<Void> {
                 if (((System.currentTimeMillis() - startTime) / 1000) >= replicationTimeOut)
{
                     replicationManager.updateReplicaState(replica.getId(), ReplicaState.DEAD,
suspendReplication);
                     return null;
-                } else {
-                    continue;
-                }
-            } finally {
-                if (connection.isOpen()) {
-                    connection.close();
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/018ba9db/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/HyracksConnection.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/HyracksConnection.java
b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/HyracksConnection.java
index b57442d..3f1ced6 100644
--- a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/HyracksConnection.java
+++ b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/HyracksConnection.java
@@ -28,11 +28,10 @@ import java.util.Map;
 import java.util.UUID;
 
 import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
 import org.apache.http.client.methods.HttpPut;
 import org.apache.http.entity.FileEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.DefaultHttpClient;
-
 import org.apache.hyracks.api.client.impl.JobSpecificationActivityClusterGraphGeneratorFactory;
 import org.apache.hyracks.api.comm.NetworkAddress;
 import org.apache.hyracks.api.deployment.DeploymentId;
@@ -130,27 +129,29 @@ public final class HyracksConnection implements IHyracksClientConnection
{
     public DeploymentId deployBinary(List<String> jars) throws Exception {
         /** generate a deployment id */
         DeploymentId deploymentId = new DeploymentId(UUID.randomUUID().toString());
-        List<URL> binaryURLs = new ArrayList<URL>();
-        if (jars != null && jars.size() > 0) {
-            HttpClient hc = new DefaultHttpClient();
-            /** upload jars through a http client one-by-one to the CC server */
-            for (String jar : jars) {
-                int slashIndex = jar.lastIndexOf('/');
-                String fileName = jar.substring(slashIndex + 1);
-                String url = "http://" + ccHost + ":" + ccInfo.getWebPort() + "/applications/"
-                        + deploymentId.toString() + "&" + fileName;
-                HttpPut put = new HttpPut(url);
-                put.setEntity(new FileEntity(new File(jar), "application/octet-stream"));
-                HttpResponse response = hc.execute(put);
-                if (response != null) {
+        List<URL> binaryURLs = new ArrayList<>();
+        if (jars != null && !jars.isEmpty()) {
+            CloseableHttpClient hc = new DefaultHttpClient();
+            try {
+                /** upload jars through a http client one-by-one to the CC server */
+                for (String jar : jars) {
+                    int slashIndex = jar.lastIndexOf('/');
+                    String fileName = jar.substring(slashIndex + 1);
+                    String url = "http://" + ccHost + ":" + ccInfo.getWebPort() + "/applications/"
+                            + deploymentId.toString() + "&" + fileName;
+                    HttpPut put = new HttpPut(url);
+                    put.setEntity(new FileEntity(new File(jar), "application/octet-stream"));
+                    HttpResponse response = hc.execute(put);
                     response.getEntity().consumeContent();
+                    if (response.getStatusLine().getStatusCode() != 200) {
+                        hci.unDeployBinary(deploymentId);
+                        throw new HyracksException(response.getStatusLine().toString());
+                    }
+                    /** add the uploaded URL address into the URLs of jars to be deployed
at NCs */
+                    binaryURLs.add(new URL(url));
                 }
-                if (response.getStatusLine().getStatusCode() != 200) {
-                    hci.unDeployBinary(deploymentId);
-                    throw new HyracksException(response.getStatusLine().toString());
-                }
-                /** add the uploaded URL address into the URLs of jars to be deployed at
NCs */
-                binaryURLs.add(new URL(url));
+            } finally {
+                hc.close();
             }
         }
         /** deploy the URLs to the CC and NCs */

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/018ba9db/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/dataset/DatasetDirectoryService.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/dataset/DatasetDirectoryService.java
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/dataset/DatasetDirectoryService.java
index 5d45920..c3c41a4 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/dataset/DatasetDirectoryService.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/dataset/DatasetDirectoryService.java
@@ -200,7 +200,7 @@ public class DatasetDirectoryService implements IDatasetDirectoryService
{
 
     @Override
     public void deinitState(JobId jobId) {
-        jobResultLocations.remove(jobResultLocations.get(jobId));
+        jobResultLocations.remove(jobId);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/018ba9db/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/TriggerNCWork.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/TriggerNCWork.java
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/TriggerNCWork.java
index 7d2ff25..9a52a06 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/TriggerNCWork.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/TriggerNCWork.java
@@ -18,10 +18,6 @@
  */
 package org.apache.hyracks.control.cc.work;
 
-import org.apache.hyracks.control.cc.ClusterControllerService;
-import org.apache.hyracks.control.common.work.AbstractWork;
-import org.ini4j.Ini;
-
 import java.io.IOException;
 import java.io.ObjectOutputStream;
 import java.io.StringWriter;
@@ -29,6 +25,10 @@ import java.net.Socket;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import org.apache.hyracks.control.cc.ClusterControllerService;
+import org.apache.hyracks.control.common.work.AbstractWork;
+import org.ini4j.Ini;
+
 /**
  * A work which is run at CC startup for each NC specified in the configuration file.
  * It contacts the NC service on each node and passes in the NC-specific configuration.
@@ -57,13 +57,13 @@ public class TriggerNCWork extends AbstractWork {
     public final void run() {
         ccs.getExecutor().execute(new Runnable() {
             @Override
+            @SuppressWarnings("squid:S2142") // suppress interrupted exception warning
             public void run() {
                 while (true) {
-                    try {
-                        if (LOGGER.isLoggable(Level.INFO)) {
-                            LOGGER.info("Connecting NC service '" + ncId + "' at " + ncHost
+ ":" + ncPort);
-                        }
-                        Socket s = new Socket(ncHost, ncPort);
+                    if (LOGGER.isLoggable(Level.INFO)) {
+                        LOGGER.info("Connecting NC service '" + ncId + "' at " + ncHost +
":" + ncPort);
+                    }
+                    try (Socket s = new Socket(ncHost, ncPort)) {
                         ObjectOutputStream oos = new ObjectOutputStream(s.getOutputStream());
                         oos.writeUTF(NC_MAGIC_COOKIE);
                         oos.writeUTF(serializeIni(ccs.getCCConfig().getIni()));

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/018ba9db/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/dataset/ResultStateSweeper.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/dataset/ResultStateSweeper.java
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/dataset/ResultStateSweeper.java
index ba71b0c..d17858b 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/dataset/ResultStateSweeper.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/dataset/ResultStateSweeper.java
@@ -49,14 +49,14 @@ public class ResultStateSweeper implements Runnable {
     }
 
     @Override
+    @SuppressWarnings("squid:S2142") // catch interrupted exception
     public void run() {
         while (true) {
             try {
                 Thread.sleep(resultSweepThreshold);
                 sweep();
             } catch (InterruptedException e) {
-                LOGGER.severe("Result cleaner thread interrupted, but we continue running
it.");
-                // There isn't much we can do really here
+                LOGGER.severe("Result cleaner thread interrupted, shutting down.");
                 break; // the interrupt was explicit from another thread. This thread should
shut down...
             }
         }


Mime
View raw message