You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by Cheolsoo Park <pi...@gmail.com> on 2014/05/01 21:37:35 UTC

Review Request 20973: PIG-3914: Change TaskContext to abstract class

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/20973/
-----------------------------------------------------------

Review request for pig, Daniel Dai and Rohini Palaniswamy.


Bugs: PIG-3914
    https://issues.apache.org/jira/browse/PIG-3914


Repository: pig-git


Description
-------

This is a follow-up of PIG-3860.

The patch includes the following changes-
1) Converts TaskContext to an abstract class and adds MRTaskContext, FetchTaskContext, and TezTaskContext as subclasses.
2) Changes "PigStatusReporter.getCounter() && counter.increment()" to "PigStatusReporter.incrCounter()" for MULTI_INPUTS_RECORD_COUNTER and MULTI_STORE_RECORD_COUNTER.


Diffs
-----

  shims/src/hadoop20/org/apache/pig/backend/hadoop/executionengine/shims/TaskContext.java 6276ccd 
  shims/src/hadoop23/org/apache/pig/backend/hadoop/executionengine/shims/TaskContext.java 46cb8f4 
  src/org/apache/pig/backend/hadoop/executionengine/TaskContext.java e69de29 
  src/org/apache/pig/backend/hadoop/executionengine/fetch/FetchLauncher.java 275ae50 
  src/org/apache/pig/backend/hadoop/executionengine/fetch/FetchTaskContext.java e69de29 
  src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/MRTaskContext.java e69de29 
  src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/MapReducePOStoreImpl.java 5746b41 
  src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigCombiner.java 776096b 
  src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigGenericMapBase.java c2b51d8 
  src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigGenericMapReduce.java 94dcbdd 
  src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigRecordReader.java 4b17228 
  src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POStore.java 5b288dd 
  src/org/apache/pig/backend/hadoop/executionengine/tez/PigProcessor.java 0cfee16 
  src/org/apache/pig/backend/hadoop/executionengine/tez/TezTaskContext.java e69de29 
  src/org/apache/pig/tools/pigstats/PigStatusReporter.java 2e4abbf 

Diff: https://reviews.apache.org/r/20973/diff/


Testing
-------

All unit tests pass.


Thanks,

Cheolsoo Park


Re: Review Request 20973: PIG-3914: Change TaskContext to abstract class

Posted by Cheolsoo Park <pi...@gmail.com>.

> On May 1, 2014, 8:09 p.m., Rohini Palaniswamy wrote:
> > src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/MRTaskContext.java, line 57
> > <https://reviews.apache.org/r/20973/diff/1/?file=572928#file572928line57>
> >
> >     In what case would counter be null after a getCounter() call? It seems to always create a counter if it does not exist. Do we need this check in all methods? Can it be removed?

Agreed. Will remove them.


> On May 1, 2014, 8:09 p.m., Rohini Palaniswamy wrote:
> > src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigRecordReader.java, line 201
> > <https://reviews.apache.org/r/20973/diff/1/?file=572933#file572933line201>
> >
> >     If counter was initialized to -1, then lot other places will have problem (Spill counters for example). We were reporting counters wrong all along by a count of 1? Looking at GenericCounter.java in hadoop it is initialized to 0 only. I haven't stepped through and checked if GenericCounter is being used though it looks like that will be the case from a glance at the code.

Actually, I was wrong about this. -1 is from MRJobStats.addOneInputStats(). I ran into -1 with TestPigRunner#testEmptyFileCounter. What happens is that MULTI_INPUTS_RECORD_COUNTER is no longer created in case of empty file since I call getCounter() only when incrementing it. So for empty file, getCounter() is never called, and thus, it is not created.


> On May 1, 2014, 8:09 p.m., Rohini Palaniswamy wrote:
> > src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POStore.java, line 123
> > <https://reviews.apache.org/r/20973/diff/1/?file=572934#file572934line123>
> >
> >     if (countername != null)

Will do.


- Cheolsoo


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/20973/#review41939
-----------------------------------------------------------


