@InterfaceAudience.Private public class StoreFileInfo extends Object implements org.apache.hadoop.conf.Configurable
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_STORE_FILE_READER_NO_READAHEAD |
static String |
HFILE_NAME_REGEX
A non-capture group, for hfiles, so that this can be embedded.
|
static String |
STORE_FILE_READER_NO_READAHEAD |
| Constructor and Description |
|---|
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.FileStatus fileStatus,
HFileLink link)
Create a Store File Info from an HFileLink
|
StoreFileInfo(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.FileStatus fileStatus,
Reference reference)
Create a Store File Info from an HFileLink
|
StoreFileInfo(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.FileStatus fileStatus,
Reference reference,
HFileLink link)
Create a Store File Info from an HFileLink and a Reference
|
StoreFileInfo(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path initialPath,
boolean primaryReplica)
Create a Store File Info
|
| Modifier and Type | Method and Description |
|---|---|
HDFSBlocksDistribution |
computeHDFSBlocksDistribution(org.apache.hadoop.fs.FileSystem fs)
Compute the HDFS Block Distribution for this StoreFile
|
boolean |
equals(Object that) |
String |
getActiveFileName()
Return the active file name that contains the real data.
|
org.apache.hadoop.conf.Configuration |
getConf() |
long |
getCreatedTimestamp()
Returns timestamp when this file was created (as returned by filesystem)
|
org.apache.hadoop.fs.FileStatus |
getFileStatus()
Returns The
FileStatus of the file |
HDFSBlocksDistribution |
getHDFSBlockDistribution()
Returns the HDFS block distribution
|
long |
getModificationTime()
Returns Get the modification time of the file.
|
org.apache.hadoop.fs.Path |
getPath()
Returns The
Path of the file |
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) |
long |
getSize()
Size of the Hfile
|
int |
hashCode() |
void |
initHFileInfo(ReaderContext context) |
static boolean |
isHFile(org.apache.hadoop.fs.Path path) |
static boolean |
isHFile(String fileName) |
boolean |
isLink()
Returns True if the store file is a link
|
static boolean |
isMobFile(org.apache.hadoop.fs.Path path)
Checks if the file is a MOB file
|
static boolean |
isMobRefFile(org.apache.hadoop.fs.Path path)
Checks if the file is a MOB reference file, created by snapshot
|
boolean |
isReference()
Returns True if the store file is a Reference
|
static boolean |
isReference(org.apache.hadoop.fs.Path path) |
static boolean |
isReference(String name) |
boolean |
isTopReference()
Returns True if the store file is a top Reference
|
static boolean |
isValid(org.apache.hadoop.fs.FileStatus fileStatus)
Return if the specified file is a valid store file or not.
|
void |
setConf(org.apache.hadoop.conf.Configuration conf) |
void |
setRegionCoprocessorHost(RegionCoprocessorHost coprocessorHost)
Sets the region coprocessor env.
|
String |
toString() |
static boolean |
validateStoreFileName(String fileName)
Validate the store file name.
|
public static final String HFILE_NAME_REGEX
public static final String STORE_FILE_READER_NO_READAHEAD
public static final boolean DEFAULT_STORE_FILE_READER_NO_READAHEAD
public StoreFileInfo(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path initialPath,
boolean primaryReplica)
throws IOException
conf - the Configuration to usefs - The current file system to use.initialPath - The Path of the fileprimaryReplica - true if this is a store file for primary replica, otherwise false.IOExceptionpublic StoreFileInfo(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.FileStatus fileStatus)
throws IOException
conf - the Configuration to usefs - The current file system to use.fileStatus - The FileStatus of the fileIOExceptionpublic StoreFileInfo(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.FileStatus fileStatus,
HFileLink link)
conf - The Configuration to usefs - The current file system to usefileStatus - The FileStatus of the filepublic StoreFileInfo(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.FileStatus fileStatus,
Reference reference)
conf - The Configuration to usefs - The current file system to usefileStatus - The FileStatus of the filereference - The reference instancepublic StoreFileInfo(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.FileStatus fileStatus,
Reference reference,
HFileLink link)
conf - The Configuration to usefs - The current file system to usefileStatus - The FileStatus of the filereference - The reference instancelink - The link instancepublic org.apache.hadoop.conf.Configuration getConf()
getConf in interface org.apache.hadoop.conf.Configurablepublic void setConf(org.apache.hadoop.conf.Configuration conf)
setConf in interface org.apache.hadoop.conf.Configurablepublic long getSize()
public void setRegionCoprocessorHost(RegionCoprocessorHost coprocessorHost)
public Reference getReference()
public boolean isReference()
public boolean isTopReference()
public boolean isLink()
public HDFSBlocksDistribution getHDFSBlockDistribution()
public HDFSBlocksDistribution computeHDFSBlocksDistribution(org.apache.hadoop.fs.FileSystem fs) throws IOException
IOExceptionpublic org.apache.hadoop.fs.FileStatus getReferencedFileStatus(org.apache.hadoop.fs.FileSystem fs)
throws IOException
FileStatus of the file referenced by this StoreFileInfofs - The current file system to use.FileStatus of the file referenced by this StoreFileInfoIOExceptionpublic org.apache.hadoop.fs.Path getPath()
Path of the filepublic org.apache.hadoop.fs.FileStatus getFileStatus()
throws IOException
FileStatus of the fileIOExceptionpublic long getModificationTime()
throws IOException
IOExceptionpublic static boolean isHFile(org.apache.hadoop.fs.Path path)
path - Path to check.public static boolean isHFile(String fileName)
public static boolean isMobFile(org.apache.hadoop.fs.Path path)
path - path to a filepublic static boolean isMobRefFile(org.apache.hadoop.fs.Path path)
path - path to a filepublic static boolean isReference(org.apache.hadoop.fs.Path path)
path - Path to check.public static boolean isReference(String name)
name - file name to check.public long getCreatedTimestamp()
public static org.apache.hadoop.fs.Path getReferredToFile(org.apache.hadoop.fs.Path p)
public static boolean validateStoreFileName(String fileName)
fileName - name of the file to validatepublic static boolean isValid(org.apache.hadoop.fs.FileStatus fileStatus)
throws IOException
fileStatus - The FileStatus of the fileIOExceptionpublic String getActiveFileName()
For referenced hfile, we will return the name of the reference file as it will be used to construct the StoreFileReader. And for linked hfile, we will return the name of the file being linked.
public void initHFileInfo(ReaderContext context) throws IOException
IOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.