Package org.apache.spark.paths
Class SparkPath
Object
org.apache.spark.paths.SparkPath
- All Implemented Interfaces:
Serializable,scala.Equals,scala.Product
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SparkPathfromFileStatus(org.apache.hadoop.fs.FileStatus fs) static SparkPathfromPath(org.apache.hadoop.fs.Path path) static SparkPathfromPathString(String str) Creates a SparkPath from a hadoop Path string.static SparkPathstatic SparkPathfromUrlString(String str) Creates a SparkPath from a url-encoded string.org.apache.hadoop.fs.PathtoPath()toString()toUri()Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface scala.Equals
canEqual, equalsMethods inherited from interface scala.Product
productArity, productElement, productElementName, productElementNames, 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
-