org.apache.ignite.internal.pagemem.wal

## Interface IgniteWriteAheadLogManager

All Superinterfaces:
  GridCacheSharedManager, IgniteChangeGlobalStateSupport

    public interface IgniteWriteAheadLogManager
    extends GridCacheSharedManager, IgniteChangeGlobalStateSupport

### Method Summary

Methods
`void` `fsync(WALPointer ptr)` Makes sure that all log entries written to the log up until the specified pointer are actually persisted to the underlying storage.
`boolean` `isAlwaysWriteFullPages()`
`boolean` `isFullSync()`
`WALPointer` `log(WALRecord entry)` Appends the given log entry to the write-ahead log.
`WALIterator` `replay(WALPointer start)` Invoke this method to iterate over the written log entries.
`void` `resumeLogging(WALPointer lastWrittenPtr)` Resumes logging after start.
`int` `truncate(WALPointer ptr)` Gives a hint to WAL manager to clear entries logged before the given pointer.

### Methods inherited from interface org.apache.ignite.internal.processors.cache.GridCacheSharedManager

`onDisconnected, onKernalStart, onKernalStop, printMemoryStats, start, stop`

### Methods inherited from interface org.apache.ignite.internal.processors.cluster.IgniteChangeGlobalStateSupport

`onActivate, onDeActivate`

### Method Detail

#### isAlwaysWriteFullPages

    boolean isAlwaysWriteFullPages()

Returns:
  `true` If we have to always write full pages.

#### isFullSync

    boolean isFullSync()

Returns:
  `true` if WAL will perform fair syncs on fsync call.

#### resumeLogging

    void resumeLogging(WALPointer lastWrittenPtr)
                       throws IgniteCheckedException

Resumes logging after start. When WAL manager is started, it will skip logging any updates until this method is called to avoid logging changes induced by the state restore procedure.

Throws:
  `IgniteCheckedException`

#### log

    WALPointer log(WALRecord entry)
                   throws IgniteCheckedException,
                          StorageException

Appends the given log entry to the write-ahead log.

Parameters:
  `entry` - entry to log.
Returns:
  WALPointer that may be passed to `fsync(WALPointer)` method to make sure the record is written to the log.
Throws:
  `IgniteCheckedException` - If failed to construct log entry.
  `StorageException` - If IO error occurred while writing log entry.

#### fsync

    void fsync(WALPointer ptr)
               throws IgniteCheckedException,
                      StorageException

Makes sure that all log entries written to the log up until the specified pointer are actually persisted to the underlying storage.

Parameters:
  `ptr` - Optional pointer to sync. If `null`, will sync up to the latest record.
Throws:
  `IgniteCheckedException` - If
  `StorageException`

#### replay

    WALIterator replay(WALPointer start)
                       throws IgniteCheckedException,
                              StorageException

Invoke this method to iterate over the written log entries.

Parameters:
  `start` - Optional WAL pointer from which to start iteration.
Returns:
  Records iterator.
Throws:
  `IgniteException` - If failed to start iteration.
  `StorageException` - If IO error occurred while reading WAL entries.
  `IgniteCheckedException`

#### truncate

    int truncate(WALPointer ptr)

Gives a hint to WAL manager to clear entries logged before the given pointer. Some entries before the the given pointer will be kept because there is a configurable WAL history size. Those entries may be used for partial partition rebalancing.

Parameters:
  `ptr` - Pointer for which it is safe to clear the log.
Returns:
  Number of deleted WAL segments.

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.0.0
Release Date | : April 30 2017