org.apache.ignite.internal.processors.cache.persistence.metastorage

## Class MetastorageTree

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.persistence.DataStructure
  - - org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree<MetastorageSearchRow,MetastorageDataRow>
    - - org.apache.ignite.internal.processors.cache.persistence.metastorage.MetastorageTree

All Implemented Interfaces:
  PageLockListener, IgniteTree<MetastorageSearchRow,MetastorageDataRow>

    public class MetastorageTree
    extends BPlusTree<MetastorageSearchRow,MetastorageDataRow>

### Nested Class Summary

Nested Classes
`static class` `MetastorageTree.MetastorageInnerIO`
`static class` `MetastorageTree.MetastoreLeafIO`

### Nested classes/interfaces inherited from class org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree

`BPlusTree.Get, BPlusTree.Insert, BPlusTree.Invoke, BPlusTree.Put, BPlusTree.Replace, BPlusTree.Result, BPlusTree.Search, BPlusTree.TreeRowClosure<L,T extends L>, BPlusTree.TreeVisitorClosure<L,T extends L>`

### Nested classes/interfaces inherited from interface org.apache.ignite.internal.util.IgniteTree

`IgniteTree.InvokeClosure<T>, IgniteTree.OperationType`

### Field Summary

Fields
`static int` `MAX_KEY_LEN` Max key length (bytes num)

### Fields inherited from class org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree

`metaPageId, pageHndWrapper`

### Fields inherited from class org.apache.ignite.internal.processors.cache.persistence.DataStructure

`grpId, pageMem, reuseList, rnd, wal`

### Constructor Summary

Constructors
Constructor and Description
`MetastorageTree(int cacheId, PageMemory pageMem, IgniteWriteAheadLogManager wal, AtomicLong globalRmvId, ReuseList reuseList, MetastorageRowStore rowStore, long metaPageId, boolean initNew, FailureProcessor failureProcessor)`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected int` `compare(BPlusIO<MetastorageSearchRow> io, long pageAddr, int idx, MetastorageSearchRow row)`
`MetastorageDataRow` `getRow(BPlusIO<MetastorageSearchRow> io, long pageAddr, int idx, Object x)` Get data row.
`MetastorageRowStore` `rowStore()`

### Methods inherited from class org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree

`compare, destroy, destroy, find, find, find, findFirst, findFirst, findLast, findLast, findOne, findOne, findOne, getFirstPageIds, getLockRetries, getName, getRow, initTree, initTree, interruptAll, invoke, iterate, latestInnerIO, latestLeafIO, printTree, put, putx, remove, removex, rootLevel, setIos, size, size, toString, treeName, validateTree, visit`

### Methods inherited from class org.apache.ignite.internal.processors.cache.persistence.DataStructure

`acquirePage, allocatePage, allocatePage, allocatePageNoReuse, groupId, init, needWalDeltaRecord, onBeforeReadLock, onBeforeWriteLock, onReadLock, onReadUnlock, onWriteLock, onWriteUnlock, pageSize, randomInt, read, read, readLock, readUnlock, recyclePage, releasePage, tryWriteLock, write, write, write, write, writeLock, writeUnlock, writeUnlock`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### MAX_KEY_LEN

    public static final int MAX_KEY_LEN

Max key length (bytes num)

See Also:
  Constant Field Values

### Constructor Detail

#### MetastorageTree

    public MetastorageTree(int cacheId,
                           PageMemory pageMem,
                           IgniteWriteAheadLogManager wal,
                           AtomicLong globalRmvId,
                           ReuseList reuseList,
                           MetastorageRowStore rowStore,
                           long metaPageId,
                           boolean initNew,
                           @Nullable
                           FailureProcessor failureProcessor)
                    throws IgniteCheckedException

Parameters:
  `pageMem` - Page memory instance.
  `wal` - WAL manager.
  `globalRmvId` - Global remove ID.
  `metaPageId` - Meta page ID.
  `reuseList` - Reuse list.
  `rowStore` - Row store.
  `initNew` - Init new flag, if `true`, then new tree will be allocated.
  `failureProcessor` - To call if the tree is corrupted.
Throws:
  `IgniteCheckedException` - If failed to initialize.

### Method Detail

#### compare

    protected int compare(BPlusIO<MetastorageSearchRow> io,
                          long pageAddr,
                          int idx,
                          MetastorageSearchRow row)

Specified by:
  `compare` in class `BPlusTree<MetastorageSearchRow,MetastorageDataRow>`
Parameters:
  `io` - IO.
  `pageAddr` - Page address.
  `idx` - Index of row in the given buffer.
  `row` - Lookup row.
Returns:
  Comparison result as in `Comparator.compare(Object, Object)`.

#### getRow

    public MetastorageDataRow getRow(BPlusIO<MetastorageSearchRow> io,
                                     long pageAddr,
                                     int idx,
                                     Object x)
                              throws IgniteCheckedException

Get data row. Can be called on inner page only if `BPlusTree.canGetRowFromInner` is `true`.

Specified by:
  `getRow` in class `BPlusTree<MetastorageSearchRow,MetastorageDataRow>`
Parameters:
  `io` - IO.
  `pageAddr` - Page address.
  `idx` - Index.
  `x` - Implementation specific argument, `null` always means that we need to return full detached data row.
Returns:
  Data row.
Throws:
  `IgniteCheckedException` - If failed.

#### rowStore

    public MetastorageRowStore rowStore()

Returns:
  RowStore.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.5
Release Date | : June 4 2019