You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@tez.apache.org by "jiang jie (JIRA)" <ji...@apache.org> on 2013/08/02 08:35:48 UTC
[jira] [Commented] (TEZ-334) There are redundant variables in
MultiStageMRConfToTezTranslator.getStageConfs
[ https://issues.apache.org/jira/browse/TEZ-334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13727406#comment-13727406 ]
jiang jie commented on TEZ-334:
-------------------------------
MultiStageMRConfToTezTranslator.getStageConfs uses three local variables as follows
int totalStages = numIntermediateStages + (hasFinalReduceStage ? 2 : 1);
int numEdges = totalStages - 1;
int numStages = numEdges + 1;
The variable numStages is equal to the variable totalStages. The totalStages and the numEdges aren't used any more while only the numStages is used later. Thus only one variable is needed.
The basic idea described below:
{code:title=MultiStageMRConfToTezTranslator.java}
diff --git a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MultiStageMRConfToTezTranslator.java b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MultiStageMRConfToTezTranslator.ja
index fecc5d9..2d37a1c 100644
--- a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MultiStageMRConfToTezTranslator.java
+++ b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MultiStageMRConfToTezTranslator.java
@@ -217,9 +217,7 @@ public class MultiStageMRConfToTezTranslator {
.getNumIntermediateStages(conf);
boolean hasFinalReduceStage = (conf.getInt(MRJobConfig.NUM_REDUCES, 0) > 0);
// Assuming no 0 map jobs, and the first stage is always a map.
- int totalStages = numIntermediateStages + (hasFinalReduceStage ? 2 : 1);
- int numEdges = totalStages - 1;
- int numStages = numEdges + 1;
+ int numStages = numIntermediateStages + (hasFinalReduceStage ? 2 : 1);
Configuration confs[] = new Configuration[numStages];
Configuration nonItermediateConf = MultiStageMRConfigUtil.extractStageConf(
{code}
> There are redundant variables in MultiStageMRConfToTezTranslator.getStageConfs
> ------------------------------------------------------------------------------
>
> Key: TEZ-334
> URL: https://issues.apache.org/jira/browse/TEZ-334
> Project: Apache Tez
> Issue Type: Improvement
> Reporter: jiang jie
> Priority: Minor
>
> MultiStageMRConfToTezTranslator.getStageConfs uses three local variables as follows
> int totalStages = numIntermediateStages + (hasFinalReduceStage ? 2 : 1);
> int numEdges = totalStages - 1;
> int numStages = numEdges + 1;
> The numStages is equal to the totalStages and only the numStages is used later, therefore we can only use one local variable.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira