@@ -176,7 +176,7 @@ def url(self, container_name, object_name):
176
176
177
177
class CloudObjectStorage (object ):
178
178
179
- def __init__ (self , sparkcontext , credentials , cos_id = '' , bucket_name = '' ):
179
+ def __init__ (self , sparkcontext , credentials , configuration_name = '' , bucket_name = '' ):
180
180
181
181
'''
182
182
sparkcontext: a SparkContext object.
@@ -208,7 +208,7 @@ def __init__(self, sparkcontext, credentials, cos_id='', bucket_name=''):
208
208
209
209
'''
210
210
self .bucket_name = bucket_name
211
- self .cos_id = cos_id
211
+ self .conf_name = configuration_name
212
212
213
213
# check if all required values are availble
214
214
credential_key_list = ["endpoint" , "access_key" , "secret_key" ]
@@ -221,8 +221,8 @@ def __init__(self, sparkcontext, credentials, cos_id='', bucket_name=''):
221
221
# setup config
222
222
prefix = "fs.cos"
223
223
224
- if (cos_id ):
225
- prefix = "{}.{}" .format (prefix , cos_id )
224
+ if (configuration_name ):
225
+ prefix = "{}.{}" .format (prefix , configuration_name )
226
226
else :
227
227
prefix = prefix + "." + DEFAULT_SERVICE_NAME
228
228
@@ -231,9 +231,6 @@ def __init__(self, sparkcontext, credentials, cos_id='', bucket_name=''):
231
231
hconf .set (prefix + ".access.key" , credentials ['access_key' ])
232
232
hconf .set (prefix + ".secret.key" , credentials ['secret_key' ])
233
233
234
- def get_os_id (self ):
235
- return self .cos_id
236
-
237
234
def url (self , object_name , bucket_name = '' ):
238
235
bucket_name_var = ''
239
236
service_name = DEFAULT_SERVICE_NAME
@@ -247,7 +244,7 @@ def url(self, object_name, bucket_name=''):
247
244
raise ValueError ("Invalid input: bucket_name is required!" )
248
245
249
246
# use service name that we set up hadoop config for
250
- if (self .cos_id ):
251
- service_name = self .cos_id
247
+ if (self .conf_name ):
248
+ service_name = self .conf_name
252
249
253
250
return "cos://{}.{}/{}" .format (bucket_name_var , service_name , object_name )
0 commit comments