From 8246fd73b2dd52cd5b2ed80b9d6ed54d2716c41b Mon Sep 17 00:00:00 2001 From: Dave Marion Date: Tue, 14 Jan 2025 18:44:11 +0000 Subject: [PATCH] Made ZC.clear() private, fixed path issue in TableZooHelper --- .../java/org/apache/accumulo/core/fate/zookeeper/ZooCache.java | 2 +- .../org/apache/accumulo/core/util/tables/TableZooHelper.java | 2 +- .../org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/apache/accumulo/core/fate/zookeeper/ZooCache.java b/core/src/main/java/org/apache/accumulo/core/fate/zookeeper/ZooCache.java index 71f8e7423bd..641b73d79ed 100644 --- a/core/src/main/java/org/apache/accumulo/core/fate/zookeeper/ZooCache.java +++ b/core/src/main/java/org/apache/accumulo/core/fate/zookeeper/ZooCache.java @@ -497,7 +497,7 @@ protected void copyStats(ZcStat userStat, ZcStat cachedStat) { /** * Clears this cache. */ - public void clear() { + private void clear() { Preconditions.checkState(!closed); nodeCache.clear(); updateCount.incrementAndGet(); diff --git a/core/src/main/java/org/apache/accumulo/core/util/tables/TableZooHelper.java b/core/src/main/java/org/apache/accumulo/core/util/tables/TableZooHelper.java index 66a41768d69..1ab1e1d708f 100644 --- a/core/src/main/java/org/apache/accumulo/core/util/tables/TableZooHelper.java +++ b/core/src/main/java/org/apache/accumulo/core/util/tables/TableZooHelper.java @@ -173,7 +173,7 @@ public TableState getTableState(TableId tableId, boolean clearCachedState) { String statePath = context.getZooKeeperRoot() + Constants.ZTABLES + "/" + tableId.canonical() + Constants.ZTABLE_STATE; if (clearCachedState) { - context.getZooCache().clear(context.getZooKeeperRoot() + statePath); + context.getZooCache().clear(statePath); instanceToMapCache.invalidateAll(); } ZooCache zc = context.getZooCache(); diff --git a/test/src/main/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java b/test/src/main/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java index ce0e21c4689..0b5ef9d119b 100644 --- a/test/src/main/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java +++ b/test/src/main/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java @@ -96,7 +96,6 @@ public void alterConfig() throws Exception { try (AccumuloClient client = Accumulo.newClient().from(getClientProps()).build(); ClientContext context = (ClientContext) client) { ZooCache zcache = context.getZooCache(); - zcache.clear(); var path = context.getServerPaths().createGarbageCollectorPath(); Optional gcLockData; do {