public final class DtFileOperations
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
FORMAT_JAVA |
Use FORMAT_* as arguments to format parameters.
|
static java.lang.String |
FORMAT_PB |
Use FORMAT_* as arguments to format parameters.
|
| Modifier and Type | Method | Description |
|---|---|---|
static void |
aliasTokenFile(java.io.File tokenFile,
java.lang.String fileFormat,
Text alias,
Text service,
Configuration conf) |
Alias a token from a file and save back to file in the local filesystem.
|
static void |
appendTokenFiles(java.util.ArrayList<java.io.File> tokenFiles,
java.lang.String fileFormat,
Configuration conf) |
Append tokens from list of files in local filesystem, saving to last file.
|
static void |
doFormattedWrite(java.io.File f,
java.lang.String format,
Credentials creds,
Configuration conf) |
Write out a Credentials object as a local file.
|
static void |
getTokenFile(java.io.File tokenFile,
java.lang.String fileFormat,
Text alias,
Text service,
java.lang.String url,
java.lang.String renewer,
Configuration conf) |
Fetch a token from a service and save to file in the local filesystem.
|
static void |
importTokenFile(java.io.File tokenFile,
java.lang.String fileFormat,
Text alias,
java.lang.String base64,
Configuration conf) |
Import a token from a base64 encoding into the local filesystem.
|
static void |
printCredentials(Credentials creds,
Text alias,
java.io.PrintStream out) |
Print out a Credentials object.
|
static void |
printTokenFile(java.io.File tokenFile,
Text alias,
Configuration conf,
java.io.PrintStream out) |
Print out a Credentials file from the local filesystem.
|
static void |
removeTokenFromFile(boolean cancel,
java.io.File tokenFile,
java.lang.String fileFormat,
Text alias,
Configuration conf) |
Remove a token from a file in the local filesystem, matching alias.
|
static void |
renewTokenFile(java.io.File tokenFile,
java.lang.String fileFormat,
Text alias,
Configuration conf) |
Renew a token from a file in the local filesystem, matching alias.
|
public static final java.lang.String FORMAT_PB
public static final java.lang.String FORMAT_JAVA
public static void doFormattedWrite(java.io.File f,
java.lang.String format,
Credentials creds,
Configuration conf)
throws java.io.IOException
f - a local File object.format - a string equal to FORMAT_PB or FORMAT_JAVA.creds - the Credentials object to be written out.conf - a Configuration object passed along.java.io.IOException - raised on errors performing I/O.public static void printTokenFile(java.io.File tokenFile,
Text alias,
Configuration conf,
java.io.PrintStream out)
throws java.io.IOException
tokenFile - a local File object.alias - print only tokens matching alias (null matches all).conf - Configuration object passed along.out - print to this stream.java.io.IOException - raised on errors performing I/O.public static void printCredentials(Credentials creds, Text alias, java.io.PrintStream out) throws java.io.IOException
creds - the Credentials object to be printed out.alias - print only tokens matching alias (null matches all).out - print to this stream.java.io.IOException - failure to unmarshall a token identifier.public static void getTokenFile(java.io.File tokenFile,
java.lang.String fileFormat,
Text alias,
Text service,
java.lang.String url,
java.lang.String renewer,
Configuration conf)
throws java.lang.Exception
tokenFile - a local File object to hold the output.fileFormat - a string equal to FORMAT_PB or FORMAT_JAVA, for outputalias - overwrite service field of fetched token with this text.service - use a DtFetcher implementation matching this service text.url - pass this URL to fetcher after stripping any http/s prefix.renewer - pass this renewer to the fetcher.conf - Configuration object passed along.java.io.IOException - raised on errors performing I/O.java.lang.Exceptionpublic static void aliasTokenFile(java.io.File tokenFile,
java.lang.String fileFormat,
Text alias,
Text service,
Configuration conf)
throws java.lang.Exception
tokenFile - a local File object to hold the input and output.fileFormat - a string equal to FORMAT_PB or FORMAT_JAVA, for outputalias - overwrite service field of fetched token with this text.service - only apply alias to tokens matching this service text.conf - Configuration object passed along.java.io.IOException - raised on errors performing I/O.java.lang.Exceptionpublic static void appendTokenFiles(java.util.ArrayList<java.io.File> tokenFiles,
java.lang.String fileFormat,
Configuration conf)
throws java.io.IOException
tokenFiles - list of local File objects. Last file holds the output.fileFormat - a string equal to FORMAT_PB or FORMAT_JAVA, for outputconf - Configuration object passed along.java.io.IOException - raised on errors performing I/O.public static void removeTokenFromFile(boolean cancel,
java.io.File tokenFile,
java.lang.String fileFormat,
Text alias,
Configuration conf)
throws java.io.IOException,
java.lang.InterruptedException
cancel - cancel token as well as remove from file.tokenFile - a local File object.fileFormat - a string equal to FORMAT_PB or FORMAT_JAVA, for outputalias - remove only tokens matching alias; null matches all.conf - Configuration object passed along.java.io.IOException - raised on errors performing I/O.java.lang.InterruptedException - if the thread is interrupted.public static void renewTokenFile(java.io.File tokenFile,
java.lang.String fileFormat,
Text alias,
Configuration conf)
throws java.io.IOException,
java.lang.InterruptedException
tokenFile - a local File object.fileFormat - a string equal to FORMAT_PB or FORMAT_JAVA, for outputalias - renew only tokens matching alias; null matches all.conf - Configuration object passed along.java.io.IOException - raised on errors performing I/O.java.lang.InterruptedException - if the thread is interrupted.public static void importTokenFile(java.io.File tokenFile,
java.lang.String fileFormat,
Text alias,
java.lang.String base64,
Configuration conf)
throws java.io.IOException
tokenFile - A local File object.fileFormat - A string equal to FORMAT_PB or FORMAT_JAVA, for output.alias - overwrite Service field of fetched token with this text.base64 - urlString Encoding of the token to import.conf - Configuration object passed along.java.io.IOException - Error to import the token into the file.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.