me.prettyprint.cassandra.service.template
Class AbstractTemplateUpdater<K,N>
java.lang.Object
me.prettyprint.cassandra.service.template.AbstractTemplateUpdater<K,N>
- Direct Known Subclasses:
- ColumnFamilyUpdater, SuperCfUpdater
public abstract class AbstractTemplateUpdater<K,N>
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEF_TTL
protected static final int DEF_TTL
- See Also:
- Constant Field Values
keys
protected List<K> keys
keyPos
protected int keyPos
columnFactory
protected ColumnFactory columnFactory
template
protected AbstractColumnFamilyTemplate<K,N> template
mutator
protected Mutator<K> mutator
clock
protected long clock
globalTtl
protected int globalTtl
AbstractTemplateUpdater
public AbstractTemplateUpdater(AbstractColumnFamilyTemplate<K,N> template,
ColumnFactory columnFactory,
Mutator<K> mutator)
addKey
public AbstractTemplateUpdater<K,N> addKey(K key)
getCurrentKey
public K getCurrentKey()
- Returns:
- Give the updater access to the current key if it needs it
update
public void update()
- To be overridden by folks choosing to add their own functionality. Default is a no-op.
getCurrentMutator
public Mutator<K> getCurrentMutator()
setClock
public void setClock(long clock)
- Reset the clock used for column creation. By default, we hold a reference to a single
clock value created at construction from
AbstractColumnFamilyTemplate.getClock()
Since updater implementations are instance-based (and thus should not be shared among threads),
call this as often as you need to apply the clock to the underlying columns.
- Parameters:
clock -
setTtl
public void setTtl(int ttl)
- Globally sets the ttl for this updater instance. Any columns created via the updater will use this ttl value unless a ttl is explicitly provided
to one of the set* methods of subclasses.
- Parameters:
ttl -
Copyright © 2013. All Rights Reserved.