HADOOP-17841. Remove ListenerHandle from Hadoop registry (#3278)
This commit is contained in:
parent
0c7b951e03
commit
6a7883431f
@ -824,9 +824,8 @@ protected String dumpRegistryRobustly(boolean verbose) {
|
||||
* 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 ListenerHandle registerPathListener(final PathListener listener) {
|
||||
.build();
|
||||
|
||||
curatorCacheBridge.listenable().addListener(cacheListener);
|
||||
return () -> curatorCacheBridge.listenable().removeListener(cacheListener);
|
||||
}
|
||||
|
||||
// TODO: should caches be stopped and then restarted if need be?
|
||||
|
@ -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();
|
||||
}
|
Loading…
Reference in New Issue
Block a user