Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/2338#discussion_r140519078
--- Diff:
storm-client/src/jvm/org/apache/storm/cluster/StormClusterStateImpl.java ---
@@ -423,50 +424,63 @@ public void supervisorHeartbeat(String supervisorId,
SupervisorInfo info) {
}
/**
- * if znode exists and to be not on?, delete; if exists and on?, do
nothing; if not exists and to be on?, create; if not exists and not on?, do
nothing;
- *
- * @param stormId
- * @param node
- * @param port
- * @param on
+ * If znode exists and timestamp is 0, delete;
+ * if exists and timestamp is larger than 0, update the timestamp;
+ * if not exists and timestamp is larger than 0, create the znode and
set the timestamp;
+ * if not exists and timestamp is 0, do nothing.
+ * @param stormId The topology Id
+ * @param node The node id
+ * @param port The port number
+ * @param timestamp The backpressure timestamp. 0 means turning off
the worker backpressure
*/
@Override
- public void workerBackpressure(String stormId, String node, Long port,
boolean on) {
+ public void workerBackpressure(String stormId, String node, Long port,
long timestamp) {
String path = ClusterUtils.backpressurePath(stormId, node, port);
boolean existed = stateStorage.node_exists(path, false);
if (existed) {
- if (on == false)
+ if (timestamp == 0) {
--- End diff --
nit: Can we make this `<= 0` just as defensive programming?
---