org.apache.hadoop.hbase.backup
Class HFileArchiver

java.lang.Object
  extended by org.apache.hadoop.hbase.backup.HFileArchiver

public class HFileArchiver
extends Object

Utility class to handle the removal of HFiles (or the respective StoreFiles) for a HRegion from the FileSystem. The hfiles will be archived or deleted, depending on the state of the system.


Method Summary
static void archiveFamily(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.conf.Configuration conf, HRegionInfo parent, org.apache.hadoop.fs.Path tableDir, byte[] family)
          Remove from the specified region the store files of the specified column family, either by archiving them or outright deletion
static void archiveRegion(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, HRegionInfo info)
          Cleans up all the files for a HRegion by archiving the HFiles to the archive directory
static boolean archiveRegion(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootdir, org.apache.hadoop.fs.Path tableDir, org.apache.hadoop.fs.Path regionDir)
          Remove an entire region from the table directory via archiving the region's hfiles.
static void archiveStoreFile(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, HRegionInfo regionInfo, org.apache.hadoop.fs.Path tableDir, byte[] family, org.apache.hadoop.fs.Path storeFile)
          Archive the store file
static void archiveStoreFiles(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, HRegionInfo regionInfo, org.apache.hadoop.fs.Path tableDir, byte[] family, Collection<StoreFile> compactedFiles)
          Remove the store files, either by archiving them or outright deletion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

archiveRegion

public static void archiveRegion(org.apache.hadoop.conf.Configuration conf,
                                 org.apache.hadoop.fs.FileSystem fs,
                                 HRegionInfo info)
                          throws IOException
Cleans up all the files for a HRegion by archiving the HFiles to the archive directory

Parameters:
conf - the configuration to use
fs - the file system object
info - HRegionInfo for region to be deleted
Throws:
IOException

archiveRegion

public static boolean archiveRegion(org.apache.hadoop.fs.FileSystem fs,
                                    org.apache.hadoop.fs.Path rootdir,
                                    org.apache.hadoop.fs.Path tableDir,
                                    org.apache.hadoop.fs.Path regionDir)
                             throws IOException
Remove an entire region from the table directory via archiving the region's hfiles.

Parameters:
fs - FileSystem from which to remove the region
rootdir - Path to the root directory where hbase files are stored (for building the archive path)
tableDir - Path to where the table is being stored (for building the archive path)
regionDir - Path to where a region is being stored (for building the archive path)
Returns:
true if the region was sucessfully deleted. false if the filesystem operations could not complete.
Throws:
IOException - if the request cannot be completed

archiveFamily

public static void archiveFamily(org.apache.hadoop.fs.FileSystem fs,
                                 org.apache.hadoop.conf.Configuration conf,
                                 HRegionInfo parent,
                                 org.apache.hadoop.fs.Path tableDir,
                                 byte[] family)
                          throws IOException
Remove from the specified region the store files of the specified column family, either by archiving them or outright deletion

Parameters:
fs - the filesystem where the store files live
conf - Configuration to examine to determine the archive directory
parent - Parent region hosting the store files
tableDir - Path to where the table is being stored (for building the archive path)
family - the family hosting the store files
Throws:
IOException - if the files could not be correctly disposed.

archiveStoreFiles

public static void archiveStoreFiles(org.apache.hadoop.conf.Configuration conf,
                                     org.apache.hadoop.fs.FileSystem fs,
                                     HRegionInfo regionInfo,
                                     org.apache.hadoop.fs.Path tableDir,
                                     byte[] family,
                                     Collection<StoreFile> compactedFiles)
                              throws IOException
Remove the store files, either by archiving them or outright deletion

Parameters:
conf - Configuration to examine to determine the archive directory
fs - the filesystem where the store files live
regionInfo - HRegionInfo of the region hosting the store files
family - the family hosting the store files
compactedFiles - files to be disposed of. No further reading of these files should be attempted; otherwise likely to cause an IOException
Throws:
IOException - if the files could not be correctly disposed.

archiveStoreFile

public static void archiveStoreFile(org.apache.hadoop.conf.Configuration conf,
                                    org.apache.hadoop.fs.FileSystem fs,
                                    HRegionInfo regionInfo,
                                    org.apache.hadoop.fs.Path tableDir,
                                    byte[] family,
                                    org.apache.hadoop.fs.Path storeFile)
                             throws IOException
Archive the store file

Parameters:
fs - the filesystem where the store files live
regionInfo - region hosting the store files
conf - Configuration to examine to determine the archive directory
tableDir - Path to where the table is being stored (for building the archive path)
family - the family hosting the store files
storeFile - file to be archived
Throws:
IOException - if the files could not be correctly disposed.


Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.