org.apache.spark.aliyun.oss

OssOps

class OssOps extends Logging with Serializable

Various utility classes for working with Aliyun OSS.

OSS URI:

There are two kinds of OSS URI:
Complete OSS URI: oss://accessKeyId:[email protected]/path
Simplified OSS URI: oss://bucket/path

like:
   oss://kj7aY*******UYx6:AiNMAlxz*************1PxaPaL8t
   @aBucket.oss-cn-hangzhou-internal.aliyuncs.com/fileA
   oss://aBucket/fileA

In simplified way, you need to config accessKeyId/accessKeySecret/endpoint
in SparkConf, like:
   SparkConf conf = new SparkConf()
   conf.set("spark.hadoop.fs.oss.accessKeyId", "kj7aY*******UYx6")
   conf.set("spark.hadoop.fs.oss.accessKeySecret",
   "AiNMAlxz*************1PxaPaL8t")
   conf.set("spark.hadoop.fs.oss.endpoint",
   "http://oss-cn-hangzhou-internal.aliyuncs.com")
Linear Supertypes
Serializable, Serializable, Logging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. OssOps
  2. Serializable
  3. Serializable
  4. Logging
  5. AnyRef
  6. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new OssOps(sc: SparkContext, endpoint: String, accessKeyId: String, accessKeySecret: String, securityToken: Option[String] = scala.None)

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  14. def isTraceEnabled(): Boolean

    Attributes
    protected
    Definition Classes
    Logging
  15. def log: Logger

    Attributes
    protected
    Definition Classes
    Logging
  16. def logDebug(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  17. def logDebug(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  18. def logError(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  19. def logError(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  20. def logInfo(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  21. def logInfo(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  22. def logName: String

    Attributes
    protected
    Definition Classes
    Logging
  23. def logTrace(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  24. def logTrace(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  25. def logWarning(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  26. def logWarning(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  27. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  28. final def notify(): Unit

    Definition Classes
    AnyRef
  29. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  31. def toString(): String

    Definition Classes
    AnyRef → Any
  32. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def readOssFile(path: String, minPartitions: Int): RDD[String]

    Read data from OSS.

    Read data from OSS.

    val ossOps: OssOps = ...
    val javaRdd: JavaRDD[T] = ossOps.readOssFile(
    "oss://[accessKeyId:accessKeySecret@]bucket[.endpoint]/path", 2)
    path

    An OSS file path which job is reading.

    minPartitions

    The minimum partitions of RDD.

    returns

    A JavaRDD[String] that contains all lines of OSS object.

    Deprecated

    Use SparkContext.textFile("oss://...") instead.

    Since

    1.0.5

  2. def readOssFileWithJava(path: String, minPartitions: Int): JavaRDD[String]

    Read data from OSS.

    Read data from OSS.

    OssOps ossOps = ...
    JavaRDD[T] javaRdd = ossOps.readOssFileWithJava(
    "oss://[accessKeyId:accessKeySecret@]bucket[.endpoint]/path", 2)
    path

    An OSS file path which job is reading.

    minPartitions

    The minimum partitions of RDD.

    returns

    A JavaRDD[String] that contains all lines of OSS object.

    Deprecated

    Use JavaSparkContext.textFile("oss://...") instead.

    Since

    1.0.5

  3. def saveToOssFile[T](path: String, rdd: RDD[T]): Unit

    Write RDD to OSS

    Write RDD to OSS

    val ossOps: OssOps = ...
    val rdd: RDD[T] = ...
    ossOps.saveToOssFile("oss://[accessKeyId:accessKeySecret@]
    bucket[.endpoint]/path", rdd)
    path

    An OSS file path which job is writing to.

    rdd

    A RDD that you want to save to OSS.

    Deprecated

    Use RDD.saveAsTextFile("oss://...") instead.

    Since

    1.0.5

  4. def saveToOssFileWithJava[T](path: String, javaRdd: JavaRDD[T]): Unit

    Write RDD to OSS

    Write RDD to OSS

    OssOps ossOps = ...
    JavaRDD[T] javaRdd = ...
    ossOps.saveToOssFileWithJava("oss://[accessKeyId:accessKeySecret@]
    bucket[.endpoint]/path", javaRdd)
    path

    An OSS file path which job is writing to.

    javaRdd

    A JavaRDD that you want to save to OSS.

    Deprecated

    Use JavaRDD.saveAsTextFile("oss://...") instead.

    Since

    1.0.5

Inherited from Serializable

Inherited from Serializable

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped