tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hyun...@apache.org
Subject [1/2] tajo git commit: TAJO-1909: Eliminate remained explicit diamond expressions.
Date Thu, 08 Oct 2015 22:21:42 GMT
Repository: tajo
Updated Branches:
  refs/heads/master ccca8c687 -> 5d470bc60


http://git-wip-us.apache.org/repos/asf/tajo/blob/5d470bc6/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/rules/PartitionedTableRewriter.java
----------------------------------------------------------------------
diff --git a/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/rules/PartitionedTableRewriter.java
b/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/rules/PartitionedTableRewriter.java
index fc0b1bb..cf54f7b 100644
--- a/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/rules/PartitionedTableRewriter.java
+++ b/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/rules/PartitionedTableRewriter.java
@@ -80,7 +80,7 @@ public class PartitionedTableRewriter implements LogicalPlanRewriteRule
{
     LogicalPlan plan = context.getPlan();
     LogicalPlan.QueryBlock rootBlock = plan.getRootBlock();
     this.catalog = context.getCatalog();
-    rewriter.visit(context.getQueryContext(), plan, rootBlock, rootBlock.getRoot(), new Stack<LogicalNode>());
+    rewriter.visit(context.getQueryContext(), plan, rootBlock, rootBlock.getRoot(), new Stack<>());
     return plan;
   }
 
@@ -237,7 +237,7 @@ public class PartitionedTableRewriter implements LogicalPlanRewriteRule
{
     if (conjunctiveForms != null) {
       EvalNode evalNode = AlgebraicUtil.createSingletonExprFromCNF(conjunctiveForms);
       EvalNodeToExprConverter convertor = new EvalNodeToExprConverter(databaseName + "."
+ tableName);
-      convertor.visit(null, evalNode, new Stack<EvalNode>());
+      convertor.visit(null, evalNode, new Stack<>());
       request.setAlgebra(convertor.getResult().toJson());
     } else {
       request.setAlgebra("");

http://git-wip-us.apache.org/repos/asf/tajo/blob/5d470bc6/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/rules/ProjectionPushDownRule.java
----------------------------------------------------------------------
diff --git a/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/rules/ProjectionPushDownRule.java
b/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/rules/ProjectionPushDownRule.java
index abfc7a9..1d32376 100644
--- a/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/rules/ProjectionPushDownRule.java
+++ b/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/rules/ProjectionPushDownRule.java
@@ -1059,8 +1059,8 @@ public class ProjectionPushDownRule extends
         rightBlock.getName()));
 
     stack.push(node);
-    visit(leftContext, plan, leftBlock, leftBlock.getRoot(), new Stack<LogicalNode>());
-    visit(rightContext, plan, rightBlock, rightBlock.getRoot(), new Stack<LogicalNode>());
+    visit(leftContext, plan, leftBlock, leftBlock.getRoot(), new Stack<>());
+    visit(rightContext, plan, rightBlock, rightBlock.getRoot(), new Stack<>());
     stack.pop();
     return node;
   }

