public class RefreshOnReadPolicy extends Object implements ReaderRefreshPolicy
RefreshOnWritePolicy
and for "sync" indexes. For "nrt" indexes TimedRefreshPolicy
should be preferred
The readers are not refreshed immediately upon write. Instead they would be refreshed if
This policy can result in some contention if index is being frequently updated and queried. *This is an experimental policy. Currently it causes high contention*
NEVER
Constructor and Description |
---|
RefreshOnReadPolicy(org.apache.jackrabbit.oak.stats.Clock clock,
TimeUnit unit,
long refreshDelta) |
Modifier and Type | Method and Description |
---|---|
void |
refreshOnReadIfRequired(Runnable refreshCallback)
This would be invoked before any query is performed
to provide a chance for IndexNode to refresh the readers
|
void |
refreshOnWriteIfRequired(Runnable refreshCallback)
This would invoked after some writes have been performed
and as a final step refresh request is being made.
|
void |
updated() |
public RefreshOnReadPolicy(org.apache.jackrabbit.oak.stats.Clock clock, TimeUnit unit, long refreshDelta)
public void refreshOnReadIfRequired(Runnable refreshCallback)
ReaderRefreshPolicy
The index may or may not be updated when this method is invoked
refreshOnReadIfRequired
in interface ReaderRefreshPolicy
refreshCallback
- callback to refresh the readerspublic void refreshOnWriteIfRequired(Runnable refreshCallback)
ReaderRefreshPolicy
Any time its invoked it can be assumed that index has been updated
refreshOnWriteIfRequired
in interface ReaderRefreshPolicy
refreshCallback
- callback to refresh the readerspublic void updated()
Copyright © 2012–2017 The Apache Software Foundation. All rights reserved.