You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@samza.apache.org by Shanthoosh Venkataraman <sa...@gmail.com> on 2017/02/16 06:26:17 UTC
Re: Review Request 52168: Tasks endpoint to list the complete details
of all tasks related to a job
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/52168/
-----------------------------------------------------------
(Updated Feb. 16, 2017, 6:26 a.m.)
Review request for samza.
Changes
-------
Changes that are related to JobCoordinator.scala:
a) This change moves the logic implemented in the initializeJobModel method to recompute & write the new changeLogPartitionMapping to coordinator stream to apply method (there by making the initializeJobModel(purely readonly) and it can be exposed via a resource). This will make initializeJobModel just a reader of jobModel [JobCoordinator.scala Lines 120-134 has the change].
b) Removes refreshJobModel method in JobCoordinator and merges it with initializeJobModel. After the current change both the refreshJobModel & initializeJobModel each contains portions of code that reads the JobModel from coordinator stream, hence the reason to merge them into a single method. Also, there are no other uses of refreshJobModel method except this, hence the felt the need to merge them into one [JobCoordinator.scala lines 198-220].
c) Moves the changlogParititonManager.start(), localityManager.start() to apply method, since both the objects are created there. I think it\u2019s better to do it over there, more like bootstrap/initializing them properly. I can\u2019t wrap my head to understand why the existing implementation had it scattered across different methods, there by making it harder to understand the code and the flow [JobCoordinator.scala Lines 95-99].
d) Extracted out the logic to build systemAdmins into a method getSystemAdmins(config), so that it can be used from the SamzaTaskProxy resource while invoking initializeJobModel to build the jobModel. This extraction might seem unnecessary, but it removes code duplication and promotes reusability in samza-rest. [JobCoordinator.scala lines 274-288].
e) Stop the coordinatorStreamProducer and coordinatorStreamConsumer in apply method in finally block. This is done since both the producer and consumer will no longer be required for the reading/updating of jobModel at the end of apply method.[JobCoordinator.scala lines 139-145].
f) Moved reWriteConfig from JobRunner.scala to Util.scala, since it's required in samza-rest to apply custom rewriters to rewrite the job config before fetching from coordinatorStream[JobRunner.scala Lines 39-61].
Apart from these, the other changes in JobCoordinator.scala are minor name changes and extracting variable that should've been constants, fixing the imports(These were done with an intent to improve readability) JobCoordinator.scala Lines (33-39, 42-51, 63, 91, 188-189).
This refactoring was done with a goal that the jobModel.read in JobCoordinator.scala is not reimplemented entirely in samza-rest.
SamzaTaskProxy #getJobModel contains the bootstrap of CoordinatorStreamSystemConsumer, CoordinatorStreamSystemProducer to read the job model from coordinator stream.
Tested the changes with a sample samza job and with samza-rest monitor.
Repository: samza
Description
-------
This patch contains the following changes
* Http get api to list the complete details of all the tasks that belongs to a job.
* Refactored some methods in coordinator stream, to reuse the existing functionality of getting jobConfig from the coordinator stream.
Diffs (updated)
-----
docs/learn/documentation/versioned/rest/resource-directory.md 79746d1e2eb3491e4bd26c3c7cf6c7efd150d8ef
docs/learn/documentation/versioned/rest/resources/tasks.md PRE-CREATION
samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala df63b97e9d598ecd1840111ba490a723e410d089
samza-core/src/main/scala/org/apache/samza/job/JobRunner.scala 022b480856483059cb9f837a08f97a718bc04c31
samza-core/src/main/scala/org/apache/samza/util/Util.scala c4836f202f7eda1d4e71eac94fd48e46207b0316
samza-rest/src/main/config/samza-rest.properties 7be0b47d1466d2199ae278247e8d81522fb6a91c
samza-rest/src/main/java/org/apache/samza/rest/model/Partition.java PRE-CREATION
samza-rest/src/main/java/org/apache/samza/rest/model/Task.java PRE-CREATION
samza-rest/src/main/java/org/apache/samza/rest/proxy/job/AbstractJobProxy.java 4d8647f3e1e650632e38b47ba5a8a2dac004f545
samza-rest/src/main/java/org/apache/samza/rest/proxy/job/JobProxyFactory.java 067711a74e5b0d7277a9c8b2d2517b56e9cfbcca
samza-rest/src/main/java/org/apache/samza/rest/proxy/job/SimpleYarnJobProxy.java a935c98730f85f448c688a6baf2e8ddffdbb2cb4
samza-rest/src/main/java/org/apache/samza/rest/proxy/job/SimpleYarnJobProxyFactory.java 11d93d4608d23a4e3fb3bfc50dfac35ab6dbdf3c
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxy.java PRE-CREATION
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxyFactory.java PRE-CREATION
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskProxy.java PRE-CREATION
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskProxyFactory.java PRE-CREATION
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskResourceConfig.java PRE-CREATION
samza-rest/src/main/java/org/apache/samza/rest/resources/BaseResourceConfig.java PRE-CREATION
samza-rest/src/main/java/org/apache/samza/rest/resources/DefaultResourceFactory.java e0224c6bcf4aeaa336e5786ac472482507fcd382
samza-rest/src/main/java/org/apache/samza/rest/resources/JobsResource.java a566db598c284d69ea61af88fdc0851483d5a089
samza-rest/src/main/java/org/apache/samza/rest/resources/JobsResourceConfig.java 527482d2ee55747e7b3f9c54c8a3b1afe7ad8797
samza-rest/src/main/java/org/apache/samza/rest/resources/Responses.java PRE-CREATION
samza-rest/src/main/java/org/apache/samza/rest/resources/TasksResource.java PRE-CREATION
samza-rest/src/test/java/org/apache/samza/rest/resources/TestJobsResource.java 7db437b348ecd286185898b8f8ab0220d59da71a
samza-rest/src/test/java/org/apache/samza/rest/resources/TestTasksResource.java PRE-CREATION
samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockInstallationFinder.java PRE-CREATION
samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockResourceFactory.java PRE-CREATION
samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockTaskProxy.java PRE-CREATION
samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockTaskProxyFactory.java PRE-CREATION
Diff: https://reviews.apache.org/r/52168/diff/
Testing
-------
Manual and unit testing has been done to verify the apis.
Thanks,
Shanthoosh Venkataraman
Re: Review Request 52168: Tasks endpoint to list the complete details
of all tasks related to a job
Posted by Xinyu Liu <xi...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/52168/#review169231
-----------------------------------------------------------
Ship it!
Ship It!
- Xinyu Liu
On Feb. 16, 2017, 6:26 a.m., Shanthoosh Venkataraman wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52168/
> -----------------------------------------------------------
>
> (Updated Feb. 16, 2017, 6:26 a.m.)
>
>
> Review request for samza.
>
>
> Repository: samza
>
>
> Description
> -------
>
> This patch contains the following changes
> * Http get api to list the complete details of all the tasks that belongs to a job.
> * Refactored some methods in coordinator stream, to reuse the existing functionality of getting jobConfig from the coordinator stream.
>
>
> Diffs
> -----
>
> docs/learn/documentation/versioned/rest/resource-directory.md 79746d1e2eb3491e4bd26c3c7cf6c7efd150d8ef
> docs/learn/documentation/versioned/rest/resources/tasks.md PRE-CREATION
> samza-core/src/main/java/org/apache/samza/standalone/StandaloneJobCoordinator.java 46dbf30eb37f7d617fb868fb4e1561fef18522d5
> samza-core/src/main/java/org/apache/samza/zk/ZkJobCoordinator.java PRE-CREATION
> samza-core/src/main/scala/org/apache/samza/coordinator/JobModelManager.scala 14d5dff00758c6e35cae018b4ebaa686d67bb57d
> samza-core/src/main/scala/org/apache/samza/job/JobRunner.scala 022b480856483059cb9f837a08f97a718bc04c31
> samza-core/src/main/scala/org/apache/samza/util/Util.scala 9019d02bc83e0e76a1b6a6fb9958733dfe8b86a4
> samza-core/src/test/java/org/apache/samza/execution/TestExecutionPlanner.java PRE-CREATION
> samza-rest/src/main/config/samza-rest.properties 7be0b47d1466d2199ae278247e8d81522fb6a91c
> samza-rest/src/main/java/org/apache/samza/rest/model/Partition.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/model/Task.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/AbstractJobProxy.java 4d8647f3e1e650632e38b47ba5a8a2dac004f545
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/JobProxyFactory.java 067711a74e5b0d7277a9c8b2d2517b56e9cfbcca
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/SimpleYarnJobProxy.java a935c98730f85f448c688a6baf2e8ddffdbb2cb4
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/SimpleYarnJobProxyFactory.java 11d93d4608d23a4e3fb3bfc50dfac35ab6dbdf3c
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxy.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxyFactory.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskProxy.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskProxyFactory.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskResourceConfig.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/resources/BaseResourceConfig.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/resources/DefaultResourceFactory.java e0224c6bcf4aeaa336e5786ac472482507fcd382
> samza-rest/src/main/java/org/apache/samza/rest/resources/JobsResource.java a566db598c284d69ea61af88fdc0851483d5a089
> samza-rest/src/main/java/org/apache/samza/rest/resources/JobsResourceConfig.java 527482d2ee55747e7b3f9c54c8a3b1afe7ad8797
> samza-rest/src/main/java/org/apache/samza/rest/resources/Responses.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/resources/TasksResource.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/TestJobsResource.java 7db437b348ecd286185898b8f8ab0220d59da71a
> samza-rest/src/test/java/org/apache/samza/rest/resources/TestTasksResource.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockInstallationFinder.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockResourceFactory.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockTaskProxy.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockTaskProxyFactory.java PRE-CREATION
>
>
> Diff: https://reviews.apache.org/r/52168/diff/15/
>
>
> Testing
> -------
>
> Manual and unit testing has been done to verify the apis.
>
>
> Thanks,
>
> Shanthoosh Venkataraman
>
>
Re: Review Request 52168: Tasks endpoint to list the complete details
of all tasks related to a job
Posted by Xinyu Liu <xi...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/52168/#review169086
-----------------------------------------------------------
Please rebase this patch with master.
samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala
Line 64 (original), 78 (patched)
<https://reviews.apache.org/r/52168/#comment241409>
Add java doc indicating we not only read jobmodel but update some other stuff.
samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala
Line 120 (original), 155 (patched)
<https://reviews.apache.org/r/52168/#comment241408>
make this private and don't expose it outside.
samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala
Line 188 (original), 224 (patched)
<https://reviews.apache.org/r/52168/#comment241407>
rename this as getJobModle. In javadoc, make clear there is no side effect.
- Xinyu Liu
On Feb. 16, 2017, 6:26 a.m., Shanthoosh Venkataraman wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52168/
> -----------------------------------------------------------
>
> (Updated Feb. 16, 2017, 6:26 a.m.)
>
>
> Review request for samza.
>
>
> Repository: samza
>
>
> Description
> -------
>
> This patch contains the following changes
> * Http get api to list the complete details of all the tasks that belongs to a job.
> * Refactored some methods in coordinator stream, to reuse the existing functionality of getting jobConfig from the coordinator stream.
>
>
> Diffs
> -----
>
> docs/learn/documentation/versioned/rest/resource-directory.md 79746d1e2eb3491e4bd26c3c7cf6c7efd150d8ef
> docs/learn/documentation/versioned/rest/resources/tasks.md PRE-CREATION
> samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala df63b97e9d598ecd1840111ba490a723e410d089
> samza-core/src/main/scala/org/apache/samza/job/JobRunner.scala 022b480856483059cb9f837a08f97a718bc04c31
> samza-core/src/main/scala/org/apache/samza/util/Util.scala c4836f202f7eda1d4e71eac94fd48e46207b0316
> samza-rest/src/main/config/samza-rest.properties 7be0b47d1466d2199ae278247e8d81522fb6a91c
> samza-rest/src/main/java/org/apache/samza/rest/model/Partition.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/model/Task.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/AbstractJobProxy.java 4d8647f3e1e650632e38b47ba5a8a2dac004f545
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/JobProxyFactory.java 067711a74e5b0d7277a9c8b2d2517b56e9cfbcca
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/SimpleYarnJobProxy.java a935c98730f85f448c688a6baf2e8ddffdbb2cb4
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/SimpleYarnJobProxyFactory.java 11d93d4608d23a4e3fb3bfc50dfac35ab6dbdf3c
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxy.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxyFactory.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskProxy.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskProxyFactory.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskResourceConfig.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/resources/BaseResourceConfig.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/resources/DefaultResourceFactory.java e0224c6bcf4aeaa336e5786ac472482507fcd382
> samza-rest/src/main/java/org/apache/samza/rest/resources/JobsResource.java a566db598c284d69ea61af88fdc0851483d5a089
> samza-rest/src/main/java/org/apache/samza/rest/resources/JobsResourceConfig.java 527482d2ee55747e7b3f9c54c8a3b1afe7ad8797
> samza-rest/src/main/java/org/apache/samza/rest/resources/Responses.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/resources/TasksResource.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/TestJobsResource.java 7db437b348ecd286185898b8f8ab0220d59da71a
> samza-rest/src/test/java/org/apache/samza/rest/resources/TestTasksResource.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockInstallationFinder.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockResourceFactory.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockTaskProxy.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockTaskProxyFactory.java PRE-CREATION
>
>
> Diff: https://reviews.apache.org/r/52168/diff/14/
>
>
> Testing
> -------
>
> Manual and unit testing has been done to verify the apis.
>
>
> Thanks,
>
> Shanthoosh Venkataraman
>
>
Re: Review Request 52168: Tasks endpoint to list the complete details
of all tasks related to a job
Posted by Prateek Maheshwari via Review Board <no...@reviews.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/52168/#review168665
-----------------------------------------------------------
Ship it!
Looks good to me, thanks.
samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala
Line 185 (original), 219 (patched)
<https://reviews.apache.org/r/52168/#comment240927>
"Reads the "
samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala
Lines 221 (patched)
<https://reviews.apache.org/r/52168/#comment240928>
Let's just delete this line.
- Prateek Maheshwari
On Feb. 15, 2017, 10:26 p.m., Shanthoosh Venkataraman wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52168/
> -----------------------------------------------------------
>
> (Updated Feb. 15, 2017, 10:26 p.m.)
>
>
> Review request for samza.
>
>
> Repository: samza
>
>
> Description
> -------
>
> This patch contains the following changes
> * Http get api to list the complete details of all the tasks that belongs to a job.
> * Refactored some methods in coordinator stream, to reuse the existing functionality of getting jobConfig from the coordinator stream.
>
>
> Diffs
> -----
>
> docs/learn/documentation/versioned/rest/resource-directory.md 79746d1e2eb3491e4bd26c3c7cf6c7efd150d8ef
> docs/learn/documentation/versioned/rest/resources/tasks.md PRE-CREATION
> samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala df63b97e9d598ecd1840111ba490a723e410d089
> samza-core/src/main/scala/org/apache/samza/job/JobRunner.scala 022b480856483059cb9f837a08f97a718bc04c31
> samza-core/src/main/scala/org/apache/samza/util/Util.scala c4836f202f7eda1d4e71eac94fd48e46207b0316
> samza-rest/src/main/config/samza-rest.properties 7be0b47d1466d2199ae278247e8d81522fb6a91c
> samza-rest/src/main/java/org/apache/samza/rest/model/Partition.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/model/Task.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/AbstractJobProxy.java 4d8647f3e1e650632e38b47ba5a8a2dac004f545
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/JobProxyFactory.java 067711a74e5b0d7277a9c8b2d2517b56e9cfbcca
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/SimpleYarnJobProxy.java a935c98730f85f448c688a6baf2e8ddffdbb2cb4
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/SimpleYarnJobProxyFactory.java 11d93d4608d23a4e3fb3bfc50dfac35ab6dbdf3c
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxy.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxyFactory.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskProxy.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskProxyFactory.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskResourceConfig.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/resources/BaseResourceConfig.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/resources/DefaultResourceFactory.java e0224c6bcf4aeaa336e5786ac472482507fcd382
> samza-rest/src/main/java/org/apache/samza/rest/resources/JobsResource.java a566db598c284d69ea61af88fdc0851483d5a089
> samza-rest/src/main/java/org/apache/samza/rest/resources/JobsResourceConfig.java 527482d2ee55747e7b3f9c54c8a3b1afe7ad8797
> samza-rest/src/main/java/org/apache/samza/rest/resources/Responses.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/resources/TasksResource.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/TestJobsResource.java 7db437b348ecd286185898b8f8ab0220d59da71a
> samza-rest/src/test/java/org/apache/samza/rest/resources/TestTasksResource.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockInstallationFinder.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockResourceFactory.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockTaskProxy.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockTaskProxyFactory.java PRE-CREATION
>
>
> Diff: https://reviews.apache.org/r/52168/diff/14/
>
>
> Testing
> -------
>
> Manual and unit testing has been done to verify the apis.
>
>
> Thanks,
>
> Shanthoosh Venkataraman
>
>
Re: Review Request 52168: Tasks endpoint to list the complete details
of all tasks related to a job
Posted by Prateek Maheshwari via Review Board <no...@reviews.apache.org>.
> On Feb. 23, 2017, 12:24 p.m., Prateek Maheshwari wrote:
> > docs/learn/documentation/versioned/rest/resources/tasks.md
> > Lines 119 (patched)
> > <https://reviews.apache.org/r/52168/diff/12/?file=1637007#file1637007line119>
> >
> > The next two configs seem like JobsResource configs. If they are, shouldn't duplicate documentation.
>
> Shanthoosh Venkataraman wrote:
> It's done to group all the configuration required for task resource at a single point. Duplication was intended here(To group configuration related to TaskResource at a single point). Moving all the configuration common for the samza-rest resources in a seperate place could be done later.
Let's create a ticket for that then.
> On Feb. 23, 2017, 12:24 p.m., Prateek Maheshwari wrote:
> > samza-rest/src/main/java/org/apache/samza/rest/model/Task.java
> > Lines 130 (patched)
> > <https://reviews.apache.org/r/52168/diff/12/?file=1637013#file1637013line130>
> >
> > storeNames?
Doesn't look like this is fixed? To clarify, should include the storeName hashCode too.
> On Feb. 23, 2017, 12:24 p.m., Prateek Maheshwari wrote:
> > samza-rest/src/main/java/org/apache/samza/rest/resources/JobsResource.java
> > Line 108 (original), 107 (patched)
> > <https://reviews.apache.org/r/52168/diff/12/?file=1637025#file1637025line108>
> >
> > Responses.serverErrorResponse
>
> Shanthoosh Venkataraman wrote:
> I think errorResponse in itself is explanatory & sufficient. Don't understand the value in renaming to serverErrorResponse.
Error is a generic term, BadRequest/NotFound is also an error. Server error is specifically HTTP 5xx codes, which is what this sends.
- Prateek
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/52168/#review166245
-----------------------------------------------------------
On Feb. 15, 2017, 10:26 p.m., Shanthoosh Venkataraman wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52168/
> -----------------------------------------------------------
>
> (Updated Feb. 15, 2017, 10:26 p.m.)
>
>
> Review request for samza.
>
>
> Repository: samza
>
>
> Description
> -------
>
> This patch contains the following changes
> * Http get api to list the complete details of all the tasks that belongs to a job.
> * Refactored some methods in coordinator stream, to reuse the existing functionality of getting jobConfig from the coordinator stream.
>
>
> Diffs
> -----
>
> docs/learn/documentation/versioned/rest/resource-directory.md 79746d1e2eb3491e4bd26c3c7cf6c7efd150d8ef
> docs/learn/documentation/versioned/rest/resources/tasks.md PRE-CREATION
> samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala df63b97e9d598ecd1840111ba490a723e410d089
> samza-core/src/main/scala/org/apache/samza/job/JobRunner.scala 022b480856483059cb9f837a08f97a718bc04c31
> samza-core/src/main/scala/org/apache/samza/util/Util.scala c4836f202f7eda1d4e71eac94fd48e46207b0316
> samza-rest/src/main/config/samza-rest.properties 7be0b47d1466d2199ae278247e8d81522fb6a91c
> samza-rest/src/main/java/org/apache/samza/rest/model/Partition.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/model/Task.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/AbstractJobProxy.java 4d8647f3e1e650632e38b47ba5a8a2dac004f545
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/JobProxyFactory.java 067711a74e5b0d7277a9c8b2d2517b56e9cfbcca
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/SimpleYarnJobProxy.java a935c98730f85f448c688a6baf2e8ddffdbb2cb4
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/SimpleYarnJobProxyFactory.java 11d93d4608d23a4e3fb3bfc50dfac35ab6dbdf3c
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxy.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxyFactory.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskProxy.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskProxyFactory.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskResourceConfig.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/resources/BaseResourceConfig.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/resources/DefaultResourceFactory.java e0224c6bcf4aeaa336e5786ac472482507fcd382
> samza-rest/src/main/java/org/apache/samza/rest/resources/JobsResource.java a566db598c284d69ea61af88fdc0851483d5a089
> samza-rest/src/main/java/org/apache/samza/rest/resources/JobsResourceConfig.java 527482d2ee55747e7b3f9c54c8a3b1afe7ad8797
> samza-rest/src/main/java/org/apache/samza/rest/resources/Responses.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/resources/TasksResource.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/TestJobsResource.java 7db437b348ecd286185898b8f8ab0220d59da71a
> samza-rest/src/test/java/org/apache/samza/rest/resources/TestTasksResource.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockInstallationFinder.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockResourceFactory.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockTaskProxy.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockTaskProxyFactory.java PRE-CREATION
>
>
> Diff: https://reviews.apache.org/r/52168/diff/13/
>
>
> Testing
> -------
>
> Manual and unit testing has been done to verify the apis.
>
>
> Thanks,
>
> Shanthoosh Venkataraman
>
>
Re: Review Request 52168: Tasks endpoint to list the complete details
of all tasks related to a job
Posted by Prateek Maheshwari <pm...@linkedin.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/52168/#review166245
-----------------------------------------------------------
First pass, will look at JobCoordinator changes separately.
docs/learn/documentation/versioned/rest/resource-directory.md (line 27)
<https://reviews.apache.org/r/52168/#comment238537>
I think you need a corresponding entry here.
docs/learn/documentation/versioned/rest/resources/tasks.md (line 22)
<https://reviews.apache.org/r/52168/#comment238497>
docs/learn/documentation/versioned/rest/resources/tasks.md (line 22)
<https://reviews.apache.org/r/52168/#comment238498>
"endpoints"
s/related to/for
docs/learn/documentation/versioned/rest/resources/tasks.md (line 23)
<https://reviews.apache.org/r/52168/#comment238499>
s/built on top of/is a sub-resource of the/. Second half ("and is not") is redundant.
docs/learn/documentation/versioned/rest/resources/tasks.md (line 41)
<https://reviews.apache.org/r/52168/#comment238500>
"the complete" is redundant.
s/that belongs to/for
docs/learn/documentation/versioned/rest/resources/tasks.md (line 74)
<https://reviews.apache.org/r/52168/#comment238501>
s/had completed/completed
Second half is unnecessary. If you keep it, use past tense to be consistent with the first�half. Also s/belong to/for
docs/learn/documentation/versioned/rest/resources/tasks.md (line 80)
<https://reviews.apache.org/r/52168/#comment238502>
Space after colon.
Let's not introduce a new convention, let's either use "jobName" or "job name". Update the place where this message is generated too.
docs/learn/documentation/versioned/rest/resources/tasks.md (line 101)
<https://reviews.apache.org/r/52168/#comment238419>
"central point to interact".
Is this for interacting with the task or just getting information about it? If the latter, should clarify it here and elsewhere.
Document intention, not implementation, for interfaces. E.g., "For example, it allows getting information about all tasks for the job" vs "exposes a method to ...".
docs/learn/documentation/versioned/rest/resources/tasks.md (line 116)
<https://reviews.apache.org/r/52168/#comment238509>
Not sure what you mean by "uses the SimpleInstallationRecord". If InstallationFinder is configurable, this shouldn't be referring to a particular installation record type. Do all InstallationFinders return a SimpleInstallationRecored? If that's the case, should remove "Simple" from the name.
docs/learn/documentation/versioned/rest/resources/tasks.md (line 119)
<https://reviews.apache.org/r/52168/#comment238539>
The next two configs seem like JobsResource configs. If they are, shouldn't duplicate documentation.
samza-rest/src/main/java/org/apache/samza/rest/model/Partition.java (line 28)
<https://reviews.apache.org/r/52168/#comment238420>
Delete extra newline at end of documentation block, here and elsewhere.
samza-rest/src/main/java/org/apache/samza/rest/model/Partition.java (line 28)
<https://reviews.apache.org/r/52168/#comment238421>
samza-rest/src/main/java/org/apache/samza/rest/model/Partition.java (line 86)
<https://reviews.apache.org/r/52168/#comment238154>
Minor: Prefer:
Partition other = (Partition) o;
return this.partitionId == other.partitionId &&
this.system == other.system &&
this.stream == other.stream;
Same elsewhere.
samza-rest/src/main/java/org/apache/samza/rest/model/Task.java (line 130)
<https://reviews.apache.org/r/52168/#comment238512>
storeNames?
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxy.java (line 57)
<https://reviews.apache.org/r/52168/#comment238541>
Not sure what "cluster agnostic" means here. Should document details about this particular implementation, e.g. that it gets the Task information and Config from the job coordinator stream.
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxy.java (line 77)
<https://reviews.apache.org/r/52168/#comment238416>
This class is classloading its own factory from config to create an instance of itself? Why is this required?
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxy.java (line 120)
<https://reviews.apache.org/r/52168/#comment238514>
Don't need "This function"/"This method" etc. in javadocs.
s/constructs/creates or builds/
s/from/for.
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxy.java (line 121)
<https://reviews.apache.org/r/52168/#comment238515>
s/denotes//
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxy.java (line 131)
<https://reviews.apache.org/r/52168/#comment238423>
"_get coordinator stream_ config"
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxy.java (line 131)
<https://reviews.apache.org/r/52168/#comment238424>
"build coordinator stream config"
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxy.java (line 137)
<https://reviews.apache.org/r/52168/#comment238516>
Second sentence is unnecessary.
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxy.java (line 139)
<https://reviews.apache.org/r/52168/#comment238517>
s/denotes//
"the job instance to get the jobModel for"
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxy.java (line 151)
<https://reviews.apache.org/r/52168/#comment238426>
"system stream _consumer_" in all these messages.
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxy.java (line 151)
<https://reviews.apache.org/r/52168/#comment238427>
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxy.java (line 161)
<https://reviews.apache.org/r/52168/#comment238428>
Don't inline config in log message (it's a map), add it to the end.
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxy.java (line 165)
<https://reviews.apache.org/r/52168/#comment238432>
Looks like this calls coordinatorSystemProducer and Consumer's start. Same with changelogManager.start. Are they idempotent?
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxy.java (line 165)
<https://reviews.apache.org/r/52168/#comment238433>
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxy.java (line 166)
<https://reviews.apache.org/r/52168/#comment238429>
Extract variables for parameters, esp. those that have side effects.
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxy.java (line 169)
<https://reviews.apache.org/r/52168/#comment238434>
Don't need to stop localityManager/changelogManager?
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxyFactory.java (line 33)
<https://reviews.apache.org/r/52168/#comment238435>
This comment is not meaningful. Should explain what kind of TaskProxy instances instead.
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxyFactory.java (line 33)
<https://reviews.apache.org/r/52168/#comment238436>
First phrase is obvious, can delete. Should explain what kind of TaskProxy instances instead.
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskProxy.java (line 30)
<https://reviews.apache.org/r/52168/#comment238440>
Should explain what the abstraction is instead of mentioning that it's an abstraction.
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskProxy.java (line 32)
<https://reviews.apache.org/r/52168/#comment238437>
Not a meaningful comment - you're just describing what interfaces are for. Should delete.
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskProxy.java (line 32)
<https://reviews.apache.org/r/52168/#comment238438>
Not sure what this means or why this is required. Should delete.
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskProxy.java (line 38)
<https://reviews.apache.org/r/52168/#comment238444>
Missing description. Noticed this somewhere else too.
s/has/have
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskProxy.java (line 42)
<https://reviews.apache.org/r/52168/#comment238519>
what status?
samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskProxy.java (line 42)
<https://reviews.apache.org/r/52168/#comment238520>
what status?
samza-rest/src/main/java/org/apache/samza/rest/resources/BaseResourceConfig.java (lines 63 - 65)
<https://reviews.apache.org/r/52168/#comment238526>
Fix indentation over multiple lines.
samza-rest/src/main/java/org/apache/samza/rest/resources/JobsResource.java (line 107)
<https://reviews.apache.org/r/52168/#comment238528>
Responses.serverErrorResponse
samza-rest/src/main/java/org/apache/samza/rest/resources/Responses.java (line 25)
<https://reviews.apache.org/r/52168/#comment238529>
Incorrect description - it's a lot more general than the class itself.
samza-rest/src/main/java/org/apache/samza/rest/resources/Responses.java (line 34)
<https://reviews.apache.org/r/52168/#comment238531>
Incorrect description. Should only be used for internal server errors.
Also, where's the Not Found (404) error response that we've documented? Bad request is usually a 400, not a 404. Does it mean a 404 in javax.ws?
samza-rest/src/main/java/org/apache/samza/rest/resources/Responses.java (line 44)
<https://reviews.apache.org/r/52168/#comment238532>
"Constructs a bad request (HTTP 400) response"
samza-rest/src/main/java/org/apache/samza/rest/resources/TasksResource.java (line 40)
<https://reviews.apache.org/r/52168/#comment238534>
If this resource is always for a particular job, should "/{jobName}/{jobId}" shouldn't go here instead of specific methods? Is that not allowed in javax.ws?
samza-rest/src/main/java/org/apache/samza/rest/resources/TasksResource.java (line 54)
<https://reviews.apache.org/r/52168/#comment238535>
This is assuming a particular implementation, what's the factory for in this case?
samza-rest/src/main/java/org/apache/samza/rest/resources/TasksResource.java (line 58)
<https://reviews.apache.org/r/52168/#comment238418>
Missing description.
- Prateek Maheshwari
On Feb. 15, 2017, 10:26 p.m., Shanthoosh Venkataraman wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52168/
> -----------------------------------------------------------
>
> (Updated Feb. 15, 2017, 10:26 p.m.)
>
>
> Review request for samza.
>
>
> Repository: samza
>
>
> Description
> -------
>
> This patch contains the following changes
> * Http get api to list the complete details of all the tasks that belongs to a job.
> * Refactored some methods in coordinator stream, to reuse the existing functionality of getting jobConfig from the coordinator stream.
>
>
> Diffs
> -----
>
> docs/learn/documentation/versioned/rest/resource-directory.md 79746d1e2eb3491e4bd26c3c7cf6c7efd150d8ef
> docs/learn/documentation/versioned/rest/resources/tasks.md PRE-CREATION
> samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala df63b97e9d598ecd1840111ba490a723e410d089
> samza-core/src/main/scala/org/apache/samza/job/JobRunner.scala 022b480856483059cb9f837a08f97a718bc04c31
> samza-core/src/main/scala/org/apache/samza/util/Util.scala c4836f202f7eda1d4e71eac94fd48e46207b0316
> samza-rest/src/main/config/samza-rest.properties 7be0b47d1466d2199ae278247e8d81522fb6a91c
> samza-rest/src/main/java/org/apache/samza/rest/model/Partition.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/model/Task.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/AbstractJobProxy.java 4d8647f3e1e650632e38b47ba5a8a2dac004f545
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/JobProxyFactory.java 067711a74e5b0d7277a9c8b2d2517b56e9cfbcca
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/SimpleYarnJobProxy.java a935c98730f85f448c688a6baf2e8ddffdbb2cb4
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/SimpleYarnJobProxyFactory.java 11d93d4608d23a4e3fb3bfc50dfac35ab6dbdf3c
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxy.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxyFactory.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskProxy.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskProxyFactory.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskResourceConfig.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/resources/BaseResourceConfig.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/resources/DefaultResourceFactory.java e0224c6bcf4aeaa336e5786ac472482507fcd382
> samza-rest/src/main/java/org/apache/samza/rest/resources/JobsResource.java a566db598c284d69ea61af88fdc0851483d5a089
> samza-rest/src/main/java/org/apache/samza/rest/resources/JobsResourceConfig.java 527482d2ee55747e7b3f9c54c8a3b1afe7ad8797
> samza-rest/src/main/java/org/apache/samza/rest/resources/Responses.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/resources/TasksResource.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/TestJobsResource.java 7db437b348ecd286185898b8f8ab0220d59da71a
> samza-rest/src/test/java/org/apache/samza/rest/resources/TestTasksResource.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockInstallationFinder.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockResourceFactory.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockTaskProxy.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockTaskProxyFactory.java PRE-CREATION
>
> Diff: https://reviews.apache.org/r/52168/diff/
>
>
> Testing
> -------
>
> Manual and unit testing has been done to verify the apis.
>
>
> Thanks,
>
> Shanthoosh Venkataraman
>
>
Re: Review Request 52168: Tasks endpoint to list the complete details
of all tasks related to a job
Posted by Prateek Maheshwari via Review Board <no...@reviews.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/52168/#review168039
-----------------------------------------------------------
samza-rest/src/main/java/org/apache/samza/rest/resources/TasksResource.java
Lines 66 (patched)
<https://reviews.apache.org/r/52168/#comment240059>
Log and throw, or add message to SamzaException.
- Prateek Maheshwari
On Feb. 15, 2017, 10:26 p.m., Shanthoosh Venkataraman wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52168/
> -----------------------------------------------------------
>
> (Updated Feb. 15, 2017, 10:26 p.m.)
>
>
> Review request for samza.
>
>
> Repository: samza
>
>
> Description
> -------
>
> This patch contains the following changes
> * Http get api to list the complete details of all the tasks that belongs to a job.
> * Refactored some methods in coordinator stream, to reuse the existing functionality of getting jobConfig from the coordinator stream.
>
>
> Diffs
> -----
>
> docs/learn/documentation/versioned/rest/resource-directory.md 79746d1e2eb3491e4bd26c3c7cf6c7efd150d8ef
> docs/learn/documentation/versioned/rest/resources/tasks.md PRE-CREATION
> samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala df63b97e9d598ecd1840111ba490a723e410d089
> samza-core/src/main/scala/org/apache/samza/job/JobRunner.scala 022b480856483059cb9f837a08f97a718bc04c31
> samza-core/src/main/scala/org/apache/samza/util/Util.scala c4836f202f7eda1d4e71eac94fd48e46207b0316
> samza-rest/src/main/config/samza-rest.properties 7be0b47d1466d2199ae278247e8d81522fb6a91c
> samza-rest/src/main/java/org/apache/samza/rest/model/Partition.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/model/Task.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/AbstractJobProxy.java 4d8647f3e1e650632e38b47ba5a8a2dac004f545
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/JobProxyFactory.java 067711a74e5b0d7277a9c8b2d2517b56e9cfbcca
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/SimpleYarnJobProxy.java a935c98730f85f448c688a6baf2e8ddffdbb2cb4
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/SimpleYarnJobProxyFactory.java 11d93d4608d23a4e3fb3bfc50dfac35ab6dbdf3c
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxy.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxyFactory.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskProxy.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskProxyFactory.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskResourceConfig.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/resources/BaseResourceConfig.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/resources/DefaultResourceFactory.java e0224c6bcf4aeaa336e5786ac472482507fcd382
> samza-rest/src/main/java/org/apache/samza/rest/resources/JobsResource.java a566db598c284d69ea61af88fdc0851483d5a089
> samza-rest/src/main/java/org/apache/samza/rest/resources/JobsResourceConfig.java 527482d2ee55747e7b3f9c54c8a3b1afe7ad8797
> samza-rest/src/main/java/org/apache/samza/rest/resources/Responses.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/resources/TasksResource.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/TestJobsResource.java 7db437b348ecd286185898b8f8ab0220d59da71a
> samza-rest/src/test/java/org/apache/samza/rest/resources/TestTasksResource.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockInstallationFinder.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockResourceFactory.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockTaskProxy.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockTaskProxyFactory.java PRE-CREATION
>
>
> Diff: https://reviews.apache.org/r/52168/diff/13/
>
>
> Testing
> -------
>
> Manual and unit testing has been done to verify the apis.
>
>
> Thanks,
>
> Shanthoosh Venkataraman
>
>
Re: Review Request 52168: Tasks endpoint to list the complete details
of all tasks related to a job
Posted by Prateek Maheshwari via Review Board <no...@reviews.apache.org>.
> On March 6, 2017, 2:33 p.m., Prateek Maheshwari wrote:
> > samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala
> > Line 121 (original), 154 (patched)
> > <https://reviews.apache.org/r/52168/diff/13/?file=1655795#file1655795line164>
> >
> > Should this be previousChangelogMapping?
>
> Shanthoosh Venkataraman wrote:
> Fixed.
Don't see this in the latest RB. Did you decide not to?
> On March 6, 2017, 2:33 p.m., Prateek Maheshwari wrote:
> > samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala
> > Line 189 (original), 223 (patched)
> > <https://reviews.apache.org/r/52168/diff/13/?file=1655795#file1655795line234>
> >
> > The fact that this is the previousChangelogPartitionMapping seems to be significant here. If so, should call it that.
> >
> > Nitpick: Let's make changelog/changeLog usage consistent in this class.
>
> Shanthoosh Venkataraman wrote:
> Renamed to previousChangeLogPartitionMapping.
>
> Fixing the nitpick is tricky. There're classes (SystemAdmin, Config, ChangeLogManager, etc) where this name (changeLog, changelog) is used intermittently and those methods are used heavily within this class and across the codebase. If we want to pick a name it should be done consistently across the codebase. So I'm not comfortable introducing this massive change as a part of this patch. We could do it later.
Makes sense, thanks.
> On March 6, 2017, 2:33 p.m., Prateek Maheshwari wrote:
> > samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala
> > Line 332 (original), 329 (patched)
> > <https://reviews.apache.org/r/52168/diff/13/?file=1655795#file1655795line395>
> >
> > Do you know why we pass in a server here when this class is managing (starting/stopping) it? If it's just to share the jobModelRef, should pass that directly.
>
> Shanthoosh Venkataraman wrote:
> AFAIK, this class was exposing http endpoint for reComputing the jobModel in the past(which is no longer supported). Your suggestion is correct, I can create a JIRA for improving/fixing it.
Doesn't seem like a big change, I'm OK with fixing it here. Up to you.
- Prateek
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/52168/#review168041
-----------------------------------------------------------
On Feb. 15, 2017, 10:26 p.m., Shanthoosh Venkataraman wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52168/
> -----------------------------------------------------------
>
> (Updated Feb. 15, 2017, 10:26 p.m.)
>
>
> Review request for samza.
>
>
> Repository: samza
>
>
> Description
> -------
>
> This patch contains the following changes
> * Http get api to list the complete details of all the tasks that belongs to a job.
> * Refactored some methods in coordinator stream, to reuse the existing functionality of getting jobConfig from the coordinator stream.
>
>
> Diffs
> -----
>
> docs/learn/documentation/versioned/rest/resource-directory.md 79746d1e2eb3491e4bd26c3c7cf6c7efd150d8ef
> docs/learn/documentation/versioned/rest/resources/tasks.md PRE-CREATION
> samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala df63b97e9d598ecd1840111ba490a723e410d089
> samza-core/src/main/scala/org/apache/samza/job/JobRunner.scala 022b480856483059cb9f837a08f97a718bc04c31
> samza-core/src/main/scala/org/apache/samza/util/Util.scala c4836f202f7eda1d4e71eac94fd48e46207b0316
> samza-rest/src/main/config/samza-rest.properties 7be0b47d1466d2199ae278247e8d81522fb6a91c
> samza-rest/src/main/java/org/apache/samza/rest/model/Partition.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/model/Task.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/AbstractJobProxy.java 4d8647f3e1e650632e38b47ba5a8a2dac004f545
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/JobProxyFactory.java 067711a74e5b0d7277a9c8b2d2517b56e9cfbcca
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/SimpleYarnJobProxy.java a935c98730f85f448c688a6baf2e8ddffdbb2cb4
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/SimpleYarnJobProxyFactory.java 11d93d4608d23a4e3fb3bfc50dfac35ab6dbdf3c
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxy.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxyFactory.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskProxy.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskProxyFactory.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskResourceConfig.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/resources/BaseResourceConfig.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/resources/DefaultResourceFactory.java e0224c6bcf4aeaa336e5786ac472482507fcd382
> samza-rest/src/main/java/org/apache/samza/rest/resources/JobsResource.java a566db598c284d69ea61af88fdc0851483d5a089
> samza-rest/src/main/java/org/apache/samza/rest/resources/JobsResourceConfig.java 527482d2ee55747e7b3f9c54c8a3b1afe7ad8797
> samza-rest/src/main/java/org/apache/samza/rest/resources/Responses.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/resources/TasksResource.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/TestJobsResource.java 7db437b348ecd286185898b8f8ab0220d59da71a
> samza-rest/src/test/java/org/apache/samza/rest/resources/TestTasksResource.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockInstallationFinder.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockResourceFactory.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockTaskProxy.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockTaskProxyFactory.java PRE-CREATION
>
>
> Diff: https://reviews.apache.org/r/52168/diff/14/
>
>
> Testing
> -------
>
> Manual and unit testing has been done to verify the apis.
>
>
> Thanks,
>
> Shanthoosh Venkataraman
>
>
Re: Review Request 52168: Tasks endpoint to list the complete details
of all tasks related to a job
Posted by Prateek Maheshwari via Review Board <no...@reviews.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/52168/#review168041
-----------------------------------------------------------
samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala
Line 50 (original), 61 (patched)
<https://reviews.apache.org/r/52168/#comment240088>
File name doesn't match class name.
samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala
Line 59 (original), 71 (patched)
<https://reviews.apache.org/r/52168/#comment240086>
Javadoc must contain description, here and everywhere else. Also fix @param description indentation over multiple lines.
samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala
Line 70 (original), 85 (patched)
<https://reviews.apache.org/r/52168/#comment240065>
"system stream consumer" etc.
samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala
Line 85 (original), 103 (patched)
<https://reviews.apache.org/r/52168/#comment240102>
This should be a private method or inlined. If you really want to share this code, (I'm not convinced we need to) it should not be in this class.
samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala
Lines 120 (patched)
<https://reviews.apache.org/r/52168/#comment240114>
What if this is null?
Prefer previousChangelogPartitionMapping. Verbose but more accurate.
samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala
Lines 122-134 (patched)
<https://reviews.apache.org/r/52168/#comment240118>
Prefer extracting this to a method called 'updateChangelogMapping' or something similar.
samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala
Line 121 (original), 154 (patched)
<https://reviews.apache.org/r/52168/#comment240091>
Should this be previousChangelogMapping?
samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala
Line 185 (original), 217 (patched)
<https://reviews.apache.org/r/52168/#comment240092>
Not your change, but first sentence is unnecessary.
samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala
Line 186 (original), 218 (patched)
<https://reviews.apache.org/r/52168/#comment240087>
Fix indentation (-1)
samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala
Lines 219 (patched)
<https://reviews.apache.org/r/52168/#comment240093>
Not your change, but shouldn't refer to historical context in comments - that belongs in PR/RB descriptions. I.e., "This method no longer needs" vs "This method does not need".
samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala
Line 188 (original), 222 (patched)
<https://reviews.apache.org/r/52168/#comment240112>
Prefer renaming to 'readCurrentJobModel' or something similar.
samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala
Line 189 (original), 223 (patched)
<https://reviews.apache.org/r/52168/#comment240121>
The fact that this is the previousChangelogPartitionMapping seems to be significant here. If so, should call it that.
Nitpick: Let's make changelog/changeLog usage consistent in this class.
samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala
Line 235 (original)
<https://reviews.apache.org/r/52168/#comment240126>
Where is this newChangelogMapping being used after it's written with the changelog manager? Does this mean that the updated mapping is only relevant for the next job run?
samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala
Line 332 (original), 329 (patched)
<https://reviews.apache.org/r/52168/#comment240109>
Do you know why we pass in a server here when this class is managing (starting/stopping) it? If it's just to share the jobModelRef, should pass that directly.
- Prateek Maheshwari
On Feb. 15, 2017, 10:26 p.m., Shanthoosh Venkataraman wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52168/
> -----------------------------------------------------------
>
> (Updated Feb. 15, 2017, 10:26 p.m.)
>
>
> Review request for samza.
>
>
> Repository: samza
>
>
> Description
> -------
>
> This patch contains the following changes
> * Http get api to list the complete details of all the tasks that belongs to a job.
> * Refactored some methods in coordinator stream, to reuse the existing functionality of getting jobConfig from the coordinator stream.
>
>
> Diffs
> -----
>
> docs/learn/documentation/versioned/rest/resource-directory.md 79746d1e2eb3491e4bd26c3c7cf6c7efd150d8ef
> docs/learn/documentation/versioned/rest/resources/tasks.md PRE-CREATION
> samza-core/src/main/scala/org/apache/samza/coordinator/JobCoordinator.scala df63b97e9d598ecd1840111ba490a723e410d089
> samza-core/src/main/scala/org/apache/samza/job/JobRunner.scala 022b480856483059cb9f837a08f97a718bc04c31
> samza-core/src/main/scala/org/apache/samza/util/Util.scala c4836f202f7eda1d4e71eac94fd48e46207b0316
> samza-rest/src/main/config/samza-rest.properties 7be0b47d1466d2199ae278247e8d81522fb6a91c
> samza-rest/src/main/java/org/apache/samza/rest/model/Partition.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/model/Task.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/AbstractJobProxy.java 4d8647f3e1e650632e38b47ba5a8a2dac004f545
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/JobProxyFactory.java 067711a74e5b0d7277a9c8b2d2517b56e9cfbcca
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/SimpleYarnJobProxy.java a935c98730f85f448c688a6baf2e8ddffdbb2cb4
> samza-rest/src/main/java/org/apache/samza/rest/proxy/job/SimpleYarnJobProxyFactory.java 11d93d4608d23a4e3fb3bfc50dfac35ab6dbdf3c
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxy.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/SamzaTaskProxyFactory.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskProxy.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskProxyFactory.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/proxy/task/TaskResourceConfig.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/resources/BaseResourceConfig.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/resources/DefaultResourceFactory.java e0224c6bcf4aeaa336e5786ac472482507fcd382
> samza-rest/src/main/java/org/apache/samza/rest/resources/JobsResource.java a566db598c284d69ea61af88fdc0851483d5a089
> samza-rest/src/main/java/org/apache/samza/rest/resources/JobsResourceConfig.java 527482d2ee55747e7b3f9c54c8a3b1afe7ad8797
> samza-rest/src/main/java/org/apache/samza/rest/resources/Responses.java PRE-CREATION
> samza-rest/src/main/java/org/apache/samza/rest/resources/TasksResource.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/TestJobsResource.java 7db437b348ecd286185898b8f8ab0220d59da71a
> samza-rest/src/test/java/org/apache/samza/rest/resources/TestTasksResource.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockInstallationFinder.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockResourceFactory.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockTaskProxy.java PRE-CREATION
> samza-rest/src/test/java/org/apache/samza/rest/resources/mock/MockTaskProxyFactory.java PRE-CREATION
>
>
> Diff: https://reviews.apache.org/r/52168/diff/13/
>
>
> Testing
> -------
>
> Manual and unit testing has been done to verify the apis.
>
>
> Thanks,
>
> Shanthoosh Venkataraman
>
>