http://git-wip-us.apache.org/repos/asf/tajo/blob/5d470bc6/tajo-plan/src/main/java/org/apache/tajo/plan/serder/EvalNodeSerializer.java
----------------------------------------------------------------------
diff --git a/tajo-plan/src/main/java/org/apache/tajo/plan/serder/EvalNodeSerializer.java b/tajo-plan/src/main/java/org/apache/tajo/plan/serder/EvalNodeSerializer.java
index fef1528..3532b37 100644
--- a/tajo-plan/src/main/java/org/apache/tajo/plan/serder/EvalNodeSerializer.java
+++ b/tajo-plan/src/main/java/org/apache/tajo/plan/serder/EvalNodeSerializer.java
@@ -59,7 +59,7 @@ public class EvalNodeSerializer
   public static PlanProto.EvalNodeTree serialize(EvalNode evalNode) {
     EvalNodeSerializer.EvalTreeProtoBuilderContext context =
         new EvalNodeSerializer.EvalTreeProtoBuilderContext();
-    instance.visit(context, evalNode, new Stack<EvalNode>());
+    instance.visit(context, evalNode, new Stack<>());
     return context.treeBuilder.build();
   }
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/5d470bc6/tajo-plan/src/main/java/org/apache/tajo/plan/serder/LogicalNodeSerializer.java
----------------------------------------------------------------------
diff --git a/tajo-plan/src/main/java/org/apache/tajo/plan/serder/LogicalNodeSerializer.java
b/tajo-plan/src/main/java/org/apache/tajo/plan/serder/LogicalNodeSerializer.java
index 3cf7d9e..7907668 100644
--- a/tajo-plan/src/main/java/org/apache/tajo/plan/serder/LogicalNodeSerializer.java
+++ b/tajo-plan/src/main/java/org/apache/tajo/plan/serder/LogicalNodeSerializer.java
@@ -71,7 +71,7 @@ public class LogicalNodeSerializer extends BasicLogicalPlanVisitor<LogicalNodeSe
   public static LogicalNodeTree serialize(LogicalNode node) {
     SerializeContext context = new SerializeContext();
     try {
-      instance.visit(context, null, null, node, new Stack<LogicalNode>());
+      instance.visit(context, null, null, node, new Stack<>());
     } catch (TajoException e) {
       throw new TajoInternalError(e);
     }
@@ -273,7 +273,7 @@ public class LogicalNodeSerializer extends BasicLogicalPlanVisitor<LogicalNodeSe
   @Override
   public LogicalNode visitGroupBy(SerializeContext context, LogicalPlan plan, LogicalPlan.QueryBlock
block,
                                   GroupbyNode node, Stack<LogicalNode> stack) throws
TajoException {
-    super.visitGroupBy(context, plan, block, node, new Stack<LogicalNode>());
+    super.visitGroupBy(context, plan, block, node, new Stack<>());
 
     PlanProto.LogicalNode.Builder nodeBuilder = buildGroupby(context, node);
     context.treeBuilder.addNodes(nodeBuilder);
@@ -309,7 +309,7 @@ public class LogicalNodeSerializer extends BasicLogicalPlanVisitor<LogicalNodeSe
   @Override
   public LogicalNode visitDistinctGroupby(SerializeContext context, LogicalPlan plan, LogicalPlan.QueryBlock
block,
                                           DistinctGroupbyNode node, Stack<LogicalNode>
stack) throws TajoException {
-    super.visitDistinctGroupby(context, plan, block, node, new Stack<LogicalNode>());
+    super.visitDistinctGroupby(context, plan, block, node, new Stack<>());
 
     int [] childIds = registerGetChildIds(context, node);
 
@@ -757,7 +757,7 @@ public class LogicalNodeSerializer extends BasicLogicalPlanVisitor<LogicalNodeSe
   @Override
   public LogicalNode visitCreateIndex(SerializeContext context, LogicalPlan plan, LogicalPlan.QueryBlock
block,
                                       CreateIndexNode node, Stack<LogicalNode> stack)
throws TajoException {
-    super.visitCreateIndex(context, plan, block, node, new Stack<LogicalNode>());
+    super.visitCreateIndex(context, plan, block, node, new Stack<>());
 
     PlanProto.CreateIndexNode.Builder createIndexBuilder = PlanProto.CreateIndexNode.newBuilder();
     int [] childIds = registerGetChildIds(context, node);

http://git-wip-us.apache.org/repos/asf/tajo/blob/5d470bc6/tajo-plan/src/main/java/org/apache/tajo/plan/util/EvalNodeToExprConverter.java
----------------------------------------------------------------------
diff --git a/tajo-plan/src/main/java/org/apache/tajo/plan/util/EvalNodeToExprConverter.java
b/tajo-plan/src/main/java/org/apache/tajo/plan/util/EvalNodeToExprConverter.java
index c656671..139bcc0 100644
--- a/tajo-plan/src/main/java/org/apache/tajo/plan/util/EvalNodeToExprConverter.java
+++ b/tajo-plan/src/main/java/org/apache/tajo/plan/util/EvalNodeToExprConverter.java
@@ -32,7 +32,7 @@ import java.util.Stack;
  *
  */
 public class EvalNodeToExprConverter extends SimpleEvalNodeVisitor<Object> {
-  private Stack<Expr> exprs = new Stack<Expr>();
+  private Stack<Expr> exprs = new Stack<>();
 
   private String tableName;
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/5d470bc6/tajo-plan/src/main/java/org/apache/tajo/plan/util/PlannerUtil.java
----------------------------------------------------------------------
diff --git a/tajo-plan/src/main/java/org/apache/tajo/plan/util/PlannerUtil.java b/tajo-plan/src/main/java/org/apache/tajo/plan/util/PlannerUtil.java
index e91375a..507ae8b 100644
--- a/tajo-plan/src/main/java/org/apache/tajo/plan/util/PlannerUtil.java
+++ b/tajo-plan/src/main/java/org/apache/tajo/plan/util/PlannerUtil.java
@@ -200,7 +200,7 @@ public class PlannerUtil {
 
   public static String getTopRelationInLineage(LogicalPlan plan, LogicalNode from) throws
TajoException {
     RelationFinderVisitor visitor = new RelationFinderVisitor(true);
-    visitor.visit(null, plan, null, from, new Stack<LogicalNode>());
+    visitor.visit(null, plan, null, from, new Stack<>());
     if (visitor.getFoundRelations().isEmpty()) {
       return null;
     } else {
@@ -276,7 +276,7 @@ public class PlannerUtil {
   public static void replaceNode(LogicalPlan plan, LogicalNode startNode, LogicalNode oldNode,
LogicalNode newNode) {
     LogicalNodeReplaceVisitor replacer = new LogicalNodeReplaceVisitor(oldNode, newNode);
     try {
-      replacer.visit(new ReplacerContext(), plan, null, startNode, new Stack<LogicalNode>());
+      replacer.visit(new ReplacerContext(), plan, null, startNode, new Stack<>());
     } catch (TajoException e) {
       throw new TajoInternalError(e);
     }
@@ -731,14 +731,14 @@ public class PlannerUtil {
   public static boolean existsAggregationFunction(Expr expr) throws TajoException {
     AggregationFunctionFinder finder = new AggregationFunctionFinder();
     AggFunctionFoundResult result = new AggFunctionFoundResult();
-    finder.visit(result, new Stack<Expr>(), expr);
+    finder.visit(result, new Stack<>(), expr);
     return result.generalSetFunction;
   }
 
   public static boolean existsDistinctAggregationFunction(Expr expr) throws TajoException
{
     AggregationFunctionFinder finder = new AggregationFunctionFinder();
     AggFunctionFoundResult result = new AggFunctionFoundResult();
-    finder.visit(result, new Stack<Expr>(), expr);
+    finder.visit(result, new Stack<>(), expr);
     return result.distinctSetFunction;
   }
 
@@ -965,7 +965,7 @@ public class PlannerUtil {
 
   public static List<EvalNode> getAllEqualEvals(EvalNode qual) {
     EvalTreeUtil.EvalFinder finder = new EvalTreeUtil.EvalFinder(EvalType.EQUAL);
-    finder.visit(null, qual, new Stack<EvalNode>());
+    finder.visit(null, qual, new Stack<>());
     return finder.getEvalNodes();
   }
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/5d470bc6/tajo-plan/src/main/java/org/apache/tajo/plan/verifier/ExprsVerifier.java
----------------------------------------------------------------------
diff --git a/tajo-plan/src/main/java/org/apache/tajo/plan/verifier/ExprsVerifier.java b/tajo-plan/src/main/java/org/apache/tajo/plan/verifier/ExprsVerifier.java
index 6c6fb1d..a9737e0 100644
--- a/tajo-plan/src/main/java/org/apache/tajo/plan/verifier/ExprsVerifier.java
+++ b/tajo-plan/src/main/java/org/apache/tajo/plan/verifier/ExprsVerifier.java
@@ -47,7 +47,7 @@ public class ExprsVerifier extends BasicEvalNodeVisitor<VerificationState,
EvalN
   }
 
   public static VerificationState verify(VerificationState state, LogicalNode currentNode,
EvalNode expression) {
-    instance.visit(state, expression, new Stack<EvalNode>());
+    instance.visit(state, expression, new Stack<>());
     Set<Column> referredColumns = EvalTreeUtil.findUniqueColumns(expression);
     for (Column referredColumn : referredColumns) {
       if (!currentNode.getInSchema().contains(referredColumn)) {

http://git-wip-us.apache.org/repos/asf/tajo/blob/5d470bc6/tajo-plan/src/main/java/org/apache/tajo/plan/verifier/PreLogicalPlanVerifier.java
----------------------------------------------------------------------
diff --git a/tajo-plan/src/main/java/org/apache/tajo/plan/verifier/PreLogicalPlanVerifier.java
b/tajo-plan/src/main/java/org/apache/tajo/plan/verifier/PreLogicalPlanVerifier.java
index 83c161e..2a50ca4 100644
--- a/tajo-plan/src/main/java/org/apache/tajo/plan/verifier/PreLogicalPlanVerifier.java
+++ b/tajo-plan/src/main/java/org/apache/tajo/plan/verifier/PreLogicalPlanVerifier.java
@@ -59,7 +59,7 @@ public class PreLogicalPlanVerifier extends BaseAlgebraVisitor<PreLogicalPlanVer
   public VerificationState verify(OverridableConf queryContext, VerificationState state,
Expr expr)
       throws TajoException {
     Context context = new Context(queryContext, state);
-    visit(context, new Stack<Expr>(), expr);
+    visit(context, new Stack<>(), expr);
     return context.state;
   }
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/5d470bc6/tajo-plan/src/main/java/org/apache/tajo/plan/visitor/BasicLogicalPlanVisitor.java
----------------------------------------------------------------------
diff --git a/tajo-plan/src/main/java/org/apache/tajo/plan/visitor/BasicLogicalPlanVisitor.java
b/tajo-plan/src/main/java/org/apache/tajo/plan/visitor/BasicLogicalPlanVisitor.java
index 2c8f344..47310e4 100644
--- a/tajo-plan/src/main/java/org/apache/tajo/plan/visitor/BasicLogicalPlanVisitor.java
+++ b/tajo-plan/src/main/java/org/apache/tajo/plan/visitor/BasicLogicalPlanVisitor.java
@@ -45,7 +45,7 @@ public class BasicLogicalPlanVisitor<CONTEXT, RESULT> implements LogicalPlanVisi
 
   public CONTEXT visit(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block)
       throws TajoException {
-    visit(context, plan, block, block.getRoot(), new Stack<LogicalNode>());
+    visit(context, plan, block, block.getRoot(), new Stack<>());
     return context;
   }
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/5d470bc6/tajo-plan/src/main/java/org/apache/tajo/plan/visitor/ExplainLogicalPlanVisitor.java
----------------------------------------------------------------------
diff --git a/tajo-plan/src/main/java/org/apache/tajo/plan/visitor/ExplainLogicalPlanVisitor.java
b/tajo-plan/src/main/java/org/apache/tajo/plan/visitor/ExplainLogicalPlanVisitor.java
index 23ff3dc..bd42588 100644
--- a/tajo-plan/src/main/java/org/apache/tajo/plan/visitor/ExplainLogicalPlanVisitor.java
+++ b/tajo-plan/src/main/java/org/apache/tajo/plan/visitor/ExplainLogicalPlanVisitor.java
@@ -181,7 +181,7 @@ public class ExplainLogicalPlanVisitor extends BasicLogicalPlanVisitor<ExplainLo
                                         TableSubQueryNode node, Stack<LogicalNode>
stack) throws TajoException {
     context.depth++;
     stack.push(node);
-    visit(context, plan, block, node.getSubQuery(), new Stack<LogicalNode>());
+    visit(context, plan, block, node.getSubQuery(), new Stack<>());
     stack.pop();
     context.depth--;
     context.add(context.depth, node.getPlanString());

http://git-wip-us.apache.org/repos/asf/tajo/blob/5d470bc6/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/TablespaceManager.java
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/TablespaceManager.java
b/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/TablespaceManager.java
index 85d5d51..407f865 100644
--- a/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/TablespaceManager.java
+++ b/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/TablespaceManager.java
@@ -185,8 +185,8 @@ public class TablespaceManager implements StorageService {
     JSONObject storageDesc = (JSONObject) entry.getValue();
     String handlerClass = (String) storageDesc.get(KEY_STORAGE_HANDLER);
 
-    return new Pair<String, Class<? extends Tablespace>>(
-        storageType, (Class<? extends Tablespace>) Class.forName(handlerClass));
+    return new Pair<>(
+            storageType, (Class<? extends Tablespace>) Class.forName(handlerClass));
   }
 
   private void loadTableSpaces(JSONObject json, boolean override) {

http://git-wip-us.apache.org/repos/asf/tajo/blob/5d470bc6/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/compress/CodecPool.java
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/compress/CodecPool.java
b/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/compress/CodecPool.java
index 6545e4e..1a636ed 100644
--- a/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/compress/CodecPool.java
+++ b/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/compress/CodecPool.java
@@ -79,7 +79,7 @@ public final class CodecPool {
       Class<T> codecClass = (Class<T>) codec.getClass();
       synchronized (pool) {
         if (!pool.containsKey(codecClass)) {
-          pool.put(codecClass, new ArrayList<T>());
+          pool.put(codecClass, new ArrayList<>());
         }
 
         List<T> codecList = pool.get(codecClass);

http://git-wip-us.apache.org/repos/asf/tajo/blob/5d470bc6/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/HashShuffleAppender.java
----------------------------------------------------------------------
diff --git a/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/HashShuffleAppender.java
b/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/HashShuffleAppender.java
index a1eead2..a82c7ec 100644
--- a/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/HashShuffleAppender.java
+++ b/tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/HashShuffleAppender.java
@@ -102,7 +102,7 @@ public class HashShuffleAppender implements Appender {
         taskTupleIndexes.put(taskId, taskIndexes);
       }
       taskIndexes.add(
-          new Pair<Long, Pair<Integer, Integer>>(currentPage.getFirst(), new
Pair(rowNumInPage, nextRowNum)));
+              new Pair<>(currentPage.getFirst(), new Pair(rowNumInPage, nextRowNum)));
       rowNumInPage = nextRowNum;
 
       if (posAfterWritten - currentPage.getFirst() > pageSize) {

http://git-wip-us.apache.org/repos/asf/tajo/blob/5d470bc6/tajo-thirdparty/asm/src/main/java/org/apache/tajo/org/objectweb/asm/util/CheckMethodAdapter.java
----------------------------------------------------------------------
diff --git a/tajo-thirdparty/asm/src/main/java/org/apache/tajo/org/objectweb/asm/util/CheckMethodAdapter.java
b/tajo-thirdparty/asm/src/main/java/org/apache/tajo/org/objectweb/asm/util/CheckMethodAdapter.java
index 48f1af5..920ac94 100644
--- a/tajo-thirdparty/asm/src/main/java/org/apache/tajo/org/objectweb/asm/util/CheckMethodAdapter.java
+++ b/tajo-thirdparty/asm/src/main/java/org/apache/tajo/org/objectweb/asm/util/CheckMethodAdapter.java
@@ -371,7 +371,7 @@ public class CheckMethodAdapter extends MethodVisitor {
      * {@link #CheckMethodAdapter(int,String,String,MethodVisitor,Map)}).
      * <i>Subclasses must not use this constructor</i>. Instead, they must use
      * the {@link #CheckMethodAdapter(int, MethodVisitor, Map)} version.
-     * 
+     *
      * @param mv
      *            the method visitor to which this adapter must delegate calls.
      */


Mime
View raw message