Skip to content

Commit 185d5f7

Browse files
committed
Modify signature of init function + add validateInput function
1 parent 3f7b519 commit 185d5f7

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

r/sparkr/R/osconfig.R

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,15 @@ bluemix <- setRefClass("bluemix",
129129
#' @export CloudObjectStorage
130130
#' @exportClass CloudObjectStorage
131131
CloudObjectStorage <- setRefClass("CloudObjectStorage",
132-
fields=list(configName="character"),
132+
fields=list(configName="character", cosType="character", authMethod="character"),
133133
methods=list(
134-
initialize = function(..., sparkContext, credentials, configurationName="") {
134+
initialize = function(..., sparkContext, credentials, configurationName="",
135+
cosType="softlayer_cos", authMethod="api_key") {
135136

137+
# validate input
138+
validateInput(credentials, cosType, authMethod)
139+
140+
# set up hadoop config
136141

137142
if (is.null(credentials["endpoint"][[1]])) {
138143
stop("Attribute endpoint in credentials is missing!")
@@ -164,6 +169,10 @@ CloudObjectStorage <- setRefClass("CloudObjectStorage",
164169
return ("service")
165170
},
166171

172+
validateInput = function (credentials, cosType, authMethod) {
173+
174+
},
175+
167176
url = function(bucketName, objectName) {
168177
serviceName = getConfigName()
169178
return (paste("cos://", bucketName, ".", serviceName, "/", objectName, sep = ""))

0 commit comments

Comments
 (0)