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

## Class IndexStorageImpl

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

All Implemented Interfaces:
  IndexStorage

    public class IndexStorageImpl
    extends Object
    implements IndexStorage

Metadata storage.

### Nested Class Summary

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

### Field Summary

Fields
`static int` `MAX_IDX_NAME_LEN` Max index name length (bytes num)
`static int` `RESERVED_IDX_NAME_LEN` Reserved size for index name.

### Constructor Summary

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

### Method Summary

All Methods Instance Methods Concrete 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

#### RESERVED_IDX_NAME_LEN

    public static final int RESERVED_IDX_NAME_LEN

Reserved size for index name. Needed for backward compatibility.

See Also:
  Constant Field Values

### Constructor Detail

#### IndexStorageImpl

    public IndexStorageImpl(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 `IndexStorage`
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 `IndexStorage`
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 `IndexStorage`
Throws:
  `IgniteCheckedException` - If failed.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.5.0
Release Date | : May 23 2018