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

## Class MetaStorage

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

All Implemented Interfaces:
  DbCheckpointListener, ReadOnlyMetastorage, ReadWriteMetastorage

    public class MetaStorage
    extends Object
    implements DbCheckpointListener, ReadOnlyMetastorage, ReadWriteMetastorage

General purpose key-value local-only storage.

### Nested Class Summary

Nested Classes
`static class` `MetaStorage.FreeListImpl`

### Nested classes/interfaces inherited from interface org.apache.ignite.internal.processors.cache.persistence.DbCheckpointListener

`DbCheckpointListener.Context`

### Field Summary

Fields
`static int` `METASTORAGE_CACHE_ID`
`static String` `METASTORAGE_CACHE_NAME`

### Constructor Summary

Constructors
Constructor and Description
`MetaStorage(IgniteWriteAheadLogManager wal, DataRegion memPlc, DataRegionMetricsImpl memMetrics)`
`MetaStorage(IgniteWriteAheadLogManager wal, DataRegion dataRegion, DataRegionMetricsImpl regionMetrics, boolean readOnly)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `applyUpdate(String key, byte[] value)`
`byte[]` `getData(String key)`
`void` `init(IgniteCacheDatabaseSharedManager db)`
`void` `onCheckpointBegin(DbCheckpointListener.Context ctx)`
`PageMemory` `pageMemory()`
`void` `putData(String key, byte[] data)`
`Serializable` `read(String key)`
`Map<String,Serializable>` `readForPredicate(IgnitePredicate<String> keyPred)` Read all keys matching provided predicate.
`void` `remove(String key)`
`void` `removeData(String key)`
`void` `write(String key, Serializable val)`

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

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

### Field Detail

#### METASTORAGE_CACHE_NAME

    public static final String METASTORAGE_CACHE_NAME

See Also:
  Constant Field Values

#### METASTORAGE_CACHE_ID

    public static final int METASTORAGE_CACHE_ID

### Constructor Detail

#### MetaStorage

    public MetaStorage(IgniteWriteAheadLogManager wal,
                       DataRegion dataRegion,
                       DataRegionMetricsImpl regionMetrics,
                       boolean readOnly)

#### MetaStorage

    public MetaStorage(IgniteWriteAheadLogManager wal,
                       DataRegion memPlc,
                       DataRegionMetricsImpl memMetrics)

### Method Detail

#### init

    public void init(IgniteCacheDatabaseSharedManager db)
              throws IgniteCheckedException

Throws:
  `IgniteCheckedException`

#### read

    public Serializable read(String key)
                      throws IgniteCheckedException

Specified by:
  `read` in interface `ReadOnlyMetastorage`
Throws:
  `IgniteCheckedException`

#### readForPredicate

    public Map<String,Serializable> readForPredicate(IgnitePredicate<String> keyPred)
                                              throws IgniteCheckedException

Read all keys matching provided predicate.

Specified by:
  `readForPredicate` in interface `ReadOnlyMetastorage`
Parameters:
  `keyPred` - Key predicate.
Returns:
  Matched key-value pairs.
Throws:
  `IgniteCheckedException` - If failed.

#### write

    public void write(@NotNull
                      String key,
                      @NotNull
                      Serializable val)
               throws IgniteCheckedException

Specified by:
  `write` in interface `ReadWriteMetastorage`
Throws:
  `IgniteCheckedException`

#### remove

    public void remove(@NotNull
                       String key)
                throws IgniteCheckedException

Specified by:
  `remove` in interface `ReadWriteMetastorage`
Throws:
  `IgniteCheckedException`

#### putData

    public void putData(String key,
                        byte[] data)
                 throws IgniteCheckedException

Throws:
  `IgniteCheckedException`

#### getData

    public byte[] getData(String key)
                   throws IgniteCheckedException

Throws:
  `IgniteCheckedException`

#### removeData

    public void removeData(String key)
                    throws IgniteCheckedException

Throws:
  `IgniteCheckedException`

#### pageMemory

    public PageMemory pageMemory()

Returns:
  Page memory.

#### onCheckpointBegin

    public void onCheckpointBegin(DbCheckpointListener.Context ctx)
                           throws IgniteCheckedException

Specified by:
  `onCheckpointBegin` in interface `DbCheckpointListener`
Throws:
  `IgniteCheckedException` - If failed.

#### applyUpdate

    public void applyUpdate(String key,
                            byte[] value)
                     throws IgniteCheckedException

Throws:
  `IgniteCheckedException`

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.4.0
Release Date | : March 5 2018