org.apache.accumulo.core.client.mapreduce
Class AccumuloOutputFormat

java.lang.Object
  extended by org.apache.hadoop.mapreduce.OutputFormat<org.apache.hadoop.io.Text,Mutation>
      extended by org.apache.accumulo.core.client.mapreduce.AccumuloOutputFormat

public class AccumuloOutputFormat
extends org.apache.hadoop.mapreduce.OutputFormat<org.apache.hadoop.io.Text,Mutation>

This class allows MapReduce jobs to use Accumulo as the sink of data. This output format 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 methods:

Other static methods are optional


Constructor Summary
AccumuloOutputFormat()
           
 
Method Summary
protected static boolean canCreateTables(org.apache.hadoop.conf.Configuration conf)
           
protected static boolean canCreateTables(org.apache.hadoop.mapreduce.JobContext job)
          Deprecated. Use canCreateTables(Configuration) instead
 void checkOutputSpecs(org.apache.hadoop.mapreduce.JobContext job)
           
protected static String getDefaultTableName(org.apache.hadoop.conf.Configuration conf)
           
protected static String getDefaultTableName(org.apache.hadoop.mapreduce.JobContext job)
          Deprecated. Use getDefaultTableName(Configuration) instead
protected static Instance getInstance(org.apache.hadoop.conf.Configuration conf)
           
protected static Instance getInstance(org.apache.hadoop.mapreduce.JobContext job)
          Deprecated. Use getInstance(Configuration) instead
protected static org.apache.log4j.Level getLogLevel(org.apache.hadoop.conf.Configuration conf)
           
protected static org.apache.log4j.Level getLogLevel(org.apache.hadoop.mapreduce.JobContext job)
          Deprecated. Use getLogLevel(Configuration) instead
protected static int getMaxLatency(org.apache.hadoop.conf.Configuration conf)
           
protected static int getMaxLatency(org.apache.hadoop.mapreduce.JobContext job)
          Deprecated. Use getMaxLatency(Configuration) instead
protected static long getMaxMutationBufferSize(org.apache.hadoop.conf.Configuration conf)
           
protected static long getMaxMutationBufferSize(org.apache.hadoop.mapreduce.JobContext job)
          Deprecated. Use getMaxMutationBufferSize(Configuration) instead
protected static int getMaxWriteThreads(org.apache.hadoop.conf.Configuration conf)
           
protected static int getMaxWriteThreads(org.apache.hadoop.mapreduce.JobContext job)
          Deprecated. Use getMaxWriteThreads(Configuration) instead
 org.apache.hadoop.mapreduce.OutputCommitter getOutputCommitter(org.apache.hadoop.mapreduce.TaskAttemptContext context)
           
protected static byte[] getPassword(org.apache.hadoop.conf.Configuration conf)
          WARNING: The password 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.
protected static byte[] getPassword(org.apache.hadoop.mapreduce.JobContext job)
          Deprecated. Use getPassword(Configuration) instead
 org.apache.hadoop.mapreduce.RecordWriter<org.apache.hadoop.io.Text,Mutation> getRecordWriter(org.apache.hadoop.mapreduce.TaskAttemptContext attempt)
           
protected static boolean getSimulationMode(org.apache.hadoop.conf.Configuration conf)
           
protected static boolean getSimulationMode(org.apache.hadoop.mapreduce.JobContext job)
          Deprecated. Use getSimulationMode(Configuration) instead
protected static String getUsername(org.apache.hadoop.conf.Configuration conf)
           
protected static String getUsername(org.apache.hadoop.mapreduce.JobContext job)
          Deprecated. Use getUsername(Configuration) instead
static void setLogLevel(org.apache.hadoop.conf.Configuration conf, org.apache.log4j.Level level)
           
static void setLogLevel(org.apache.hadoop.mapreduce.JobContext job, org.apache.log4j.Level level)
          Deprecated. Use setLogLevel(Configuration,Level) instead
static void setMaxLatency(org.apache.hadoop.conf.Configuration conf, int numberOfMilliseconds)
           
static void setMaxLatency(org.apache.hadoop.mapreduce.JobContext job, int numberOfMilliseconds)
          Deprecated. Use setMaxLatency(Configuration,int) instead
static void setMaxMutationBufferSize(org.apache.hadoop.conf.Configuration conf, long numberOfBytes)
           
static void setMaxMutationBufferSize(org.apache.hadoop.mapreduce.JobContext job, long numberOfBytes)
          Deprecated. Use setMaxMutationBufferSize(Configuration,long) instead
static void setMaxWriteThreads(org.apache.hadoop.conf.Configuration conf, int numberOfThreads)
           
