public static class INKeyRep.MaxKeySize extends INKeyRep
INKeyRep.Default, INKeyRep.MaxKeySize, INKeyRep.Type
Modifier and Type | Field and Description |
---|---|
static byte |
DEFAULT_MAX_KEY_LENGTH |
static int |
MAX_KEYS |
Constructor and Description |
---|
INKeyRep.MaxKeySize(int nodeMaxEntries,
short maxKeySize) |
INKeyRep.MaxKeySize(SizeofMarker marker) |
Modifier and Type | Method and Description |
---|---|
boolean |
accountsForKeyByteMemUsage()
Returns true if the key bytes mem usage is accounted for internally
here, or false if each key has a separate byte array and its mem usage
is accounted for by the parent.
|
long |
calculateMemorySize()
Returns the current memory size of the underlying representation in
bytes.
|
INKeyRep |
compact(IN parent)
Chooses a more compact representation, if that's possible, otherwise
does nothing.
|
INKeyRep |
copy(int from,
int to,
int n,
IN parent)
Copies n elements at index denoted by "from" to the index denoted by
"to".
|
byte[] |
get(int idx)
Returns the element at idx.
|
INKeyRep.Type |
getType() |
int |
length() |
INKeyRep |
set(int idx,
byte[] key,
IN parent)
Sets the array element at idx to the node.
|
(package private) void |
updateCacheStats(boolean increment,
Evictor evictor)
Update the cache statistics for this representation.
|
noteRepChange, updateCacheStats
public static final byte DEFAULT_MAX_KEY_LENGTH
public static final int MAX_KEYS
public INKeyRep.MaxKeySize(int nodeMaxEntries, short maxKeySize)
public INKeyRep.MaxKeySize(SizeofMarker marker)
public INKeyRep.Type getType()
getType
in class INArrayRep<INKeyRep,INKeyRep.Type,byte[]>
public INKeyRep copy(int from, int to, int n, IN parent)
INArrayRep
copy
in class INArrayRep<INKeyRep,INKeyRep.Type,byte[]>
from
- the source (inclusive) of the copyto
- the target (inclusive) of the copyn
- the number of elements to be copied.public byte[] get(int idx)
INArrayRep
get
in class INArrayRep<INKeyRep,INKeyRep.Type,byte[]>
public INKeyRep set(int idx, byte[] key, IN parent)
INArrayRep
set
in class INArrayRep<INKeyRep,INKeyRep.Type,byte[]>
idx
- the index to be setkey
- the array elelement at the idxpublic long calculateMemorySize()
INArrayRep
calculateMemorySize
in class INArrayRep<INKeyRep,INKeyRep.Type,byte[]>
public boolean accountsForKeyByteMemUsage()
INKeyRep
accountsForKeyByteMemUsage
in class INKeyRep
public INKeyRep compact(IN parent)
INArrayRep
WARNING: This method must not change the memory size of the current representation and return 'this', without explicitly adjusting memory usage (via noteRepChange) before returning. Returning a new instance is the trigger for adjusting memory usage in the parent.
compact
in class INArrayRep<INKeyRep,INKeyRep.Type,byte[]>
void updateCacheStats(boolean increment, Evictor evictor)
INArrayRep
updateCacheStats
in class INArrayRep<INKeyRep,INKeyRep.Type,byte[]>
increment
- true the stat should be incremented, false if it must
be decrementedevictor
- the evictor that shoulds ths stat counters#updateCacheStats(boolean)
Copyright (c) 2004-2012 Oracle. All rights reserved.