|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MapIndex
This interface is an abstract index that can be created on a Map. The index can be used to perform efficient look ups and possibly other operations such as relational operations on an attribute in a Map. The MapIndex is provided with all update events and maintains an index that can be used to issue simple queries against the index later. The index could use an index defined callback to make an index on composite attributes.
ObjectMap.getIndex(String)
Nested Class Summary | |
---|---|
static class |
MapIndex.SpecialValue
This class represents directives for finding types of values in an index. |
Field Summary | |
---|---|
static MapIndex.SpecialValue |
EMPTY_VALUE
A SpecialValue constant that indicates a particular attribute value should be excluded from an index query. |
Method Summary | |
---|---|
Iterator |
findAll()
Returns the keys of the entire map. |
Iterator |
findAll(Object attributeValue)
Returns the keys for the entries that have the specified attribute value. |
Field Detail |
---|
static final MapIndex.SpecialValue EMPTY_VALUE
Method Detail |
---|
Iterator findAll(Object attributeValue) throws FinderException
For maps that are configured to have ObjectMap.getKeyOutputFormat() set to OutputFormat.RAW,
the keys returned will be SerializedKey
objects. If required, you can use the SerializedEntry.getObject()
method to retrieve (possibly inflating the serialized object) the original key or value object.
If the index is a composite index
(having more than one attribute), the attributeValue parameter must be the type of Object[] of the same size as
the number of attributes defined in the index. Each attribute value element in the Object array is corresponding
to the list of attribute names defined for the composite index. Use constant value EMPTY_VALUE
to indicate a particular attribute value to be excluded from value evaluation during index searching.
For example, if there is a composite index that has attributes defined: state,city,zip.
To find all keys that match a specific state, city and zip:
Iterator result = idx.findAll(new Object[]{"MN", "Rochester", "55901"});
To find all keys that match only the state:
Iterator result = idx.findAll(new Object[]{"MN", MapIndex.EMPTY_VALUE, MapIndex.EMPTY_VALUE});
attributeValue
- a reference to the attribute value to search for. In composite index case, this must be the type of
Object[].
FinderException
- if an exception or retry limit is reached when concurrent transactions updating the index prevent
findAll from completing.
IllegalArgumentException
- For a composite index, the IllegalArgumentException will be thrown in each of the following
conditions: If the attributeValue is null or is not of type Object[], and also if the attributeValue
is of type Object[] but has length unequal to the length of the configured attribute names.Iterator findAll() throws FinderException
SerializedKey
objects. If required, you can use the SerializedEntry.getObject()
method to retrieve (possibly inflating the serialized object) the original key or value object.
FinderException
- if an exception or retry limit is reached when concurrent transactions updating the index prevent
findAll from completing.
|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |