public abstract class

AbstractThriftMutationBatchImpl

extends Object
implements MutationBatch
java.lang.Object
   ↳ com.netflix.astyanax.thrift.AbstractThriftMutationBatchImpl

Class Overview

Basic implementation of a mutation batch using the thrift data structures. The thrift mutation data structure is, Map of Keys -> Map of ColumnFamily -> MutationList

Summary

Fields
protected long timestamp
Public Constructors
AbstractThriftMutationBatchImpl(Clock clock)
Public Methods
<K> void deleteRow(Collection<ColumnFamily<K, ?>> columnFamilies, K rowKey)
Delete the row for all the specified column families
void deserialize(ByteBuffer data)
Re-recreate a mutation batch from a serialized ByteBuffer created by a call to serialize().
void discardMutations()
Discard any pending mutations.
Map<ByteBuffer, Map<StringList<Mutation>>> getMutationMap()
int getRowCount()
Returns the number of rows being mutated
Map<ByteBuffer, Set<String>> getRowKeys()
Return a mapping of column families to rows being modified
boolean isEmpty()
Checks whether the mutation object contains rows.
MutationBatch lockCurrentTimestamp()
Force all future mutations to have the same timestamp.
void mergeShallow(MutationBatch other)
Perform a shallow merge of mutations from another batch.
ByteBuffer serialize()
Serialize the entire mutation batch into a ByteBuffer.@return
MutationBatch setTimeout(long timeout)
This never really did anything :)
MutationBatch setTimestamp(long timestamp)
Set the timestamp for all subsequent operations on this mutation
String toString()
Generate a string representation of the mutation with the following syntax Key1: cf1: Mutation count cf2: Mutation count Key2: cf1: Mutation count cf2: Mutation count
<K, C> ColumnListMutation<C> withRow(ColumnFamily<K, C> columnFamily, K rowKey)
Mutate a row.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.netflix.astyanax.Execution
From interface com.netflix.astyanax.MutationBatch

Fields

protected long timestamp

Public Constructors

public AbstractThriftMutationBatchImpl (Clock clock)

Public Methods

public void deleteRow (Collection<ColumnFamily<K, ?>> columnFamilies, K rowKey)

Delete the row for all the specified column families

public void deserialize (ByteBuffer data)

Re-recreate a mutation batch from a serialized ByteBuffer created by a call to serialize(). Serialization of MutationBatches from different implementations is not guaranteed to match.

Throws
Exception

public void discardMutations ()

Discard any pending mutations. All previous references returned by row are now invalid.

public Map<ByteBuffer, Map<StringList<Mutation>>> getMutationMap ()

public int getRowCount ()

Returns the number of rows being mutated

public Map<ByteBuffer, Set<String>> getRowKeys ()

Return a mapping of column families to rows being modified

public boolean isEmpty ()

Checks whether the mutation object contains rows. While the map may contain row keys the row keys may not contain any mutations.

public MutationBatch lockCurrentTimestamp ()

Force all future mutations to have the same timestamp. Make sure to call lockTimestamp before doing any other operations otherwise previously created withRow mutations will use the previous timestamp.

public void mergeShallow (MutationBatch other)

Perform a shallow merge of mutations from another batch.

public ByteBuffer serialize ()

Serialize the entire mutation batch into a ByteBuffer.@return

Throws
Exception

public MutationBatch setTimeout (long timeout)

This never really did anything :)

public MutationBatch setTimestamp (long timestamp)

Set the timestamp for all subsequent operations on this mutation

public String toString ()

Generate a string representation of the mutation with the following syntax Key1: cf1: Mutation count cf2: Mutation count Key2: cf1: Mutation count cf2: Mutation count

public ColumnListMutation<C> withRow (ColumnFamily<K, C> columnFamily, K rowKey)

Mutate a row. The ColumnFamilyMutation is only valid until execute() or discardMutations is called.