public abstract class ColumnFamily<T> extends Object implements Comparable<ColumnFamily<T>>
| Modifier and Type | Class and Description |
|---|---|
static class |
ColumnFamily.ChangeKind |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
addOnly |
protected boolean |
allChanged |
protected Map<String,ColumnFamily.ChangeKind> |
changes |
protected Class<T> |
clazz |
protected Map<String,T> |
collection |
protected Map<String,Number> |
increments |
protected long |
lastActivation |
protected String |
name |
protected PersistingElement |
owner |
protected Field |
property |
| Constructor and Description |
|---|
ColumnFamily() |
ColumnFamily(Class<T> clazz,
Field property,
String name,
PersistingElement owner) |
| Modifier and Type | Method and Description |
|---|---|
void |
activate() |
void |
activate(Constraint c) |
abstract void |
activate(Object from,
Object to) |
void |
activate(String fromIndex,
String toIndex) |
protected abstract void |
addToPOJO(Object pojoVersion,
String key,
T element) |
void |
assertIsActivated(String messageToDescribeTheContextOfTheCheck) |
Set<String> |
changedKeySet() |
void |
clearChanges() |
int |
compareTo(ColumnFamily<T> rhs) |
boolean |
containsKey(String key) |
long |
getActivationDate()
The date (epoch) at which the column familu was last activated.
|
Class<T> |
getClazz() |
T |
getElement(String key)
Finds an cached element according to its key.
|
T |
getFromStore(String key)
Finds an element according to its key.
|
Number |
getIncrement(String key) |
Set<String> |
getKeys()
The set of identifiers for activated elements.
|
String |
getName() |
PersistingElement |
getOwner() |
Object |
getPOJO(boolean createIfNull) |
Field |
getProperty() |
abstract Serializable |
getSerializableVersion() |
boolean |
hasChanged() |
protected boolean |
hasChanged(String key,
T lhs,
T rhs) |
Set<String> |
incrementedKeySet() |
boolean |
isActivated() |
boolean |
isActivated(long timeout)
Whether this column family was activated during the last
timeout period. |
boolean |
isAddOnly() |
boolean |
isEmpty()
Checks whether this column family is empty.
|
boolean |
isEmptyInStore()
Checks whether this column family is empty in the data store.
|
protected T |
preparePut(String key,
byte[] rep) |
void |
putElement(String key,
T element) |
void |
rebuild(Map<String,byte[]> rawData) |
void |
removeKey(String key)
Removes an element to the column family given its key.
|
void |
setActivated() |
void |
setAllChanged() |
int |
size()
Returns the number of activated elements.
|
void |
storeToPOJO() |
protected abstract void |
storeToPOJO(Object pojoVersion) |
void |
updateFromPOJO() |
protected abstract void |
updateFromPOJO(Object pojoVersion) |
boolean |
wasChanged(String key) |
boolean |
wasDeleted(String key) |
protected final Field property
protected final String name
protected final PersistingElement owner
protected boolean allChanged
protected Map<String,ColumnFamily.ChangeKind> changes
protected final boolean addOnly
protected long lastActivation
public ColumnFamily()
public ColumnFamily(Class<T> clazz, Field property, String name, PersistingElement owner)
public abstract Serializable getSerializableVersion()
protected abstract void updateFromPOJO(Object pojoVersion)
protected abstract void storeToPOJO(Object pojoVersion)
public int compareTo(ColumnFamily<T> rhs)
compareTo in interface Comparable<ColumnFamily<T>>public String getName()
public Field getProperty()
public PersistingElement getOwner()
public boolean isAddOnly()
public boolean isActivated()
public boolean isActivated(long timeout)
timeout period.timeout - negative value means at any time ; Long.MAX_VALUE bypasses clock readpublic void setActivated()
public long getActivationDate()
public void assertIsActivated(String messageToDescribeTheContextOfTheCheck) throws IllegalStateException
IllegalStateExceptionpublic void activate()
throws DatabaseNotReachedException
DatabaseNotReachedExceptionpublic abstract void activate(Object from, Object to) throws DatabaseNotReachedException
DatabaseNotReachedExceptionpublic void activate(String fromIndex, String toIndex) throws DatabaseNotReachedException
DatabaseNotReachedExceptionpublic void activate(Constraint c) throws DatabaseNotReachedException
DatabaseNotReachedExceptionpublic void rebuild(Map<String,byte[]> rawData) throws DatabaseNotReachedException
DatabaseNotReachedExceptionpublic int size()
public boolean isEmpty()
public boolean isEmptyInStore()
throws DatabaseNotReachedException
DatabaseNotReachedExceptionpublic boolean containsKey(String key)
public void putElement(String key, T element) throws IncrementException
IncrementExceptionpublic void removeKey(String key)
PersistingElement.store() method.public T getFromStore(String key) throws DatabaseNotReachedException
DatabaseNotReachedExceptionpublic boolean hasChanged()
public boolean wasChanged(String key)
public boolean wasDeleted(String key)
public void setAllChanged()
public void clearChanges()
public Object getPOJO(boolean createIfNull)
public void updateFromPOJO()
public void storeToPOJO()
Copyright © 2016. All Rights Reserved.