@InterfaceAudience.Private public class StoreFileInfo extends Object
Modifier and Type | Field and Description |
---|---|
private org.apache.hadoop.conf.Configuration |
conf |
private RegionCoprocessorHost |
coprocessorHost |
private long |
createdTimestamp |
static boolean |
DEFAULT_STORE_FILE_READER_NO_READAHEAD |
private static Pattern |
DELFILE_NAME_PATTERN
Regex that will work for del files
|
static String |
DELFILE_NAME_REGEX
A non-capture group, for del files, so that this can be embedded.
|
private org.apache.hadoop.fs.FileSystem |
fs |
private HDFSBlocksDistribution |
hdfsBlocksDistribution |
private static Pattern |
HFILE_NAME_PATTERN
Regex that will work for hfiles
|
static String |
HFILE_NAME_REGEX
A non-capture group, for hfiles, so that this can be embedded.
|
private HFileInfo |
hfileInfo |
private org.apache.hadoop.fs.Path |
initialPath |
private HFileLink |
link |
private static org.slf4j.Logger |
LOG |
private boolean |
noReadahead |
private boolean |
primaryReplica |
private static Pattern |
REF_NAME_PATTERN
Regex that will work for straight reference names (
<hfile>.<parentEncRegion> )
and hfilelink reference names (<table>=<region>-<hfile>.<parentEncRegion> )
If reference, then the regex has more than just one group. |
(package private) AtomicInteger |
refCount |
private Reference |
reference |
private long |
size |
static String |
STORE_FILE_READER_NO_READAHEAD |
Modifier | 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
|
private |
StoreFileInfo(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.FileStatus fileStatus,
org.apache.hadoop.fs.Path initialPath,
boolean primaryReplica) |
|
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
|
private HDFSBlocksDistribution |
computeHDFSBlocksDistributionInternal(org.apache.hadoop.fs.FileSystem fs) |
private static HDFSBlocksDistribution |
computeRefFileHDFSBlockDistribution(org.apache.hadoop.fs.FileSystem fs,
Reference reference,
org.apache.hadoop.fs.FileStatus status)
helper function to compute HDFS blocks distribution of a given reference
file.For reference file, we don't compute the exact value.
|
(package private) StoreFileReader |
createReader(ReaderContext context,
CacheConfig cacheConf) |
(package private) ReaderContext |
createReaderContext(boolean doDropBehind,
long readahead,
ReaderContext.ReaderType type) |
boolean |
equals(Object that) |
String |
getActiveFileName()
Return the active file name that contains the real data.
|
(package private) org.apache.hadoop.conf.Configuration |
getConf() |
long |
getCreatedTimestamp() |
org.apache.hadoop.fs.FileStatus |
getFileStatus() |
(package private) org.apache.hadoop.fs.FileSystem |
getFileSystem() |
HDFSBlocksDistribution |
getHDFSBlockDistribution() |
(package private) HFileInfo |
getHFileInfo() |
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) |
long |
getSize()
Size of the Hfile
|
int |
hashCode() |
(package private) void |
initHDFSBlocksDistribution() |
void |
initHFileInfo(ReaderContext context) |
static boolean |
isDelFile(org.apache.hadoop.fs.Path path) |
static boolean |
isDelFile(String fileName) |
static boolean |
isHFile(org.apache.hadoop.fs.Path path) |
static boolean |
isHFile(String fileName) |
boolean |
isLink() |
(package private) boolean |
isNoReadahead() |
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.
|
(package private) StoreFileReader |
postStoreFileReaderOpen(ReaderContext context,
CacheConfig cacheConf,
StoreFileReader reader) |
(package private) StoreFileReader |
preStoreFileReaderOpen(ReaderContext context,
CacheConfig cacheConf) |
void |
setRegionCoprocessorHost(RegionCoprocessorHost coprocessorHost)
Sets the region coprocessor env.
|
String |
toString() |
static boolean |
validateStoreFileName(String fileName)
Validate the store file name.
|
private static final org.slf4j.Logger LOG
public static final String HFILE_NAME_REGEX
private static final Pattern HFILE_NAME_PATTERN
public static final String DELFILE_NAME_REGEX
private static final Pattern DELFILE_NAME_PATTERN
private static final Pattern REF_NAME_PATTERN
<hfile>.<parentEncRegion>
)
and hfilelink reference names (<table>=<region>-<hfile>.<parentEncRegion>
)
If reference, then the regex has more than just one group.
Group 1, hfile/hfilelink pattern, is this file's id.
Group 2 '(.+)' is the reference's parent region name.public static final String STORE_FILE_READER_NO_READAHEAD
public static final boolean DEFAULT_STORE_FILE_READER_NO_READAHEAD
private final org.apache.hadoop.conf.Configuration conf
private final org.apache.hadoop.fs.FileSystem fs
private HDFSBlocksDistribution hdfsBlocksDistribution
private final org.apache.hadoop.fs.Path initialPath
private RegionCoprocessorHost coprocessorHost
private long createdTimestamp
private long size
private final boolean primaryReplica
private final boolean noReadahead
final AtomicInteger refCount
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.IOException
private StoreFileInfo(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.FileStatus fileStatus, org.apache.hadoop.fs.Path initialPath, boolean primaryReplica) throws IOException
IOException
public 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 fileIOException
public 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 long getSize()
public void setRegionCoprocessorHost(RegionCoprocessorHost coprocessorHost)
coprocessorHost
- public Reference getReference()
public boolean isReference()
public boolean isTopReference()
public boolean isLink()
public HDFSBlocksDistribution getHDFSBlockDistribution()
StoreFileReader createReader(ReaderContext context, CacheConfig cacheConf) throws IOException
IOException
ReaderContext createReaderContext(boolean doDropBehind, long readahead, ReaderContext.ReaderType type) throws IOException
IOException
public HDFSBlocksDistribution computeHDFSBlocksDistribution(org.apache.hadoop.fs.FileSystem fs) throws IOException
IOException
private HDFSBlocksDistribution computeHDFSBlocksDistributionInternal(org.apache.hadoop.fs.FileSystem fs) throws IOException
IOException
public 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 StoreFileInfoIOException
public org.apache.hadoop.fs.Path getPath()
Path
of the filepublic org.apache.hadoop.fs.FileStatus getFileStatus() throws IOException
FileStatus
of the fileIOException
public long getModificationTime() throws IOException
IOException
public static boolean isHFile(org.apache.hadoop.fs.Path path)
path
- Path to check.public static boolean isDelFile(org.apache.hadoop.fs.Path path)
path
- Path to check.public static boolean isDelFile(String fileName)
fileName
- Sting version of path to validate.public 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 fileIOException
private static HDFSBlocksDistribution computeRefFileHDFSBlockDistribution(org.apache.hadoop.fs.FileSystem fs, Reference reference, org.apache.hadoop.fs.FileStatus status) throws IOException
fs
- The FileSystemreference
- The referencestatus
- The reference FileStatusIOException
public 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.
org.apache.hadoop.fs.FileSystem getFileSystem()
org.apache.hadoop.conf.Configuration getConf()
boolean isNoReadahead()
HFileInfo getHFileInfo()
void initHDFSBlocksDistribution() throws IOException
IOException
StoreFileReader preStoreFileReaderOpen(ReaderContext context, CacheConfig cacheConf) throws IOException
IOException
StoreFileReader postStoreFileReaderOpen(ReaderContext context, CacheConfig cacheConf, StoreFileReader reader) throws IOException
IOException
public void initHFileInfo(ReaderContext context) throws IOException
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.