|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openanzo.common.rdb.layout.ValueLayoutCacheProxy
public class ValueLayoutCacheProxy
Wraps and caches data accessed by an IValueLayout object.
| Constructor Summary | |
|---|---|
ValueLayoutCacheProxy(IValueLayout base,
java.util.Map<java.lang.Long,java.lang.String> byIdCache,
java.util.Map<java.lang.String,java.lang.Long> byValueCache)
Create Cache Proxy for the given base layout. |
|
| Method Summary | |
|---|---|
void |
batchAdd(java.util.Iterator<java.lang.String> iter)
Doesn't cached added nodes |
void |
batchAddAndCache(java.util.Iterator<java.lang.String> iter)
Add set of strings into this layout and cache their values |
java.lang.String |
cache(java.lang.Long id,
java.lang.String value,
java.lang.Long modifierId)
Create object from provided ID and value and cache result |
void |
clearCache()
Clear all cached objects and IDs |
void |
clearUncommittedCache()
Clear any uncommitted cache entries |
void |
commitUncommittedCache()
Commit any uncommitted cache entries |
ClosableIterator<NodeSQL.FetchAllCommonValuesResult> |
fetchAll()
Doesn't cache fetched Nodes |
java.lang.Long |
fetchId(java.lang.String value)
Fetch the ID for this value |
java.lang.String |
fetchValue(java.lang.Long id)
Fetch the value for this ID |
java.lang.String |
getIfCached(java.lang.Long id)
Get the Object for this ID, if already cached |
java.lang.Long |
getIfCached(java.lang.String value)
Get the ID for this Object, if already cached |
boolean |
isCached(java.lang.Long id)
Return true if an Object with this ID is already cached |
boolean |
isCached(java.lang.String value)
Return true if a ID for this Object is already cached |
java.lang.Long |
store(java.lang.String value)
Store String value |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ValueLayoutCacheProxy(IValueLayout base,
java.util.Map<java.lang.Long,java.lang.String> byIdCache,
java.util.Map<java.lang.String,java.lang.Long> byValueCache)
base - Base layout to add caching layer ontobyIdCache - ID cache for this layoutbyValueCache - Value cache for this layout| Method Detail |
|---|
public void clearCache()
ILayoutCache
clearCache in interface ILayoutCache<java.lang.String>public void commitUncommittedCache()
ILayoutCache
commitUncommittedCache in interface ILayoutCache<java.lang.String>public void clearUncommittedCache()
ILayoutCache
clearUncommittedCache in interface ILayoutCache<java.lang.String>
public java.lang.String cache(java.lang.Long id,
java.lang.String value,
java.lang.Long modifierId)
ILayoutCache
cache in interface ILayoutCache<java.lang.String>id - ID of nodevalue - String value of nodemodifierId - modifierId for literals
public boolean isCached(java.lang.String value)
ILayoutCache
isCached in interface ILayoutCache<java.lang.String>value - object to check
public boolean isCached(java.lang.Long id)
ILayoutCache
isCached in interface ILayoutCache<java.lang.String>id - id to check
public java.lang.Long getIfCached(java.lang.String value)
ILayoutCache
getIfCached in interface ILayoutCache<java.lang.String>value - object to find cached ID
public java.lang.String getIfCached(java.lang.Long id)
ILayoutCache
getIfCached in interface ILayoutCache<java.lang.String>id - id of Object to retrieve
public java.lang.Long fetchId(java.lang.String value)
IValueLayout
fetchId in interface IValueLayoutvalue - value to lookup
public java.lang.String fetchValue(java.lang.Long id)
IValueLayout
fetchValue in interface IValueLayoutid - id to lookup
public java.lang.Long store(java.lang.String value)
IValueLayout
store in interface IValueLayoutvalue - value to store
public void batchAdd(java.util.Iterator<java.lang.String> iter)
batchAdd in interface IValueLayoutiter - Set of strings to storepublic ClosableIterator<NodeSQL.FetchAllCommonValuesResult> fetchAll()
fetchAll in interface IValueLayoutpublic void batchAddAndCache(java.util.Iterator<java.lang.String> iter)
iter - set of strings to store and cache
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||