Skip to content

Commit 54967f9

Browse files
committed
update comments and readme file
1 parent 74463f2 commit 54967f9

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

scala/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ This library is cross-built on both Scala 2.10 (for Spark 1.6.0) and Scala 2.11
4949

5050
#### IBM Spark Service
5151

52-
The `ibmos2spark` Scala library package is now pre-installed on IBM Apache Spark as a service. This includes
53-
service instances created in Bluemix or in Data Science Experience.
52+
The `ibmos2spark` Scala library package is now pre-installed on IBM Apache Spark as a service. This includes
53+
service instances created in Bluemix or in Data Science Experience.
5454

5555
### Snapshots
5656

@@ -148,7 +148,8 @@ var credentials = scala.collection.mutable.HashMap[String, String](
148148
var bucketName = "myBucket"
149149
var objectname = "mydata.csv"
150150

151-
var cos = new CloudObjectStorage(sc, credentials)
151+
var configurationName = "cos_config_name" // you can choose any string you want
152+
var cos = new CloudObjectStorage(sc, credentials, configurationName)
152153
var spark = SparkSession.
153154
builder().
154155
getOrCreate()

scala/src/main/scala/Osconfig.scala

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,20 +141,17 @@ class bluemix(sc: SparkContext, name: String, creds: HashMap[String, String],
141141
142142
* secretKey
143143
144-
* cosId [optional]: this parameter is the cloud object storage unique id. It is useful
145-
to keep in the class instance for further checks after the initialization. However,
146-
it is not mandatory for the class instance to work. This value can be retrieved by
147-
calling the getCosId function.
144+
* configurationName [optional]: string that identifies this configuration. You can
145+
use any string you like. This allows you to create
146+
multiple configurations to different Object Storage accounts.
147+
if a configuration name is not passed the default one will be used "service".
148148
149149
bucket_name (projectId in DSX) [optional]: string that identifies the defult
150150
bucket nameyou want to access files from in the COS service instance.
151151
In DSX, bucket_name is the same as projectId. One bucket is
152152
associated with one project.
153153
If this value is not specified, you need to pass it when
154154
you use the url function.
155-
*
156-
Warning: creating a new instance of this class would overwrite the existing
157-
spark hadoop configs if set before if used with the same spark context instance.
158155
*/
159156
class CloudObjectStorage(sc: SparkContext, credentials: HashMap[String, String], configurationName: String = "") {
160157

0 commit comments

Comments
 (0)