org.apache.hadoop.hbase.regionserver
Class StoreFileInfo

java.lang.Object
  extended by org.apache.hadoop.hbase.regionserver.StoreFileInfo

@InterfaceAudience.Private
public class StoreFileInfo
extends Object

Describe a StoreFile (hfile, reference, link)


Field Summary
static String HFILE_NAME_REGEX
          A non-capture group, for hfiles, so that this can be embedded.
static org.apache.commons.logging.Log LOG
           
 
Constructor Summary
StoreFileInfo(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.FileStatus fileStatus)
          Create a Store File Info
StoreFileInfo(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path)
          Create a Store File Info
 
Method Summary
 HDFSBlocksDistribution computeHDFSBlocksDistribution(org.apache.hadoop.fs.FileSystem fs)
          Compute the HDFS Block Distribution for this StoreFile
 long getCreatedTimestamp()
           
 org.apache.hadoop.fs.FileStatus getFileStatus()
           
 HDFSBlocksDistribution getHDFSBlockDistribution()
           
 long getModificationTime()
           
 org.apache.hadoop.fs.Path getPath()
           
 Reference getReference()
           
 org.apache.hadoop.fs.FileStatus getReferencedFileStatus(org.apache.hadoop.fs.FileSystem fs)
          Get the FileStatus of the file referenced by this StoreFileInfo
static org.apache.hadoop.fs.Path getReferredToFile(org.apache.hadoop.fs.Path p)
           
static boolean isHFile(org.apache.hadoop.fs.Path path)
           
static boolean isHFile(String fileName)
           
 boolean isLink()
           
 boolean isReference()
           
static boolean isReference(org.apache.hadoop.fs.Path path)
           
static boolean isReference(String name)
           
 boolean isTopReference()
           
static boolean isValid(org.apache.hadoop.fs.FileStatus fileStatus)
          Return if the specified file is a valid store file or not.
 StoreFile.Reader open(org.apache.hadoop.fs.FileSystem fs, CacheConfig cacheConf, boolean canUseDropBehind)
          Open a Reader for the StoreFile
 void setRegionCoprocessorHost(RegionCoprocessorHost coprocessorHost)
          Sets the region coprocessor env.
 String toString()
           
static boolean validateStoreFileName(String fileName)
          Validate the store file name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG

HFILE_NAME_REGEX

public static final String HFILE_NAME_REGEX
A non-capture group, for hfiles, so that this can be embedded. HFiles are uuid ([0-9a-z]+). Bulk loaded hfiles has (_SeqId_[0-9]+_) has suffix.

See Also:
Constant Field Values
Constructor Detail

StoreFileInfo

public StoreFileInfo(org.apache.hadoop.conf.Configuration conf,
                     org.apache.hadoop.fs.FileSystem fs,
                     org.apache.hadoop.fs.Path path)
              throws IOException
Create a Store File Info

Parameters:
conf - the Configuration to use
fs - The current file system to use.
path - The Path of the file
Throws:
IOException

StoreFileInfo

public StoreFileInfo(org.apache.hadoop.conf.Configuration conf,
                     org.apache.hadoop.fs.FileSystem fs,
                     org.apache.hadoop.fs.FileStatus fileStatus)
              throws IOException
Create a Store File Info

Parameters:
conf - the Configuration to use
fs - The current file system to use.
fileStatus - The FileStatus of the file
Throws:
IOException
Method Detail

setRegionCoprocessorHost

public void setRegionCoprocessorHost(RegionCoprocessorHost coprocessorHost)
Sets the region coprocessor env.

Parameters:
coprocessorHost -

getReference

public Reference getReference()

isReference

public boolean isReference()
Returns:
True if the store file is a Reference

isTopReference

public boolean isTopReference()
Returns:
True if the store file is a top Reference

isLink

public boolean isLink()
Returns:
True if the store file is a link

getHDFSBlockDistribution

public HDFSBlocksDistribution getHDFSBlockDistribution()
Returns:
the HDFS block distribution

open

public StoreFile.Reader open(org.apache.hadoop.fs.FileSystem fs,
                             CacheConfig cacheConf,
                             boolean canUseDropBehind)
                      throws IOException
Open a Reader for the StoreFile

Parameters:
fs - The current file system to use.
cacheConf - The cache configuration and block cache reference.
Returns:
The StoreFile.Reader for the file
Throws:
IOException

computeHDFSBlocksDistribution

public HDFSBlocksDistribution computeHDFSBlocksDistribution(org.apache.hadoop.fs.FileSystem fs)
                                                     throws IOException
Compute the HDFS Block Distribution for this StoreFile

Throws:
IOException

getReferencedFileStatus

public org.apache.hadoop.fs.FileStatus getReferencedFileStatus(org.apache.hadoop.fs.FileSystem fs)
                                                        throws IOException
Get the FileStatus of the file referenced by this StoreFileInfo

Parameters:
fs - The current file system to use.
Returns:
The FileStatus of the file referenced by this StoreFileInfo
Throws:
IOException

getPath

public org.apache.hadoop.fs.Path getPath()
Returns:
The Path of the file

getFileStatus

public org.apache.hadoop.fs.FileStatus getFileStatus()
Returns:
The FileStatus of the file

getModificationTime

public long getModificationTime()
Returns:
Get the modification time of the file.

toString

public String toString()
Overrides:
toString in class Object

isHFile

public static boolean isHFile(org.apache.hadoop.fs.Path path)
Parameters:
path - Path to check.
Returns:
True if the path has format of a HFile.

isHFile

public static boolean isHFile(String fileName)

isReference

public static boolean isReference(org.apache.hadoop.fs.Path path)
Parameters:
path - Path to check.
Returns:
True if the path has format of a HStoreFile reference.

isReference

public static boolean isReference(String name)
Parameters:
name - file name to check.
Returns:
True if the path has format of a HStoreFile reference.

getCreatedTimestamp

public long getCreatedTimestamp()
Returns:
timestamp when this file was created (as returned by filesystem)

getReferredToFile

public static org.apache.hadoop.fs.Path getReferredToFile(org.apache.hadoop.fs.Path p)

validateStoreFileName

public static boolean validateStoreFileName(String fileName)
Validate the store file name.

Parameters:
fileName - name of the file to validate
Returns:
true if the file could be a valid store file, false otherwise

isValid

public static boolean isValid(org.apache.hadoop.fs.FileStatus fileStatus)
                       throws IOException
Return if the specified file is a valid store file or not.

Parameters:
fileStatus - The FileStatus of the file
Returns:
true if the file is valid
Throws:
IOException


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