NihalJain commented on code in PR #6783:
URL: https://github.com/apache/hbase/pull/6783#discussion_r1990119805
##########
hbase-it/src/test/java/org/apache/hadoop/hbase/MockHttpApiRule.java:
##########
@@ -151,6 +154,32 @@ void clearRegistrations() {
}
@Override
+ public boolean
handle(org.apache.hbase.thirdparty.org.eclipse.jetty.server.Request request,
Response response, Callback callback) throws Exception {
+ // TODO: TestRESTApiClusterManager is failing because of this line??
+ String target = request.getHttpURI().asString();
+ responseMappingLock.readLock().lock();
+ try {
+ if (!regexSet.matches(target)) {
+ response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+ callback.succeeded();
+ return true;
+ }
+ responseMapping.entrySet().stream()
+ .filter(e -> Pattern.matches(e.getKey(), target))
+ .findAny()
+ .map(Map.Entry::getValue)
+ .orElseThrow(() -> noMatchFound(target))
+ .accept(target, (HttpServletResponse) response);
+ callback.succeeded();
+ } catch (Exception e) {
+ callback.failed(e);
+ } finally {
+ responseMappingLock.readLock().unlock();
+ }
+ return true;
+ }
+
+ //@Override
Review Comment:
ah drop old version
--
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]