@@ -25,7 +25,8 @@ def swifturl2d(name, container_name, object_name):
25
25
26
26
class softlayer (object ):
27
27
28
- def __init__ (self , sparkcontext , name , auth_url , username , password ):
28
+ def __init__ (self , sparkcontext , name , auth_url , username , password ,
29
+ public = False ):
29
30
'''
30
31
sparkcontext is a SparkContext object.
31
32
name is a string that can be anything other than an empty string.
@@ -43,7 +44,7 @@ def __init__(self, sparkcontext, name, auth_url, username, password):
43
44
hconf .set (prefix + ".auth.endpoint.prefix" , "endpoints" )
44
45
hconf .setInt (prefix + ".http.port" , 8080 )
45
46
hconf .set (prefix + ".apikey" , password )
46
- hconf .setBoolean (prefix + ".public" , True )
47
+ hconf .setBoolean (prefix + ".public" , public )
47
48
hconf .set (prefix + ".use.get.auth" , "true" )
48
49
hconf .setBoolean (prefix + ".location-aware" , False )
49
50
hconf .set (prefix + ".password" , password )
@@ -54,7 +55,7 @@ def url(self, container_name, object_name):
54
55
class softlayer2d (object ):
55
56
56
57
def __init__ (self , sparkcontext , name , auth_url , tenant , username , password ,
57
- swift2d_driver = 'com.ibm.stocator.fs.ObjectStoreFileSystem' ):
58
+ swift2d_driver = 'com.ibm.stocator.fs.ObjectStoreFileSystem' , public = False ):
58
59
'''
59
60
sparkcontext is a SparkContext object.
60
61
name is a string that can be anything other than an empty string.
@@ -74,7 +75,7 @@ def __init__(self, sparkcontext, name, auth_url, tenant, username, password,
74
75
hconf .set (prefix + ".auth.method" , "swiftauth" )
75
76
hconf .setInt (prefix + ".http.port" , 8080 )
76
77
hconf .set (prefix + ".apikey" , password )
77
- hconf .setBoolean (prefix + ".public" , True )
78
+ hconf .setBoolean (prefix + ".public" , public )
78
79
hconf .set (prefix + ".use.get.auth" , "true" )
79
80
hconf .setBoolean (prefix + ".location-aware" , False )
80
81
hconf .set (prefix + ".password" , password )
@@ -84,7 +85,7 @@ def url(self, container_name, object_name):
84
85
85
86
class bluemix (object ):
86
87
87
- def __init__ (self , sparkcontext , credentials ):
88
+ def __init__ (self , sparkcontext , credentials , public = False ):
88
89
'''
89
90
sparkcontext is a SparkContext object.
90
91
@@ -115,15 +116,16 @@ def __init__(self, sparkcontext, credentials):
115
116
hconf .set (prefix + ".password" , credentials ['password' ])
116
117
hconf .setInt (prefix + ".http.port" , 8080 )
117
118
hconf .set (prefix + ".region" , credentials ['region' ])
118
- hconf .setBoolean (prefix + ".public" , True )
119
+ hconf .setBoolean (prefix + ".public" , False )
119
120
120
121
def url (self , container_name , object_name ):
121
122
return swifturl (self .name , container_name , object_name )
122
123
123
124
class bluemix2d (object ):
124
125
125
126
def __init__ (self , sparkcontext , credentials ,
126
- swift2d_driver = 'com.ibm.stocator.fs.ObjectStoreFileSystem' ):
127
+ swift2d_driver = 'com.ibm.stocator.fs.ObjectStoreFileSystem' ,
128
+ public = False ):
127
129
'''
128
130
sparkcontext is a SparkContext object.
129
131
@@ -156,7 +158,7 @@ def __init__(self, sparkcontext, credentials,
156
158
hconf .set (prefix + ".password" , credentials ['password' ])
157
159
hconf .setInt (prefix + ".http.port" , 8080 )
158
160
hconf .set (prefix + ".region" , credentials ['region' ])
159
- hconf .setBoolean (prefix + ".public" , True )
161
+ hconf .setBoolean (prefix + ".public" , public )
160
162
161
163
def url (self , container_name , object_name ):
162
164
return swifturl2d (self .name , container_name , object_name )
0 commit comments