object Utils extends Logging
- Alphabetic
- By Inheritance
- Utils
- Logging
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
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
- val DEFAULT_SHUTDOWN_PRIORITY: Int
- val FLINK_ENGINE_SHUTDOWN_PRIORITY: Int
- val JDBC_ENGINE_SHUTDOWN_PRIORITY: Int
- val REDACTION_REPLACEMENT_TEXT: String
- val SERVER_SHUTDOWN_PRIORITY: Int
- val SPARK_CONTEXT_SHUTDOWN_PRIORITY: Int
- val TRINO_ENGINE_SHUTDOWN_PRIORITY: Int
-
def
addShutdownHook(hook: Runnable, priority: Int = DEFAULT_SHUTDOWN_PRIORITY): Unit
Add some operations that you want into ShutdownHook
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
createDirectory(root: String, namePrefix: String = "kyuubi"): Path
Create a directory inside the given parent directory.
Create a directory inside the given parent directory. The directory is guaranteed to be newly created, and is not marked for automatic deletion.
-
def
createTempDir(prefix: String = "kyuubi", root: String = ...): Path
Create a temporary directory inside the given parent directory.
Create a temporary directory inside the given parent directory. The directory will be automatically deleted when the VM shuts down.
- def currentUser: String
-
def
debug(message: ⇒ Any, t: Throwable): Unit
- Definition Classes
- Logging
-
def
debug(message: ⇒ Any): Unit
- Definition Classes
- Logging
-
def
deleteDirectoryRecursively(f: File): Boolean
Delete a directory recursively.
- def doAs[T](proxyUser: String, realUser: UserGroupInformation = UserGroupInformation.getCurrentUser)(f: () ⇒ T): T
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
error(message: ⇒ Any): Unit
- Definition Classes
- Logging
-
def
error(message: ⇒ Any, t: Throwable): Unit
- Definition Classes
- Logging
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
findLocalInetAddress: InetAddress
This block of code is based on Spark's Utils.findLocalInetAddress()
- def fromCommandLineArgs(args: Array[String], conf: KyuubiConf): Unit
- def getAbsolutePathFromWork(pathStr: String, env: Map[String, String] = sys.env): Path
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getCodeSourceLocation(clazz: Class[_]): String
-
def
getContextOrKyuubiClassLoader: ClassLoader
Get the Context ClassLoader on this thread or, if not present, the ClassLoader that loaded Kyuubi.
Get the Context ClassLoader on this thread or, if not present, the ClassLoader that loaded Kyuubi.
This should be used whenever passing a ClassLoader to Class.ForName or finding the currently active loader when setting up ClassLoader delegation chains.
-
def
getDateFromTimestamp(time: Long): String
return date of format yyyyMMdd
- def getDefaultPropertiesFile(env: Map[String, String] = sys.env): Option[File]
-
def
getKyuubiClassLoader: ClassLoader
Get the ClassLoader which loaded Kyuubi.
- def getPropertiesFile(fileName: String, env: Map[String, String] = sys.env): Option[File]
- def getPropertiesFromFile(file: Option[File]): Map[String, String]
- def getSystemProperties: Map[String, String]
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
info(message: ⇒ Any, t: Throwable): Unit
- Definition Classes
- Logging
-
def
info(message: ⇒ Any): Unit
- Definition Classes
- Logging
-
def
initializeLoggerIfNecessary(isInterpreter: Boolean): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def isCommandAvailable(cmd: String): Boolean
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
val
isMac: Boolean
Whether the underlying operating system is MacOS.
- def isOnK8s: Boolean
-
def
isTesting: Boolean
Indicates whether Kyuubi is currently running unit tests.
-
val
isWindows: Boolean
Whether the underlying operating system is Windows.
-
def
logger: Logger
- Attributes
- protected
- Definition Classes
- Logging
-
def
loggerName: String
- Attributes
- protected
- Definition Classes
- Logging
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
prettyPrint(e: Throwable): String
Return a nice string representation of the exception.
Return a nice string representation of the exception. It will call "printStackTrace" to recursively generate the stack trace including the exception and its causes.
-
def
redact[K, V](regex: Option[Regex], kvs: Seq[(K, V)]): Seq[(K, V)]
Redact the sensitive values in the given map.
Redact the sensitive values in the given map. If a map key matches the redaction pattern then its value is replaced with a dummy text.
- def redactCommandLineArgs(conf: KyuubiConf, commands: Array[String]): Array[String]
-
def
shortVersion(version: String): String
Given a Kyuubi/Spark/Hive version string, return the short version string.
Given a Kyuubi/Spark/Hive version string, return the short version string. E.g., for 3.0.0-SNAPSHOT, return '3.0.0'.
- def strToSeq(s: String, sp: String = ","): Seq[String]
-
def
stringifyException(e: Throwable): String
Make a string representation of the exception.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
terminateProcess(process: Process, gracefulPeriod: Long): Option[Int]
Try killing the process gracefully first, then forcibly if process does not exit in graceful period.
Try killing the process gracefully first, then forcibly if process does not exit in graceful period.
- process
the being killed process
- gracefulPeriod
the graceful killing period, in milliseconds
- returns
the exit code if process exit normally, None if the process finally was killed forcibly
-
def
toString(): String
- Definition Classes
- AnyRef → Any
- def tryLogNonFatalError(block: ⇒ Unit): 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()
-
def
warn(message: ⇒ Any, t: Throwable): Unit
- Definition Classes
- Logging
-
def
warn(message: ⇒ Any): Unit
- Definition Classes
- Logging
- def withLockRequired[T](lock: Lock)(block: ⇒ T): T
-
def
writeToTempFile(source: InputStream, dir: Path, fileName: String): File
Copies bytes from an InputStream source to a newly created temporary file created in the directory destination.
Copies bytes from an InputStream source to a newly created temporary file created in the directory destination. The temporary file will be created with new name by adding random identifiers before original file name's suffix, and the file will be deleted on JVM exit. The directories up to destination will be created if they don't already exist. destination will be overwritten if it already exists. The source stream is closed.
- source
the InputStream to copy bytes from, must not be null, will be closed
- dir
the directory path for temp file creation
- fileName
original file name with suffix
- returns
the created temp file in dir