Github user lei-xia commented on a diff in the pull request:
https://github.com/apache/helix/pull/152#discussion_r176144284
--- Diff: helix-core/src/main/java/org/apache/helix/util/HelixUtil.java ---
@@ -219,4 +220,22 @@ public static String serializeByComma(List<String>
objects) {
return idealStateMap;
}
+
+ /**
+ * Remove the given message from ZK using the given accessor. This
function will
+ * not throw exception
+ * @param accessor HelixDataAccessor
+ * @param msg message to remove
+ * @param instanceName name of the instance on which the message sits
+ * @return true if success else false
+ */
+ public static boolean removeMessageFromZK(HelixDataAccessor accessor,
Message msg,
+ String instanceName) {
+ try {
+ return accessor.removeProperty(msg.getKey(accessor.keyBuilder(),
instanceName));
+ } catch (Exception e) {
--- End diff --
Do we throw NoNodeException here, if there is, NoNodeException should be
treated as success?
---