Package org.h2.mvstore
Class Chunk<C extends Chunk<C>>
java.lang.Object
org.h2.mvstore.Chunk<C>
- Direct Known Subclasses:
SFChunk
A chunk of data, containing one or multiple pages.
Minimum chunk size is usually 4096 bytes, and it grows in those fixed increments (blocks). Chunk's length and it's position in the underlying filestore are multiples of that increment (block size), therefore they both are measured in blocks, instead of bytes. There are at most 67 million (2^26) chunks, and each chunk is at most 2 GB large.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionlongThe start block number within the file.ByteBuffer holding this Chunk's serialized content before it gets saved to file store.final intThe chunk id.intThe length in number of blocks.intThe last used map id.static final intThe maximum chunk id.longThe sum of the max length of all pages.longThe sum of the length of all pages that are still alive.longThe predicted position of the next chunk.longWhen this chunk was created, in milliseconds since the store was created.longWhen this chunk was no longer needed, in milliseconds after the store was created.longThe version stored in this chunk. -
Method Summary
Modifier and TypeMethodDescriptionfinal StringasString()Get the chunk metadata as a string to be stored in a layout map.protected voiddump(StringBuilder buff) booleaninthashCode()protected abstract ByteBuffertoString()
-
Field Details
-
MAX_ID
public static final int MAX_IDThe maximum chunk id.- See Also:
-
id
public final int idThe chunk id. -
block
public volatile long blockThe start block number within the file. -
len
public int lenThe length in number of blocks. -
maxLen
public long maxLenThe sum of the max length of all pages. -
maxLenLive
public long maxLenLiveThe sum of the length of all pages that are still alive. -
version
public long versionThe version stored in this chunk. -
time
public long timeWhen this chunk was created, in milliseconds since the store was created. -
unused
public long unusedWhen this chunk was no longer needed, in milliseconds after the store was created. After this, the chunk is kept alive a bit longer (in case it is referenced in older versions). -
mapId
public int mapIdThe last used map id. -
next
public long nextThe predicted position of the next chunk. -
buffer
ByteBuffer holding this Chunk's serialized content before it gets saved to file store. This allows to release pages of this Chunk earlier, allowing them to be garbage collected.
-
-
Method Details