@InterfaceAudience.Private public class TezCommonUtils extends Object
| Modifier and Type | Field and Description | 
|---|---|
static org.apache.hadoop.fs.permission.FsPermission | 
TEZ_AM_DIR_PERMISSION  | 
static org.apache.hadoop.fs.permission.FsPermission | 
TEZ_AM_FILE_PERMISSION  | 
static String | 
TEZ_SYSTEM_SUB_DIR  | 
| Constructor and Description | 
|---|
TezCommonUtils()  | 
| Modifier and Type | Method and Description | 
|---|---|
static void | 
addAdditionalLocalResources(Map<String,org.apache.hadoop.yarn.api.records.LocalResource> additionalLrs,
                           Map<String,org.apache.hadoop.yarn.api.records.LocalResource> originalLRs,
                           String logContext)  | 
static com.google.protobuf.ByteString | 
compressByteArrayToByteString(byte[] inBytes)  | 
static ByteBuffer | 
convertJobTokenToBytes(org.apache.hadoop.security.token.Token<JobTokenIdentifier> jobToken)  | 
static org.apache.hadoop.fs.FSDataOutputStream | 
createFileForAM(org.apache.hadoop.fs.FileSystem fs,
               org.apache.hadoop.fs.Path filePath)
 Create a file with  
TEZ_AM_FILE_PERMISSION permission and
 returns OutputStream | 
static org.apache.hadoop.fs.Path | 
createTezSystemStagingPath(org.apache.hadoop.conf.Configuration conf,
                          String strAppId)
 This function returns the staging directory for TEZ system. 
 | 
static byte[] | 
decompressByteStringToByteArray(com.google.protobuf.ByteString byteString)  | 
static org.apache.hadoop.fs.Path | 
getAttemptRecoveryPath(org.apache.hadoop.fs.Path recoveryPath,
                      int attemptID)
 Returns a path to store app attempt specific recovery details 
 | 
static String | 
getCredentialsInfo(org.apache.hadoop.security.Credentials credentials,
                  String identifier)  | 
static org.apache.hadoop.fs.Path | 
getDAGRecoveryPath(org.apache.hadoop.fs.Path attemptRecoverPath,
                  String dagID)
 Returns a path to store DAG specific recovery info 
 | 
static org.apache.hadoop.fs.Path | 
getRecoveryPath(org.apache.hadoop.fs.Path tezSysStagingPath,
               org.apache.hadoop.conf.Configuration conf)
 Returns a path to store recovery information 
 | 
static org.apache.hadoop.fs.Path | 
getSummaryRecoveryPath(org.apache.hadoop.fs.Path attemptRecoverPath)
 Returns a path to store summary info for recovery 
 | 
static org.apache.hadoop.fs.Path | 
getTezAMJarStagingPath(org.apache.hadoop.fs.Path tezSysStagingPath)
 Returns a path to store local resources/session jars 
 | 
static org.apache.hadoop.fs.Path | 
getTezBaseStagingPath(org.apache.hadoop.conf.Configuration conf)
 This function returns the staging directory defined in the config with
 property name  
TezConfiguration.TEZ_AM_STAGING_DIR. | 
static org.apache.hadoop.fs.Path | 
getTezBinPlanStagingPath(org.apache.hadoop.fs.Path tezSysStagingPath)
 Returns a path to store binary plan 
 | 
static org.apache.hadoop.fs.Path | 
getTezConfStagingPath(org.apache.hadoop.fs.Path tezSysStagingPath)
 Returns a path to store binary configuration 
 | 
static org.apache.hadoop.fs.Path | 
getTezSystemStagingPath(org.apache.hadoop.conf.Configuration conf,
                       String strAppId)
 This function returns the staging directory for TEZ system. 
 | 
static org.apache.hadoop.fs.Path | 
getTezTextPlanStagingPath(org.apache.hadoop.fs.Path tezSysStagingPath,
                         String strAppId,
                         String dagPBName)
 Returns a path to store text plan 
 | 
static String[] | 
getTrimmedStrings(String str)
Splits a comma separated value  
String, trimming leading and trailing whitespace on each value. | 
static void | 
logCredentials(org.slf4j.Logger log,
              org.apache.hadoop.security.Credentials credentials,
              String identifier)  | 
static void | 
mkDirForAM(org.apache.hadoop.fs.FileSystem fs,
          org.apache.hadoop.fs.Path dir)
 Create a directory with predefined directory permission 
 | 
static org.apache.hadoop.security.Credentials | 
parseCredentialsBytes(byte[] credentialsBytes)  | 
static ByteBuffer | 
serializeServiceData(org.apache.hadoop.security.token.Token<JobTokenIdentifier> jobToken)
A helper function to serialize the JobTokenIdentifier to be sent to the
 ShuffleHandler as ServiceData. 
 | 
static Collection<String> | 
tokenizeString(String str,
              String delim)  | 
public static final org.apache.hadoop.fs.permission.FsPermission TEZ_AM_DIR_PERMISSION
public static final org.apache.hadoop.fs.permission.FsPermission TEZ_AM_FILE_PERMISSION
public static final String TEZ_SYSTEM_SUB_DIR
public static org.apache.hadoop.fs.Path getTezBaseStagingPath(org.apache.hadoop.conf.Configuration conf)
 This function returns the staging directory defined in the config with
 property name TezConfiguration.TEZ_AM_STAGING_DIR. If the
 property is not defined in the conf, Tez uses the value defined as
 TezConfiguration.TEZ_AM_STAGING_DIR_DEFAULT. In addition, the
 function makes sure if the staging directory exists. If not, it creates the
 directory with permission TEZ_AM_DIR_PERMISSION.
 
