Skip to content

Commit d07e7b4

Browse files
author
Adam Cox
committed
Adds support to specify swift2d driver
1 parent 105f9c2 commit d07e7b4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ibmos2spark/osconfig.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ def url(self, container_name, object_name):
5353

5454
class softlayer2d(object):
5555

56-
def __init__(self, sparkcontext, name, auth_url, tenant, username, password):
56+
def __init__(self, sparkcontext, name, auth_url, tenant, username, password,
57+
swift2d_driver='com.ibm.stocator.fs.ObjectStoreFileSystem'):
5758
'''
5859
sparkcontext is a SparkContext object.
5960
name is a string that can be anything other than an empty string.
@@ -65,6 +66,7 @@ def __init__(self, sparkcontext, name, auth_url, tenant, username, password):
6566

6667
prefix = "fs.swift2d.service." + name
6768
hconf = sparkcontext._jsc.hadoopConfiguration()
69+
hconf.set("fs.swift2d.impl", swift2d_driver)
6870
hconf.set(prefix + ".auth.url", auth_url)
6971
hconf.set(prefix + ".username", username)
7072
hconf.set(prefix + ".tenant", tenant)
@@ -120,7 +122,8 @@ def url(self, container_name, object_name):
120122

121123
class bluemix2d(object):
122124

123-
def __init__(self, sparkcontext, credentials):
125+
def __init__(self, sparkcontext, credentials,
126+
swift2d_driver='com.ibm.stocator.fs.ObjectStoreFileSystem'):
124127
'''
125128
sparkcontext is a SparkContext object.
126129
@@ -144,6 +147,7 @@ def __init__(self, sparkcontext, credentials):
144147

145148
prefix = "fs.swift2d.service." + credentials['name']
146149
hconf = sparkcontext._jsc.hadoopConfiguration()
150+
hconf.set("fs.swift2d.impl", swift2d_driver)
147151
hconf.set(prefix + ".auth.url", credentials['auth_url']+'/v3/auth/tokens')
148152
hconf.set(prefix + ".auth.endpoint.prefix", "endpoints")
149153
hconf.set(prefix + ".auth.method","keystoneV3 ")

0 commit comments

Comments
 (0)