public class AccumuloStorage extends AbstractAccumuloStorage
When writing data, the first entry in the Tuple
is treated as the row
in the Accumulo key, while subsequent entries in the tuple are handled as
columns in that row. Map
s are expanded, placing the map key in the
column family and the map value in the Accumulo value. Scalars are placed
directly into the value with an empty column qualifier. If the columns
argument on the constructor is omitted, null or the empty String, no column
family is provided on the Keys created for Accumulo
When reading data, if aggregateColfams is true, elements in the same row and
column family are aggregated into a single Map
. This will result in a
Tuple
of length (unique_column_families + 1) for the given row. If
aggregateColfams is false, column family and column qualifier are
concatenated (separated by a colon), and placed into a Map
. This will
result in a Tuple
with two entries, where the latter element has a
number of elements equal to the number of columns in the given row.
ASTERISK, authorizations, caster, columns, columnSeparator, COMMA, commandLine, contextSignature, end, ignoreWhitespace, inst, maxLatency, maxMutationBufferSize, maxWriteThreads, password, schema, start, storageOptions, table, tableName, user, zookeepers
Constructor and Description |
---|
AccumuloStorage()
|
AccumuloStorage(String columns)
Create an AccumuloStorage with a CSV of columns-families to use on write
and whether columns in a row should be grouped by family on read.
|
AccumuloStorage(String columnStr,
String args) |
Modifier and Type | Method and Description |
---|---|
protected void |
addColumn(org.apache.accumulo.core.data.Mutation mutation,
String colfam,
String colqual,
org.apache.accumulo.core.data.Value columnValue)
Adds the given column family, column qualifier and value to the given
mutation
|
protected void |
configureInputFormat(org.apache.hadoop.mapreduce.Job job)
Method to allow specific implementations to add more elements to the Job
for reading data from Accumulo.
|
protected Collection<org.apache.accumulo.core.data.Mutation> |
getMutations(Tuple tuple) |
protected Tuple |
getTuple(org.apache.accumulo.core.data.Key key,
org.apache.accumulo.core.data.Value value) |
checkSchema, cleanupOnFailure, cleanupOnSuccess, clearUnset, configureOutputFormat, extractArgs, getCommandLine, getEntries, getInputFormat, getInputFormatEntries, getLoadCaster, getNext, getOutputFormat, getOutputFormatEntries, getUDFProperties, getWriter, loadDependentJars, makePair, objectToText, objToBytes, objToText, prepareToRead, prepareToWrite, putNext, relativeToAbsolutePath, relToAbsPathForStoreLocation, schemaToType, schemaToType, setLocation, setStoreFuncUDFContextSignature, setStoreLocation, setUDFContextSignature, simpleUnset, tupleToBytes, tupleToText, unsetEntriesFromConfiguration
getAbsolutePath, getCacheFiles, getPathStrings, getShipFiles, join, warn
public AccumuloStorage() throws org.apache.commons.cli.ParseException, IOException
Tuple
with an empty column family and doesn't group column families together on
read (creates on Map
for all columns)org.apache.commons.cli.ParseException
IOException
public AccumuloStorage(String columns) throws org.apache.commons.cli.ParseException, IOException
columns
- A comma-separated list of column families to use when writing
data, aligned to the n'th entry in the tupleaggregateColfams
- Should unique column qualifier and value pairs be grouped
together by column family when reading dataorg.apache.commons.cli.ParseException
IOException
public AccumuloStorage(String columnStr, String args) throws org.apache.commons.cli.ParseException, IOException
org.apache.commons.cli.ParseException
IOException
protected Tuple getTuple(org.apache.accumulo.core.data.Key key, org.apache.accumulo.core.data.Value value) throws IOException
getTuple
in class AbstractAccumuloStorage
IOException
protected void configureInputFormat(org.apache.hadoop.mapreduce.Job job)
AbstractAccumuloStorage
configureInputFormat
in class AbstractAccumuloStorage
protected Collection<org.apache.accumulo.core.data.Mutation> getMutations(Tuple tuple) throws ExecException, IOException
getMutations
in class AbstractAccumuloStorage
ExecException
IOException
Copyright © 2007-2017 The Apache Software Foundation