|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.TreeSet<StorableIndex<S>>
com.amazon.carbonado.qe.StorableIndexSet<S>
public class StorableIndexSet<S extends Storable>
Manages a set of StorableIndex objects, intended for reducing the
set such that the minimal amount of physical indexes need to be defined for
a specific type of Storable.
| Constructor Summary | |
|---|---|
StorableIndexSet()
|
|
StorableIndexSet(StorableIndexSet<S> set)
Copy constructor. |
|
| Method Summary | |
|---|---|
void |
addAlternateKeys(StorableInfo<S> info)
Adds all of the alternate keys of the given storable as indexes by calling addKey. |
void |
addIndexes(StorableInfo<S> info)
Adds all the indexes of the given storable. |
void |
addIndexes(StorableInfo<S> info,
Direction defaultDirection)
Adds all the indexes of the given storable. |
void |
addKey(StorableKey<S> key)
Adds the key as a unique index, preserving the property arrangement. |
void |
addPrimaryKey(StorableInfo<S> info)
Adds the primary key of the given storable as indexes by calling addKey. |
StorableIndex<S> |
findKeyIndex(StorableKey<S> key)
Finds the best index to represent the given key. |
StorableIndex<S> |
findPrimaryKeyIndex(StorableInfo<S> info)
Finds the best index to represent the primary key. |
void |
markClustered(boolean clustered)
Marks all indexes as clustered or non-clustered. |
void |
reduce()
Reduces the size of the set by removing redundant indexes, and merges others together. |
void |
reduce(Direction defaultDirection)
Reduces the size of the set by removing redundant indexes, and merges others together. |
void |
setDefaultDirection(Direction defaultDirection)
Set the default direction for all index properties. |
void |
uniquify(StorableInfo<S> info)
Augment non-unique indexes with primary key properties, thus making them unique. |
void |
uniquify(StorableKey<S> key)
Augment non-unique indexes with key properties, thus making them unique. |
| Methods inherited from class java.util.TreeSet |
|---|
add, addAll, ceiling, clear, clone, comparator, contains, descendingIterator, descendingSet, first, floor, headSet, headSet, higher, isEmpty, iterator, last, lower, pollFirst, pollLast, remove, size, subSet, subSet, tailSet, tailSet |
| Methods inherited from class java.util.AbstractSet |
|---|
equals, hashCode, removeAll |
| Methods inherited from class java.util.AbstractCollection |
|---|
containsAll, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public StorableIndexSet()
public StorableIndexSet(StorableIndexSet<S> set)
| Method Detail |
|---|
public void addIndexes(StorableInfo<S> info)
IllegalArgumentException - if info is null
public void addIndexes(StorableInfo<S> info,
Direction defaultDirection)
defaultDirection - default ordering direction to apply to each
index property
IllegalArgumentException - if any argument is nullpublic void addAlternateKeys(StorableInfo<S> info)
addKey.
IllegalArgumentException - if info is nullpublic void addPrimaryKey(StorableInfo<S> info)
addKey. This method should not be called if the primary key
cannot be altered because persistent data is already stored against
it. Instead, the primary key index should be added as a normal index.
After adding the primary key via this method and after reducing the
set, call findPrimaryKeyIndex to get the
best index to represent the primary key.
IllegalArgumentException - if info is nullpublic void addKey(StorableKey<S> key)
IllegalArgumentException - if key is nullpublic void reduce()
public void reduce(Direction defaultDirection)
defaultDirection - replace unspecified property directions with thispublic void setDefaultDirection(Direction defaultDirection)
defaultDirection - replace unspecified property directions with thispublic void markClustered(boolean clustered)
clustered - true to mark clustered; false to mark non-clusteredStorableIndex.isClustered()public void uniquify(StorableInfo<S> info)
IllegalArgumentException - if info is nullpublic void uniquify(StorableKey<S> key)
IllegalArgumentException - if key is nullpublic StorableIndex<S> findPrimaryKeyIndex(StorableInfo<S> info)
addPrimaryKey, this method should never return null.
IllegalArgumentException - if info is nullpublic StorableIndex<S> findKeyIndex(StorableKey<S> key)
addKey,
this method should never return null.
IllegalArgumentException - if key is null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||