class CompatibilitySparkHadoopUtil extends Logging
Contains util methods to interact with Hadoop from Spark.
- Alphabetic
- By Inheritance
- CompatibilitySparkHadoopUtil
- Logging
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new CompatibilitySparkHadoopUtil()
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
addCredentials(conf: JobConf): Unit
Add any user credentials to the job conf which are necessary for running on a secure Hadoop cluster.
- def addCurrentUserCredentials(creds: Credentials): Unit
-
def
addDelegationTokens(tokens: Array[Byte], sparkConf: SparkConf): Unit
Add or overwrite current user's credentials with serialized delegation tokens, also confirms correct hadoop configuration is set.
-
def
appendS3AndSparkHadoopHiveConfigurations(conf: SparkConf, hadoopConf: Configuration): Unit
Appends S3-specific, spark.hadoop.*, and spark.buffer.size configurations to a Hadoop configuration.
-
def
appendSparkHadoopConfigs(srcMap: Map[String, String], destMap: HashMap[String, String]): Unit
Appends spark.hadoop.* configurations from a Map to another without the spark.hadoop.
Appends spark.hadoop.* configurations from a Map to another without the spark.hadoop. prefix.
-
def
appendSparkHadoopConfigs(conf: SparkConf, hadoopConf: Configuration): Unit
Appends spark.hadoop.* configurations from a SparkConf to a Hadoop configuration without the spark.hadoop.
Appends spark.hadoop.* configurations from a SparkConf to a Hadoop configuration without the spark.hadoop. prefix.
- def appendSparkHiveConfigs(srcMap: Map[String, String], destMap: HashMap[String, String]): Unit
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- val conf: Configuration
- def createSparkUser(): UserGroupInformation
- def deserialize(tokenBytes: Array[Byte]): Credentials
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getFSBytesReadOnThreadCallback(): () ⇒ Long
Returns a function that can be called to find Hadoop FileSystem bytes read.
Returns a function that can be called to find Hadoop FileSystem bytes read. If getFSBytesReadOnThreadCallback is called from thread r at time t, the returned callback will return the bytes read on r since t.
- Annotations
- @silent( "deprecated" )
-
def
getFSBytesWrittenOnThreadCallback(): () ⇒ Long
Returns a function that can be called to find Hadoop FileSystem bytes written.
Returns a function that can be called to find Hadoop FileSystem bytes written. If getFSBytesWrittenOnThreadCallback is called from thread r at time t, the returned callback will return the bytes written on r since t.
- returns
None if the required method can't be found.
- Annotations
- @silent( "deprecated" )
- def getSuffixForCredentialsPath(credentialsPath: Path): Int
- def globPath(fs: FileSystem, pattern: Path): Seq[Path]
- def globPath(pattern: Path): Seq[Path]
- def globPathIfNecessary(fs: FileSystem, pattern: Path): Seq[Path]
- def globPathIfNecessary(pattern: Path): Seq[Path]
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
- Attributes
- protected
- Definition Classes
- Logging
-
def
initializeLogIfNecessary(isInterpreter: Boolean): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def isGlobPath(pattern: Path): Boolean
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isProxyUser(ugi: UserGroupInformation): Boolean
-
def
isTraceEnabled(): Boolean
- Attributes
- protected
- Definition Classes
- Logging
-
def
listFilesSorted(remoteFs: FileSystem, dir: Path, prefix: String, exclusionSuffix: String): Array[FileStatus]
Lists all the files in a directory with the specified prefix, and does not end with the given suffix.
Lists all the files in a directory with the specified prefix, and does not end with the given suffix. The returned {{FileStatus}} instances are sorted by the modification times of the respective files.
- def listLeafDirStatuses(fs: FileSystem, baseStatus: FileStatus): Seq[FileStatus]
- def listLeafDirStatuses(fs: FileSystem, basePath: Path): Seq[FileStatus]
-
def
listLeafStatuses(fs: FileSystem, baseStatus: FileStatus): Seq[FileStatus]
Get FileStatus objects for all leaf children (files) under the given base path.
Get FileStatus objects for all leaf children (files) under the given base path. If the given path points to a file, return a single-element collection containing FileStatus of that file.
-
def
listLeafStatuses(fs: FileSystem, basePath: Path): Seq[FileStatus]
Get FileStatus objects for all leaf children (files) under the given base path.
Get FileStatus objects for all leaf children (files) under the given base path. If the given path points to a file, return a single-element collection containing FileStatus of that file.
-
def
log: Logger
- Attributes
- protected
- Definition Classes
- Logging
-
def
logDebug(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logDebug(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logError(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logError(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logInfo(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logInfo(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logName: String
- Attributes
- protected
- Definition Classes
- Logging
-
def
logTrace(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logTrace(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logWarning(msg: ⇒ String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logWarning(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def loginUserFromKeytab(principalName: String, keytabFilename: String): Unit
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
newConfiguration(conf: SparkConf): Configuration
Return an appropriate (subclass) of Configuration.
Return an appropriate (subclass) of Configuration. Creating config can initialize some Hadoop subsystems.
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
runAsSparkUser(func: () ⇒ Unit): Unit
Runs the given function with a Hadoop UserGroupInformation as a thread local variable (distributed to child threads), used for authenticating HDFS and YARN calls.
Runs the given function with a Hadoop UserGroupInformation as a thread local variable (distributed to child threads), used for authenticating HDFS and YARN calls.
IMPORTANT NOTE: If this function is going to be called repeated in the same process you need to look https://issues.apache.org/jira/browse/HDFS-3545 and possibly do a FileSystem.closeAllForUGI in order to avoid leaking Filesystems
- def serialize(creds: Credentials): Array[Byte]
-
def
substituteHadoopVariables(text: String, hadoopConf: Configuration): String
Substitute variables by looking them up in Hadoop configs.
Substitute variables by looking them up in Hadoop configs. Only variables that match the ${hadoopconf- .. } pattern are substituted.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
- def transferCredentials(source: UserGroupInformation, dest: UserGroupInformation): Unit
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()