public abstract class AbstractTemplateUpdater<K,N> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected long |
clock |
protected ColumnFactory |
columnFactory |
protected static int |
DEF_TTL |
protected int |
globalTtl |
protected int |
keyPos |
protected List<K> |
keys |
protected Mutator<K> |
mutator |
protected AbstractColumnFamilyTemplate<K,N> |
template |
| Constructor and Description |
|---|
AbstractTemplateUpdater(AbstractColumnFamilyTemplate<K,N> template,
ColumnFactory columnFactory,
Mutator<K> mutator) |
| Modifier and Type | Method and Description |
|---|---|
AbstractTemplateUpdater<K,N> |
addKey(K key) |
K |
getCurrentKey() |
Mutator<K> |
getCurrentMutator() |
void |
setClock(long clock)
Reset the clock used for column creation.
|
void |
setTtl(int ttl)
Globally sets the ttl for this updater instance.
|
void |
update()
To be overridden by folks choosing to add their own functionality.
|
protected static final int DEF_TTL
protected int keyPos
protected ColumnFactory columnFactory
protected AbstractColumnFamilyTemplate<K,N> template
protected long clock
protected int globalTtl
public AbstractTemplateUpdater(AbstractColumnFamilyTemplate<K,N> template, ColumnFactory columnFactory, Mutator<K> mutator)
public AbstractTemplateUpdater<K,N> addKey(K key)
public K getCurrentKey()
public void update()
public void setClock(long clock)
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.clock - public void setTtl(int ttl)
ttl - Copyright © 2014. All Rights Reserved.