public abstract class Chunk<C extends Chunk<C>>
extends java.lang.Object
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
Chunk.PositionComparator<C extends Chunk<C>> |
| Modifier and Type | Field and Description |
|---|---|
long |
block
The start block number within the file.
|
java.nio.ByteBuffer |
buffer
ByteBuffer holding this Chunk's serialized content before it gets saved to file store.
|
int |
id
The chunk id.
|
int |
len
The length in number of blocks.
|
int |
mapId
The last used map id.
|
static int |
MAX_ID
The maximum chunk id.
|
long |
maxLen
The sum of the max length of all pages.
|
long |
maxLenLive
The sum of the length of all pages that are still alive.
|
long |
next
The predicted position of the next chunk.
|
long |
time
When this chunk was created, in milliseconds since the store was created.
|
long |
unused
When this chunk was no longer needed, in milliseconds after the store was
created.
|
long |
version
The version stored in this chunk.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
asString()
Get the chunk metadata as a string to be stored in a layout map.
|
protected void |
dump(java.lang.StringBuilder buff) |
boolean |
equals(java.lang.Object o) |
java.lang.String |
getHeader() |
int |
hashCode() |
protected abstract java.nio.ByteBuffer |
readFully(FileStore<C> fileStore,
long filePos,
int length) |
java.lang.String |
toString() |
public static final int MAX_ID
public final int id
public volatile long block
public int len
public long maxLen
public long maxLenLive
public long version
public long time
public long unused
public int mapId
public long next
public volatile java.nio.ByteBuffer buffer
protected abstract java.nio.ByteBuffer readFully(FileStore<C> fileStore, long filePos, int length)
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic final java.lang.String asString()
protected void dump(java.lang.StringBuilder buff)
public java.lang.String getHeader()
public java.lang.String toString()
toString in class java.lang.Object