Skip to content

Commit

Permalink
[SPARK-21809] : Addressing Reviews November 20, 2018
Browse files Browse the repository at this point in the history
Changing searchValue from Option to String
  • Loading branch information
pgandhi committed Nov 20, 2018
1 parent b3e2370 commit 672b12a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private[v1] class StagesResource extends BaseAppResource {
val uriQueryParameters = uriInfo.getQueryParameters(true)
val totalRecords = uriQueryParameters.getFirst("numTasks")
var isSearch = false
var searchValue: Option[String] = None
var searchValue: String = null
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
Expand All @@ -126,15 +126,15 @@ private[v1] class StagesResource extends BaseAppResource {
if (uriQueryParameters.getFirst("search[value]") != null &&
uriQueryParameters.getFirst("search[value]").length > 0) {
isSearch = true
searchValue = Some(uriQueryParameters.getFirst("search[value]"))
searchValue = 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)
val filteredTaskList = filterTaskList(_tasksToShow, searchValue)
filteredRecords = filteredTaskList.length.toString
if (filteredTaskList.length > 0) {
val pageStartIndex = uriQueryParameters.getFirst("start").toInt
Expand Down

0 comments on commit 672b12a

Please sign in to comment.