[ 
https://issues.apache.org/jira/browse/HADOOP-17835?focusedWorklogId=634526&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-634526
 ]

ASF GitHub Bot logged work on HADOOP-17835:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 05/Aug/21 12:25
            Start Date: 05/Aug/21 12:25
    Worklog Time Spent: 10m 
      Work Description: Randgalt commented on a change in pull request #3266:
URL: https://github.com/apache/hadoop/pull/3266#discussion_r683403623



##########
File path: 
hadoop-common-project/hadoop-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/CuratorService.java
##########
@@ -824,73 +825,65 @@ protected String dumpRegistryRobustly(boolean verbose) {
    *
    * @param listener the listener.
    * @return a handle allowing for the management of the listener.
-   * @throws Exception if registration fails due to error.
    */
-  public ListenerHandle registerPathListener(final PathListener listener)
-      throws Exception {
-
-    final TreeCacheListener pathChildrenCacheListener =
-        new TreeCacheListener() {
-
-          public void childEvent(CuratorFramework curatorFramework,
-              TreeCacheEvent event)
-              throws Exception {
-            String path = null;
-            if (event != null && event.getData() != null) {
-              path = event.getData().getPath();
-            }
-            assert event != null;
-            switch (event.getType()) {
-            case NODE_ADDED:
-              LOG.info("Informing listener of added node {}", path);
-              listener.nodeAdded(path);
-
-              break;
-
-            case NODE_REMOVED:
-              LOG.info("Informing listener of removed node {}", path);
-              listener.nodeRemoved(path);
-
-              break;
-
-            case NODE_UPDATED:
-              LOG.info("Informing listener of updated node {}", path);
-              listener.nodeAdded(path);
-
-              break;
-
-            default:
-              // do nothing
-              break;
-
-            }
+  public ListenerHandle registerPathListener(final PathListener listener) {
+
+    CuratorCacheListener cacheListener = CuratorCacheListener.builder()
+        .forCreates(childData -> {

Review comment:
       Note: there is a `forCreatesAndChanges()`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 634526)
    Time Spent: 2h  (was: 1h 50m)

> Use CuratorCache implementation instead of PathChildrenCache / TreeCache
> ------------------------------------------------------------------------
>
>                 Key: HADOOP-17835
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17835
>             Project: Hadoop Common
>          Issue Type: Task
>            Reporter: Viraj Jasani
>            Assignee: Viraj Jasani
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> As we have moved to Curator 5.2.0 for Hadoop 3.4.0, we should start using new 
> CuratorCache service implementation in place of deprecated PathChildrenCache 
> and TreeCache usecases.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to