static void setMaxWriteThreads(org.apache.hadoop.mapreduce.JobContext job, int numberOfThreads)
          Deprecated. Use setMaxWriteThreads(Configuration,int) instead
static void setMockInstance(org.apache.hadoop.conf.Configuration conf, String instanceName)
           
static void setMockInstance(org.apache.hadoop.mapreduce.JobContext job, String instanceName)
          Deprecated. Use setMockInstance(Configuration,String) instead
static void setOutputInfo(org.apache.hadoop.conf.Configuration conf, String user, byte[] passwd, boolean createTables, String defaultTable)
          Configure the output format.
static void setOutputInfo(org.apache.hadoop.mapreduce.JobContext job, String user, byte[] passwd, boolean createTables, String defaultTable)
          Deprecated. Use setOutputInfo(Configuration,String,byte[],boolean,String) instead
static void setSimulationMode(org.apache.hadoop.conf.Configuration conf)
           
static void setSimulationMode(org.apache.hadoop.mapreduce.JobContext job)
          Deprecated. Use setSimulationMode(Configuration) instead
static void setZooKeeperInstance(org.apache.hadoop.conf.Configuration conf, String instanceName, String zooKeepers)
           
static void setZooKeeperInstance(org.apache.hadoop.mapreduce.JobContext job, String instanceName, String zooKeepers)
          Deprecated. Use setZooKeeperInstance(Configuration,String,String) instead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccumuloOutputFormat

public AccumuloOutputFormat()
Method Detail

setOutputInfo

@Deprecated
public static void setOutputInfo(org.apache.hadoop.mapreduce.JobContext job,
                                            String user,
                                            byte[] passwd,
                                            boolean createTables,
                                            String defaultTable)
Deprecated. Use setOutputInfo(Configuration,String,byte[],boolean,String) instead

Configure the output format.

Parameters:
job - the Map/Reduce job object
user - the username, which must have the Table.CREATE permission to create tables
passwd - the passwd for the username
createTables - the output format will create new tables as necessary. Table names can only be alpha-numeric and underscores.
defaultTable - the table to use when the tablename is null in the write call

setOutputInfo

public static void setOutputInfo(org.apache.hadoop.conf.Configuration conf,
                                 String user,
                                 byte[] passwd,
                                 boolean createTables,
                                 String defaultTable)
Configure the output format.

Parameters:
conf - the Map/Reduce job object
user - the username, which must have the Table.CREATE permission to create tables
passwd - the passwd for the username
createTables - the output format will create new tables as necessary. Table names can only be alpha-numeric and underscores.
defaultTable - the table to use when the tablename is null in the write call

setZooKeeperInstance

@Deprecated
public static void setZooKeeperInstance(org.apache.hadoop.mapreduce.JobContext job,
                                                   String instanceName,
                                                   String zooKeepers)
Deprecated. Use setZooKeeperInstance(Configuration,String,String) instead


setZooKeeperInstance

public static void setZooKeeperInstance(org.apache.hadoop.conf.Configuration conf,
                                        String instanceName,
                                        String zooKeepers)

setMockInstance

@Deprecated
public static void setMockInstance(org.apache.hadoop.mapreduce.JobContext job,
                                              String instanceName)
Deprecated. Use setMockInstance(Configuration,String) instead


setMockInstance

public static void setMockInstance(org.apache.hadoop.conf.Configuration conf,
                                   String instanceName)

setMaxMutationBufferSize

@Deprecated
public static void setMaxMutationBufferSize(org.apache.hadoop.mapreduce.JobContext job,
                                                       long numberOfBytes)
Deprecated. Use setMaxMutationBufferSize(Configuration,long) instead


setMaxMutationBufferSize

public static void setMaxMutationBufferSize(org.apache.hadoop.conf.Configuration conf,
                                            long numberOfBytes)

setMaxLatency

@Deprecated
public static void setMaxLatency(org.apache.hadoop.mapreduce.JobContext job,
                                            int numberOfMilliseconds)
Deprecated. Use setMaxLatency(Configuration,int) instead


setMaxLatency

public static void setMaxLatency(org.apache.hadoop.conf.Configuration conf,
                                 int numberOfMilliseconds)

setMaxWriteThreads

@Deprecated
public static void setMaxWriteThreads(org.apache.hadoop.mapreduce.JobContext job,
                                                 int numberOfThreads)
Deprecated. Use setMaxWriteThreads(Configuration,int) instead


setMaxWriteThreads

public static void setMaxWriteThreads(org.apache.hadoop.conf.Configuration conf,
                                      int numberOfThreads)

setLogLevel

