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

This commit is contained in:
Viraj Jasani 2021-08-09 14:27:53 +05:30 committed by GitHub
parent 0c7b951e03
commit 6a7883431f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 28 deletions

View File

@ -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?

View File

@ -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();
}