|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface HadoopShims
In order to be compatible with multiple versions of Hadoop, all parts of the Hadoop interface that are not cross-version compatible are encapsulated in an implementation of this class. Users should use the ShimLoader class as a factory to obtain an implementation of HadoopShims corresponding to the version of Hadoop currently on the classpath.
Nested Class Summary | |
---|---|
static interface |
HadoopShims.CombineFileInputFormatShim<K,V>
CombineFileInputFormatShim. |
static interface |
HadoopShims.InputSplitShim
InputSplitShim. |
static class |
HadoopShims.JobTrackerState
|
static interface |
HadoopShims.MiniDFSShim
Shim around the functions in MiniDFSCluster that Hive uses. |
Field Summary | |
---|---|
static org.apache.commons.logging.Log |
LOG
|
Method Summary | ||
---|---|---|
void |
closeAllForUGI(UserGroupInformation ugi)
Get the UGI that the given job configuration will run as. |
|
int |
compareText(Text a,
Text b)
We define this function here to make the code compatible between hadoop 0.17 and hadoop 0.20. |
|
int |
createHadoopArchive(Configuration conf,
Path parentDir,
Path destDir,
String archiveName)
|
|
UserGroupInformation |
createProxyUser(String userName)
Create the proxy ugi for the given userid |
|
UserGroupInformation |
createRemoteUser(String userName,
List<String> groupNames)
Used by metastore server to creates UGI object for a remote user. |
|
|
doAs(UserGroupInformation ugi,
PrivilegedExceptionAction<T> pvea)
Used by metastore server to perform requested rpc in client context. |
|
boolean |
fileSystemDeleteOnExit(FileSystem fs,
Path path)
Calls fs.deleteOnExit(path) if such a function exists. |
|
long |
getAccessTime(FileStatus file)
return the last access time of the given file. |
|
HadoopShims.CombineFileInputFormatShim |
getCombineFileInputFormat()
|
|
long |
getDefaultBlockSize(FileSystem fs,
Path path)
Get the default block size for the path. |
|
short |
getDefaultReplication(FileSystem fs,
Path path)
Get the default replication for a path. |
|
URI |
getHarUri(URI original,
URI base,
URI originalBase)
|
|
String |
getInputFormatClassName()
|
|
String |
getJobLauncherHttpAddress(Configuration conf)
All references to jobtracker/resource manager http address in the configuration should be done through this shim |
|
String |
getJobLauncherRpcAddress(Configuration conf)
All retrieval of jobtracker/resource manager rpc address in the configuration should be done through this shim |
|
HadoopShims.JobTrackerState |
getJobTrackerState(ClusterStatus clusterStatus)
Convert the ClusterStatus to its Thrift equivalent: JobTrackerState. |
|
HadoopShims.MiniDFSShim |
getMiniDfs(Configuration conf,
int numDataNodes,
boolean format,
String[] racks)
Returns a shim to wrap MiniDFSCluster. |
|
String |
getShortUserName(UserGroupInformation ugi)
Get the short name corresponding to the subject in the passed UGI In secure versions of Hadoop, this returns the short name (after undergoing the translation in the kerberos name rule mapping). |
|
String |
getTaskAttemptLogUrl(JobConf conf,
String taskTrackerHttpAddress,
String taskAttemptId)
Constructs and Returns TaskAttempt Log Url or null if the TaskLogServlet is not available |
|
String[] |
getTaskJobIDs(TaskCompletionEvent t)
getTaskJobIDs returns an array of String with two elements. |
|
String |
getTokenStrForm(String tokenSignature)
Get the string form of the token given a token signature. |
|
UserGroupInformation |
getUGIForConf(Configuration conf)
|
|
void |
inputFormatValidateInput(InputFormat fmt,
JobConf conf)
Calls fmt.validateInput(conf) if such a function exists. |
|
boolean |
isJobPreparing(RunningJob job)
Return true if the job has not switched to RUNNING state yet and is still in PREP state |
|
boolean |
isLocalMode(Configuration conf)
Check wether MR is configured to run in local-mode |
|
boolean |
isSecureShimImpl()
Return true if the Shim is based on Hadoop Security APIs. |
|
boolean |
isSecurityEnabled()
Return true if the hadoop configuration has security enabled |
|
void |
loginUserFromKeytab(String principal,
String keytabFile)
Perform kerberos login using the given principal and keytab |
|
boolean |
moveToAppropriateTrash(FileSystem fs,
Path path,
Configuration conf)
Move the directory/file to trash. |
|
JobContext |
newJobContext(Job job)
|
|
TaskAttemptContext |
newTaskAttemptContext(Configuration conf,
Progressable progressable)
|
|
void |
prepareJobOutput(JobConf conf)
Hive uses side effect files exclusively for it's output. |
|
void |
setFloatConf(Configuration conf,
String varName,
float val)
Wrapper for Configuration.setFloat, which was not introduced until 0.20. |
|
void |
setJobLauncherRpcAddress(Configuration conf,
String val)
All updates to jobtracker/resource manager rpc address in the configuration should be done through this shim |
|
void |
setTmpFiles(String prop,
String files)
If JobClient.getCommandLineConfig exists, sets the given property/value pair in that Configuration object. |
|
void |
setTokenStr(UserGroupInformation ugi,
String tokenStr,
String tokenService)
Add a delegation token to the given ugi |
|
String |
unquoteHtmlChars(String item)
Used by TaskLogProcessor to Remove HTML quoting from a string |
|
boolean |
usesJobShell()
Return true if the current version of Hadoop uses the JobShell for command line interpretation. |
Field Detail |
---|
static final org.apache.commons.logging.Log LOG
Method Detail |
---|
boolean usesJobShell()
String getTaskAttemptLogUrl(JobConf conf, String taskTrackerHttpAddress, String taskAttemptId) throws MalformedURLException
MalformedURLException
boolean isJobPreparing(RunningJob job) throws IOException
IOException
boolean fileSystemDeleteOnExit(FileSystem fs, Path path) throws IOException
IOException
void inputFormatValidateInput(InputFormat fmt, JobConf conf) throws IOException
IOException
void setTmpFiles(String prop, String files)
long getAccessTime(FileStatus file)
file
-
HadoopShims.MiniDFSShim getMiniDfs(Configuration conf, int numDataNodes, boolean format, String[] racks) throws IOException
IOException
int compareText(Text a, Text b)
HadoopShims.CombineFileInputFormatShim getCombineFileInputFormat()
String getInputFormatClassName()
void setFloatConf(Configuration conf, String varName, float val)
String[] getTaskJobIDs(TaskCompletionEvent t)
int createHadoopArchive(Configuration conf, Path parentDir, Path destDir, String archiveName) throws Exception
Exception
URI getHarUri(URI original, URI base, URI originalBase) throws URISyntaxException
URISyntaxException
void prepareJobOutput(JobConf conf)
String unquoteHtmlChars(String item)
item
- the string to unquote
void closeAllForUGI(UserGroupInformation ugi)
UserGroupInformation getUGIForConf(Configuration conf) throws LoginException, IOException
LoginException
IOException
<T> T doAs(UserGroupInformation ugi, PrivilegedExceptionAction<T> pvea) throws IOException, InterruptedException
T
- ugi
- pvea
-
IOException
InterruptedException
UserGroupInformation createRemoteUser(String userName, List<String> groupNames)
userName
- remote User NamegroupNames
- group names associated with remote user name
String getShortUserName(UserGroupInformation ugi)
boolean isSecureShimImpl()
boolean isSecurityEnabled()
String getTokenStrForm(String tokenSignature) throws IOException
tokenSignature
-
IOException
void setTokenStr(UserGroupInformation ugi, String tokenStr, String tokenService) throws IOException
ugi
- tokenStr
- tokenService
-
IOException
HadoopShims.JobTrackerState getJobTrackerState(ClusterStatus clusterStatus) throws Exception
clusterStatus
-
Exception
- if no equivalent JobTrackerState existsTaskAttemptContext newTaskAttemptContext(Configuration conf, Progressable progressable)
JobContext newJobContext(Job job)
boolean isLocalMode(Configuration conf)
conf
-
String getJobLauncherRpcAddress(Configuration conf)
conf
-
void setJobLauncherRpcAddress(Configuration conf, String val)
conf
- String getJobLauncherHttpAddress(Configuration conf)
conf
-
void loginUserFromKeytab(String principal, String keytabFile) throws IOException
IOException
boolean moveToAppropriateTrash(FileSystem fs, Path path, Configuration conf) throws IOException
fs
- path
- conf
-
IOException
long getDefaultBlockSize(FileSystem fs, Path path)
fs
- path
-
short getDefaultReplication(FileSystem fs, Path path)
fs
- path
-
UserGroupInformation createProxyUser(String userName) throws IOException
userName
-
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |