|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.tree.INArrayRep<ARRAY_BASE_TYPE,REP_ENUM_TYPE,ELEMENT_TYPE>
public abstract class INArrayRep<ARRAY_BASE_TYPE,REP_ENUM_TYPE,ELEMENT_TYPE>
The base class for the various array representations used by fields associated with an IN node. Storage efficiency, especially when JE is operating in a "cache full" environment is the prime motivation for the various representations.
Each representation assumes that all read operations are done under a shared latch and all updates (set, copy and compact) are done under an exclusive latch. As a result, the representations themselves do not make any provisions for synchronization.
The callers of all the potentially representation mutating methods:
must be careful to save the result value and use it for subsequent operations, since it could represent the new mutated object.
Field Summary | |
---|---|
protected IN |
parent
|
Constructor Summary | |
---|---|
INArrayRep(IN parent)
|
Method Summary | |
---|---|
(package private) abstract long |
calculateMemorySize()
Returns the current memory size of the underlying representation in bytes. |
abstract ARRAY_BASE_TYPE |
compact()
Chooses a more compact representation, if that's possible, otherwise does nothing. |
abstract ARRAY_BASE_TYPE |
copy(int from,
int to,
int n)
Copies n elements at index denoted by "from" to the index denoted by "to". |
abstract ELEMENT_TYPE |
get(int idx)
Returns the element at idx. |
abstract REP_ENUM_TYPE |
getType()
|
abstract int |
length()
Returns the length, that is, the range within which get and set operations can be performed. |
void |
noteRepChange(INArrayRep<ARRAY_BASE_TYPE,REP_ENUM_TYPE,ELEMENT_TYPE> newRep)
|
void |
noteRepChange(INArrayRep<ARRAY_BASE_TYPE,REP_ENUM_TYPE,ELEMENT_TYPE> newRep,
int keyRepDelta)
Performs the bookkeeping associated with a representation change. |
abstract ARRAY_BASE_TYPE |
set(int idx,
ELEMENT_TYPE e)
Sets the array element at idx to the node. |
(package private) void |
updateCacheStats(boolean increment)
Updates the cache statistics associated with this representation. |
(package private) abstract void |
updateCacheStats(boolean increment,
Evictor evictor)
Update the cache statistics for this representation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final IN parent
Constructor Detail |
---|
public INArrayRep(IN parent)
Method Detail |
---|
public abstract REP_ENUM_TYPE getType()
public abstract ARRAY_BASE_TYPE set(int idx, ELEMENT_TYPE e)
idx
- the index to be sete
- the array elelement at the idx
public abstract ELEMENT_TYPE get(int idx)
public abstract int length()
public abstract ARRAY_BASE_TYPE copy(int from, int to, int n)
from
- the source (inclusive) of the copyto
- the target (inclusive) of the copyn
- the number of elements to be copied.
public abstract ARRAY_BASE_TYPE compact()
abstract long calculateMemorySize()
abstract void updateCacheStats(boolean increment, Evictor evictor)
increment
- true the stat should be incremented, false if it must
be decrementedevictor
- the evictor that shoulds ths stat countersupdateCacheStats(boolean)
final void updateCacheStats(boolean increment)
increment
- true if the stat is to be incremented, false if it is
to be decrementedpublic final void noteRepChange(INArrayRep<ARRAY_BASE_TYPE,REP_ENUM_TYPE,ELEMENT_TYPE> newRep, int keyRepDelta)
newRep
- the new representation that is replacing this one.keyRepDelta
- any further adjustments that must be made. This
parameter exists to allow for the fact that the key object overhead is
sometimes accounted for by the IN node itself, for example, in the
default representation.public final void noteRepChange(INArrayRep<ARRAY_BASE_TYPE,REP_ENUM_TYPE,ELEMENT_TYPE> newRep)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |