public class AccumuloOutputFormat extends Object implements org.apache.hadoop.mapred.OutputFormat<org.apache.hadoop.io.Text,Mutation>
OutputFormat accepts keys and values of type Text (for a table
 name) and Mutation from the Map and Reduce functions.
 The user must specify the following via static configurator methods:
 
 Other static methods are optional.| Modifier and Type | Class and Description | 
|---|---|
| protected static class  | AccumuloOutputFormat.AccumuloRecordWriterA base class to be used to create  RecordWriterinstances that write to Accumulo. | 
| Modifier and Type | Field and Description | 
|---|---|
| protected static org.apache.log4j.Logger | log | 
| Constructor and Description | 
|---|
| AccumuloOutputFormat() | 
| Modifier and Type | Method and Description | 
|---|---|
| protected static Boolean | canCreateTables(org.apache.hadoop.mapred.JobConf job)Determines whether tables are permitted to be created as needed. | 
| void | checkOutputSpecs(org.apache.hadoop.fs.FileSystem ignored,
                org.apache.hadoop.mapred.JobConf job) | 
| protected static BatchWriterConfig | getBatchWriterOptions(org.apache.hadoop.mapred.JobConf job)Gets the  BatchWriterConfigsettings. | 
| protected static String | getDefaultTableName(org.apache.hadoop.mapred.JobConf job)Gets the default table name from the configuration. | 
| protected static Instance | getInstance(org.apache.hadoop.mapred.JobConf job)Initializes an Accumulo  Instancebased 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 principal from the configuration. | 
| org.apache.hadoop.mapred.RecordWriter<org.apache.hadoop.io.Text,Mutation> | getRecordWriter(org.apache.hadoop.fs.FileSystem ignored,
               org.apache.hadoop.mapred.JobConf job,
               String name,
               org.apache.hadoop.util.Progressable progress) | 
| protected static Boolean | getSimulationMode(org.apache.hadoop.mapred.JobConf job)Determines whether this feature is enabled. | 
| protected static byte[] | getToken(org.apache.hadoop.mapred.JobConf job)Gets the password from the configuration. | 
| protected static String | getTokenClass(org.apache.hadoop.mapred.JobConf job)Gets the serialized token class from the configuration. | 
| protected static Boolean | isConnectorInfoSet(org.apache.hadoop.mapred.JobConf job)Determines if the connector has been configured. | 
| static void | setBatchWriterOptions(org.apache.hadoop.mapred.JobConf job,
                     BatchWriterConfig bwConfig)Sets the configuration for for the job's  BatchWriterinstances. | 
| 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 | setCreateTables(org.apache.hadoop.mapred.JobConf job,
               boolean enableFeature)Sets the directive to create new tables, as necessary. | 
| static void | setDefaultTableName(org.apache.hadoop.mapred.JobConf job,
                   String tableName)Sets the default table name to use if one emits a null in place of a table name for a given mutation. | 
| 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  MockInstancefor this job. | 
| static void | setSimulationMode(org.apache.hadoop.mapred.JobConf job,
                 boolean enableFeature)Sets the directive to use simulation mode for this job. | 
| static void | setZooKeeperInstance(org.apache.hadoop.mapred.JobConf job,
                    String instanceName,
                    String zooKeepers)Configures a  ZooKeeperInstancefor this job. | 
public static void setConnectorInfo(org.apache.hadoop.mapred.JobConf job,
                    String principal,
                    AuthenticationToken token)
                             throws AccumuloSecurityException
WARNING: The serialized token is stored in the configuration and shared with all MapReduce tasks. It is BASE64 encoded to provide a charset safe conversion to a string, and is not intended to be secure.
job - the Hadoop job instance to be configuredprincipal - a valid Accumulo user name (user must have Table.CREATE permission if setCreateTables(JobConf, boolean) is set to true)token - the user's passwordAccumuloSecurityExceptionprotected 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 String getTokenClass(org.apache.hadoop.mapred.JobConf job)
job - the Hadoop context for the configured jobsetConnectorInfo(JobConf, String, AuthenticationToken)protected static byte[] getToken(org.apache.hadoop.mapred.JobConf job)
job - the Hadoop context for the configured jobsetConnectorInfo(JobConf, String, AuthenticationToken)public static void setZooKeeperInstance(org.apache.hadoop.mapred.JobConf job,
                        String instanceName,
                        String zooKeepers)
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 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, String, String), 
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 setDefaultTableName(org.apache.hadoop.mapred.JobConf job,
                       String tableName)
job - the Hadoop job instance to be configuredtableName - the table to use when the tablename is null in the write callprotected static String getDefaultTableName(org.apache.hadoop.mapred.JobConf job)
job - the Hadoop context for the configured jobsetDefaultTableName(JobConf, String)public static void setBatchWriterOptions(org.apache.hadoop.mapred.JobConf job,
                         BatchWriterConfig bwConfig)
BatchWriter instances. If not set, a new BatchWriterConfig, with sensible built-in defaults is
 used. Setting the configuration multiple times overwrites any previous configuration.job - the Hadoop job instance to be configuredbwConfig - the configuration for the BatchWriterprotected static BatchWriterConfig getBatchWriterOptions(org.apache.hadoop.mapred.JobConf job)
BatchWriterConfig settings.job - the Hadoop context for the configured jobsetBatchWriterOptions(JobConf, BatchWriterConfig)public static void setCreateTables(org.apache.hadoop.mapred.JobConf job,
                   boolean enableFeature)
By default, this feature is disabled.
job - the Hadoop job instance to be configuredenableFeature - the feature is enabled if true, disabled otherwiseprotected static Boolean canCreateTables(org.apache.hadoop.mapred.JobConf job)
job - the Hadoop context for the configured jobsetCreateTables(JobConf, boolean)public static void setSimulationMode(org.apache.hadoop.mapred.JobConf job,
                     boolean enableFeature)
By default, this feature is disabled.
job - the Hadoop job instance to be configuredenableFeature - the feature is enabled if true, disabled otherwiseprotected static Boolean getSimulationMode(org.apache.hadoop.mapred.JobConf job)
job - the Hadoop context for the configured jobsetSimulationMode(JobConf, boolean)public void checkOutputSpecs(org.apache.hadoop.fs.FileSystem ignored,
                    org.apache.hadoop.mapred.JobConf job)
                      throws IOException
checkOutputSpecs in interface org.apache.hadoop.mapred.OutputFormat<org.apache.hadoop.io.Text,Mutation>IOExceptionpublic org.apache.hadoop.mapred.RecordWriter<org.apache.hadoop.io.Text,Mutation> getRecordWriter(org.apache.hadoop.fs.FileSystem ignored, org.apache.hadoop.mapred.JobConf job, String name, org.apache.hadoop.util.Progressable progress) throws IOException
getRecordWriter in interface org.apache.hadoop.mapred.OutputFormat<org.apache.hadoop.io.Text,Mutation>IOExceptionCopyright © 2011-2016 The Apache Software Foundation. All Rights Reserved.