public class Mutation extends Object implements org.apache.hadoop.io.Writable
Mutation represents an action that manipulates a row in a table. A mutation holds a list of column/value pairs that represent an atomic set of modifications to make to a row.
Convenience methods which takes columns and value as CharSequence (String implements CharSequence) are provided. CharSequence is converted to UTF-8 by constructing a new Text object.
When always passing in the same data as a CharSequence/String, its probably more efficient to call the Text put methods. This way the data is only encoded once and only one Text object is created.
All of the put methods append data to the mutation, they do not overwrite anything that was previously put. The mutation holds a list of all column/values that were put into it. The putDelete() methods do not remove something that was previously added to the mutation, rather they indicate that Accumulo should insert a delete marker for that row column.
Modifier and Type | Class and Description |
---|---|
static class |
Mutation.SERIALIZED_FORMAT |
Constructor and Description |
---|
Mutation() |
Mutation(byte[] row) |
Mutation(byte[] row,
int start,
int length) |
Mutation(CharSequence row) |
Mutation(Mutation m) |
Mutation(org.apache.hadoop.io.Text row) |
Mutation(org.apache.accumulo.core.data.thrift.TMutation tmutation) |
Modifier and Type | Method and Description |
---|---|
protected void |
droppingOldTimestamp(long ts) |
boolean |
equals(Mutation m) |
boolean |
equals(Object o) |
long |
estimatedMemoryUsed() |
byte[] |
getRow() |
protected Mutation.SERIALIZED_FORMAT |
getSerializedFormat() |
List<ColumnUpdate> |
getUpdates() |
int |
hashCode() |
protected ColumnUpdate |
newColumnUpdate(byte[] cf,
byte[] cq,
byte[] cv,
boolean hasts,
long ts,
boolean deleted,
byte[] val) |
long |
numBytes() |
void |
put(byte[] columnFamily,
byte[] columnQualifier,
byte[] value) |
void |
put(byte[] columnFamily,
byte[] columnQualifier,
ColumnVisibility columnVisibility,
byte[] value) |
void |
put(byte[] columnFamily,
byte[] columnQualifier,
ColumnVisibility columnVisibility,
long timestamp,
byte[] value) |
void |
put(byte[] columnFamily,
byte[] columnQualifier,
long timestamp,
byte[] value) |
void |
put(CharSequence columnFamily,
CharSequence columnQualifier,
CharSequence value) |
void |
put(CharSequence columnFamily,
CharSequence columnQualifier,
ColumnVisibility columnVisibility,
CharSequence value) |
void |
put(CharSequence columnFamily,
CharSequence columnQualifier,
ColumnVisibility columnVisibility,
long timestamp,
CharSequence value) |
void |
put(CharSequence columnFamily,
CharSequence columnQualifier,
ColumnVisibility columnVisibility,
long timestamp,
Value value) |
void |
put(CharSequence columnFamily,
CharSequence columnQualifier,
ColumnVisibility columnVisibility,
Value value) |
void |
put(CharSequence columnFamily,
CharSequence columnQualifier,
long timestamp,
CharSequence value) |
void |
put(CharSequence columnFamily,
CharSequence columnQualifier,
long timestamp,
Value value) |
void |
put(CharSequence columnFamily,
CharSequence columnQualifier,
Value value) |
void |
put(org.apache.hadoop.io.Text columnFamily,
org.apache.hadoop.io.Text columnQualifier,
ColumnVisibility columnVisibility,
long timestamp,
Value value) |
void |
put(org.apache.hadoop.io.Text columnFamily,
org.apache.hadoop.io.Text columnQualifier,
ColumnVisibility columnVisibility,
Value value) |
void |
put(org.apache.hadoop.io.Text columnFamily,
org.apache.hadoop.io.Text columnQualifier,
long timestamp,
Value value) |
void |
put(org.apache.hadoop.io.Text columnFamily,
org.apache.hadoop.io.Text columnQualifier,
Value value) |
void |
putDelete(byte[] columnFamily,
byte[] columnQualifier) |
void |
putDelete(byte[] columnFamily,
byte[] columnQualifier,
ColumnVisibility columnVisibility) |
void |
putDelete(byte[] columnFamily,
byte[] columnQualifier,
ColumnVisibility columnVisibility,
long timestamp) |
void |
putDelete(byte[] columnFamily,
byte[] columnQualifier,
long timestamp) |
void |
putDelete(CharSequence columnFamily,
CharSequence columnQualifier) |
void |
putDelete(CharSequence columnFamily,
CharSequence columnQualifier,
ColumnVisibility columnVisibility) |
void |
putDelete(CharSequence columnFamily,
CharSequence columnQualifier,
ColumnVisibility columnVisibility,
long timestamp) |
void |
putDelete(CharSequence columnFamily,
CharSequence columnQualifier,
long timestamp) |
void |
putDelete(org.apache.hadoop.io.Text columnFamily,
org.apache.hadoop.io.Text columnQualifier) |
void |
putDelete(org.apache.hadoop.io.Text columnFamily,
org.apache.hadoop.io.Text columnQualifier,
ColumnVisibility columnVisibility) |
void |
putDelete(org.apache.hadoop.io.Text columnFamily,
org.apache.hadoop.io.Text columnQualifier,
ColumnVisibility columnVisibility,
long timestamp) |
void |
putDelete(org.apache.hadoop.io.Text columnFamily,
org.apache.hadoop.io.Text columnQualifier,
long timestamp) |
void |
readFields(DataInput in) |
int |
size() |
org.apache.accumulo.core.data.thrift.TMutation |
toThrift()
Creates a
TMutation object
containing this Mutation's data. |
void |
write(DataOutput out) |
public Mutation(byte[] row)
public Mutation(byte[] row, int start, int length)
public Mutation(org.apache.hadoop.io.Text row)
public Mutation(CharSequence row)
public Mutation()
public Mutation(org.apache.accumulo.core.data.thrift.TMutation tmutation)
public Mutation(Mutation m)
public byte[] getRow()
public void put(org.apache.hadoop.io.Text columnFamily, org.apache.hadoop.io.Text columnQualifier, Value value)
public void put(org.apache.hadoop.io.Text columnFamily, org.apache.hadoop.io.Text columnQualifier, ColumnVisibility columnVisibility, Value value)
public void put(org.apache.hadoop.io.Text columnFamily, org.apache.hadoop.io.Text columnQualifier, long timestamp, Value value)
public void put(org.apache.hadoop.io.Text columnFamily, org.apache.hadoop.io.Text columnQualifier, ColumnVisibility columnVisibility, long timestamp, Value value)
public void putDelete(org.apache.hadoop.io.Text columnFamily, org.apache.hadoop.io.Text columnQualifier)
public void putDelete(org.apache.hadoop.io.Text columnFamily, org.apache.hadoop.io.Text columnQualifier, ColumnVisibility columnVisibility)
public void putDelete(org.apache.hadoop.io.Text columnFamily, org.apache.hadoop.io.Text columnQualifier, long timestamp)
public void putDelete(org.apache.hadoop.io.Text columnFamily, org.apache.hadoop.io.Text columnQualifier, ColumnVisibility columnVisibility, long timestamp)
public void put(CharSequence columnFamily, CharSequence columnQualifier, Value value)
public void put(CharSequence columnFamily, CharSequence columnQualifier, ColumnVisibility columnVisibility, Value value)
public void put(CharSequence columnFamily, CharSequence columnQualifier, long timestamp, Value value)
public void put(CharSequence columnFamily, CharSequence columnQualifier, ColumnVisibility columnVisibility, long timestamp, Value value)
public void putDelete(CharSequence columnFamily, CharSequence columnQualifier)
public void putDelete(CharSequence columnFamily, CharSequence columnQualifier, ColumnVisibility columnVisibility)
public void putDelete(CharSequence columnFamily, CharSequence columnQualifier, long timestamp)
public void putDelete(CharSequence columnFamily, CharSequence columnQualifier, ColumnVisibility columnVisibility, long timestamp)
public void put(CharSequence columnFamily, CharSequence columnQualifier, CharSequence value)
public void put(CharSequence columnFamily, CharSequence columnQualifier, ColumnVisibility columnVisibility, CharSequence value)
public void put(CharSequence columnFamily, CharSequence columnQualifier, long timestamp, CharSequence value)
public void put(CharSequence columnFamily, CharSequence columnQualifier, ColumnVisibility columnVisibility, long timestamp, CharSequence value)
public void put(byte[] columnFamily, byte[] columnQualifier, byte[] value)
public void put(byte[] columnFamily, byte[] columnQualifier, ColumnVisibility columnVisibility, byte[] value)
public void put(byte[] columnFamily, byte[] columnQualifier, long timestamp, byte[] value)
public void put(byte[] columnFamily, byte[] columnQualifier, ColumnVisibility columnVisibility, long timestamp, byte[] value)
public void putDelete(byte[] columnFamily, byte[] columnQualifier)
public void putDelete(byte[] columnFamily, byte[] columnQualifier, ColumnVisibility columnVisibility)
public void putDelete(byte[] columnFamily, byte[] columnQualifier, long timestamp)
public void putDelete(byte[] columnFamily, byte[] columnQualifier, ColumnVisibility columnVisibility, long timestamp)
public List<ColumnUpdate> getUpdates()
protected ColumnUpdate newColumnUpdate(byte[] cf, byte[] cq, byte[] cv, boolean hasts, long ts, boolean deleted, byte[] val)
public long numBytes()
public long estimatedMemoryUsed()
public int size()
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
protected void droppingOldTimestamp(long ts)
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public boolean equals(Mutation m)
public org.apache.accumulo.core.data.thrift.TMutation toThrift()
TMutation
object
containing this Mutation's data.
Note that this method will move the Mutation into a "serialized" state
that will prevent users from adding more data via Mutation#put().protected Mutation.SERIALIZED_FORMAT getSerializedFormat()
Copyright © 2011-2016 The Apache Software Foundation. All Rights Reserved.