Xushaohong commented on code in PR #4294:
URL: https://github.com/apache/ozone/pull/4294#discussion_r1174848899


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OMNodeDetails.java:
##########
@@ -160,23 +164,27 @@ public OMNodeDetails build() {
     }
   }
 
-  public String getOMDBCheckpointEnpointUrl(boolean isHttpPolicy) {
-    if (isHttpPolicy) {
-      if (StringUtils.isNotEmpty(getHttpAddress())) {
-        return "http://"; + getHttpAddress() +
-            OZONE_DB_CHECKPOINT_HTTP_ENDPOINT +
-            "?" + OZONE_DB_CHECKPOINT_REQUEST_FLUSH + "=true&" +
-            OZONE_DB_CHECKPOINT_INCLUDE_SNAPSHOT_DATA + "=true";
-      }
-    } else {
-      if (StringUtils.isNotEmpty(getHttpsAddress())) {
-        return "https://"; + getHttpsAddress() +
-            OZONE_DB_CHECKPOINT_HTTP_ENDPOINT +
-            "?" + OZONE_DB_CHECKPOINT_REQUEST_FLUSH + "=true&" +
-            OZONE_DB_CHECKPOINT_INCLUDE_SNAPSHOT_DATA + "=true";
+  public URL getOMDBCheckpointEndpointUrl(boolean isHttp, boolean flush,
+      List<String> sstList) throws IOException {
+    URL url;
+    try {
+      URIBuilder urlBuilder = new URIBuilder().
+          setScheme(isHttp ? "http" : "https").
+          setHost(isHttp ? getHttpAddress() : getHttpsAddress()).
+          setPath(OZONE_DB_CHECKPOINT_HTTP_ENDPOINT).
+          addParameter(OZONE_DB_CHECKPOINT_INCLUDE_SNAPSHOT_DATA, "true").
+          addParameter(OZONE_DB_CHECKPOINT_REQUEST_FLUSH,
+              flush ? "true" : "false");
+      if (sstList != null && !sstList.isEmpty()) {
+        for (String s: sstList) {
+          urlBuilder.addParameter(OZONE_DB_CHECKPOINT_REQUEST_SST, s);

Review Comment:
   Currently, the toExclude SST list is sent as URL parameters as now it is a 
GET request. I plan to refactor the request to be a POST request in a separate 
PR.
   See conversations in 
https://github.com/apache/ozone/pull/4294#issuecomment-1507840025



-- 
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]

Reply via email to