瀏覽代碼

HADOOP-17841. Remove ListenerHandle from Hadoop registry (#3278)

Viraj Jasani 3 年之前
父節點
當前提交
6a7883431f

+ 1 - 3
hadoop-common-project/hadoop-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/CuratorService.java

@@ -824,9 +824,8 @@ public class CuratorService extends CompositeService
    * Registers a listener to path related events.
    *
    * @param listener the listener.
-   * @return a handle allowing for the management of the listener.
    */
-  public ListenerHandle registerPathListener(final PathListener listener) {
+  public void registerPathListener(final PathListener listener) {
 
     CuratorCacheListener cacheListener = CuratorCacheListener.builder()
         .forCreatesAndChanges((oldNode, node) -> {
@@ -854,7 +853,6 @@ public class CuratorService extends CompositeService
         .build();
 
     curatorCacheBridge.listenable().addListener(cacheListener);
-    return () -> curatorCacheBridge.listenable().removeListener(cacheListener);
   }
 
   // TODO: should caches be stopped and then restarted if need be?

+ 0 - 25
hadoop-common-project/hadoop-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/ListenerHandle.java

@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.registry.client.impl.zk;
-
-/**
- *
- */
-public interface ListenerHandle {
-  void remove();
-}