On May 1, 2014, 7:37 p.m., Cheolsoo Park wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/20973/
> -----------------------------------------------------------
> 
> (Updated May 1, 2014, 7:37 p.m.)
> 
> 
> Review request for pig, Daniel Dai and Rohini Palaniswamy.
> 
> 
> Bugs: PIG-3914
>     https://issues.apache.org/jira/browse/PIG-3914
> 
> 
> Repository: pig-git
> 
> 
> Description
> -------
> 
> This is a follow-up of PIG-3860.
> 
> The patch includes the following changes-
> 1) Converts TaskContext to an abstract class and adds MRTaskContext, FetchTaskContext, and TezTaskContext as subclasses.
> 2) Changes "PigStatusReporter.getCounter() && counter.increment()" to "PigStatusReporter.incrCounter()" for MULTI_INPUTS_RECORD_COUNTER and MULTI_STORE_RECORD_COUNTER.
> 
> 
> Diffs
> -----
> 
>   shims/src/hadoop20/org/apache/pig/backend/hadoop/executionengine/shims/TaskContext.java 6276ccd 
>   shims/src/hadoop23/org/apache/pig/backend/hadoop/executionengine/shims/TaskContext.java 46cb8f4 
>   src/org/apache/pig/backend/hadoop/executionengine/TaskContext.java e69de29 
>   src/org/apache/pig/backend/hadoop/executionengine/fetch/FetchLauncher.java 275ae50 
>   src/org/apache/pig/backend/hadoop/executionengine/fetch/FetchTaskContext.java e69de29 
>   src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/MRTaskContext.java e69de29 
>   src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/MapReducePOStoreImpl.java 5746b41 
>   src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigCombiner.java 776096b 
>   src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigGenericMapBase.java c2b51d8 
>   src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigGenericMapReduce.java 94dcbdd 
>   src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigRecordReader.java 4b17228 
>   src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POStore.java 5b288dd 
>   src/org/apache/pig/backend/hadoop/executionengine/tez/PigProcessor.java 0cfee16 
>   src/org/apache/pig/backend/hadoop/executionengine/tez/TezTaskContext.java e69de29 
>   src/org/apache/pig/tools/pigstats/PigStatusReporter.java 2e4abbf 
> 
> Diff: https://reviews.apache.org/r/20973/diff/
> 
> 
> Testing
> -------
> 
> All unit tests pass.
> 
> 
> Thanks,
> 
> Cheolsoo Park
> 
>


Re: Review Request 20973: PIG-3914: Change TaskContext to abstract class

Posted by Rohini Palaniswamy <ro...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/20973/#review41939
-----------------------------------------------------------


Few comments already in jira.


src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/MRTaskContext.java
<https://reviews.apache.org/r/20973/#comment75596>

    In what case would counter be null after a getCounter() call? It seems to always create a counter if it does not exist. Do we need this check in all methods? Can it be removed?



src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigRecordReader.java
<https://reviews.apache.org/r/20973/#comment75598>

    If counter was initialized to -1, then lot other places will have problem (Spill counters for example). We were reporting counters wrong all along by a count of 1? Looking at GenericCounter.java in hadoop it is initialized to 0 only. I haven't stepped through and checked if GenericCounter is being used though it looks like that will be the case from a glance at the code.



src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POStore.java
<https://reviews.apache.org/r/20973/#comment75597>

    if (countername != null)


- Rohini Palaniswamy


On May 1, 2014, 7:37 p.m., Cheolsoo Park wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/20973/
> -----------------------------------------------------------
> 
> (Updated May 1, 2014, 7:37 p.m.)
> 
> 
> Review request for pig, Daniel Dai and Rohini Palaniswamy.
> 
> 
> Bugs: PIG-3914
>     https://issues.apache.org/jira/browse/PIG-3914
> 
> 
> Repository: pig-git
> 
> 
> Description
> -------
> 
> This is a follow-up of PIG-3860.
> 
> The patch includes the following changes-
> 1) Converts TaskContext to an abstract class and adds MRTaskContext, FetchTaskContext, and TezTaskContext as subclasses.
> 2) Changes "PigStatusReporter.getCounter() && counter.increment()" to "PigStatusReporter.incrCounter()" for MULTI_INPUTS_RECORD_COUNTER and MULTI_STORE_RECORD_COUNTER.
> 
> 
> Diffs
> -----
> 
>   shims/src/hadoop20/org/apache/pig/backend/hadoop/executionengine/shims/TaskContext.java 6276ccd 
>   shims/src/hadoop23/org/apache/pig/backend/hadoop/executionengine/shims/TaskContext.java 46cb8f4 
>   src/org/apache/pig/backend/hadoop/executionengine/TaskContext.java e69de29 
>   src/org/apache/pig/backend/hadoop/executionengine/fetch/FetchLauncher.java 275ae50 
>   src/org/apache/pig/backend/hadoop/executionengine/fetch/FetchTaskContext.java e69de29 
>   src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/MRTaskContext.java e69de29 
>   src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/MapReducePOStoreImpl.java 5746b41 
>   src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigCombiner.java 776096b 
>   src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigGenericMapBase.java c2b51d8 
>   src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigGenericMapReduce.java 94dcbdd 
>   src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigRecordReader.java 4b17228 
>   src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POStore.java 5b288dd 
>   src/org/apache/pig/backend/hadoop/executionengine/tez/PigProcessor.java 0cfee16 
>   src/org/apache/pig/backend/hadoop/executionengine/tez/TezTaskContext.java e69de29 
>   src/org/apache/pig/tools/pigstats/PigStatusReporter.java 2e4abbf 
> 
> Diff: https://reviews.apache.org/r/20973/diff/
> 
> 
> Testing
> -------
> 
> All unit tests pass.
> 
> 
> Thanks,
> 
> Cheolsoo Park
> 
>


Re: Review Request 20973: PIG-3914: Change TaskContext to abstract class

Posted by Rohini Palaniswamy <ro...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/20973/#review41978
-----------------------------------------------------------

Ship it!


Ship It!

