Hello,
Is it possible to get beforeGet(), afterGet() events for Region.get() API
with current state of codebase..?
Seeing the internal code, it seems *i need to add code *(that invoke
listener, writer callbacks) for these events, something similar to the way
events for Region.put() are invoked. is this a correct understanding..?
If so, I need to create a EntryEventImpl (shown in Red colour ) and pass
it. What is the purpose of clientEvent here ? can i use clientEvent directly
to create Get events or is it used for some different purpose?
*LocalRegion.java*
@Override
public Object get(Object key, Object aCallbackArgument,
boolean generateCallbacks, EntryEventImpl clientEvent) throws
TimeoutException, CacheLoaderException
{
*clientEvent = newGetEntryEvent(key, aCallbackArgument);*
Object result = get(key, aCallbackArgument, generateCallbacks,
false, false, null, *clientEvent*, false, true/*allowReadFromHDFS*/);
if (Token.isInvalid(result)) {
result = null;
}
return result;
}
If so, hook (listener, writer calls ) for GET callbacks are ok as shown in
red colour...?
*LocalRegion.java*
public final Object getDeserializedValue(RegionEntry re, final KeyInfo
keyInfo, final boolean updateStats, boolean disableCopyOnRead,
boolean preferCD, EntryEventImpl clientEvent, boolean
returnTombstones, boolean allowReadFromHDFS, boolean retainResult) {
* //hook for before GET - call CacheWriter *
try{
if (this.diskRegion != null) {
this.diskRegion.setClearCountReference();
//code in try ends here *//hook for after GET - call CacheListener.*
}finally {
if (this.diskRegion != null) {
this.diskRegion.removeClearCountReference();
}
}
}
Looking forward to a quick help.
Nilkanth.