This is an automated email from the ASF dual-hosted git repository.

dlmarion pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/main by this push:
     new 8cd2bbfc77 Removed ZooKeeperLockChecker.invalidateCache(String) (#6436)
8cd2bbfc77 is described below

commit 8cd2bbfc7771ef568ea3ba572515b6956d7ade8b
Author: Dave Marion <[email protected]>
AuthorDate: Tue Jun 23 13:28:52 2026 -0400

    Removed ZooKeeperLockChecker.invalidateCache(String) (#6436)
    
    This method was previously used in the TabletLocator, which has
    been refactored in 4.0.0. This method is no longer used.
---
 .../core/clientImpl/ClientTabletCacheImpl.java     |  2 -
 .../core/clientImpl/ZookeeperLockChecker.java      |  7 ---
 .../core/clientImpl/ClientTabletCacheImplTest.java |  5 --
 .../core/clientImpl/ZookeeperLockCheckerTest.java  | 68 ----------------------
 4 files changed, 82 deletions(-)

diff --git 
a/core/src/main/java/org/apache/accumulo/core/clientImpl/ClientTabletCacheImpl.java
 
b/core/src/main/java/org/apache/accumulo/core/clientImpl/ClientTabletCacheImpl.java
index 2ffbed12eb..814c4b856f 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/clientImpl/ClientTabletCacheImpl.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/clientImpl/ClientTabletCacheImpl.java
@@ -155,8 +155,6 @@ public class ClientTabletCacheImpl extends 
ClientTabletCache {
 
   public interface TabletServerLockChecker {
     boolean isLockHeld(String tserver, String session);
-
-    void invalidateCache(String server);
   }
 
   private class LockCheckerSession {
diff --git 
a/core/src/main/java/org/apache/accumulo/core/clientImpl/ZookeeperLockChecker.java
 
b/core/src/main/java/org/apache/accumulo/core/clientImpl/ZookeeperLockChecker.java
index 68382a867c..503bc49558 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/clientImpl/ZookeeperLockChecker.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/clientImpl/ZookeeperLockChecker.java
@@ -22,7 +22,6 @@ import static java.util.Objects.requireNonNull;
 
 import java.util.Set;
 
-import org.apache.accumulo.core.Constants;
 import 
org.apache.accumulo.core.clientImpl.ClientTabletCacheImpl.TabletServerLockChecker;
 import org.apache.accumulo.core.lock.ServiceLock;
 import org.apache.accumulo.core.lock.ServiceLockPaths;
@@ -65,10 +64,4 @@ public class ZookeeperLockChecker implements 
TabletServerLockChecker {
     return false;
   }
 
-  @Override
-  public void invalidateCache(String tserver) {
-    // The path for the tserver contains a resource group. The resource group 
is unknown, so can not
-    // construct a prefix. Therefore clear any path that contains the tserver.
-    zc.clear(path -> path.startsWith(Constants.ZTSERVERS) && 
path.contains(tserver));
-  }
 }
diff --git 
a/core/src/test/java/org/apache/accumulo/core/clientImpl/ClientTabletCacheImplTest.java
 
b/core/src/test/java/org/apache/accumulo/core/clientImpl/ClientTabletCacheImplTest.java
index 9c35fd312b..2f4d89ddad 100644
--- 
a/core/src/test/java/org/apache/accumulo/core/clientImpl/ClientTabletCacheImplTest.java
+++ 
b/core/src/test/java/org/apache/accumulo/core/clientImpl/ClientTabletCacheImplTest.java
@@ -556,8 +556,6 @@ public class ClientTabletCacheImplTest {
       return true;
     }
 
-    @Override
-    public void invalidateCache(String server) {}
   }
 
   static class TestRootClientTabletCache extends RootClientTabletCache {
@@ -1564,9 +1562,6 @@ public class ClientTabletCacheImplTest {
           public boolean isLockHeld(String tserver, String session) {
             return activeLocks.contains(tserver + ":" + session);
           }
-
-          @Override
-          public void invalidateCache(String server) {}
         });
 
     KeyExtent ke1 = createNewKeyExtent("foo", null, null);
diff --git 
a/core/src/test/java/org/apache/accumulo/core/clientImpl/ZookeeperLockCheckerTest.java
 
b/core/src/test/java/org/apache/accumulo/core/clientImpl/ZookeeperLockCheckerTest.java
deleted file mode 100644
index 07487939b1..0000000000
--- 
a/core/src/test/java/org/apache/accumulo/core/clientImpl/ZookeeperLockCheckerTest.java
+++ /dev/null
@@ -1,68 +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
- *
- *   https://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.accumulo.core.clientImpl;
-
-import static org.easymock.EasyMock.anyObject;
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.reset;
-import static org.easymock.EasyMock.verify;
-
-import java.util.function.Predicate;
-
-import org.apache.accumulo.core.zookeeper.ZooCache;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-public class ZookeeperLockCheckerTest {
-
-  private ClientContext context;
-  private ZooCache zc;
-
-  @BeforeEach
-  public void setUp() {
-    zc = createMock(ZooCache.class);
-    context = createMock(ClientContext.class);
-    expect(context.getZooCache()).andReturn(zc).anyTimes();
-    replay(context, zc);
-  }
-
-  @AfterEach
-  public void tearDown() {
-    verify(context, zc);
-  }
-
-  @Test
-  public void testInvalidateCache() {
-    var zklc = new ZookeeperLockChecker(zc);
-
-    verify(zc);
-    reset(zc);
-    @SuppressWarnings("unchecked")
-    Predicate<String> anyObj = anyObject(Predicate.class);
-    zc.clear(anyObj);
-    expectLastCall().once();
-    replay(zc);
-
-    zklc.invalidateCache("server");
-  }
-}

Reply via email to