Top Description Inners Fields Constructors Methods
org.h2.mvstore.tx

pack-priv final Class Record<K, V>

extends Object
Class Inheritance
Imports
java.nio.ByteBuffer, org.h2.engine.Constants, org.h2.mvstore.DataUtils, .MVMap, .WriteBuffer, org.h2.mvstore.type.BasicDataType, org.h2.value.VersionedValue

Class Record is a value for undoLog. It contains information about a single change of some map.
Author
Andrei Tokar

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
Record.Type<K, V>

A data type for undo log values

Field Summary

Modifier and TypeField and Description
pack-priv static final Record<?, ?>
pack-priv final K
key

Key of the changed map entry key

pack-priv final int
mapId

Map id for this change is related to

pack-priv final VersionedValue<V>
oldValue

Value of the entry before change.

Constructor Summary

AccessConstructor and Description
pack-priv
Record(int mapId, K key, VersionedValue<V> oldValue)

Method Summary

Modifier and TypeMethod and Description
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

COMMIT_MARKERback to summary
pack-priv static final Record<?, ?> COMMIT_MARKER
keyback to summary
pack-priv final K key

Key of the changed map entry key

mapIdback to summary
pack-priv final int mapId

Map id for this change is related to

oldValueback to summary
pack-priv final VersionedValue<V> oldValue

Value of the entry before change. It is null if entry did not exist before the change (addition).

Constructor Detail

Recordback to summary
pack-priv Record(int mapId, K key, VersionedValue<V> oldValue)

Method Detail

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
org.h2.mvstore.tx back to summary

pack-priv final Class Record.Type<K, V>

extends BasicDataType<Record<K, V>>
Class Inheritance

A data type for undo log values

Field Summary

Modifier and TypeField and Description
private final TransactionStore

Constructor Summary

AccessConstructor and Description
pack-priv
Type(TransactionStore transactionStore)

Method Summary

Modifier and TypeMethod and Description
public int
compare(Record<K, V>
the first key
aObj
,
Record<K, V>
the second key
bObj
)

Overrides org.h2.mvstore.type.BasicDataType.compare.

Implements org.h2.mvstore.type.DataType.compare.

Compare two keys.

public Record<K, V>[]
createStorage(int
number of values to hold
size
)

Implements org.h2.mvstore.type.DataType.createStorage.

Create storage object of array type to hold values

public int
getMemory(Record<K, V>
the object
record
)

Implements abstract org.h2.mvstore.type.BasicDataType.getMemory.

Implements org.h2.mvstore.type.DataType.getMemory.

Calculates the amount of used memory in bytes.

public Record<K, V>
read(ByteBuffer
the source buffer
buff
)

Implements abstract org.h2.mvstore.type.BasicDataType.read.

Implements org.h2.mvstore.type.DataType.read.

Read an object.

public void
write(WriteBuffer
the target buffer
buff
,
Record<K, V>
the value
record
)

Implements abstract org.h2.mvstore.type.BasicDataType.write.

Implements org.h2.mvstore.type.DataType.write.

Write an object.

Inherited from org.h2.mvstore.type.BasicDataType:
binarySearchcastequalshashCodeisMemoryEstimationAllowedreadwrite

Field Detail

transactionStoreback to summary
private final TransactionStore transactionStore

Constructor Detail

Typeback to summary
pack-priv Type(TransactionStore transactionStore)

Method Detail

compareback to summary
public int compare(Record<K, V> aObj, Record<K, V> bObj)

Overrides org.h2.mvstore.type.BasicDataType.compare.

Implements org.h2.mvstore.type.DataType.compare.

Doc from org.h2.mvstore.type.DataType.compare.

Compare two keys.

Parameters
aObj:Record<K, V>

the first key

bObj:Record<K, V>

the second key

Returns:int

-1 if the first key is smaller, 1 if larger, and 0 if equal

Annotations
@Override
createStorageback to summary
public Record<K, V>[] createStorage(int size)

Implements org.h2.mvstore.type.DataType.createStorage.

Doc from org.h2.mvstore.type.DataType.createStorage.

Create storage object of array type to hold values

Parameters
size:int

number of values to hold

Returns:Record<K, V>[]

storage object

Annotations
@SuppressWarnings:unchecked
@Override
getMemoryback to summary
public int getMemory(Record<K, V> record)

Implements abstract org.h2.mvstore.type.BasicDataType.getMemory.

Implements org.h2.mvstore.type.DataType.getMemory.

Doc from org.h2.mvstore.type.DataType.getMemory.

Calculates the amount of used memory in bytes.

Parameters
record:Record<K, V>

the object

Returns:int

the used memory

Annotations
@Override
readback to summary
public Record<K, V> read(ByteBuffer buff)

Implements abstract org.h2.mvstore.type.BasicDataType.read.

Implements org.h2.mvstore.type.DataType.read.

Doc from org.h2.mvstore.type.DataType.read.

Read an object.

Parameters
buff:ByteBuffer

the source buffer

Returns:Record<K, V>

the object

Annotations
@SuppressWarnings:unchecked
@Override
writeback to summary
public void write(WriteBuffer buff, Record<K, V> record)

Implements abstract org.h2.mvstore.type.BasicDataType.write.

Implements org.h2.mvstore.type.DataType.write.

Doc from org.h2.mvstore.type.DataType.write.

Write an object.

Parameters
buff:WriteBuffer

the target buffer

record:Record<K, V>

the value

Annotations
@Override