Skip to content

Commit 2cf1a6c

Browse files
committed
address comments
1 parent 37c9861 commit 2cf1a6c

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

helix-core/src/main/java/org/apache/helix/NotificationContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,6 @@ public boolean getIsChildChange() {
234234
}
235235

236236
public void setIsChildChange(boolean cc) {
237-
_isChildChange = cc;
237+
this._isChildChange = cc;
238238
}
239239
}

helix-core/src/test/java/org/apache/helix/integration/TestZkCallbackHandlerLeak.java

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626

2727
import org.apache.helix.CurrentStateChangeListener;
2828
import org.apache.helix.HelixDataAccessor;
29-
import org.apache.helix.HelixManager;
30-
import org.apache.helix.HelixManagerFactory;
31-
import org.apache.helix.InstanceType;
3229
import org.apache.helix.NotificationContext;
3330
import org.apache.helix.PropertyKey;
3431
import org.apache.helix.PropertyType;
@@ -467,23 +464,29 @@ public void testCurrentStatePathLeakingByAsycRemoval() throws Exception {
467464
cs.setSessionId(jobSessionId);
468465
cs.setStateModelDefRef(db0.getStateModelDefRef());
469466

467+
Map<String, List<String>> rpWatchPaths = ZkTestHelper.getZkWatch(rpManager.getZkClient());
468+
Assert.assertFalse(rpWatchPaths.get("dataWatches").contains(jobKey.getPath()));
469+
470470
LOG.info("add job");
471-
boolean rtJob = false;
472471
for (int i = 0; i < mJobUpdateCnt; i++) {
473-
rtJob = jobAccesor.setProperty(jobKey, cs);
472+
jobAccesor.setProperty(jobKey, cs);
474473
}
475474

475+
Map<String, Set<String>> listenersByZkPath = ZkTestHelper.getListenersByZkPath(ZK_ADDR);
476+
Assert.assertTrue(listenersByZkPath.keySet().contains(jobKey.getPath()));
477+
rpWatchPaths = ZkTestHelper.getZkWatch(rpManager.getZkClient());
478+
Assert.assertTrue(rpWatchPaths.get("dataWatches").contains(jobKey.getPath()));
479+
476480
LOG.info("remove job");
477-
rtJob = jobParticipant.getZkClient().delete(jobKey.getPath());
481+
jobParticipant.getZkClient().delete(jobKey.getPath());
478482

479483
// validate the job watch is not leaked.
480484
Thread.sleep(5000);
481485

482-
Map<String, Set<String>> listenersByZkPath = ZkTestHelper.getListenersByZkPath(ZK_ADDR);
483-
boolean jobKeyExists = listenersByZkPath.keySet().contains(jobKey.getPath());
484-
Assert.assertFalse(jobKeyExists);
486+
listenersByZkPath = ZkTestHelper.getListenersByZkPath(ZK_ADDR);
487+
Assert.assertFalse(listenersByZkPath.keySet().contains(jobKey.getPath()));
485488

486-
Map<String, List<String>> rpWatchPaths = ZkTestHelper.getZkWatch(rpManager.getZkClient());
489+
rpWatchPaths = ZkTestHelper.getZkWatch(rpManager.getZkClient());
487490
List<String> existWatches = rpWatchPaths.get("existWatches");
488491
Assert.assertTrue(existWatches.isEmpty());
489492

0 commit comments

Comments
 (0)