deniskuzZ commented on code in PR #6749:
URL: https://github.com/apache/hive/pull/6749#discussion_r4024615428
##########
standalone-metastore/metastore-rest-catalog/src/main/java/org/apache/iceberg/rest/HMSCatalogAdapter.java:
##########
@@ -173,10 +175,11 @@ enum Route {
Class<? extends RESTRequest> requestClass) {
this.method = method;
this.resourcePath = pattern;
+ this.withPrefix = pattern.contains(PREFIX);
// parse the pattern into requirements and variables
List<String> parts =
Review Comment:
maybe
````
private static final Splitter SLASH = Splitter.on('/').omitEmptyStrings();
private static final String PREFIX_VAR = "prefix";
private static final String PREFIX_PLACEHOLDER = "{" + PREFIX_VAR + "}";
private final String pathTemplate;
private final boolean acceptsPrefix;
Route(HTTPMethod method, String pattern,
Class<? extends RESTRequest> requestClass) {
this.method = method;
this.pathTemplate = pattern;
List<String> segments = SLASH.splitToList(pattern);
this.acceptsPrefix = segments.contains(PREFIX_PLACEHOLDER);
// parse the pattern into requirements and variables
List<String> parts = segments.stream()
.filter(s -> !PREFIX_PLACEHOLDER.equals(s))
.toList();
// unchanged
}
````
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]