public class DefaultSearchSystem extends java.lang.Object implements ISearchSystem
Modifier and Type | Field and Description |
---|---|
static org.apache.commons.logging.Log |
LOGGER
logger definition
|
Constructor and Description |
---|
DefaultSearchSystem(IDeclarativeModule module) |
Modifier and Type | Method and Description |
---|---|
protected void |
addIndexing(IChunk chunk,
java.lang.String slotName,
java.lang.Object value) |
protected void |
cleanAddAll(java.util.Collection<IChunk> rtnSet,
java.util.Collection<IChunk> candidates)
wrappers for the set logic so that we can easily clean up of the temporary
collections
|
protected void |
cleanRemoveAll(java.util.Collection<IChunk> rtnSet,
java.util.Collection<IChunk> candidates) |
protected void |
cleanRetainAll(java.util.Collection<IChunk> rtnSet,
java.util.Collection<IChunk> candidates) |
void |
clear() |
protected java.util.Collection<IChunk> |
equals(IChunkType type,
ISlot slot) |
protected java.util.Collection<IChunk> |
find(IChunkType type,
ISlot slot,
java.util.Set<IChunk> candidates)
current candidates is required in the case of NOT conditions
|
java.util.SortedSet<IChunk> |
findExact(ChunkTypeRequest pattern,
java.util.Comparator<IChunk> sortRule,
IChunkFilter filter)
this implementation fails fast
|
protected java.util.Collection<IChunk> |
findExactPooledThreads(ChunkTypeRequest pattern) |
protected java.util.SortedSet<IChunk> |
findExactSingleThreaded(ChunkTypeRequest pattern,
java.util.Comparator<IChunk> sortRule,
IChunkFilter filter) |
java.util.SortedSet<IChunk> |
findFuzzy(ChunkTypeRequest pattern,
java.util.Comparator<IChunk> sortRule,
IChunkFilter filter)
find all I that match this pattern somewhat
|
protected java.lang.String |
getKey(IChunkType chunkType,
java.lang.String slotName) |
protected java.util.Set<java.lang.String> |
getKeys(IChunkType chunkType,
java.lang.String slotName) |
protected java.util.concurrent.locks.ReentrantReadWriteLock |
getLock() |
protected ITypeValueMap<?,IChunk> |
getSlotNameTypeValueMap(java.lang.String typeSlotNameIndexKey,
java.lang.Object value,
boolean create)
return the ITypeValueMap for the slot name.
|
protected java.util.Collection<IChunk> |
greaterThan(IChunkType type,
ISlot slot) |
protected long |
guessEqualsSize(IChunkType type,
ISlot slot) |
protected long |
guessGreaterThanSize(IChunkType type,
ISlot slot) |
protected long |
guessLessThanSize(IChunkType type,
ISlot slot) |
protected long |
guessNotSize(IChunkType type,
ISlot slot) |
protected long |
guessSize(IChunkType type,
ISlot slot) |
void |
index(IChunk chunk)
index this object
|
protected ITypeValueMap<?,IChunk> |
instantiateTypeValueMap(java.lang.Object value) |
protected java.util.Collection<ITypeValueMap<?,IChunk>> |
instantiateTypeValueMapCollection() |
protected java.util.Collection<IChunk> |
lessThan(IChunkType type,
ISlot slot) |
protected java.util.Collection<IChunk> |
not(IChunkType type,
ISlot slot) |
protected void |
recycleCollection(java.util.Collection<?> collection) |
protected void |
removeIndexing(IChunk chunk,
java.lang.String slotName,
java.lang.Object value) |
protected java.util.Collection<ISlot> |
sortPattern(IChunkType chunkType,
java.util.Collection<? extends ISlot> slots) |
void |
unindex(IChunk chunk)
remove this object from the index
|
void |
update(IChunk chunk,
java.lang.String slotName,
java.lang.Object oldValue,
java.lang.Object newValue) |
public DefaultSearchSystem(IDeclarativeModule module)
public void clear()
clear
in interface ISearchSystem
protected java.util.Collection<ITypeValueMap<?,IChunk>> instantiateTypeValueMapCollection()
protected ITypeValueMap<?,IChunk> instantiateTypeValueMap(java.lang.Object value)
protected java.util.concurrent.locks.ReentrantReadWriteLock getLock()
public java.util.SortedSet<IChunk> findExact(ChunkTypeRequest pattern, java.util.Comparator<IChunk> sortRule, IChunkFilter filter)
findExact
in interface ISearchSystem
sortRule
- may be nullfilter
- TODOISearchSystem.findExact(ChunkTypeRequest,
java.util.Comparator, IChunkFilter)
protected java.util.Collection<IChunk> findExactPooledThreads(ChunkTypeRequest pattern)
protected java.util.Collection<ISlot> sortPattern(IChunkType chunkType, java.util.Collection<? extends ISlot> slots)
protected java.util.SortedSet<IChunk> findExactSingleThreaded(ChunkTypeRequest pattern, java.util.Comparator<IChunk> sortRule, IChunkFilter filter)
public java.util.SortedSet<IChunk> findFuzzy(ChunkTypeRequest pattern, java.util.Comparator<IChunk> sortRule, IChunkFilter filter)
ISearchSystem
findFuzzy
in interface ISearchSystem
filter
- TODOprotected long guessSize(IChunkType type, ISlot slot)
protected java.util.Collection<IChunk> find(IChunkType type, ISlot slot, java.util.Set<IChunk> candidates)
slot
- candidates
- protected void cleanAddAll(java.util.Collection<IChunk> rtnSet, java.util.Collection<IChunk> candidates)
rtnSet
- candidates
- protected void cleanRetainAll(java.util.Collection<IChunk> rtnSet, java.util.Collection<IChunk> candidates)
protected void cleanRemoveAll(java.util.Collection<IChunk> rtnSet, java.util.Collection<IChunk> candidates)
protected java.util.Collection<IChunk> equals(IChunkType type, ISlot slot)
protected long guessEqualsSize(IChunkType type, ISlot slot)
protected java.util.Collection<IChunk> lessThan(IChunkType type, ISlot slot)
protected long guessLessThanSize(IChunkType type, ISlot slot)
protected java.util.Collection<IChunk> greaterThan(IChunkType type, ISlot slot)
protected long guessGreaterThanSize(IChunkType type, ISlot slot)
protected void recycleCollection(java.util.Collection<?> collection)
protected java.util.Collection<IChunk> not(IChunkType type, ISlot slot)
protected long guessNotSize(IChunkType type, ISlot slot)
protected java.lang.String getKey(IChunkType chunkType, java.lang.String slotName)
protected java.util.Set<java.lang.String> getKeys(IChunkType chunkType, java.lang.String slotName)
public void index(IChunk chunk)
ISearchSystem
index
in interface ISearchSystem
public void unindex(IChunk chunk)
ISearchSystem
unindex
in interface ISearchSystem
public void update(IChunk chunk, java.lang.String slotName, java.lang.Object oldValue, java.lang.Object newValue)
update
in interface ISearchSystem
protected void removeIndexing(IChunk chunk, java.lang.String slotName, java.lang.Object value)
protected void addIndexing(IChunk chunk, java.lang.String slotName, java.lang.Object value)
protected ITypeValueMap<?,IChunk> getSlotNameTypeValueMap(java.lang.String typeSlotNameIndexKey, java.lang.Object value, boolean create)
typeSlotNameIndexKey
- create
-