This is an automated email from the ASF dual-hosted git repository.
dlmarion pushed a commit to branch 2.1
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/2.1 by this push:
new 7ddcfdbc81 Added check in TabletClientHandler.getTabletStats (#6556)
7ddcfdbc81 is described below
commit 7ddcfdbc8183d01d13e41b397580787fc1ee2ec5
Author: Dave Marion <[email protected]>
AuthorDate: Fri Sep 25 11:45:33 2026 -0400
Added check in TabletClientHandler.getTabletStats (#6556)
---
.../accumulo/tserver/TabletClientHandler.java | 24 ++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git
a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletClientHandler.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletClientHandler.java
index 608291db7a..3176e45c08 100644
---
a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletClientHandler.java
+++
b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletClientHandler.java
@@ -1106,13 +1106,29 @@ public class TabletClientHandler implements
TabletClientService.Iface {
}
@Override
- public List<TabletStats> getTabletStats(TInfo tinfo, TCredentials
credentials, String tableId) {
+ public List<TabletStats> getTabletStats(TInfo tinfo, TCredentials
credentials, String tableId)
+ throws ThriftSecurityException {
List<TabletStats> result = new ArrayList<>();
- TableId text = TableId.of(tableId);
- KeyExtent start = new KeyExtent(text, new Text(), null);
+ TableId tid = TableId.of(tableId);
+ NamespaceId namespaceId = null;
+ try {
+ namespaceId = getNamespaceId(credentials, tid);
+ } catch (ThriftSecurityException e) {
+ if (e.getCode() == SecurityErrorCode.TABLE_DOESNT_EXIST) {
+ return result;
+ }
+ throw e;
+ }
+ if (!security.canScan(credentials, tid, namespaceId, Map.of(), List.of(),
List.of(), Map.of(),
+ List.of())) {
+ throw new ThriftSecurityException(credentials.getPrincipal(),
+ SecurityErrorCode.PERMISSION_DENIED);
+ }
+
+ KeyExtent start = new KeyExtent(tid, new Text(), null);
for (Entry<KeyExtent,Tablet> entry :
server.getOnlineTablets().tailMap(start).entrySet()) {
KeyExtent ke = entry.getKey();
- if (ke.tableId().compareTo(text) == 0) {
+ if (ke.tableId().compareTo(tid) == 0) {
Tablet tablet = entry.getValue();
TabletStats stats = tablet.getTabletStats();
stats.extent = ke.toThrift();