public final class RootClassHolder extends java.lang.Object implements MemoryHandler
MemoryHandler.Cost
Modifier and Type | Field and Description |
---|---|
java.util.concurrent.atomic.AtomicBoolean |
fullLoad
full load.
|
Constructor and Description |
---|
RootClassHolder(DBClass dbClass,
VirtualDB layer)
create a new secondary cache holder.
|
Modifier and Type | Method and Description |
---|---|
void |
checkFullList(long rowUID)
check that the row exist in the full list
|
PossibleRowsHolder |
fetchFullPR()
fetch the full list
|
PossibleRowsHolder |
findFullList(boolean lock)
find the full list of rows for this class.
|
long |
freeMemory(double percentage)
free the memory
|
MemoryHandler.Cost |
getCost()
the memory cost for this memory handler
|
long |
getEstimatedSize()
how much size are we holding ?
|
DBField[] |
getFieldList()
the field list
|
long |
getLastAccessed()
when was it last accessed ?
|
FieldValuesHolder |
getValues(java.lang.String fieldId)
return the values for this field
|
boolean |
hasFieldCache()
do we have any field cache ?
|
long |
panicFreeMemory()
Clear all memory ASAP.
|
long |
queuedFreeMemory(double percentage)
queue to free the memory
|
void |
removeValues(java.lang.String fieldId)
remove the values for this field
|
void |
setHoldHardLink(boolean flag)
turn on/off the hard links for this class
|
static void |
simulateSlowLoad(long sleepMS)
simulate heavy load by sleeping in select spots.
|
long |
tidyUp()
tidy up the memory used
|
java.lang.String |
toString()
display the details of this holder
|
void |
unlockFullList()
unlock the list.
|
public void unlockFullList()
public void setHoldHardLink(boolean flag)
flag
- turn on/offpublic void checkFullList(long rowUID)
rowUID
- the row to check@CheckReturnValue @Nullable public PossibleRowsHolder fetchFullPR()
@CheckReturnValue @Nonnull public PossibleRowsHolder findFullList(boolean lock) throws java.lang.Exception
lock
- lock thejava.lang.Exception
- a serious problempublic void removeValues(@Nonnull java.lang.String fieldId)
fieldId
- the field to remove the values for@CheckReturnValue @Nonnull public FieldValuesHolder getValues(@Nonnull java.lang.String fieldId)
fieldId
- the field to get the values for@CheckReturnValue @Nonnull public DBField[] getFieldList()
@Nonnegative public long freeMemory(@Nonnegative double percentage)
freeMemory
in interface MemoryHandler
percentage
- the percentage of the memory to free@CheckReturnValue public MemoryHandler.Cost getCost()
getCost
in interface MemoryHandler
@CheckReturnValue @Nonnegative public long getEstimatedSize()
getEstimatedSize
in interface MemoryHandler
@CheckReturnValue @Nonnegative public long getLastAccessed()
getLastAccessed
in interface MemoryHandler
@Nonnegative public long panicFreeMemory()
panicFreeMemory
in interface MemoryHandler
@Nonnegative public long queuedFreeMemory(@Nonnegative double percentage)
queuedFreeMemory
in interface MemoryHandler
percentage
- the percentage of the memory to free@Nonnegative public long tidyUp()
tidyUp
in interface MemoryHandler
@CheckReturnValue @Nonnull public java.lang.String toString()
toString
in class java.lang.Object
@CheckReturnValue public boolean hasFieldCache()
public static void simulateSlowLoad(@Nonnegative long sleepMS)
sleepMS
- number of milliseconds to sleepstSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.