Package org.apache.spark.paths
Class SparkPath
Object
org.apache.spark.paths.SparkPath
- All Implemented Interfaces:
Serializable
,scala.Equals
,scala.Product
,scala.Serializable
A canonical representation of a file path. This class is intended to provide
type-safety to the way that Spark handles Paths. Paths can be represented as
Strings in multiple ways, which are not always compatible. Spark regularly uses
two ways: 1. hadoop Path.toString and java URI.toString.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SparkPath
fromFileStatus
(org.apache.hadoop.fs.FileStatus fs) static SparkPath
fromPath
(org.apache.hadoop.fs.Path path) static SparkPath
fromPathString
(String str) Creates a SparkPath from a hadoop Path string.static SparkPath
static SparkPath
fromUrlString
(String str) Creates a SparkPath from a url-encoded string.org.apache.hadoop.fs.Path
toPath()
toString()
toUri()
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface scala.Equals
canEqual, equals
Methods inherited from interface scala.Product
productArity, productElement, productIterator, productPrefix
-
Constructor Details
-
SparkPath
public SparkPath()
-
-
Method Details
-
fromPathString
Creates a SparkPath from a hadoop Path string. Please be very sure that the provided string is encoded (or not encoded) in the right way.Please see the hadoop Path documentation here: https://hadoop.apache.org/docs/stable/api/org/apache/hadoop/fs/Path.html#Path-java.lang.String-
- Parameters:
str
- (undocumented)- Returns:
- (undocumented)
-
fromPath
-
fromFileStatus
-
fromUrlString
Creates a SparkPath from a url-encoded string. Note: It is the responsibility of the caller to ensure that str is a valid url-encoded string.- Parameters:
str
- (undocumented)- Returns:
- (undocumented)
-
fromUri
-
urlEncoded
-
toUri
-
toPath
public org.apache.hadoop.fs.Path toPath() -
toString
-