Skip to content

Commit

Permalink
Fix checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaojinchao95 committed May 26, 2024
1 parent 8ca7826 commit 507a60d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.apache.curator.framework.api.ACLProvider;
import org.apache.curator.framework.recipes.cache.CuratorCache;
import org.apache.curator.framework.recipes.cache.CuratorCacheListener;
import org.apache.curator.framework.recipes.cache.TreeCacheEvent;
import org.apache.curator.retry.ExponentialBackoffRetry;
import org.apache.curator.utils.CloseableUtils;
import org.apache.shardingsphere.infra.instance.ComputeNodeInstanceContext;
Expand Down Expand Up @@ -241,6 +240,7 @@ public void watch(final String key, final DataChangedEventListener listener) {
cache = CuratorCache.build(client, key);
caches.put(key, cache);
}
// CHECKSTYLE:OFF
CuratorCacheListener cacheListener = (curatorType, oldData, newData) -> {
if (null == newData && null == oldData) {
return;
Expand All @@ -256,6 +256,7 @@ public void watch(final String key, final DataChangedEventListener listener) {
byte[] data = Type.DELETED == type ? oldData.getData() : newData.getData();
listener.onChange(new DataChangedEvent(path, null == data ? "" : new String(data, StandardCharsets.UTF_8), type));
};
// CHECKSTYLE:ON
cache.listenable().addListener(cacheListener);
cache.start();
}
Expand Down

0 comments on commit 507a60d

Please sign in to comment.