@@ -161,8 +161,28 @@ class CloudObjectStorage(sc: SparkContext, credentials: HashMap[String, String],
161
161
val prefix = " fs.cos." + _getConfigurationName()
162
162
163
163
hadoopConf.set(prefix + " .endpoint" , credentials(" endPoint" ))
164
- hadoopConf.set(prefix + " .access.key" , credentials(" accessKey" ))
165
- hadoopConf.set(prefix + " .secret.key" , credentials(" secretKey" ))
164
+
165
+ if (cos_type == " softlayer_cos" ) {
166
+ // softlayer cos case
167
+ hadoopConf.set(prefix + " .access.key" , credentials(" accessKey" ))
168
+ hadoopConf.set(prefix + " .secret.key" , credentials(" secretKey" ))
169
+ } else if (cos_type == " bluemix_cos" ) {
170
+ // bluemix cos case
171
+ hadoopConf.set(prefix + " .iam.service.id" , credentials(" serviceId" ))
172
+ if (authMethod == " api_key" ) {
173
+ hadoopConf.set(prefix + " .iam.api.key" , credentials(" apiKey" ))
174
+ } else if (authMethod == " iam_token" ) {
175
+ hadoopConf.set(prefix + " .iam.token" , credentials(" iamToken" ))
176
+ }
177
+
178
+ if (credentials.contains(" iamServiceEndpoint" )) {
179
+ hadoopConf.set(prefix + " .iam.endpoint" , credentials(" iamServiceEndpoint" ))
180
+ }
181
+
182
+ if (credentials.contains(" v2SignerType" )) {
183
+ hadoopConf.set(prefix + " .v2.signer.type" , credentials(" v2SignerType" ))
184
+ }
185
+ }
166
186
167
187
private def _getConfigurationName () : String = {
168
188
if (configurationName != " " ) {
0 commit comments