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

## Class MetadataStorage

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.persistence.MetadataStorage

All Implemented Interfaces:
  MetaStore

    public class MetadataStorage
    extends Object
    implements MetaStore

Metadata storage.

### Nested Class Summary

Nested Classes
`static class` `MetadataStorage.MetaStoreInnerIO`
`static class` `MetadataStorage.MetaStoreLeafIO`

### Field Summary

Fields
`static int` `MAX_IDX_NAME_LEN` Max index name length (bytes num)

### Constructor Summary

Constructors
Constructor and Description
`MetadataStorage(PageMemory pageMem, IgniteWriteAheadLogManager wal, AtomicLong globalRmvId, int grpId, int allocPartId, byte allocSpace, ReuseList reuseList, long rootPageId, boolean initNew)`

### Method Summary

Methods
`void` `destroy()` Destroy this meta store.
`RootPage` `dropRootPage(String idxName)` Deallocate index page and remove from tree.
`RootPage` `getOrAllocateForTree(String idxName)` Get or allocate initial page for an index.

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

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

### Field Detail

#### MAX_IDX_NAME_LEN

    public static final int MAX_IDX_NAME_LEN

Max index name length (bytes num)

See Also:
  Constant Field Values

### Constructor Detail

#### MetadataStorage

    public MetadataStorage(PageMemory pageMem,
                   IgniteWriteAheadLogManager wal,
                   AtomicLong globalRmvId,
                   int grpId,
                   int allocPartId,
                   byte allocSpace,
                   ReuseList reuseList,
                   long rootPageId,
                   boolean initNew)

Parameters:
  `pageMem` - Page memory.
  `wal` - Write ahead log manager.

### Method Detail

#### getOrAllocateForTree

    public RootPage getOrAllocateForTree(String idxName)
                                  throws IgniteCheckedException

Get or allocate initial page for an index.

Specified by:
  `getOrAllocateForTree` in interface `MetaStore`
Parameters:
  `idxName` - Index name.
Returns:
  `RootPage` that keeps pageId, allocated flag that shows whether the page was newly allocated, and rootId that is counter which increments each time new page allocated.
Throws:
  `IgniteCheckedException` - If failed.

#### dropRootPage

    public RootPage dropRootPage(String idxName)
                          throws IgniteCheckedException

Deallocate index page and remove from tree.

Specified by:
  `dropRootPage` in interface `MetaStore`
Parameters:
  `idxName` - Index name.
Returns:
  Root ID or -1 if no page was removed.
Throws:
  `IgniteCheckedException` - If failed.

#### destroy

    public void destroy()
                 throws IgniteCheckedException

Destroy this meta store.

Specified by:
  `destroy` in interface `MetaStore`
Throws:
  `IgniteCheckedException` - If failed.

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.2.0
Release Date | : September 15 2017