You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by "Chris Riccomini (JIRA)" <ji...@apache.org> on 2015/02/25 01:54:05 UTC
[jira] [Updated] (SAMZA-555) Write a ZK-based samza-standalone
JobRunner
[ https://issues.apache.org/jira/browse/SAMZA-555?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chris Riccomini updated SAMZA-555:
----------------------------------
Attachment: SAMZA-555-0.patch
Attaching patch. RB at:
https://reviews.apache.org/r/31392
This is a draft patch. Changes:
# Added a samza-standalone module.
# Updated JobRunner to default to wait until a JobRunner returns a "finished" status. This can be configured with job.await.finish, which defaults to true.
# Updated RunLoop to check if the current thread is interrupted. In cases where a container *always* has messages available, there is never a blocking operation, and the thread will never get an InterruptedException. Checking isInterrupted shuts down in this case.
# Wrote a StandaloneJob, which starts a coordinator controller and a container controller.
# Wrote container controller, which listens for container assignments in ZK. When it receives them, it fetches the container:task assignments from the JobCoordinator's HTTP server, and starts a new container to process the tasks.
# Wrote a coordinator controller which elects a leader to start and run the JobCoordinator. The leader stores container ID assignments in ZK, which the container controller listens for.
# Added a basic test that starts a coordinator controller, and starts and stops several container controllers. It verifies that partition ownership is handed off as expected.
(2) is a different characteristic than JobRunner used to have. It used to just stop after the job was started.
For (7), I also ran hello-samza's {{latest}} branch with StandaloneJobFactory instead of YarnJobFactory. I created a wikipedia-raw topic with 4 partitions, and was able to stop and start multiple containers. I observed the partition ownership shifting as expected. When I killed ZK, the containers seem to get confused. I haven't debugged this yet.
Open TODO items:
* Metrics.
* Javadocs.
* Config doc update for job.await.finnish.
* (Maybe) Eliminate StandaloneZkCoordinatorState.
* StandaloneJob unit tests.
* Write Zopkio stress test and remove TestStandaloneZkCoordinatorController.
* Handle ZK failures.
* Consider whether the ZK protocol is sufficient if we want to shift partitions without fully bouncing a container.
* Clean up the controller constructors.
* Eliminate remaining TODOs, or open follow-on tickets.
> Write a ZK-based samza-standalone JobRunner
> -------------------------------------------
>
> Key: SAMZA-555
> URL: https://issues.apache.org/jira/browse/SAMZA-555
> Project: Samza
> Issue Type: Sub-task
> Components: container
> Affects Versions: 0.9.0
> Reporter: Chris Riccomini
> Assignee: Chris Riccomini
> Attachments: SAMZA-555-0.patch
>
>
> SAMZA-516 documents the design of a standalone Samza job, which uses ZK for liveness monitoring and partition assignment rather than YARN. The first step to implementing this design is to add a samza-standalone submodule in Samza, which implements a JobRunner that uses ZK to elect a leader for the job (JobCoordinator), and then start a container. When failures occur, the leader should shift partitions within ZK to move partitions off of the dead container. Likewise, when a new container is added, the leader should shift partitions to the new container. The SamzaContainer should remain immutable, and simply be bounced when partitions are added or removed from it.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)