asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From buyin...@apache.org
Subject asterixdb git commit: Miscellaneous minor cleanups.
Date Sat, 10 Jun 2017 03:28:15 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master 788383d5e -> 486c4cdd2


Miscellaneous minor cleanups.

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


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

Branch: refs/heads/master
Commit: 486c4cdd2a8d1725627ac3ddcdb35fcae5db9bcc
Parents: 788383d
Author: Yingyi Bu <yingyi@couchbase.com>
Authored: Thu Jun 8 16:30:37 2017 -0700
Committer: Yingyi Bu <buyingyi@gmail.com>
Committed: Fri Jun 9 20:27:55 2017 -0700

----------------------------------------------------------------------
 .../rewriter/ActivityClusterGraphRewriter.java  | 25 ++++++++++----------
 .../api/rewriter/runtime/SuperActivity.java     |  3 +--
 .../std/base/AbstractOperatorDescriptor.java    |  5 ++--
 .../result/ResultWriterOperatorDescriptor.java  |  1 -
 4 files changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/486c4cdd/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/rewriter/ActivityClusterGraphRewriter.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/rewriter/ActivityClusterGraphRewriter.java
b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/rewriter/ActivityClusterGraphRewriter.java
index 38e7fbe..20f128d 100644
--- a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/rewriter/ActivityClusterGraphRewriter.java
+++ b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/rewriter/ActivityClusterGraphRewriter.java
@@ -50,7 +50,8 @@ import org.apache.hyracks.api.rewriter.runtime.SuperActivity;
  * @author yingyib
  */
 public class ActivityClusterGraphRewriter {
-    private static String ONE_TO_ONE_CONNECTOR = "org.apache.hyracks.dataflow.std.connectors.OneToOneConnectorDescriptor";
+    private static final String ONE_TO_ONE_CONNECTOR = "org.apache.hyracks.dataflow.std.connectors."
+            + "OneToOneConnectorDescriptor";
 
     /**
      * rewrite an activity cluster graph to eliminate
@@ -63,7 +64,7 @@ public class ActivityClusterGraphRewriter {
     public void rewrite(ActivityClusterGraph acg) {
         acg.getActivityMap().clear();
         acg.getConnectorMap().clear();
-        Map<IActivity, SuperActivity> invertedActivitySuperActivityMap = new HashMap<IActivity,
SuperActivity>();
+        Map<IActivity, SuperActivity> invertedActivitySuperActivityMap = new HashMap<>();
         for (Entry<ActivityClusterId, ActivityCluster> entry : acg.getActivityClusterMap().entrySet())
{
             rewriteIntraActivityCluster(entry.getValue(), invertedActivitySuperActivityMap);
         }
@@ -82,18 +83,18 @@ public class ActivityClusterGraphRewriter {
     private void rewriteInterActivityCluster(ActivityCluster ac,
             Map<IActivity, SuperActivity> invertedActivitySuperActivityMap) {
         Map<ActivityId, Set<ActivityId>> blocked2BlockerMap = ac.getBlocked2BlockerMap();
-        Map<ActivityId, ActivityId> invertedAid2SuperAidMap = new HashMap<ActivityId,
ActivityId>();
+        Map<ActivityId, ActivityId> invertedAid2SuperAidMap = new HashMap<>();
         for (Entry<IActivity, SuperActivity> entry : invertedActivitySuperActivityMap.entrySet())
{
             invertedAid2SuperAidMap.put(entry.getKey().getActivityId(), entry.getValue().getActivityId());
         }
-        Map<ActivityId, Set<ActivityId>> replacedBlocked2BlockerMap = new HashMap<ActivityId,
Set<ActivityId>>();
+        Map<ActivityId, Set<ActivityId>> replacedBlocked2BlockerMap = new HashMap<>();
         for (Entry<ActivityId, Set<ActivityId>> entry : blocked2BlockerMap.entrySet())
{
             ActivityId blocked = entry.getKey();
             ActivityId replacedBlocked = invertedAid2SuperAidMap.get(blocked);
             Set<ActivityId> blockers = entry.getValue();
             Set<ActivityId> replacedBlockers = null;
             if (blockers != null) {
-                replacedBlockers = new HashSet<ActivityId>();
+                replacedBlockers = new HashSet<>();
                 for (ActivityId blocker : blockers) {
                     replacedBlockers.add(invertedAid2SuperAidMap.get(blocker));
                     ActivityCluster dependingAc = ac.getActivityClusterGraph().getActivityMap()
@@ -131,9 +132,9 @@ public class ActivityClusterGraphRewriter {
         Map<ConnectorDescriptorId, Pair<Pair<IActivity, Integer>, Pair<IActivity,
Integer>>> connectorActivityMap = ac
                 .getConnectorActivityMap();
         ActivityClusterGraph acg = ac.getActivityClusterGraph();
-        Map<ActivityId, IActivity> startActivities = new HashMap<ActivityId, IActivity>();
-        Map<ActivityId, SuperActivity> superActivities = new HashMap<ActivityId,
SuperActivity>();
-        Map<ActivityId, Queue<IActivity>> toBeExpendedMap = new HashMap<ActivityId,
Queue<IActivity>>();
+        Map<ActivityId, IActivity> startActivities = new HashMap<>();
+        Map<ActivityId, SuperActivity> superActivities = new HashMap<>();
+        Map<ActivityId, Queue<IActivity>> toBeExpendedMap = new HashMap<>();
 
         /**
          * Build the initial super activities
@@ -234,8 +235,8 @@ public class ActivityClusterGraphRewriter {
 
         Map<ConnectorDescriptorId, IConnectorDescriptor> connMap = ac.getConnectorMap();
         Map<ConnectorDescriptorId, RecordDescriptor> connRecordDesc = ac.getConnectorRecordDescriptorMap();
-        Map<SuperActivity, Integer> superActivityProducerPort = new HashMap<SuperActivity,
Integer>();
-        Map<SuperActivity, Integer> superActivityConsumerPort = new HashMap<SuperActivity,
Integer>();
+        Map<SuperActivity, Integer> superActivityProducerPort = new HashMap<>();
+        Map<SuperActivity, Integer> superActivityConsumerPort = new HashMap<>();
         for (Entry<ActivityId, SuperActivity> entry : superActivities.entrySet()) {
             superActivityProducerPort.put(entry.getValue(), 0);
             superActivityConsumerPort.put(entry.getValue(), 0);
@@ -305,7 +306,7 @@ public class ActivityClusterGraphRewriter {
          */
         for (Entry<ActivityId, SuperActivity> entry : superActivities.entrySet()) {
             List<IConnectorDescriptor> connIds = newActivityCluster.getActivityOutputMap().get(entry.getKey());
-            if (connIds == null || connIds.size() == 0) {
+            if (connIds == null || connIds.isEmpty()) {
                 newActivityCluster.addRoot(entry.getValue());
             }
         }
@@ -343,7 +344,7 @@ public class ActivityClusterGraphRewriter {
         SuperActivity superActivity = new SuperActivity(acg.getActivityClusterGraph(), acg.getId(),
activityId);
         superActivities.put(activityId, superActivity);
         superActivity.addActivity(activity);
-        Queue<IActivity> toBeExpended = new LinkedList<IActivity>();
+        Queue<IActivity> toBeExpended = new LinkedList<>();
         toBeExpended.add(activity);
         toBeExpendedMap.put(activityId, toBeExpended);
         invertedActivitySuperActivityMap.put(activity, superActivity);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/486c4cdd/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/rewriter/runtime/SuperActivity.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/rewriter/runtime/SuperActivity.java
b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/rewriter/runtime/SuperActivity.java
index 28e098f..476a744 100644
--- a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/rewriter/runtime/SuperActivity.java
+++ b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/rewriter/runtime/SuperActivity.java
@@ -25,7 +25,6 @@ import java.util.Map;
 import java.util.Map.Entry;
 
 import org.apache.commons.lang3.tuple.Pair;
-
 import org.apache.hyracks.api.context.IHyracksTaskContext;
 import org.apache.hyracks.api.dataflow.ActivityId;
 import org.apache.hyracks.api.dataflow.IActivity;
@@ -58,7 +57,7 @@ public class SuperActivity extends OneToOneConnectedActivityCluster implements
I
     public IOperatorNodePushable createPushRuntime(IHyracksTaskContext ctx,
             final IRecordDescriptorProvider recordDescProvider, final int partition, final
int nPartitions)
             throws HyracksDataException {
-        final Map<ActivityId, IActivity> startActivities = new HashMap<ActivityId,
IActivity>();
+        final Map<ActivityId, IActivity> startActivities = new HashMap<>();
         Map<ActivityId, IActivity> activities = getActivityMap();
         for (Entry<ActivityId, IActivity> entry : activities.entrySet()) {
             /**

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/486c4cdd/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/base/AbstractOperatorDescriptor.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/base/AbstractOperatorDescriptor.java
b/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/base/AbstractOperatorDescriptor.java
index a83273a..e338961 100644
--- a/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/base/AbstractOperatorDescriptor.java
+++ b/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/base/AbstractOperatorDescriptor.java
@@ -18,8 +18,6 @@
  */
 package org.apache.hyracks.dataflow.std.base;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
 import org.apache.hyracks.api.application.ICCServiceContext;
 import org.apache.hyracks.api.constraints.IConstraintAcceptor;
 import org.apache.hyracks.api.dataflow.IOperatorDescriptor;
@@ -27,6 +25,9 @@ import org.apache.hyracks.api.dataflow.OperatorDescriptorId;
 import org.apache.hyracks.api.dataflow.value.RecordDescriptor;
 import org.apache.hyracks.api.job.IOperatorDescriptorRegistry;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
 public abstract class AbstractOperatorDescriptor implements IOperatorDescriptor {
     private static final long serialVersionUID = 1L;
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/486c4cdd/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/result/ResultWriterOperatorDescriptor.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/result/ResultWriterOperatorDescriptor.java
b/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/result/ResultWriterOperatorDescriptor.java
index f1a777b..d3120bb 100644
--- a/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/result/ResultWriterOperatorDescriptor.java
+++ b/hyracks-fullstack/hyracks/hyracks-dataflow-std/src/main/java/org/apache/hyracks/dataflow/std/result/ResultWriterOperatorDescriptor.java
@@ -21,7 +21,6 @@ package org.apache.hyracks.dataflow.std.result;
 import java.io.IOException;
 import java.io.PrintStream;
 import java.nio.ByteBuffer;
-import java.util.logging.Logger;
 
 import org.apache.hyracks.api.comm.IFrame;
 import org.apache.hyracks.api.comm.IFrameWriter;


Mime
View raw message