me.prettyprint.cassandra.service.template
Class AbstractTemplateUpdater<K,N>

java.lang.Object
  extended by me.prettyprint.cassandra.service.template.AbstractTemplateUpdater<K,N>
Direct Known Subclasses:
ColumnFamilyUpdater, SuperCfUpdater

public abstract class AbstractTemplateUpdater<K,N>
extends Object


Field Summary
protected  long clock
           
protected  ColumnFactory columnFactory
           
protected  int keyPos
           
protected  List<K> keys
           
protected  Mutator<K> mutator
           
protected  AbstractColumnFamilyTemplate<K,N> template
           
 
Constructor Summary
AbstractTemplateUpdater(AbstractColumnFamilyTemplate<K,N> template, ColumnFactory columnFactory, Mutator<K> mutator)
           
 
Method Summary
 AbstractTemplateUpdater<K,N> addKey(K key)
           
 K getCurrentKey()
           
 Mutator<K> getCurrentMutator()
           
 void setClock(long clock)
          Reset the clock used for column creation.
 void update()
          To be overridden by folks choosing to add their own functionality.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

AbstractTemplateUpdater

public AbstractTemplateUpdater(AbstractColumnFamilyTemplate<K,N> template,
                               ColumnFactory columnFactory,
                               Mutator<K> mutator)
Method Detail

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 -


Copyright © 2012. All Rights Reserved.