- Rohini Palaniswamy


On May 1, 2014, 9:01 p.m., Cheolsoo Park wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/20973/
> -----------------------------------------------------------
> 
> (Updated May 1, 2014, 9:01 p.m.)
> 
> 
> Review request for pig, Daniel Dai and Rohini Palaniswamy.
> 
> 
> Bugs: PIG-3914
>     https://issues.apache.org/jira/browse/PIG-3914
> 
> 
> Repository: pig-git
> 
> 
> Description
> -------
> 
> This is a follow-up of PIG-3860.
> 
> The patch includes the following changes-
> 1) Converts TaskContext to an abstract class and adds MRTaskContext, FetchTaskContext, and TezTaskContext as subclasses.
> 2) Changes "PigStatusReporter.getCounter() && counter.increment()" to "PigStatusReporter.incrCounter()" for MULTI_INPUTS_RECORD_COUNTER and MULTI_STORE_RECORD_COUNTER.
> 
> 
> Diffs
> -----
> 
>   shims/src/hadoop20/org/apache/pig/backend/hadoop/executionengine/shims/TaskContext.java 6276ccd 
>   shims/src/hadoop23/org/apache/pig/backend/hadoop/executionengine/shims/TaskContext.java 46cb8f4 
>   src/org/apache/pig/backend/hadoop/executionengine/TaskContext.java e69de29 
>   src/org/apache/pig/backend/hadoop/executionengine/fetch/FetchLauncher.java 275ae50 
>   src/org/apache/pig/backend/hadoop/executionengine/fetch/FetchTaskContext.java e69de29 
>   src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/MRTaskContext.java e69de29 
>   src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/MapReducePOStoreImpl.java 5746b41 
>   src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigCombiner.java 776096b 
>   src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigGenericMapBase.java c2b51d8 
>   src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigGenericMapReduce.java 94dcbdd 
>   src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigRecordReader.java 4b17228 
>   src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POStore.java 5b288dd 
>   src/org/apache/pig/backend/hadoop/executionengine/tez/PigProcessor.java 0cfee16 
>   src/org/apache/pig/backend/hadoop/executionengine/tez/TezTaskContext.java e69de29 
>   src/org/apache/pig/tools/pigstats/PigStatusReporter.java 2e4abbf 
> 
> Diff: https://reviews.apache.org/r/20973/diff/
> 
> 
> Testing
> -------
> 
> All unit tests pass.
> 
> 
> Thanks,
> 
> Cheolsoo Park
> 
>


Re: Review Request 20973: PIG-3914: Change TaskContext to abstract class

Posted by Cheolsoo Park <pi...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/20973/
-----------------------------------------------------------

(Updated May 1, 2014, 9:01 p.m.)


Review request for pig, Daniel Dai and Rohini Palaniswamy.


Changes
-------

Incorporated Rohini's comments except the following one-

>> reporter != null checks have been removed. Is that ok? Is it never expected to be null?

reporter is initialized by PigStatusReporter.getInstance() inside the constructor of PigRecordReader, and PigStatusReporter.getInstance() never returns null.


Bugs: PIG-3914
    https://issues.apache.org/jira/browse/PIG-3914


Repository: pig-git


Description
-------

This is a follow-up of PIG-3860.

The patch includes the following changes-
1) Converts TaskContext to an abstract class and adds MRTaskContext, FetchTaskContext, and TezTaskContext as subclasses.
2) Changes "PigStatusReporter.getCounter() && counter.increment()" to "PigStatusReporter.incrCounter()" for MULTI_INPUTS_RECORD_COUNTER and MULTI_STORE_RECORD_COUNTER.


Diffs (updated)
-----

  shims/src/hadoop20/org/apache/pig/backend/hadoop/executionengine/shims/TaskContext.java 6276ccd 
  shims/src/hadoop23/org/apache/pig/backend/hadoop/executionengine/shims/TaskContext.java 46cb8f4 
  src/org/apache/pig/backend/hadoop/executionengine/TaskContext.java e69de29 
  src/org/apache/pig/backend/hadoop/executionengine/fetch/FetchLauncher.java 275ae50 
  src/org/apache/pig/backend/hadoop/executionengine/fetch/FetchTaskContext.java e69de29 
  src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/MRTaskContext.java e69de29 
  src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/MapReducePOStoreImpl.java 5746b41 
  src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigCombiner.java 776096b 
  src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigGenericMapBase.java c2b51d8 
  src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigGenericMapReduce.java 94dcbdd 
  src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigRecordReader.java 4b17228 
  src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/relationalOperators/POStore.java 5b288dd 
  src/org/apache/pig/backend/hadoop/executionengine/tez/PigProcessor.java 0cfee16 
  src/org/apache/pig/backend/hadoop/executionengine/tez/TezTaskContext.java e69de29 
  src/org/apache/pig/tools/pigstats/PigStatusReporter.java 2e4abbf 

Diff: https://reviews.apache.org/r/20973/diff/


Testing
-------

All unit tests pass.


Thanks,

Cheolsoo Park