From fa88169fb8f95943c7da1ffbe8e10bb7cee4312a Mon Sep 17 00:00:00 2001 From: Yanbo Liang Date: Tue, 8 Dec 2015 14:00:18 +0800 Subject: [PATCH 1/2] Deprecate the JAVA-specific deserialized storage levels --- R/pkg/R/DataFrame.R | 5 ++++- R/pkg/R/RDD.R | 5 ++++- R/pkg/R/utils.R | 8 ++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/R/pkg/R/DataFrame.R b/R/pkg/R/DataFrame.R index 81b4e6b91d8a2..8c48df7ac8be8 100644 --- a/R/pkg/R/DataFrame.R +++ b/R/pkg/R/DataFrame.R @@ -491,7 +491,10 @@ setMethod("cache", #' #' Persist this DataFrame with the specified storage level. For details of the #' supported storage levels, refer to -#' \url{http://spark.apache.org/docs/latest/programming-guide.html#rdd-persistence}. +#' \url{http://spark.apache.org/docs/latest/programming-guide.html#rdd-persistence}. \cr +#' The following four storage level constants are deprecated in 2.0, +#' since the records will always be serialized in R: \cr +#' MEMORY_ONLY_SER, MEMORY_ONLY_SER_2, MEMORY_AND_DISK_SER, MEMORY_AND_DISK_SER_2 #' #' @param x The DataFrame to persist #' diff --git a/R/pkg/R/RDD.R b/R/pkg/R/RDD.R index 00c40c38cabc9..2a4b05a9834db 100644 --- a/R/pkg/R/RDD.R +++ b/R/pkg/R/RDD.R @@ -225,7 +225,10 @@ setMethod("cache", #' #' Persist this RDD with the specified storage level. For details of the #' supported storage levels, refer to -#' http://spark.apache.org/docs/latest/programming-guide.html#rdd-persistence. +#' http://spark.apache.org/docs/latest/programming-guide.html#rdd-persistence. \cr +#' The following four storage level constants are deprecated in 2.0, +#' since the records will always be serialized in R: \cr +#' MEMORY_ONLY_SER, MEMORY_ONLY_SER_2, MEMORY_AND_DISK_SER, MEMORY_AND_DISK_SER_2 #' #' @param x The RDD to persist #' @param newLevel The new storage level to be assigned diff --git a/R/pkg/R/utils.R b/R/pkg/R/utils.R index 43105aaa38424..5f997f3e484f4 100644 --- a/R/pkg/R/utils.R +++ b/R/pkg/R/utils.R @@ -339,14 +339,14 @@ getStorageLevel <- function(newLevel = c("DISK_ONLY", storageLevel <- switch(newLevel, "DISK_ONLY" = callJStatic(storageLevelClass, "DISK_ONLY"), "DISK_ONLY_2" = callJStatic(storageLevelClass, "DISK_ONLY_2"), - "MEMORY_AND_DISK" = callJStatic(storageLevelClass, "MEMORY_AND_DISK"), - "MEMORY_AND_DISK_2" = callJStatic(storageLevelClass, "MEMORY_AND_DISK_2"), + "MEMORY_AND_DISK" = callJStatic(storageLevelClass, "MEMORY_AND_DISK_SER"), + "MEMORY_AND_DISK_2" = callJStatic(storageLevelClass, "MEMORY_AND_DISK_SER_2"), "MEMORY_AND_DISK_SER" = callJStatic(storageLevelClass, "MEMORY_AND_DISK_SER"), "MEMORY_AND_DISK_SER_2" = callJStatic(storageLevelClass, "MEMORY_AND_DISK_SER_2"), - "MEMORY_ONLY" = callJStatic(storageLevelClass, "MEMORY_ONLY"), - "MEMORY_ONLY_2" = callJStatic(storageLevelClass, "MEMORY_ONLY_2"), + "MEMORY_ONLY" = callJStatic(storageLevelClass, "MEMORY_ONLY_SER"), + "MEMORY_ONLY_2" = callJStatic(storageLevelClass, "MEMORY_ONLY_SER_2"), "MEMORY_ONLY_SER" = callJStatic(storageLevelClass, "MEMORY_ONLY_SER"), "MEMORY_ONLY_SER_2" = callJStatic(storageLevelClass, "MEMORY_ONLY_SER_2"), "OFF_HEAP" = callJStatic(storageLevelClass, "OFF_HEAP")) From 588acafb786f46e22309cb55020d3de5d94f8453 Mon Sep 17 00:00:00 2001 From: Yanbo Liang Date: Tue, 8 Dec 2015 14:30:24 +0800 Subject: [PATCH 2/2] fix typos --- R/pkg/R/utils.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/pkg/R/utils.R b/R/pkg/R/utils.R index 5f997f3e484f4..4aa1978d892f1 100644 --- a/R/pkg/R/utils.R +++ b/R/pkg/R/utils.R @@ -340,7 +340,8 @@ getStorageLevel <- function(newLevel = c("DISK_ONLY", "DISK_ONLY" = callJStatic(storageLevelClass, "DISK_ONLY"), "DISK_ONLY_2" = callJStatic(storageLevelClass, "DISK_ONLY_2"), "MEMORY_AND_DISK" = callJStatic(storageLevelClass, "MEMORY_AND_DISK_SER"), - "MEMORY_AND_DISK_2" = callJStatic(storageLevelClass, "MEMORY_AND_DISK_SER_2"), + "MEMORY_AND_DISK_2" = callJStatic(storageLevelClass, + "MEMORY_AND_DISK_SER_2"), "MEMORY_AND_DISK_SER" = callJStatic(storageLevelClass, "MEMORY_AND_DISK_SER"), "MEMORY_AND_DISK_SER_2" = callJStatic(storageLevelClass,