@Deprecated
public static void setLogLevel(org.apache.hadoop.mapreduce.JobContext job,
                                          org.apache.log4j.Level level)
Deprecated. Use setLogLevel(Configuration,Level) instead


setLogLevel

public static void setLogLevel(org.apache.hadoop.conf.Configuration conf,
                               org.apache.log4j.Level level)

setSimulationMode

@Deprecated
public static void setSimulationMode(org.apache.hadoop.mapreduce.JobContext job)
Deprecated. Use setSimulationMode(Configuration) instead


setSimulationMode

public static void setSimulationMode(org.apache.hadoop.conf.Configuration conf)

getUsername

@Deprecated
protected static String getUsername(org.apache.hadoop.mapreduce.JobContext job)
Deprecated. Use getUsername(Configuration) instead


getUsername

protected static String getUsername(org.apache.hadoop.conf.Configuration conf)

getPassword

@Deprecated
protected static byte[] getPassword(org.apache.hadoop.mapreduce.JobContext job)
Deprecated. Use getPassword(Configuration) instead

WARNING: The password 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.


getPassword

protected static byte[] getPassword(org.apache.hadoop.conf.Configuration conf)
WARNING: The password 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.


canCreateTables

@Deprecated
protected static boolean canCreateTables(org.apache.hadoop.mapreduce.JobContext job)
Deprecated. Use canCreateTables(Configuration) instead


canCreateTables

protected static boolean canCreateTables(org.apache.hadoop.conf.Configuration conf)

getDefaultTableName

@Deprecated
protected static String getDefaultTableName(org.apache.hadoop.mapreduce.JobContext job)
Deprecated. Use getDefaultTableName(Configuration) instead


getDefaultTableName

protected static String getDefaultTableName(org.apache.hadoop.conf.Configuration conf)

getInstance

@Deprecated
protected static Instance getInstance(org.apache.hadoop.mapreduce.JobContext job)
Deprecated. Use getInstance(Configuration) instead


getInstance

protected static Instance getInstance(org.apache.hadoop.conf.Configuration conf)

getMaxMutationBufferSize

@Deprecated
protected static long getMaxMutationBufferSize(org.apache.hadoop.mapreduce.JobContext job)
Deprecated. Use getMaxMutationBufferSize(Configuration) instead


getMaxMutationBufferSize

protected static long getMaxMutationBufferSize(org.apache.hadoop.conf.Configuration conf)

getMaxLatency

@Deprecated
protected static int getMaxLatency(org.apache.hadoop.mapreduce.JobContext job)
Deprecated. Use getMaxLatency(Configuration) instead


getMaxLatency

protected static int getMaxLatency(org.apache.hadoop.conf.Configuration conf)

getMaxWriteThreads

@Deprecated
protected static int getMaxWriteThreads(org.apache.hadoop.mapreduce.JobContext job)
Deprecated. Use getMaxWriteThreads(Configuration) instead


getMaxWriteThreads

protected static int getMaxWriteThreads(org.apache.hadoop.conf.Configuration conf)

getLogLevel

@Deprecated
protected static org.apache.log4j.Level getLogLevel(org.apache.hadoop.mapreduce.JobContext job)
Deprecated. Use getLogLevel(Configuration) instead


getLogLevel

protected static org.apache.log4j.Level getLogLevel(org.apache.hadoop.conf.Configuration conf)

getSimulationMode

@Deprecated
protected static boolean getSimulationMode(org.apache.hadoop.mapreduce.JobContext job)
Deprecated. Use getSimulationMode(Configuration) instead


getSimulationMode

protected static boolean getSimulationMode(org.apache.hadoop.conf.Configuration conf)

checkOutputSpecs

public void checkOutputSpecs(org.apache.hadoop.mapreduce.JobContext job)
                      throws IOException
Specified by:
checkOutputSpecs in class org.apache.hadoop.mapreduce.OutputFormat<org.apache.hadoop.io.Text,Mutation>
Throws:
IOException

getOutputCommitter

public org.apache.hadoop.mapreduce.OutputCommitter getOutputCommitter(org.apache.hadoop.mapreduce.TaskAttemptContext context)
Specified by:
getOutputCommitter in class org.apache.hadoop.mapreduce.OutputFormat<org.apache.hadoop.io.Text,Mutation>

getRecordWriter

public org.apache.hadoop.mapreduce.RecordWriter<org.apache.hadoop.io.Text,Mutation> getRecordWriter(org.apache.hadoop.mapreduce.TaskAttemptContext attempt)
                                                                                             throws IOException
Specified by:
getRecordWriter in class org.apache.hadoop.mapreduce.OutputFormat<org.apache.hadoop.io.Text,Mutation>
Throws:
IOException


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.