Skip to content

Commit

Permalink
taking spark context as first argument
Browse files Browse the repository at this point in the history
  • Loading branch information
falaki committed Jun 18, 2015
1 parent 343ca77 commit a2c19af
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions R/pkg/R/sparkR.R
Original file line number Diff line number Diff line change
Expand Up @@ -282,34 +282,28 @@ sparkRHive.init <- function(jsc = NULL) {
#' Assigns a group ID to all the jobs started by this thread until the group ID is set to a
#' different value or cleared.
#'
#' @param sc The existing
#' @param sc existing spark context
#' @param groupid the ID to be assigned to job groups
#' @param description description for the the job group ID
#' @param interruptOnCancel flag to indicate if the job is interrupted on job cancellation

setJobGroup <- function(groupId, description, interruptOnCancel) {
if (exists(".sparkRjsc", envir = env)) {
sc <- get(".sparkRjsc", envir = env)
callJMethod(sc, "setJobGroup", groupId, description, interruptOnCancel)
}
setJobGroup <- function(sc, groupId, description, interruptOnCancel) {
callJMethod(sc, "setJobGroup", groupId, description, interruptOnCancel)
}

#' Clear current job group ID and its description
#'
#' @param sc existing spark context

clearJobGroup <- function() {
if (exists(".sparkRjsc", envir = env)) {
sc <- get(".sparkRjsc", envir = env)
callJMethod(sc, "clearJobGroup")
}
clearJobGroup <- function(sc) {
callJMethod(sc, "clearJobGroup")
}

#' Cancel active jobs for the specified group
#'
#' @param sc existing spark context
#' @param groupId the ID of job group to be cancelled

cancelJobGroup <- function(groupId) {
if (exists(".sparkRjsc", envir = env)) {
sc <- get(".sparkRjsc", envir = env)
callJMethod(sc, "cancelJobGroup", groupId)
}
cancelJobGroup <- function(sc, groupId) {
callJMethod(sc, "cancelJobGroup", groupId)
}

0 comments on commit a2c19af

Please sign in to comment.