jackjlli commented on a change in pull request #4360: Adding util methods for 
controller that will be used in offline push
URL: https://github.com/apache/incubator-pinot/pull/4360#discussion_r296907283
 
 

 ##########
 File path: 
pinot-hadoop/src/main/java/org/apache/pinot/hadoop/job/DefaultControllerRestApi.java
 ##########
 @@ -134,9 +134,56 @@ public void sendSegmentUris(List<String> segmentUris) {
     }
   }
 
+  @Override
+  public void deleteExtraSegmentUris(List<String> segmentUris) {
+    LOGGER.info("Start deleting segment URIs: {} to locations: {}", 
segmentUris, _pushLocations);
+    for (String segmentUri : segmentUris) {
+      for (PushLocation pushLocation : _pushLocations) {
+        LOGGER.info("Sending deleting segment URI: {} to location: {}", 
segmentUri, pushLocation);
+        try {
+          SimpleHttpResponse response = 
_fileUploadDownloadClient.sendDeleteRequest(
+              
FileUploadDownloadClient.getDeleteSegmentHttpUri(pushLocation.getHost(), 
pushLocation.getPort(), _rawTableName,
+              segmentUri, "OFFLINE"));
+          LOGGER.info("Response {}: {}", response.getStatusCode(), 
response.getResponse());
+        } catch (Exception e) {
+          LOGGER.error("Caught exception while deleting segment URI: {} to 
location: {}", segmentUri, pushLocation, e);
+          throw new RuntimeException(e);
+        }
+      }
+    }
+  }
+
+  @Override
+  public List<String> getAllSegments(String tableType) {
+    LOGGER.info("Getting all segments");
 
 Review comment:
   `"Getting all segments of Table: {}"`

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to