|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.core.engine.subindex.ModuloSubIndexHash
public class ModuloSubIndexHash
Uses a hash function based on hash code computation of alias and ids, and using the modulo operation against the configured size.
The sub index name isprefix_(hashCode % size).
If using configuration, expects prefix as the setting name,
and size as the modulo right hand side operation.
| Constructor Summary | |
|---|---|
ModuloSubIndexHash()
Constructs a new instance, will have to be configured. |
|
ModuloSubIndexHash(String prefix,
int size)
Constructs a new instance, using the given prefix and size. |
|
| Method Summary | |
|---|---|
void |
configure(CompassSettings settings)
Using configuration, expects prefix as the setting name,
and size as the modulo right hand side operation. |
String[] |
getSubIndexes()
Returns all the sub indexes possible, basically in the form of prefix_(0..size) (not including size). |
String |
mapSubIndex(String alias,
Property[] ids)
Computes the hash code of alias and all the ids, and then modulo it by size. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ModuloSubIndexHash()
public ModuloSubIndexHash(String prefix,
int size)
prefix - The prefix sed for the sub index prefix namesize - The size the modulo will be used| Method Detail |
|---|
public void configure(CompassSettings settings)
throws CompassException
prefix as the setting name,
and size as the modulo right hand side operation.
configure in interface CompassConfigurablesettings - The setting to configure by
CompassExceptionpublic String[] getSubIndexes()
prefix_(0..size) (not including size).
getSubIndexes in interface SubIndexHash
public String mapSubIndex(String alias,
Property[] ids)
throws SearchEngineException
prefix_(hashCode % size).
mapSubIndex in interface SubIndexHashalias - The alias to compute the sub index by (optional)ids - The set of ids to compute the sub index by (optional)
SearchEngineExceptionpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||