Github user srdo commented on a diff in the pull request:
https://github.com/apache/storm/pull/2487#discussion_r159093595
--- Diff:
storm-client/src/jvm/org/apache/storm/cluster/StormClusterStateImpl.java ---
@@ -438,9 +438,7 @@ public void workerBackpressure(String stormId, String
node, Long port, long time
String path = ClusterUtils.backpressurePath(stormId, node, port);
boolean existed = stateStorage.node_exists(path, false);
if (existed) {
- if (timestamp <= 0) {
- stateStorage.delete_node(path);
- } else {
+ if (timestamp > 0) {
--- End diff --
The change seems reasonable to me. The javadoc for this method is slightly
out of date now, consider updating the first line of it.
The two outermost branches here do mostly the same thing. Consider
rewriting to something like
```
if (timestamp <= 0) {
return
}
String path = ...
boolean existed = ...
byte[] data = ...
if (existed) {
set_data
} else {
set_ephemeral_node
}
```
---