org.apache.accumulo.core.data
Class Mutation
java.lang.Object
org.apache.accumulo.core.data.Mutation
- All Implemented Interfaces:
- org.apache.hadoop.io.Writable
- Direct Known Subclasses:
- ConditionalMutation
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.
Method Summary |
protected void |
droppingOldTimestamp(long ts)
|
boolean |
equals(Mutation m)
Checks if this mutation equals another. |
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()
|
TMutation |
toThrift()
|
void |
write(DataOutput out)
|
Mutation
public Mutation(byte[] row)
- Since:
- 1.5.0
Mutation
public Mutation(byte[] row,
int start,
int length)
- Since:
- 1.5.0
Mutation
public Mutation(org.apache.hadoop.io.Text row)
Mutation
public Mutation(CharSequence row)
Mutation
public Mutation()
Mutation
public Mutation(TMutation tmutation)
Mutation
public Mutation(Mutation m)
getRow
public byte[] getRow()
put
public void put(org.apache.hadoop.io.Text columnFamily,
org.apache.hadoop.io.Text columnQualifier,
Value value)
put
public void put(org.apache.hadoop.io.Text columnFamily,
org.apache.hadoop.io.Text columnQualifier,
ColumnVisibility columnVisibility,
Value value)
put
public void put(org.apache.hadoop.io.Text columnFamily,
org.apache.hadoop.io.Text columnQualifier,
long timestamp,
Value value)
put
public void put(org.apache.hadoop.io.Text columnFamily,
org.apache.hadoop.io.Text columnQualifier,
ColumnVisibility columnVisibility,
long timestamp,
Value value)
putDelete
public void putDelete(org.apache.hadoop.io.Text columnFamily,
org.apache.hadoop.io.Text columnQualifier)
putDelete
public void putDelete(org.apache.hadoop.io.Text columnFamily,
org.apache.hadoop.io.Text columnQualifier,
ColumnVisibility columnVisibility)
putDelete
public void putDelete(org.apache.hadoop.io.Text columnFamily,
org.apache.hadoop.io.Text columnQualifier,
long timestamp)
putDelete
public void putDelete(org.apache.hadoop.io.Text columnFamily,
org.apache.hadoop.io.Text columnQualifier,
ColumnVisibility columnVisibility,
long timestamp)
put
public void put(CharSequence columnFamily,
CharSequence columnQualifier,
Value value)
put
public void put(CharSequence columnFamily,
CharSequence columnQualifier,
ColumnVisibility columnVisibility,
Value value)
put
public void put(CharSequence columnFamily,
CharSequence columnQualifier,
long timestamp,
Value value)
put
public void put(CharSequence columnFamily,
CharSequence columnQualifier,
ColumnVisibility columnVisibility,
long timestamp,
Value value)
putDelete
public void putDelete(CharSequence columnFamily,
CharSequence columnQualifier)
putDelete
public void putDelete(CharSequence columnFamily,
CharSequence columnQualifier,
ColumnVisibility columnVisibility)
putDelete
public void putDelete(CharSequence columnFamily,
CharSequence columnQualifier,
long timestamp)
putDelete
public void putDelete(CharSequence columnFamily,
CharSequence columnQualifier,
ColumnVisibility columnVisibility,
long timestamp)
put
public void put(CharSequence columnFamily,
CharSequence columnQualifier,
CharSequence value)
put
public void put(CharSequence columnFamily,
CharSequence columnQualifier,
ColumnVisibility columnVisibility,
CharSequence value)
put
public void put(CharSequence columnFamily,
CharSequence columnQualifier,
long timestamp,
CharSequence value)
put
public void put(CharSequence columnFamily,
CharSequence columnQualifier,
ColumnVisibility columnVisibility,
long timestamp,
CharSequence value)
put
public void put(byte[] columnFamily,
byte[] columnQualifier,
byte[] value)
- Since:
- 1.5.0
put
public void put(byte[] columnFamily,
byte[] columnQualifier,
ColumnVisibility columnVisibility,
byte[] value)
- Since:
- 1.5.0
put
public void put(byte[] columnFamily,
byte[] columnQualifier,
long timestamp,
byte[] value)
- Since:
- 1.5.0
put
public void put(byte[] columnFamily,
byte[] columnQualifier,
ColumnVisibility columnVisibility,
long timestamp,
byte[] value)
- Since:
- 1.5.0
putDelete
public void putDelete(byte[] columnFamily,
byte[] columnQualifier)
- Since:
- 1.5.0
putDelete
public void putDelete(byte[] columnFamily,
byte[] columnQualifier,
ColumnVisibility columnVisibility)
- Since:
- 1.5.0
putDelete
public void putDelete(byte[] columnFamily,
byte[] columnQualifier,
long timestamp)
- Since:
- 1.5.0
putDelete
public void putDelete(byte[] columnFamily,
byte[] columnQualifier,
ColumnVisibility columnVisibility,
long timestamp)
- Since:
- 1.5.0
getUpdates
public List<ColumnUpdate> getUpdates()
newColumnUpdate
protected ColumnUpdate newColumnUpdate(byte[] cf,
byte[] cq,
byte[] cv,
boolean hasts,
long ts,
boolean deleted,
byte[] val)
numBytes
public long numBytes()
estimatedMemoryUsed
public long estimatedMemoryUsed()
size
public int size()
- Returns:
- the number of column value pairs added to the mutation
readFields
public void readFields(DataInput in)
throws IOException
- Specified by:
readFields
in interface org.apache.hadoop.io.Writable
- Throws:
IOException
droppingOldTimestamp
protected void droppingOldTimestamp(long ts)
write
public void write(DataOutput out)
throws IOException
- Specified by:
write
in interface org.apache.hadoop.io.Writable
- Throws:
IOException
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
equals
public boolean equals(Mutation m)
- Checks if this mutation equals another. This method may be removed in a future API revision in favor of
equals(Object)
. See ACCUMULO-1627 for more
information.
- Parameters:
m
- mutation
- Returns:
- true if the given mutation equals this one, false otehrwise
toThrift
public TMutation toThrift()
getSerializedFormat
protected Mutation.SERIALIZED_FORMAT getSerializedFormat()
Copyright © 2015 Apache Accumulo Project. All rights reserved.