org.apache.hadoop.hive.shims
Class HadoopShimsSecure

java.lang.Object
  extended by org.apache.hadoop.hive.shims.HadoopShimsSecure
All Implemented Interfaces:
HadoopShims

public abstract class HadoopShimsSecure
extends Object
implements HadoopShims

Base implemention for shims against secure Hadoop 0.20.3/0.23.


Nested Class Summary
static class HadoopShimsSecure.CombineFileInputFormatShim<K,V>
           
static class HadoopShimsSecure.CombineFileRecordReader<K,V>
           
static class HadoopShimsSecure.InputSplitShim
           
static class HadoopShimsSecure.NullOutputCommitter
           
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hive.shims.HadoopShims
HadoopShims.ByteBufferPoolShim, HadoopShims.DirectCompressionType, HadoopShims.DirectDecompressorShim, HadoopShims.HCatHadoopShims, HadoopShims.JobTrackerState, HadoopShims.MiniDFSShim, HadoopShims.MiniMrShim, HadoopShims.WebHCatJTShim, HadoopShims.ZeroCopyReaderShim
 
Constructor Summary
HadoopShimsSecure()
           
 
Method Summary
 String addServiceToToken(String tokenStr, String tokenService)
          Add a given service to delegation token string.
 void authorizeProxyAccess(String proxyUser, org.apache.hadoop.security.UserGroupInformation realUserUgi, String ipAddress, org.apache.hadoop.conf.Configuration conf)
           
 void closeAllForUGI(org.apache.hadoop.security.UserGroupInformation ugi)
           
 Path createDelegationTokenFile(org.apache.hadoop.conf.Configuration conf)
           
 int createHadoopArchive(org.apache.hadoop.conf.Configuration conf, Path sourceDir, Path destDir, String archiveName)
           
abstract  FileSystem createProxyFileSystem(FileSystem fs, URI uri)
           
 org.apache.hadoop.security.UserGroupInformation createProxyUser(String userName)
           
 org.apache.hadoop.security.UserGroupInformation createRemoteUser(String userName, List<String> groupNames)
           
<T> T
doAs(org.apache.hadoop.security.UserGroupInformation ugi, PrivilegedExceptionAction<T> pvea)
           
 HadoopShims.CombineFileInputFormatShim getCombineFileInputFormat()
           
abstract  long getDefaultBlockSize(FileSystem fs, Path path)
           
abstract  short getDefaultReplication(FileSystem fs, Path path)
           
 URI getHarUri(URI original, URI base, URI originalBase)
           
 String getInputFormatClassName()
           
abstract  String getJobLauncherHttpAddress(org.apache.hadoop.conf.Configuration conf)
           
abstract  String getJobLauncherRpcAddress(org.apache.hadoop.conf.Configuration conf)
           
abstract  HadoopShims.JobTrackerState getJobTrackerState(org.apache.hadoop.mapred.ClusterStatus clusterStatus)
           
abstract  FileSystem getNonCachedFileSystem(URI uri, org.apache.hadoop.conf.Configuration conf)
           
 String getShortUserName(org.apache.hadoop.security.UserGroupInformation ugi)
           
 String getTokenFileLocEnvName()
           
 String getTokenStrForm(String tokenSignature)
           
 org.apache.hadoop.security.UserGroupInformation getUGIForConf(org.apache.hadoop.conf.Configuration conf)
           
abstract  boolean isLocalMode(org.apache.hadoop.conf.Configuration conf)
           
 boolean isLoginKeytabBased()
           
 boolean isSecureShimImpl()
           
 boolean isSecurityEnabled()
           
 void loginUserFromKeytab(String principal, String keytabFile)
           
 org.apache.hadoop.security.UserGroupInformation loginUserFromKeytabAndReturnUGI(String principal, String keytabFile)
           
abstract  boolean moveToAppropriateTrash(FileSystem fs, Path path, org.apache.hadoop.conf.Configuration conf)
           
abstract  org.apache.hadoop.mapreduce.JobContext newJobContext(org.apache.hadoop.mapreduce.Job job)
           
abstract  org.apache.hadoop.mapreduce.TaskAttemptContext newTaskAttemptContext(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.util.Progressable progressable)
           
 void prepareJobOutput(org.apache.hadoop.mapred.JobConf conf)
           
 void reLoginUserFromKeytab()
           
abstract  void setJobLauncherRpcAddress(org.apache.hadoop.conf.Configuration conf, String val)
           
 void setTokenStr(org.apache.hadoop.security.UserGroupInformation ugi, String tokenStr, String tokenService)
          Create a delegation token object for the given token string and service.
 String unquoteHtmlChars(String item)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.hive.shims.HadoopShims
getConfiguration, getDirectDecompressor, getHadoopConfNames, getHCatShim, getLocations, getLongComparator, getMiniDfs, getMiniMrCluster, getTaskAttemptLogUrl, getWebHCatShim, getZeroCopyReader, hflush, listLocatedStatus, newTaskAttemptID, setTotalOrderPartitionFile
 

Constructor Detail

HadoopShimsSecure

public HadoopShimsSecure()
Method Detail

unquoteHtmlChars

public String unquoteHtmlChars(String item)
Specified by:
unquoteHtmlChars in interface HadoopShims

getCombineFileInputFormat

public HadoopShims.CombineFileInputFormatShim getCombineFileInputFormat()
Specified by:
getCombineFileInputFormat in interface HadoopShims

getInputFormatClassName

public String getInputFormatClassName()
Specified by:
getInputFormatClassName in interface HadoopShims

createHadoopArchive

public int createHadoopArchive(org.apache.hadoop.conf.Configuration conf,
                               Path sourceDir,
                               Path destDir,
                               String archiveName)
                        throws Exception
Specified by:
createHadoopArchive in interface HadoopShims
Throws:
Exception

getHarUri

public URI getHarUri(URI original,
                     URI base,
                     URI originalBase)
              throws URISyntaxException
Specified by:
getHarUri in interface HadoopShims
Throws:
URISyntaxException

prepareJobOutput

public void prepareJobOutput(org.apache.hadoop.mapred.JobConf conf)
Specified by:
prepareJobOutput in interface HadoopShims

getUGIForConf

public org.apache.hadoop.security.UserGroupInformation getUGIForConf(org.apache.hadoop.conf.Configuration conf)
                                                              throws IOException
Specified by:
getUGIForConf in interface HadoopShims
Throws:
IOException

isSecureShimImpl

public boolean isSecureShimImpl()
Specified by:
isSecureShimImpl in interface HadoopShims

getShortUserName

public String getShortUserName(org.apache.hadoop.security.UserGroupInformation ugi)
Specified by:
getShortUserName in interface HadoopShims

getTokenStrForm

public String getTokenStrForm(String tokenSignature)
                       throws IOException
Specified by:
getTokenStrForm in interface HadoopShims
Throws:
IOException

setTokenStr

public void setTokenStr(org.apache.hadoop.security.UserGroupInformation ugi,
                        String tokenStr,
                        String tokenService)
                 throws IOException
Create a delegation token object for the given token string and service. Add the token to given UGI

Specified by:
setTokenStr in interface HadoopShims
Throws:
IOException

addServiceToToken

public String addServiceToToken(String tokenStr,
                                String tokenService)
                         throws IOException
Add a given service to delegation token string.

Specified by:
addServiceToToken in interface HadoopShims
Throws:
IOException

doAs

public <T> T doAs(org.apache.hadoop.security.UserGroupInformation ugi,
                  PrivilegedExceptionAction<T> pvea)
       throws IOException,
              InterruptedException
Specified by:
doAs in interface HadoopShims
Throws:
IOException
InterruptedException

createDelegationTokenFile

public Path createDelegationTokenFile(org.apache.hadoop.conf.Configuration conf)
                               throws IOException
Specified by:
createDelegationTokenFile in interface HadoopShims
Throws:
IOException

createProxyUser

public org.apache.hadoop.security.UserGroupInformation createProxyUser(String userName)
                                                                throws IOException
Specified by:
createProxyUser in interface HadoopShims
Throws:
IOException

authorizeProxyAccess

public void authorizeProxyAccess(String proxyUser,
                                 org.apache.hadoop.security.UserGroupInformation realUserUgi,
                                 String ipAddress,
                                 org.apache.hadoop.conf.Configuration conf)
                          throws IOException
Specified by:
authorizeProxyAccess in interface HadoopShims
Throws:
IOException

isSecurityEnabled

public boolean isSecurityEnabled()
Specified by:
isSecurityEnabled in interface HadoopShims

createRemoteUser

public org.apache.hadoop.security.UserGroupInformation createRemoteUser(String userName,
                                                                        List<String> groupNames)
Specified by:
createRemoteUser in interface HadoopShims

closeAllForUGI

public void closeAllForUGI(org.apache.hadoop.security.UserGroupInformation ugi)
Specified by:
closeAllForUGI in interface HadoopShims

loginUserFromKeytab

public void loginUserFromKeytab(String principal,
                                String keytabFile)
                         throws IOException
Specified by:
loginUserFromKeytab in interface HadoopShims
Throws:
IOException

loginUserFromKeytabAndReturnUGI

public org.apache.hadoop.security.UserGroupInformation loginUserFromKeytabAndReturnUGI(String principal,
                                                                                       String keytabFile)
                                                                                throws IOException
Specified by:
loginUserFromKeytabAndReturnUGI in interface HadoopShims
Throws:
IOException

getTokenFileLocEnvName

public String getTokenFileLocEnvName()
Specified by:
getTokenFileLocEnvName in interface HadoopShims

reLoginUserFromKeytab

public void reLoginUserFromKeytab()
                           throws IOException
Specified by:
reLoginUserFromKeytab in interface HadoopShims
Throws:
IOException

isLoginKeytabBased

public boolean isLoginKeytabBased()
                           throws IOException
Specified by:
isLoginKeytabBased in interface HadoopShims
Throws:
IOException

getJobTrackerState

public abstract HadoopShims.JobTrackerState getJobTrackerState(org.apache.hadoop.mapred.ClusterStatus clusterStatus)
                                                        throws Exception
Specified by:
getJobTrackerState in interface HadoopShims
Throws:
Exception

newTaskAttemptContext

public abstract org.apache.hadoop.mapreduce.TaskAttemptContext newTaskAttemptContext(org.apache.hadoop.conf.Configuration conf,
                                                                                     org.apache.hadoop.util.Progressable progressable)
Specified by:
newTaskAttemptContext in interface HadoopShims

newJobContext

public abstract org.apache.hadoop.mapreduce.JobContext newJobContext(org.apache.hadoop.mapreduce.Job job)
Specified by:
newJobContext in interface HadoopShims

isLocalMode

public abstract boolean isLocalMode(org.apache.hadoop.conf.Configuration conf)
Specified by:
isLocalMode in interface HadoopShims

setJobLauncherRpcAddress

public abstract void setJobLauncherRpcAddress(org.apache.hadoop.conf.Configuration conf,
                                              String val)
Specified by:
setJobLauncherRpcAddress in interface HadoopShims

getJobLauncherHttpAddress

public abstract String getJobLauncherHttpAddress(org.apache.hadoop.conf.Configuration conf)
Specified by:
getJobLauncherHttpAddress in interface HadoopShims

getJobLauncherRpcAddress

public abstract String getJobLauncherRpcAddress(org.apache.hadoop.conf.Configuration conf)
Specified by:
getJobLauncherRpcAddress in interface HadoopShims

getDefaultReplication

public abstract short getDefaultReplication(FileSystem fs,
                                            Path path)
Specified by:
getDefaultReplication in interface HadoopShims

getDefaultBlockSize

public abstract long getDefaultBlockSize(FileSystem fs,
                                         Path path)
Specified by:
getDefaultBlockSize in interface HadoopShims

moveToAppropriateTrash

public abstract boolean moveToAppropriateTrash(FileSystem fs,
                                               Path path,
                                               org.apache.hadoop.conf.Configuration conf)
                                        throws IOException
Specified by:
moveToAppropriateTrash in interface HadoopShims
Throws:
IOException

createProxyFileSystem

public abstract FileSystem createProxyFileSystem(FileSystem fs,
                                                 URI uri)
Specified by:
createProxyFileSystem in interface HadoopShims

getNonCachedFileSystem

public abstract FileSystem getNonCachedFileSystem(URI uri,
                                                  org.apache.hadoop.conf.Configuration conf)
                                           throws IOException
Specified by:
getNonCachedFileSystem in interface HadoopShims
Throws:
IOException


Copyright © 2014 The Apache Software Foundation. All rights reserved.