conf - TEZ configuration@InterfaceAudience.Private
public static org.apache.hadoop.fs.Path createTezSystemStagingPath(org.apache.hadoop.conf.Configuration conf,
                                                                             String strAppId)
 This function returns the staging directory for TEZ system. Tez creates all
 its temporary files under this sub-directory. The function creates a
 sub-directory (TEZ_SYSTEM_SUB_DIR/
conf - Tez configurationstrAppId - Application ID as string@InterfaceAudience.Private
public static org.apache.hadoop.fs.Path getTezSystemStagingPath(org.apache.hadoop.conf.Configuration conf,
                                                                          String strAppId)
This function returns the staging directory for TEZ system. Tez creates all its temporary files under this sub-directory. The function normally doesn't creates any sub-directory under the base staging directory.
conf - Tez configurationstrAppId - Application ID as string@InterfaceAudience.Private public static org.apache.hadoop.fs.Path getTezConfStagingPath(org.apache.hadoop.fs.Path tezSysStagingPath)
Returns a path to store binary configuration
tezSysStagingPath - TEZ system level staging directory used for Tez internals@InterfaceAudience.Private public static org.apache.hadoop.fs.Path getTezAMJarStagingPath(org.apache.hadoop.fs.Path tezSysStagingPath)
Returns a path to store local resources/session jars
tezSysStagingPath - TEZ system level staging directory used for Tez internals@InterfaceAudience.Private public static org.apache.hadoop.fs.Path getTezBinPlanStagingPath(org.apache.hadoop.fs.Path tezSysStagingPath)
Returns a path to store binary plan
tezSysStagingPath - TEZ system level staging directory used for Tez internals@InterfaceAudience.Private
public static org.apache.hadoop.fs.Path getTezTextPlanStagingPath(org.apache.hadoop.fs.Path tezSysStagingPath,
                                                                            String strAppId,
                                                                            String dagPBName)
Returns a path to store text plan
tezSysStagingPath - TEZ system level staging directory used for Tez internalsstrAppId - Application IDdagPBName - DAG PB Name@InterfaceAudience.Private
public static org.apache.hadoop.fs.Path getRecoveryPath(org.apache.hadoop.fs.Path tezSysStagingPath,
                                                                  org.apache.hadoop.conf.Configuration conf)
                                                 throws IOException
Returns a path to store recovery information
tezSysStagingPath - TEZ system level staging directory used for Tez internalsconf - Tez configurationIOException@InterfaceAudience.Private
public static org.apache.hadoop.fs.Path getAttemptRecoveryPath(org.apache.hadoop.fs.Path recoveryPath,
                                                                         int attemptID)
Returns a path to store app attempt specific recovery details
recoveryPath - TEZ recovery directory used for Tez internalsattemptID - Application Attempt Id@InterfaceAudience.Private
public static org.apache.hadoop.fs.Path getDAGRecoveryPath(org.apache.hadoop.fs.Path attemptRecoverPath,
                                                                     String dagID)
Returns a path to store DAG specific recovery info
attemptRecoverPath - :TEZ system level staging directory used for Tez internalsdagID - DagID as string@InterfaceAudience.Private public static org.apache.hadoop.fs.Path getSummaryRecoveryPath(org.apache.hadoop.fs.Path attemptRecoverPath)
Returns a path to store summary info for recovery
attemptRecoverPath - TEZ system level staging directory used for Tez internalspublic static void mkDirForAM(org.apache.hadoop.fs.FileSystem fs,
              org.apache.hadoop.fs.Path dir)
                       throws IOException
Create a directory with predefined directory permission
fs - Filesystemdir - directory to be createdIOExceptionpublic static org.apache.hadoop.fs.FSDataOutputStream createFileForAM(org.apache.hadoop.fs.FileSystem fs,
                                                      org.apache.hadoop.fs.Path filePath)
                                                               throws IOException
 Create a file with TEZ_AM_FILE_PERMISSION permission and
 returns OutputStream
 
fs - FilesystemfilePath - file path to create the fileIOExceptionpublic static void addAdditionalLocalResources(Map<String,org.apache.hadoop.yarn.api.records.LocalResource> additionalLrs, Map<String,org.apache.hadoop.yarn.api.records.LocalResource> originalLRs, String logContext)
@InterfaceAudience.Private
public static com.google.protobuf.ByteString compressByteArrayToByteString(byte[] inBytes)
                                                                    throws IOException
IOException@InterfaceAudience.Private
public static byte[] decompressByteStringToByteArray(com.google.protobuf.ByteString byteString)
                                              throws IOException
IOExceptionpublic static String getCredentialsInfo(org.apache.hadoop.security.Credentials credentials, String identifier)
public static ByteBuffer convertJobTokenToBytes(org.apache.hadoop.security.token.Token<JobTokenIdentifier> jobToken) throws IOException
IOExceptionpublic static org.apache.hadoop.security.Credentials parseCredentialsBytes(byte[] credentialsBytes)
                                                                    throws IOException
IOExceptionpublic static void logCredentials(org.slf4j.Logger log,
                  org.apache.hadoop.security.Credentials credentials,
                  String identifier)
public static Collection<String> tokenizeString(String str, String delim)
public static String[] getTrimmedStrings(String str)
String, trimming leading and trailing whitespace on each value.str - a comma separated String valuespublic static ByteBuffer serializeServiceData(org.apache.hadoop.security.token.Token<JobTokenIdentifier> jobToken) throws IOException
jobToken - the job token to be used for authentication of shuffle data
          requests.IOExceptionCopyright © 2016 Apache Software Foundation. All rights reserved.