public interface HadoopShims
Modifier and Type | Interface and Description |
---|---|
static interface |
HadoopShims.ByteBufferPoolShim
a hadoop.io ByteBufferPool shim.
|
static interface |
HadoopShims.CombineFileInputFormatShim<K,V>
CombineFileInputFormatShim.
|
static class |
HadoopShims.DirectCompressionType |
static interface |
HadoopShims.DirectDecompressorShim |
static interface |
HadoopShims.HCatHadoopShims |
static interface |
HadoopShims.HdfsEncryptionShim
This interface encapsulates methods used to get encryption information from
HDFS paths.
|
static interface |
HadoopShims.HdfsFileStatus
Includes the vanilla FileStatus, and AclStatus if it applies to this version of hadoop.
|
static class |
HadoopShims.JobTrackerState |
static interface |
HadoopShims.KerberosNameShim
Shim for KerberosName
|
static interface |
HadoopShims.MiniDFSShim
Shim around the functions in MiniDFSCluster that Hive uses.
|
static interface |
HadoopShims.MiniMrShim
Shim for MiniMrCluster
|
static class |
HadoopShims.NoopHdfsEncryptionShim
This is a dummy class used when the hadoop version does not support hdfs encryption.
|
static interface |
HadoopShims.StoragePolicyShim |
static class |
HadoopShims.StoragePolicyValue
Create a shim for DFS storage policy.
|
static interface |
HadoopShims.WebHCatJTShim |
static interface |
HadoopShims.ZeroCopyReaderShim |
Modifier and Type | Method and Description |
---|---|
void |
addDelegationTokens(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.security.Credentials cred,
String uname)
Get Delegation token and add it to Credential.
|
void |
checkFileAccess(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.FileStatus status,
org.apache.hadoop.fs.permission.FsAction action)
Check if the configured UGI has access to the path for the given file system action.
|
HadoopShims.HdfsEncryptionShim |
createHdfsEncryptionShim(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.conf.Configuration conf)
Returns a new instance of the HdfsEncryption shim.
|
org.apache.hadoop.fs.FileSystem |
createProxyFileSystem(org.apache.hadoop.fs.FileSystem fs,
URI uri)
Create a proxy file system that can serve a given scheme/authority using some
other file system.
|
HadoopShims.CombineFileInputFormatShim |
getCombineFileInputFormat() |
org.apache.hadoop.conf.Configuration |
getConfiguration(org.apache.hadoop.mapreduce.JobContext context)
Get configuration from JobContext
|
org.apache.hadoop.fs.Path |
getCurrentTrashPath(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs) |
long |
getDefaultBlockSize(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path)
Get the default block size for the path.
|
short |
getDefaultReplication(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path)
Get the default replication for a path.
|
HadoopShims.DirectDecompressorShim |
getDirectDecompressor(HadoopShims.DirectCompressionType codec) |
HadoopShims.HdfsFileStatus |
getFullFileStatus(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path file)
For a given file, return a file status
|
Map<String,String> |
getHadoopConfNames() |
HadoopShims.HCatHadoopShims |
getHCatShim() |
org.apache.hadoop.mapred.JobConf |
getJobConf(org.apache.hadoop.mapred.JobContext context)
Get job conf from the old style JobContext.
|
String |
getJobLauncherHttpAddress(org.apache.hadoop.conf.Configuration conf)
All references to jobtracker/resource manager http address
in the configuration should be done through this shim
|
String |
getJobLauncherRpcAddress(org.apache.hadoop.conf.Configuration conf)
All retrieval of jobtracker/resource manager rpc address
in the configuration should be done through this shim
|
HadoopShims.JobTrackerState |
getJobTrackerState(org.apache.hadoop.mapred.ClusterStatus clusterStatus)
Convert the ClusterStatus to its Thrift equivalent: JobTrackerState.
|
HadoopShims.KerberosNameShim |
getKerberosNameShim(String name)
Returns a shim to wrap KerberosName
|
org.apache.hadoop.fs.BlockLocation[] |
getLocations(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.FileStatus status)
For file status returned by listLocatedStatus, convert them into a list
of block locations.
|
TreeMap<Long,org.apache.hadoop.fs.BlockLocation> |
getLocationsWithOffset(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.FileStatus status)
For the block locations returned by getLocations() convert them into a Treemap
|
Comparator<org.apache.hadoop.io.LongWritable> |
getLongComparator() |
void |
getMergedCredentials(org.apache.hadoop.mapred.JobConf jobConf) |
HadoopShims.MiniDFSShim |
getMiniDfs(org.apache.hadoop.conf.Configuration conf,
int numDataNodes,
boolean format,
String[] racks)
Returns a shim to wrap MiniDFSCluster.
|
HadoopShims.MiniMrShim |
getMiniMrCluster(org.apache.hadoop.conf.Configuration conf,
int numberOfTaskTrackers,
String nameNode,
int numDir)
Returns a shim to wrap MiniMrCluster
|
HadoopShims.MiniMrShim |
getMiniSparkCluster(org.apache.hadoop.conf.Configuration conf,
int numberOfTaskTrackers,
String nameNode,
int numDir) |
HadoopShims.MiniMrShim |
getMiniTezCluster(org.apache.hadoop.conf.Configuration conf,
int numberOfTaskTrackers,
String nameNode,
int numDir) |
org.apache.hadoop.fs.FileSystem |
getNonCachedFileSystem(URI uri,
org.apache.hadoop.conf.Configuration conf) |
String |
getPassword(org.apache.hadoop.conf.Configuration conf,
String name)
Use password API (if available) to fetch credentials/password
|
org.apache.hadoop.fs.Path |
getPathWithoutSchemeAndAuthority(org.apache.hadoop.fs.Path path) |
HadoopShims.StoragePolicyShim |
getStoragePolicyShim(org.apache.hadoop.fs.FileSystem fs)
obtain a storage policy shim associated with the filesystem.
|
String |
getTaskAttemptLogUrl(org.apache.hadoop.mapred.JobConf conf,
String taskTrackerHttpAddress,
String taskAttemptId)
Constructs and Returns TaskAttempt Log Url
or null if the TaskLogServlet is not available
|
HadoopShims.WebHCatJTShim |
getWebHCatShim(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.security.UserGroupInformation ugi)
Provides a Hadoop JobTracker shim.
|
HadoopShims.ZeroCopyReaderShim |
getZeroCopyReader(org.apache.hadoop.fs.FSDataInputStream in,
HadoopShims.ByteBufferPoolShim pool)
Provides an HDFS ZeroCopyReader shim.
|
boolean |
hasStickyBit(org.apache.hadoop.fs.permission.FsPermission permission)
Check stick bit in the permission
|
void |
hflush(org.apache.hadoop.fs.FSDataOutputStream stream)
Flush and make visible to other users the changes to the given stream.
|
boolean |
isDirectory(org.apache.hadoop.fs.FileStatus fileStatus)
Check whether file is directory.
|
boolean |
isLocalMode(org.apache.hadoop.conf.Configuration conf)
Check wether MR is configured to run in local-mode
|
List<org.apache.hadoop.fs.FileStatus> |
listLocatedStatus(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
org.apache.hadoop.fs.PathFilter filter)
Get the block locations for the given directory.
|
void |
mergeCredentials(org.apache.hadoop.mapred.JobConf dest,
org.apache.hadoop.mapred.JobConf src) |
boolean |
moveToAppropriateTrash(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration conf)
Move the directory/file to trash.
|
org.apache.hadoop.mapreduce.JobContext |
newJobContext(org.apache.hadoop.mapreduce.Job job) |
org.apache.hadoop.mapreduce.TaskAttemptContext |
newTaskAttemptContext(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.util.Progressable progressable) |
org.apache.hadoop.mapreduce.TaskAttemptID |
newTaskAttemptID(org.apache.hadoop.mapreduce.JobID jobId,
boolean isMap,
int taskId,
int id) |
int |
readByteBuffer(org.apache.hadoop.fs.FSDataInputStream file,
ByteBuffer dest)
Reads data into ByteBuffer.
|
void |
refreshDefaultQueue(org.apache.hadoop.conf.Configuration conf,
String userName)
Reset the default fair scheduler queue mapping to end user.
|
boolean |
runDistCp(org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst,
org.apache.hadoop.conf.Configuration conf)
Copies a source dir/file to a destination by orchestrating the copy between hdfs nodes.
|
void |
setFullFileStatus(org.apache.hadoop.conf.Configuration conf,
HadoopShims.HdfsFileStatus sourceStatus,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path target)
For a given file, set a given file status.
|
void |
setJobLauncherRpcAddress(org.apache.hadoop.conf.Configuration conf,
String val)
All updates to jobtracker/resource manager rpc address
in the configuration should be done through this shim
|
void |
setTotalOrderPartitionFile(org.apache.hadoop.mapred.JobConf jobConf,
org.apache.hadoop.fs.Path partition)
The method sets to set the partition file has a different signature between
hadoop versions.
|
void |
startPauseMonitor(org.apache.hadoop.conf.Configuration conf) |
boolean |
supportStickyBit()
check whether current hadoop supports sticky bit
|
boolean |
supportTrashFeature() |
String getTaskAttemptLogUrl(org.apache.hadoop.mapred.JobConf conf, String taskTrackerHttpAddress, String taskAttemptId) throws MalformedURLException
MalformedURLException
HadoopShims.MiniMrShim getMiniMrCluster(org.apache.hadoop.conf.Configuration conf, int numberOfTaskTrackers, String nameNode, int numDir) throws IOException
IOException
HadoopShims.MiniMrShim getMiniTezCluster(org.apache.hadoop.conf.Configuration conf, int numberOfTaskTrackers, String nameNode, int numDir) throws IOException
IOException
HadoopShims.MiniMrShim getMiniSparkCluster(org.apache.hadoop.conf.Configuration conf, int numberOfTaskTrackers, String nameNode, int numDir) throws IOException
IOException
HadoopShims.MiniDFSShim getMiniDfs(org.apache.hadoop.conf.Configuration conf, int numDataNodes, boolean format, String[] racks) throws IOException
IOException
HadoopShims.CombineFileInputFormatShim getCombineFileInputFormat()
HadoopShims.JobTrackerState getJobTrackerState(org.apache.hadoop.mapred.ClusterStatus clusterStatus) throws Exception
clusterStatus
- Exception
- if no equivalent JobTrackerState existsorg.apache.hadoop.mapreduce.TaskAttemptContext newTaskAttemptContext(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.util.Progressable progressable)
org.apache.hadoop.mapreduce.TaskAttemptID newTaskAttemptID(org.apache.hadoop.mapreduce.JobID jobId, boolean isMap, int taskId, int id)
org.apache.hadoop.mapreduce.JobContext newJobContext(org.apache.hadoop.mapreduce.Job job)
void startPauseMonitor(org.apache.hadoop.conf.Configuration conf)
boolean isLocalMode(org.apache.hadoop.conf.Configuration conf)
conf
- String getJobLauncherRpcAddress(org.apache.hadoop.conf.Configuration conf)
conf
- void setJobLauncherRpcAddress(org.apache.hadoop.conf.Configuration conf, String val)
conf
- String getJobLauncherHttpAddress(org.apache.hadoop.conf.Configuration conf)
conf
- boolean moveToAppropriateTrash(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf) throws IOException
fs
- path
- conf
- IOException
long getDefaultBlockSize(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path)
fs
- path
- short getDefaultReplication(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path)
fs
- path
- void refreshDefaultQueue(org.apache.hadoop.conf.Configuration conf, String userName) throws IOException
conf
- userName
- end user nameIOException
void setTotalOrderPartitionFile(org.apache.hadoop.mapred.JobConf jobConf, org.apache.hadoop.fs.Path partition)
jobConf
- partition
- Comparator<org.apache.hadoop.io.LongWritable> getLongComparator()
List<org.apache.hadoop.fs.FileStatus> listLocatedStatus(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, org.apache.hadoop.fs.PathFilter filter) throws IOException
fs
- the file systempath
- the directory name to get the status and block locationsfilter
- a filter that needs to accept the file (or null)IOException
org.apache.hadoop.fs.BlockLocation[] getLocations(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.FileStatus status) throws IOException
fs
- the file systemstatus
- the file informationIOException
TreeMap<Long,org.apache.hadoop.fs.BlockLocation> getLocationsWithOffset(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.FileStatus status) throws IOException
fs
- the file systemstatus
- the file informationIOException
void hflush(org.apache.hadoop.fs.FSDataOutputStream stream) throws IOException
stream
- the stream to hflush.IOException
HadoopShims.HdfsFileStatus getFullFileStatus(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path file) throws IOException
conf
- fs
- file
- IOException
void setFullFileStatus(org.apache.hadoop.conf.Configuration conf, HadoopShims.HdfsFileStatus sourceStatus, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path target) throws IOException
conf
- sourceStatus
- fs
- target
- IOException
HadoopShims.HCatHadoopShims getHCatShim()
HadoopShims.WebHCatJTShim getWebHCatShim(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.security.UserGroupInformation ugi) throws IOException
conf
- not null
IOException
org.apache.hadoop.fs.FileSystem createProxyFileSystem(org.apache.hadoop.fs.FileSystem fs, URI uri)
HadoopShims.StoragePolicyShim getStoragePolicyShim(org.apache.hadoop.fs.FileSystem fs)
HadoopShims.ZeroCopyReaderShim getZeroCopyReader(org.apache.hadoop.fs.FSDataInputStream in, HadoopShims.ByteBufferPoolShim pool) throws IOException
in
- FSDataInputStream to read from (where the cached/mmap buffers are tied to)in
- ByteBufferPoolShim to allocate fallback buffers withIOException
HadoopShims.DirectDecompressorShim getDirectDecompressor(HadoopShims.DirectCompressionType codec)
org.apache.hadoop.conf.Configuration getConfiguration(org.apache.hadoop.mapreduce.JobContext context)
org.apache.hadoop.mapred.JobConf getJobConf(org.apache.hadoop.mapred.JobContext context)
context
- job contextorg.apache.hadoop.fs.FileSystem getNonCachedFileSystem(URI uri, org.apache.hadoop.conf.Configuration conf) throws IOException
IOException
void getMergedCredentials(org.apache.hadoop.mapred.JobConf jobConf) throws IOException
IOException
void mergeCredentials(org.apache.hadoop.mapred.JobConf dest, org.apache.hadoop.mapred.JobConf src) throws IOException
IOException
void checkFileAccess(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.FileStatus status, org.apache.hadoop.fs.permission.FsAction action) throws IOException, AccessControlException, Exception
fs
- status
- action
- IOException
AccessControlException
Exception
String getPassword(org.apache.hadoop.conf.Configuration conf, String name) throws IOException
conf
- name
- IOException
boolean supportStickyBit()
boolean hasStickyBit(org.apache.hadoop.fs.permission.FsPermission permission)
permission
- boolean supportTrashFeature()
org.apache.hadoop.fs.Path getCurrentTrashPath(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs)
boolean isDirectory(org.apache.hadoop.fs.FileStatus fileStatus)
HadoopShims.KerberosNameShim getKerberosNameShim(String name) throws IOException
IOException
boolean runDistCp(org.apache.hadoop.fs.Path src, org.apache.hadoop.fs.Path dst, org.apache.hadoop.conf.Configuration conf) throws IOException
src
- Path to the source file or directory to copydst
- Path to the destination file or directoryconf
- The hadoop configuration objectIOException
HadoopShims.HdfsEncryptionShim createHdfsEncryptionShim(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.conf.Configuration conf) throws IOException
fs
- A FileSystem object to HDFSconf
- A Configuration objectIOException
- If an error occurred while creating the instance.org.apache.hadoop.fs.Path getPathWithoutSchemeAndAuthority(org.apache.hadoop.fs.Path path)
int readByteBuffer(org.apache.hadoop.fs.FSDataInputStream file, ByteBuffer dest) throws IOException
file
- File.dest
- Buffer.IOException
void addDelegationTokens(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.security.Credentials cred, String uname) throws IOException
fs
- FileSystem object to HDFScred
- Credentials object to add the token to.uname
- user name.IOException
- If an error occurred on adding the token.Copyright © 2017 The Apache Software Foundation. All rights reserved.