Skip to content

Conversation

@hummelm
Copy link

@hummelm hummelm commented Apr 7, 2018

Add in WorkerState an internal list of deserialized workerHooks and use it to
start/stop

Add in WorkerState an internal list of workerHooks and use it to
start/stop
Copy link
Contributor

@HeartSaVioR HeartSaVioR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, left some comments.

@@ -599,20 +613,16 @@ public WorkerTopologyContext getWorkerTopologyContext() {
public void runWorkerStartHooks() {
WorkerTopologyContext workerContext = getWorkerTopologyContext();
if (topology.is_set_worker_hooks()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if statement unnecessary for now.

}

public void runWorkerShutdownHooks() {
if (topology.is_set_worker_hooks()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if statement unnecessary for now.

int maxTaskId = getMaxTaskId(componentToSortedTasks);
this.workerTransfer = new WorkerTransfer(this, topologyConf, maxTaskId);
this.bpTracker = new BackPressureTracker(workerId, localTaskIds);
//
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

‘//‘ can be removed, and better to extract below to private method as we did above.

Use a private method to deserialize hooks
remove unnecessary if statement
Copy link
Contributor

@revans2 revans2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 looks good to me.

Copy link
Contributor

@HeartSaVioR HeartSaVioR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@asfgit asfgit merged commit d9a3693 into apache:master Apr 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants