public abstract class AbstractInputFormat<K,V> extends Object implements org.apache.hadoop.mapred.InputFormat<K,V>
RecordReader
.Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractInputFormat.AbstractRecordReader<K,V>
|
Modifier and Type | Field and Description |
---|---|
protected static Class<?> |
CLASS |
protected static org.apache.log4j.Logger |
log |
Constructor and Description |
---|
AbstractInputFormat() |
Modifier and Type | Method and Description |
---|---|
protected static AuthenticationToken |
getAuthenticationToken(org.apache.hadoop.mapred.JobConf job)
Gets the authenticated token from either the specified token file or directly from the configuration, whichever was used when the job was configured.
|
protected static ClientConfiguration |
getClientConfiguration(org.apache.hadoop.mapred.JobConf job)
Fetch the client configuration from the job.
|
static InputTableConfig |
getInputTableConfig(org.apache.hadoop.mapred.JobConf job,
String tableName)
Fetches a
InputTableConfig that has been set on the configuration for a specific table. |
static Map<String,InputTableConfig> |
getInputTableConfigs(org.apache.hadoop.mapred.JobConf job)
Fetches all
InputTableConfig s that have been set on the given Hadoop job. |
protected static Instance |
getInstance(org.apache.hadoop.mapred.JobConf job)
Initializes an Accumulo
Instance based on the configuration. |
protected static org.apache.log4j.Level |
getLogLevel(org.apache.hadoop.mapred.JobConf job)
Gets the log level from this configuration.
|
protected static String |
getPrincipal(org.apache.hadoop.mapred.JobConf job)
Gets the user name from the configuration.
|
protected static Authorizations |
getScanAuthorizations(org.apache.hadoop.mapred.JobConf job)
Gets the authorizations to set for the scans from the configuration.
|
org.apache.hadoop.mapred.InputSplit[] |
getSplits(org.apache.hadoop.mapred.JobConf job,
int numSplits)
Gets the splits of the tables that have been set on the job by reading the metadata table for the specified ranges.
|
protected static org.apache.accumulo.core.client.impl.TabletLocator |
getTabletLocator(org.apache.hadoop.mapred.JobConf job,
String tableId)
Deprecated.
since 1.7.0 This method returns a type that is not part of the public API and is not guaranteed to be stable. The method was deprecated to
discourage its use.
|
protected static Boolean |
isConnectorInfoSet(org.apache.hadoop.mapred.JobConf job)
Determines if the connector has been configured.
|
static void |
setConnectorInfo(org.apache.hadoop.mapred.JobConf job,
String principal,
AuthenticationToken token)
Sets the connector information needed to communicate with Accumulo in this job.
|
static void |
setConnectorInfo(org.apache.hadoop.mapred.JobConf job,
String principal,
String tokenFile)
Sets the connector information needed to communicate with Accumulo in this job.
|
static void |
setLogLevel(org.apache.hadoop.mapred.JobConf job,
org.apache.log4j.Level level)
Sets the log level for this job.
|
static void |
setMockInstance(org.apache.hadoop.mapred.JobConf job,
String instanceName)
Configures a
MockInstance for this job. |
static void |
setScanAuthorizations(org.apache.hadoop.mapred.JobConf job,
Authorizations auths)
Sets the
Authorizations used to scan. |
static void |
setZooKeeperInstance(org.apache.hadoop.mapred.JobConf job,
ClientConfiguration clientConfig)
Configures a
ZooKeeperInstance for this job. |
static void |
setZooKeeperInstance(org.apache.hadoop.mapred.JobConf job,
String instanceName,
String zooKeepers)
Deprecated.
since 1.6.0; Use
setZooKeeperInstance(JobConf, ClientConfiguration) instead. |
protected static void |
validateOptions(org.apache.hadoop.mapred.JobConf job)
Check whether a configuration is fully configured to be used with an Accumulo
InputFormat . |
protected static final Class<?> CLASS
protected static final org.apache.log4j.Logger log
public static void setConnectorInfo(org.apache.hadoop.mapred.JobConf job, String principal, AuthenticationToken token) throws AccumuloSecurityException
WARNING: Some tokens, when serialized, divulge sensitive information in the configuration as a means to pass the token to MapReduce tasks. This
information is BASE64 encoded to provide a charset safe conversion to a string, but this conversion is not intended to be secure. PasswordToken
is
one example that is insecure in this way; however DelegationToken
s, acquired using
SecurityOperations.getDelegationToken(DelegationTokenConfig)
, is not subject to this concern.
job
- the Hadoop job instance to be configuredprincipal
- a valid Accumulo user name (user must have Table.CREATE permission)token
- the user's passwordAccumuloSecurityException
public static void setConnectorInfo(org.apache.hadoop.mapred.JobConf job, String principal, String tokenFile) throws AccumuloSecurityException
Stores the password in a file in HDFS and pulls that into the Distributed Cache in an attempt to be more secure than storing it in the Configuration.
job
- the Hadoop job instance to be configuredprincipal
- a valid Accumulo user name (user must have Table.CREATE permission)tokenFile
- the path to the token fileAccumuloSecurityException
protected static Boolean isConnectorInfoSet(org.apache.hadoop.mapred.JobConf job)
job
- the Hadoop context for the configured jobsetConnectorInfo(JobConf, String, AuthenticationToken)
protected static String getPrincipal(org.apache.hadoop.mapred.JobConf job)
job
- the Hadoop context for the configured jobsetConnectorInfo(JobConf, String, AuthenticationToken)
protected static AuthenticationToken getAuthenticationToken(org.apache.hadoop.mapred.JobConf job)
job
- the Hadoop context for the configured jobsetConnectorInfo(JobConf, String, AuthenticationToken)
,
setConnectorInfo(JobConf, String, String)
@Deprecated public static void setZooKeeperInstance(org.apache.hadoop.mapred.JobConf job, String instanceName, String zooKeepers)
setZooKeeperInstance(JobConf, ClientConfiguration)
instead.ZooKeeperInstance
for this job.job
- the Hadoop job instance to be configuredinstanceName
- the Accumulo instance namezooKeepers
- a comma-separated list of zookeeper serverspublic static void setZooKeeperInstance(org.apache.hadoop.mapred.JobConf job, ClientConfiguration clientConfig)
ZooKeeperInstance
for this job.job
- the Hadoop job instance to be configuredclientConfig
- client configuration containing connection optionspublic static void setMockInstance(org.apache.hadoop.mapred.JobConf job, String instanceName)
MockInstance
for this job.job
- the Hadoop job instance to be configuredinstanceName
- the Accumulo instance nameprotected static Instance getInstance(org.apache.hadoop.mapred.JobConf job)
Instance
based on the configuration.job
- the Hadoop context for the configured jobsetZooKeeperInstance(JobConf, ClientConfiguration)
,
setMockInstance(JobConf, String)
public static void setLogLevel(org.apache.hadoop.mapred.JobConf job, org.apache.log4j.Level level)
job
- the Hadoop job instance to be configuredlevel
- the logging levelprotected static org.apache.log4j.Level getLogLevel(org.apache.hadoop.mapred.JobConf job)
job
- the Hadoop context for the configured jobsetLogLevel(JobConf, Level)
public static void setScanAuthorizations(org.apache.hadoop.mapred.JobConf job, Authorizations auths)
Authorizations
used to scan. Must be a subset of the user's authorization. Defaults to the empty set.job
- the Hadoop job instance to be configuredauths
- the user's authorizationsprotected static Authorizations getScanAuthorizations(org.apache.hadoop.mapred.JobConf job)
job
- the Hadoop context for the configured jobsetScanAuthorizations(JobConf, Authorizations)
@Deprecated protected static org.apache.accumulo.core.client.impl.TabletLocator getTabletLocator(org.apache.hadoop.mapred.JobConf job, String tableId) throws TableNotFoundException
TabletLocator
based on the configuration.job
- the Hadoop context for the configured jobTableNotFoundException
- if the table name set on the configuration doesn't existprotected static ClientConfiguration getClientConfiguration(org.apache.hadoop.mapred.JobConf job)
job
- The jobprotected static void validateOptions(org.apache.hadoop.mapred.JobConf job) throws IOException
InputFormat
.job
- the Hadoop context for the configured jobIOException
- if the context is improperly configuredpublic static Map<String,InputTableConfig> getInputTableConfigs(org.apache.hadoop.mapred.JobConf job)
InputTableConfig
s that have been set on the given Hadoop job.job
- the Hadoop job instance to be configuredInputTableConfig
objects set on the jobpublic static InputTableConfig getInputTableConfig(org.apache.hadoop.mapred.JobConf job, String tableName)
InputTableConfig
that has been set on the configuration for a specific table.
null is returned in the event that the table doesn't exist.
job
- the Hadoop job instance to be configuredtableName
- the table name for which to grab the config objectInputTableConfig
for the given tablepublic org.apache.hadoop.mapred.InputSplit[] getSplits(org.apache.hadoop.mapred.JobConf job, int numSplits) throws IOException
getSplits
in interface org.apache.hadoop.mapred.InputFormat<K,V>
IOException
- if a table set on the job doesn't exist or an error occurs initializing the tablet locatorCopyright © 2011–2018 The Apache Software Foundation. All rights reserved.