Github user pgandhi999 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21688#discussion_r235184320
  
    --- Diff: 
core/src/main/scala/org/apache/spark/status/api/v1/StagesResource.scala ---
    @@ -102,4 +103,120 @@ private[v1] class StagesResource extends 
BaseAppResource {
         withUI(_.store.taskList(stageId, stageAttemptId, offset, length, 
sortBy))
       }
     
    +  // This api needs to stay formatted exactly as it is below, since, it is 
being used by the
    +  // datatables for the stages page.
    +  @GET
    +  @Path("{stageId: \\d+}/{stageAttemptId: \\d+}/taskTable")
    +  def taskTable(
    +    @PathParam("stageId") stageId: Int,
    +    @PathParam("stageAttemptId") stageAttemptId: Int,
    +    @QueryParam("details") @DefaultValue("true") details: Boolean,
    +    @Context uriInfo: UriInfo):
    +  HashMap[String, Object] = {
    +    withUI { ui =>
    +      val uriQueryParameters = uriInfo.getQueryParameters(true)
    +      val totalRecords = uriQueryParameters.getFirst("numTasks")
    +      var isSearch = false
    +      var searchValue: Option[String] = None
    +      var filteredRecords = totalRecords
    +      // The datatables client API sends a list of query parameters to the 
server which contain
    +      // information like the columns to be sorted, search value typed by 
the user in the search
    +      // box, pagination index etc. For more information on these query 
parameters,
    +      // refer https://datatables.net/manual/server-side.
    +      if (uriQueryParameters.getFirst("search[value]") != null &&
    +        uriQueryParameters.getFirst("search[value]").length > 0) {
    +        isSearch = true
    +        searchValue = Some(uriQueryParameters.getFirst("search[value]"))
    +      }
    +      val _tasksToShow: Seq[TaskData] = doPagination(uriQueryParameters, 
stageId, stageAttemptId,
    +        isSearch, totalRecords.toInt)
    +      val ret = new HashMap[String, Object]()
    +      if (_tasksToShow.nonEmpty) {
    +        // Performs server-side search based on input from user
    +        if (isSearch) {
    +          val filteredTaskList = filterTaskList(_tasksToShow, 
searchValue.get)
    --- End diff --
    
    Done


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to