-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Stats to DatastreamTaskImpl #855
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ | |
import org.I0Itec.zkclient.IZkStateListener; | ||
import org.I0Itec.zkclient.exception.ZkException; | ||
import org.I0Itec.zkclient.exception.ZkNoNodeException; | ||
import org.apache.commons.lang3.StringUtils; | ||
import org.apache.zookeeper.CreateMode; | ||
import org.apache.zookeeper.Watcher; | ||
import org.slf4j.Logger; | ||
|
@@ -681,6 +682,11 @@ private void addTaskNodes(String instance, DatastreamTaskImpl task) { | |
KeyBuilder.datastreamTaskState(_cluster, task.getConnectorType(), task.getDatastreamTaskName()); | ||
_zkclient.ensurePath(taskStatePath); | ||
|
||
// save the task stats. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update the task node's directory structure in the method description above. This is a new subdirectory "stats" under the task, correct? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, "stats" directory will be inside "state" directory and will be conditional. |
||
if (!StringUtils.isEmpty(task.getStats())) { | ||
task.saveState("stats", task.getStats()); | ||
} | ||
|
||
String instancePath = KeyBuilder.instanceAssignment(_cluster, instance, name); | ||
String json = ""; | ||
try { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to have a timestamp field here instead of having the latest flag, so that we get a sense of the last partition throughput distribution more accurately?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we can add timestamp. We still need the latest flag, because not all the partition assignments will use Throughput based balancing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will address it separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotcha! thanks