Skip to content

Commit 99ec3d1

Browse files
yingjianwu98Yingjian Wu
andauthored
exclude table table from request tags (#667)
* exclude table table from request * address comments --------- Co-authored-by: Yingjian Wu <[email protected]>
1 parent aee1228 commit 99ec3d1

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

metacat-common/src/main/java/com/netflix/metacat/common/QualifiedName.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,21 @@ public Map<String, String> toJson() {
501501
return map;
502502
}
503503

504+
/**
505+
* Returns the qualified name with only catalog and database in parts.
506+
*
507+
* @return parts of the qualified name as a Map
508+
*/
509+
public Map<String, String> partsWithCatalogAndDatabase() {
510+
final Map<String, String> map = new HashMap<>(2);
511+
map.put("catalogName", catalogName);
512+
513+
if (!databaseName.isEmpty()) {
514+
map.put("databaseName", databaseName);
515+
}
516+
return map;
517+
}
518+
504519
/**
505520
* Returns the qualified name in parts.
506521
*

metacat-main/src/main/java/com/netflix/metacat/main/api/RequestWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public <R> R processRequest(
153153
final Map<String, String> requestTags,
154154
final Supplier<R> supplier) {
155155
final long start = registry.clock().wallTime();
156-
final Map<String, String> tags = new HashMap<>(name.parts());
156+
final Map<String, String> tags = new HashMap<>(name.partsWithCatalogAndDatabase());
157157
final Map<String, String> percentileTags = Maps.newHashMap();
158158
if (requestTags != null) {
159159
tags.putAll(requestTags);

0 commit comments

Comments
 (0)