me.prettyprint.cassandra.service.template
Class ColumnFamilyUpdater<K,N>
java.lang.Object
me.prettyprint.cassandra.service.template.AbstractTemplateUpdater<K,N>
me.prettyprint.cassandra.service.template.ColumnFamilyUpdater<K,N>
- Type Parameters:
K
- the key's data typeN
- the standard or super column's data type
public class ColumnFamilyUpdater<K,N>
- extends AbstractTemplateUpdater<K,N>
This provides an interface of updating a specified row, most likely with the
contents of an object. This would likely by implemented as an anonymous inner
class with access to a final object in scope. It would update the given row
with the object's data.
For more complex behaviour, subclasses should implementat update() to simply make
consecutive calls to various set****() methods which already have the
contextual information they need to update the correct row.
The downside of this approach is that the updater is essentially stateful and
cannot be used concurrently. The alternative is to pass an object in to
update() as a parameter with the setter methods, leaving the updater to be
stateless.
- Author:
- david, zznate
Method Summary |
void |
deleteColumn(N columnName)
|
void |
setBoolean(N columnName,
Boolean value)
|
void |
setByteArray(N columnName,
byte[] value)
|
void |
setByteBuffer(N columnName,
ByteBuffer value)
|
|
setColumn(HColumn<N,V> column)
|
void |
setDate(N columnName,
Date value)
|
void |
setDouble(N columnName,
Double value)
|
void |
setInteger(N columnName,
Integer value)
|
void |
setLong(N columnName,
Long value)
|
void |
setString(N columnName,
String value)
|
void |
setUUID(N columnName,
UUID value)
|
|
setValue(N columnName,
V value,
Serializer<V> serializer)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ColumnFamilyUpdater
public ColumnFamilyUpdater(ColumnFamilyTemplate<K,N> template,
ColumnFactory columnFactory)
- Constructs a ColumnFamilyUpdater with the provided
ColumnFamilyTemplate
and ColumnFactory
. A Mutator
is created internally for this updater.
- Parameters:
template
- columnFactory
-
ColumnFamilyUpdater
public ColumnFamilyUpdater(ColumnFamilyTemplate<K,N> template,
ColumnFactory columnFactory,
Mutator<K> mutator)
- Same as 2-arg version, except we use the provided
Mutator
- Parameters:
template
- columnFactory
- mutator
-
deleteColumn
public void deleteColumn(N columnName)
setString
public void setString(N columnName,
String value)
setUUID
public void setUUID(N columnName,
UUID value)
setLong
public void setLong(N columnName,
Long value)
setInteger
public void setInteger(N columnName,
Integer value)
setDouble
public void setDouble(N columnName,
Double value)
setBoolean
public void setBoolean(N columnName,
Boolean value)
setByteArray
public void setByteArray(N columnName,
byte[] value)
setByteBuffer
public void setByteBuffer(N columnName,
ByteBuffer value)
setDate
public void setDate(N columnName,
Date value)
setValue
public <V> void setValue(N columnName,
V value,
Serializer<V> serializer)
setColumn
public <V> void setColumn(HColumn<N,V> column)
Copyright © 2011. All Rights Reserved.