org.h2.store
Class PageStreamTrunk

java.lang.Object
  extended by org.h2.util.CacheObject
      extended by org.h2.store.Page
          extended by org.h2.store.PageStreamTrunk
All Implemented Interfaces:
java.lang.Comparable<CacheObject>

public class PageStreamTrunk
extends Page

A trunk page of a stream. It contains the page numbers of the stream, and the page number of the next trunk. The format is:


Field Summary
 
Fields inherited from class org.h2.store.Page
changeCount, FLAG_LAST, TYPE_BTREE_LEAF, TYPE_BTREE_NODE, TYPE_DATA_LEAF, TYPE_DATA_NODE, TYPE_DATA_OVERFLOW, TYPE_EMPTY, TYPE_FREE_LIST, TYPE_STREAM_DATA, TYPE_STREAM_TRUNK
 
Fields inherited from class org.h2.util.CacheObject
cacheChained, cacheNext, cachePrevious
 
Method Summary
 boolean canMove()
          If this page can be moved.
 boolean canRemove()
          Check if the object can be removed from the cache.
 int getMemory()
          Get the estimated memory size.
 int getNextTrunk()
           
 void moveTo(Session session, int newPos)
          Copy the data to a new location, change the parent to point to the new location, and free up the current page.
 java.lang.String toString()
           
 void write()
          Write the page.
 
Methods inherited from class org.h2.store.Page
add, insert, insert, insert, remove, remove, remove
 
Methods inherited from class org.h2.util.CacheObject
compareTo, getPos, isChanged, setChanged, setPos
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

write

public void write()
Description copied from class: Page
Write the page.

Specified by:
write in class Page

getMemory

public int getMemory()
Get the estimated memory size.

Specified by:
getMemory in class CacheObject
Returns:
number of double words (4 bytes)

moveTo

public void moveTo(Session session,
                   int newPos)
Description copied from class: Page
Copy the data to a new location, change the parent to point to the new location, and free up the current page.

Specified by:
moveTo in class Page
Parameters:
session - the session
newPos - the new position

getNextTrunk

public int getNextTrunk()

canRemove

public boolean canRemove()
Description copied from class: CacheObject
Check if the object can be removed from the cache. For example pinned objects can not be removed.

Specified by:
canRemove in class CacheObject
Returns:
true if it can be removed

toString

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

canMove

public boolean canMove()
Description copied from class: Page
If this page can be moved. Transaction log and free-list pages can not.

Overrides:
canMove in class Page
Returns:
true if moving is allowed