|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openjena.atlas.data.ThresholdPolicyMemory<T>
public class ThresholdPolicyMemory<T>
A threshold policy based on the estimated memory size of the tuples added.
TODO This policy isn't ready to be used because the SerializationFactorys don't support generating memory estimates yet.
TODO It might be too expensive to examine each tuple individually. We could change it to sample the first 100 tuples to calculate an average tuple size.
Constructor Summary | |
---|---|
ThresholdPolicyMemory(long threshold,
SerializationFactory<T> serializerFactory)
|
Method Summary | |
---|---|
long |
getCount()
Returns the current count of the number of items incremented in this policy. |
long |
getMemorySize()
Returns the current total estimated memory size of all the items incremented in this policy. |
long |
getThreshold()
Returns the threshold before the list is written to disk. |
void |
increment(T item)
Call this method each time to increment the policy's threshold count. |
boolean |
isThresholdExceeded()
Determines whether or not the configured threshold has been exceeded for this policy. |
void |
reset()
Reset the policy back to the initial state. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ThresholdPolicyMemory(long threshold, SerializationFactory<T> serializerFactory)
Method Detail |
---|
public void increment(T item)
ThresholdPolicy
increment
in interface ThresholdPolicy<T>
item
- The item that was added.public boolean isThresholdExceeded()
ThresholdPolicy
isThresholdExceeded
in interface ThresholdPolicy<T>
true
if the threshold has been reached; false
otherwise.public void reset()
ThresholdPolicy
reset
in interface ThresholdPolicy<T>
public long getThreshold()
public long getCount()
public long getMemorySize()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |