You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@tajo.apache.org by dkhwangbo <gi...@git.apache.org> on 2015/12/02 08:02:12 UTC

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

GitHub user dkhwangbo opened a pull request:

    https://github.com/apache/tajo/pull/891

    TAJO-1999: TUtil.newList/newLinkedHashMap should be replaced by Java's diamond operator

    We introduced Java 8. We don't need TUtil.newList/newLinkedHashMap utility methods anymore. We need to eliminate them.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dkhwangbo/tajo TAJO-1999

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tajo/pull/891.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #891
    
----

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457452
  
    --- Diff: tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestHBaseTable.java ---
    @@ -1312,7 +1312,9 @@ public void testInsertIntoUsingPut() throws Exception {
         } finally {
           executeString("DROP TABLE hbase_mapped_table PURGE").close();
     
    -      client.unsetSessionVariables(TUtil.newList(HBaseStorageConstants.INSERT_PUT_MODE));
    +      List inputList = new ArrayList<>();
    +      inputList.addAll(Arrays.asList(HBaseStorageConstants.INSERT_PUT_MODE));
    +      client.unsetSessionVariables(inputList);
    --- End diff --
    
    Can be rewritten with a simple Arrays.asList() call.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r48933471
  
    --- Diff: tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/Schema.java ---
    @@ -83,7 +82,7 @@ private static void deserializeColumn(List<Column> tobeAdded, List<ColumnProto>
           // where is start index of nested fields?
           int childStartIndex = tobeAdded.size() - childNum;
           // Extract nested fields
    -      List<Column> nestedColumns = TUtil.newList(tobeAdded.subList(childStartIndex, childStartIndex + childNum));
    +      List<Column> nestedColumns = new ArrayList<>(tobeAdded.subList(childStartIndex, childStartIndex + childNum));
    --- End diff --
    
    Oh, this may be intended. Let's keep it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457276
  
    --- Diff: tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/function/FunctionSignature.java ---
    @@ -109,7 +113,9 @@ public FunctionSignatureProto getProto() {
         FunctionSignatureProto.Builder builder = FunctionSignatureProto.newBuilder();
         builder.setType(functionType);
         builder.setName(name);
    -    builder.addAllParameterTypes(TUtil.newList(paramTypes));
    +    List inputList = new ArrayList<>();
    +    inputList.addAll(Arrays.asList(paramTypes));
    +    builder.addAllParameterTypes(inputList);
    --- End diff --
    
    inputList is redundant. It can be replaced with just ```Arrays.asList(paramTypes)```.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on the pull request:

    https://github.com/apache/tajo/pull/891#issuecomment-169258163
  
    +1. Thanks for your contribution. I'll commit this patch.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457648
  
    --- Diff: tajo-storage/tajo-storage-hdfs/src/test/java/org/apache/tajo/storage/TestMergeScanner.java ---
    @@ -165,7 +167,9 @@ public void testMultipleFiles() throws IOException {
         targetSchema.addColumn(schema.getColumn(0));
         targetSchema.addColumn(schema.getColumn(2));
     
    -    Scanner scanner = new MergeScanner(conf, schema, meta, TUtil.newList(fragment), targetSchema);
    +    List inputList = new ArrayList<>();
    +    inputList.addAll(Arrays.asList(fragment));
    +    Scanner scanner = new MergeScanner(conf, schema, meta, inputList, targetSchema);
    --- End diff --
    
    Can be rewritten with Arrays.asList().


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457505
  
    --- Diff: tajo-core/src/main/java/org/apache/tajo/engine/planner/physical/ExternalSortExec.java ---
    @@ -333,8 +334,9 @@ private int calculateFanout(int remainInputChunks, int inputNum, int outputNum,
     
       private Scanner externalMergeAndSort(List<Chunk> chunks) throws Exception {
         int level = 0;
    -    final List<Chunk> inputFiles = TUtil.newList(chunks);
    -    final List<Chunk> outputFiles = TUtil.newList();
    +    final List<Chunk> inputFiles = new ArrayList<>();
    +    inputFiles.addAll(chunks);
    --- End diff --
    
    Can be rewritten with a single constructor call.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457562
  
    --- Diff: tajo-core/src/main/java/org/apache/tajo/querymaster/Repartitioner.java ---
    @@ -1163,7 +1170,9 @@ public static void scheduleScatteredHashShuffleFetches(TaskSchedulerContext sche
           if (hashed.containsKey(entry.getPartId())) {
             hashed.get(entry.getPartId()).add(entry);
           } else {
    -        hashed.put(entry.getPartId(), TUtil.newList(entry));
    +        List inputList = new ArrayList<>();
    +        inputList.addAll(Arrays.asList(entry));
    +        hashed.put(entry.getPartId(), inputList);
    --- End diff --
    
    Can be rewritten with Arrays.asList().


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457102
  
    --- Diff: tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/Schema.java ---
    @@ -83,7 +84,8 @@ private static void deserializeColumn(List<Column> tobeAdded, List<ColumnProto>
           // where is start index of nested fields?
           int childStartIndex = tobeAdded.size() - childNum;
           // Extract nested fields
    -      List<Column> nestedColumns = TUtil.newList(tobeAdded.subList(childStartIndex, childStartIndex + childNum));
    +      List<Column> nestedColumns = new ArrayList<>();
    +      nestedColumns.addAll(tobeAdded.subList(childStartIndex, childStartIndex + childNum));
    --- End diff --
    
    The above two lines can be merged into a single constructor call.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457568
  
    --- Diff: tajo-plan/src/main/java/org/apache/tajo/plan/ExprAnnotator.java ---
    @@ -596,7 +594,9 @@ public EvalNode visitFunction(Context ctx, Stack<Expr> stack, FunctionExpr expr)
         FunctionDesc funcDesc = catalog.getFunction(expr.getSignature(), paramTypes);
     
         // trying the implicit type conversion between actual parameter types and the definition types.
    -    if (CatalogUtil.checkIfVariableLengthParamDefinition(TUtil.newList(funcDesc.getParamTypes()))) {
    +    List inputList = new ArrayList<>();
    +    inputList.addAll(Arrays.asList(funcDesc.getParamTypes()));
    +    if (CatalogUtil.checkIfVariableLengthParamDefinition(inputList)) {
    --- End diff --
    
    Can be rewritten with Arrays.asList().


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457655
  
    --- Diff: tajo-storage/tajo-storage-jdbc/src/main/java/org/apache/tajo/storage/jdbc/JdbcFragment.java ---
    @@ -89,7 +93,9 @@ public boolean isEmpty() {
         builder.setInputSourceId(this.inputSourceId);
         builder.setUri(this.uri);
         if(hostNames != null) {
    -      builder.addAllHosts(TUtil.newList(hostNames));
    +      List inputList = new ArrayList<>();
    +      inputList.addAll(Arrays.asList(hostNames));
    +      builder.addAllHosts(inputList);
    --- End diff --
    
    Can be rewritten with Arrays.asList().


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457615
  
    --- Diff: tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/rules/ProjectionPushDownRule.java ---
    @@ -795,7 +797,10 @@ public LogicalNode visitGroupBy(Context context, LogicalPlan plan, LogicalPlan.Q
         // Getting projected targets
         if (node.hasAggFunctions() && aggEvalNames != null) {
           List<AggregationFunctionCallEval> aggEvals = new ArrayList<>();
    -      for (Iterator<String> it = getFilteredReferences(aggEvalNames, TUtil.newList(aggEvalNames)); it.hasNext();) {
    +      int i = 0;
    +      List inputList = new ArrayList<>();
    +      inputList.addAll(Arrays.asList(aggEvalNames));
    +      for (Iterator<String> it = getFilteredReferences(aggEvalNames, inputList); it.hasNext();) {
    --- End diff --
    
    Can be rewritten with Arrays.asList().


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r48933481
  
    --- Diff: tajo-cli/src/main/java/org/apache/tajo/cli/tools/TajoDump.java ---
    @@ -169,7 +168,7 @@ private static void dumpDatabase(TajoClient client, String databaseName, PrintWr
         writer.write("\n\n");
     
         // returned list is immutable.
    -    List<String> tableNames = TUtil.newList(client.getTableList(databaseName));
    +    List<String> tableNames = new ArrayList<>(client.getTableList(databaseName));
    --- End diff --
    
    Oh, this may be intended. Let's keep it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457550
  
    --- Diff: tajo-core/src/main/java/org/apache/tajo/querymaster/Repartitioner.java ---
    @@ -987,7 +991,8 @@ public static void scheduleScatteredHashShuffleFetches(TaskSchedulerContext sche
             int partId = eachInterm.getPartId();
             List<IntermediateEntry> partitionInterms = partitionIntermMap.get(partId);
             if (partitionInterms == null) {
    -          partitionInterms = TUtil.newList(eachInterm);
    +          partitionInterms = new ArrayList<>();
    +          partitionInterms.addAll(Arrays.asList(eachInterm));
    --- End diff --
    
    Can be rewritten with a single constructor call.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457496
  
    --- Diff: tajo-core/src/main/java/org/apache/tajo/engine/planner/global/rewriter/rules/BroadcastJoinRule.java ---
    @@ -387,7 +389,8 @@ private long estimateOutputVolumeInternal(LogicalNode node) throws TajoInternalE
          * @param block
          */
         private void checkTotalSizeOfBroadcastableRelations(Context context, ExecutionBlock block) {
    -      List<ScanNode> broadcastCandidates = TUtil.newList(block.getBroadcastRelations());
    +      List<ScanNode> broadcastCandidates = new ArrayList<>();
    +      broadcastCandidates.addAll(block.getBroadcastRelations());
    --- End diff --
    
    Can be rewritten with a single constructor call.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457581
  
    --- Diff: tajo-plan/src/main/java/org/apache/tajo/plan/LogicalPlanner.java ---
    @@ -1191,7 +1191,8 @@ public LogicalNode visitJoin(PlanContext context, Stack<Expr> stack, Join join)
         // In this case, this join is the top most one within a query block.
         boolean isTopMostJoin = stack.isEmpty() ? true : stack.peek().getType() != OpType.Join;
         List<String> newlyEvaluatedExprs = getNewlyEvaluatedExprsForJoin(context, joinNode, isTopMostJoin);
    -    List<Target> targets = TUtil.newList(PlannerUtil.schemaToTargets(merged));
    +    List<Target> targets = new ArrayList<>();
    +    targets.addAll(PlannerUtil.schemaToTargets(merged));
    --- End diff --
    
    Can be rewritten with a single constructor call.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457536
  
    --- Diff: tajo-core/src/main/java/org/apache/tajo/querymaster/Repartitioner.java ---
    @@ -314,12 +314,16 @@ private static void scheduleSymmetricRepartitionJoin(QueryMasterTask.QueryMaster
                 if (tbNameToInterm.containsKey(scanEbId)) {
                   tbNameToInterm.get(scanEbId).add(intermediateEntry);
                 } else {
    -              tbNameToInterm.put(scanEbId, TUtil.newList(intermediateEntry));
    +              List inputList = new ArrayList<>();
    +              inputList.addAll(Arrays.asList(intermediateEntry));
    +              tbNameToInterm.put(scanEbId, inputList);
    --- End diff --
    
    Can be rewritten with Arrays.asList().


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457447
  
    --- Diff: tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java ---
    @@ -58,7 +58,9 @@ public TestGroupByQuery(String groupByOption) throws Exception {
     
       @AfterClass
       public static void tearDown() throws Exception {
    -    client.unsetSessionVariables(TUtil.newList(SessionVars.GROUPBY_MULTI_LEVEL_ENABLED.keyname()));
    +    List inputList = new ArrayList<>();
    +    inputList.addAll(Arrays.asList(SessionVars.GROUPBY_MULTI_LEVEL_ENABLED.keyname()));
    +    client.unsetSessionVariables(inputList);
    --- End diff --
    
    Can be rewritten with a simple Arrays.asList() call.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457467
  
    --- Diff: tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSelectNestedRecord.java ---
    @@ -32,7 +34,9 @@
       @Test
       public final void testSelect0() throws Exception {
         List<String> tables = executeDDL("sample1_ddl.sql", "sample1", "sample1");
    -    assertEquals(TUtil.newList("sample1"), tables);
    +    List inputList = new ArrayList<>();
    --- End diff --
    
    ```inputList```s in this test look not necessary.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457490
  
    --- Diff: tajo-core/src/main/java/org/apache/tajo/engine/planner/global/rewriter/rules/BroadcastJoinRule.java ---
    @@ -143,7 +143,8 @@ public void visit(Object context, Stack<ExecutionBlockId> stack, ExecutionBlockI
             // When every child is a broadcast candidate, enforce non-broadcast for the largest relation for the join to be
             // computed at the node who stores such largest relation.
             if (isFullyBroadcastable(current)) {
    -          List<ScanNode> broadcastCandidates = TUtil.newList(current.getBroadcastRelations());
    +          List<ScanNode> broadcastCandidates = new ArrayList<>();
    +          broadcastCandidates.addAll(current.getBroadcastRelations());
    --- End diff --
    
    Can be rewritten with a single constructor call.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457309
  
    --- Diff: tajo-cli/src/main/java/org/apache/tajo/cli/tools/TajoDump.java ---
    @@ -169,7 +169,8 @@ private static void dumpDatabase(TajoClient client, String databaseName, PrintWr
         writer.write("\n\n");
     
         // returned list is immutable.
    -    List<String> tableNames = TUtil.newList(client.getTableList(databaseName));
    +    List<String> tableNames = new ArrayList<>();
    +    tableNames.addAll(client.getTableList(databaseName));
    --- End diff --
    
    These lines can be rewritten with a single constructor call.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457494
  
    --- Diff: tajo-core/src/main/java/org/apache/tajo/engine/planner/global/rewriter/rules/BroadcastJoinRule.java ---
    @@ -244,7 +245,8 @@ private void visitNonLeafNode(Context context, ExecutionBlock current) {
                 context.estimatedEbOutputSize.put(current.getId(), outputVolume);
               }
             } else {
    -          List<ScanNode> relations = TUtil.newList(current.getBroadcastRelations());
    +          List<ScanNode> relations = new ArrayList<>();
    +          relations.addAll(current.getBroadcastRelations());
    --- End diff --
    
    Can be rewritten with a single constructor call.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457157
  
    --- Diff: tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/Schema.java ---
    @@ -423,7 +425,9 @@ public synchronized Schema addColumn(String name, TypeDesc typeDesc) {
         Column newCol = new Column(normalized, typeDesc);
         fields.add(newCol);
         fieldsByQualifiedName.put(newCol.getQualifiedName(), fields.size() - 1);
    -    fieldsByName.put(newCol.getSimpleName(), TUtil.newList(fields.size() - 1));
    +    List inputList = new ArrayList<>();
    --- End diff --
    
    Please specify type.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457560
  
    --- Diff: tajo-core/src/main/java/org/apache/tajo/querymaster/Repartitioner.java ---
    @@ -1065,8 +1070,10 @@ public static void scheduleScatteredHashShuffleFetches(TaskSchedulerContext sche
               fetchListForSingleTask = new ArrayList<>();
               fetchListVolume = 0;
             }
    +        List inputList = new ArrayList<>();
    +        inputList.addAll(Arrays.asList(currentInterm));
             FetchImpl fetch = new FetchImpl(currentInterm.getPullHost(), SCATTERED_HASH_SHUFFLE,
    -            ebId, currentInterm.getPartId(), TUtil.newList(currentInterm));
    +            ebId, currentInterm.getPartId(), inputList);
    --- End diff --
    
    Can be rewritten with Arrays.asList().


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457586
  
    --- Diff: tajo-plan/src/main/java/org/apache/tajo/plan/LogicalPlanner.java ---
    @@ -1299,7 +1300,8 @@ private LogicalNode createCartesianProduct(PlanContext context, LogicalNode left
           } catch (UndefinedColumnException ve) {}
         }
     
    -    List<Target> targets = TUtil.newList(PlannerUtil.schemaToTargets(merged));
    +    List<Target> targets = new ArrayList<>();
    +    targets.addAll(PlannerUtil.schemaToTargets(merged));
    --- End diff --
    
    Can be rewritten with a single constructor call.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by dkhwangbo <gi...@git.apache.org>.
Github user dkhwangbo commented on the pull request:

    https://github.com/apache/tajo/pull/891#issuecomment-164459595
  
    @jihoonson Thanks for your review and comment. I apply your suggestion. Please review this PR.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/tajo/pull/891


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457610
  
    --- Diff: tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/rules/ProjectionPushDownRule.java ---
    @@ -689,7 +689,9 @@ public LogicalNode visitWindowAgg(Context context, LogicalPlan plan, LogicalPlan
         if (node.hasAggFunctions() && aggEvalNames != null) {
           WindowFunctionEval [] aggEvals = new WindowFunctionEval[aggEvalNames.length];
           int i = 0;
    -      for (Iterator<String> it = getFilteredReferences(aggEvalNames, TUtil.newList(aggEvalNames)); it.hasNext();) {
    +      List inputList = new ArrayList<>();
    +      inputList.addAll(Arrays.asList(aggEvalNames));
    +      for (Iterator<String> it = getFilteredReferences(aggEvalNames, inputList); it.hasNext();) {
    --- End diff --
    
    Can be rewritten with Arrays.asList().


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457328
  
    --- Diff: tajo-common/src/main/java/org/apache/tajo/util/TUtil.java ---
    @@ -185,7 +155,9 @@ public static boolean checkEquals(int [] s1, int [] s2) {
         if (map.containsKey(k1)) {
           map.get(k1).addAll(list);
         } else {
    -      map.put(k1, TUtil.newList(list));
    +      List inputList = new ArrayList<>();
    +      inputList.addAll(list);
    --- End diff --
    
    These lines can be rewritten with a single constructor call.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457564
  
    --- Diff: tajo-core/src/main/java/org/apache/tajo/querymaster/Repartitioner.java ---
    @@ -1179,7 +1188,9 @@ public static void scheduleScatteredHashShuffleFetches(TaskSchedulerContext sche
           if (hashed.containsKey(host)) {
             hashed.get(host).add(entry);
           } else {
    -        hashed.put(host, TUtil.newList(entry));
    +        List inputList = new ArrayList<>();
    +        inputList.addAll(Arrays.asList(entry));
    +        hashed.put(host, inputList);
    --- End diff --
    
    Can be rewritten with Arrays.asList().


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457643
  
    --- Diff: tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/fragment/FileFragment.java ---
    @@ -226,7 +226,9 @@ public FragmentProto getProto() {
         }
     
         if(hosts != null) {
    -      builder.addAllHosts(TUtil.newList(hosts));
    +      List inputList = new ArrayList<>();
    +      inputList.addAll(Arrays.asList(hosts));
    +      builder.addAllHosts(inputList);
    --- End diff --
    
    Can be rewritten with Arrays.asList().


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457538
  
    --- Diff: tajo-core/src/main/java/org/apache/tajo/querymaster/Repartitioner.java ---
    @@ -314,12 +314,16 @@ private static void scheduleSymmetricRepartitionJoin(QueryMasterTask.QueryMaster
                 if (tbNameToInterm.containsKey(scanEbId)) {
                   tbNameToInterm.get(scanEbId).add(intermediateEntry);
                 } else {
    -              tbNameToInterm.put(scanEbId, TUtil.newList(intermediateEntry));
    +              List inputList = new ArrayList<>();
    +              inputList.addAll(Arrays.asList(intermediateEntry));
    +              tbNameToInterm.put(scanEbId, inputList);
                 }
               } else {
                 Map<ExecutionBlockId, List<IntermediateEntry>> tbNameToInterm =
                         new HashMap<>();
    -            tbNameToInterm.put(scanEbId, TUtil.newList(intermediateEntry));
    +            List inputList = new ArrayList<>();
    +            inputList.addAll(Arrays.asList(intermediateEntry));
    +            tbNameToInterm.put(scanEbId, inputList);
    --- End diff --
    
    Can be rewritten with Arrays.asList().


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r48933378
  
    --- Diff: tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/Schema.java ---
    @@ -83,7 +82,7 @@ private static void deserializeColumn(List<Column> tobeAdded, List<ColumnProto>
           // where is start index of nested fields?
           int childStartIndex = tobeAdded.size() - childNum;
           // Extract nested fields
    -      List<Column> nestedColumns = TUtil.newList(tobeAdded.subList(childStartIndex, childStartIndex + childNum));
    +      List<Column> nestedColumns = new ArrayList<>(tobeAdded.subList(childStartIndex, childStartIndex + childNum));
    --- End diff --
    
    ```new ArrayList()``` is redundant.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r48933432
  
    --- Diff: tajo-cli/src/main/java/org/apache/tajo/cli/tools/TajoDump.java ---
    @@ -169,7 +168,7 @@ private static void dumpDatabase(TajoClient client, String databaseName, PrintWr
         writer.write("\n\n");
     
         // returned list is immutable.
    -    List<String> tableNames = TUtil.newList(client.getTableList(databaseName));
    +    List<String> tableNames = new ArrayList<>(client.getTableList(databaseName));
    --- End diff --
    
    ```new ArrayList()``` is redundant.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457639
  
    --- Diff: tajo-storage/tajo-storage-hbase/src/main/java/org/apache/tajo/storage/hbase/HBaseTablespace.java ---
    @@ -462,8 +462,10 @@ public URI getTableUri(String databaseName, String tableName) {
               stopRows.add(stopRow);
             }
           } else {
    -        startRows = TUtil.newList(HConstants.EMPTY_START_ROW);
    -        stopRows = TUtil.newList(HConstants.EMPTY_END_ROW);
    +        startRows = new ArrayList<>();
    +        startRows.addAll(Arrays.asList(HConstants.EMPTY_START_ROW));
    +        stopRows = new ArrayList<>();
    +        stopRows.addAll(Arrays.asList(HConstants.EMPTY_END_ROW));
    --- End diff --
    
    Can be rewritten with a single constructor call.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457622
  
    --- Diff: tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/rules/ProjectionPushDownRule.java ---
    @@ -962,14 +967,16 @@ public LogicalNode visitJoin(Context context, LogicalPlan plan, LogicalPlan.Quer
       }
     
       static Iterator<String> getFilteredReferences(String [] targetNames, Collection<String> required) {
    -    return new FilteredStringsIterator(targetNames, required);
    +    List inputList = new ArrayList<>();
    +    inputList.addAll(Arrays.asList(targetNames));
    +    return new FilteredStringsIterator(inputList, required);
    --- End diff --
    
    Can be rewritten with Arrays.asList().


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1999: TUtil.newList/newLinkedHashMap shoul...

Posted by jihoonson <gi...@git.apache.org>.
Github user jihoonson commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/891#discussion_r47457423
  
    --- Diff: tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestPhysicalPlanner.java ---
    @@ -674,7 +674,9 @@ public final void testPartitionedStorePlan() throws IOException, TajoException {
         }
     
         assertEquals(numPartitions, fragments.size());
    -    Scanner scanner = new MergeScanner(conf, rootNode.getOutSchema(), outputMeta, TUtil.newList(fragments));
    +    List inputList = new ArrayList<>();
    --- End diff --
    
    ```inputList```s in this test look not necessary.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---