org.h2.mvstore
Class Chunk

java.lang.Object
  extended by org.h2.mvstore.Chunk

public class Chunk
extends java.lang.Object

A chunk of data, containing one or multiple pages.

Chunks are page aligned (each page is usually 4096 bytes). There are at most 67 million (2^26) chunks, each chunk is at most 2 GB large. File format: 1 byte: 'c' 4 bytes: length 4 bytes: chunk id (an incrementing number) 4 bytes: pageCount 8 bytes: metaRootPos 8 bytes: maxLengthLive [ Page ] *


Field Summary
 int collectPriority
          The garbage collection priority.
 int id
          The chunk id.
 int length
          The length in bytes.
 long maxLength
          The sum of the max length of all pages.
 long maxLengthLive
          The sum of the max length of all pages that are in use.
 long metaRootPos
          The position of the meta root.
 int pageCount
          The total number of pages in this chunk.
 int pageCountLive
          The number of pages still alive.
 long start
          The start position within the file.
 long time
          When this chunk was created, in milliseconds after the store was created.
 long version
          The version stored in this chunk.
 
Method Summary
 java.lang.String asString()
          Get the chunk data as a string.
 boolean equals(java.lang.Object o)
           
static Chunk fromString(java.lang.String s)
          Build a block from the given string.
 int getFillRate()
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

id

public final int id
The chunk id.


start

public long start
The start position within the file.


length

public int length
The length in bytes.


pageCount

public int pageCount
The total number of pages in this chunk.


pageCountLive

public int pageCountLive
The number of pages still alive.


maxLength

public long maxLength
The sum of the max length of all pages.


maxLengthLive

public long maxLengthLive
The sum of the max length of all pages that are in use.


collectPriority

public int collectPriority
The garbage collection priority.


metaRootPos

public long metaRootPos
The position of the meta root.


version

public long version
The version stored in this chunk.


time

public long time
When this chunk was created, in milliseconds after the store was created.

Method Detail

fromString

public static Chunk fromString(java.lang.String s)
Build a block from the given string.

Parameters:
s - the string
Returns:
the block

getFillRate

public int getFillRate()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

asString

public java.lang.String asString()
Get the chunk data as a string.

Returns:
the string

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object