class HdfsBackupHandler extends AnyRef
Handler for the backup operations of HDFS files
- Alphabetic
- By Inheritance
- HdfsBackupHandler
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
HdfsBackupHandler(fs: FileSystem, backupParentDirPath: Path, dataPath: Path)
- fs
FileSystem to use for the operations
- backupParentDirPath
Base path where to create the backup directory
- dataPath
Path containing the data that will be backup
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
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
backup(filesToBackup: Seq[Path]): Try[Path]
Create a new directory inside
backupParentDir, called "backup_{randomUUID}".Create a new directory inside
backupParentDir, called "backup_{randomUUID}". Each of the files insidefilesToBackupwill be copied in this directory, also maintaining the eventual HDFS partitioning. The new file path is created by removing the base directory (that isdataPath) from the file path, and replacing it with the path of the backup directory. Example:filesToBackup= ["/user/data/p1=a/p2=b/file.parquet"]backupParentDir= "/user"dataPath= "/user/data"- This function creates:
backupDir= "/user/backup_123" - then it copies the file into this directory, replacing the prefix "/user/data" with "/user/backup_123": "/user/backup_123/p1=a/p2=b/file.parquet"
- filesToBackup
Files that should be copied in the backup directory
- returns
Path of the newly created backup directory
- This function creates:
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
def
deleteBackup(backupPath: Path): Try[Unit]
Delete the entire backup directory
Delete the entire backup directory
- backupPath
Path of the backup directory to delete
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
restoreBackup(backupPath: Path): Try[Unit]
Restores files backup inside
backupPathtodataPath.Restores files backup inside
backupPathtodataPath. Each of the files listed recursively insidebackupPathis "moved back" to the data directory, by replacing the prefix of the backup directory with the prefix of the data directory. Example:backupPath= "/user/backup_123"backupParentDir= "/user"dataPath= "/user/data"- Listed backup file "/user/backup_123/p1=a/p2=b/file.parquet" - this file is renamed by replacing the prefix "/user/backup_123" with "/user/data" "/user/data/p1=a/p2=b/file.parquet"
- backupPath
Path of the backup directory containing the files to restore
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
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()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated @deprecated
- Deprecated
(Since version ) see corresponding Javadoc for more information.