com.hazelcast.config

## Class EventJournalConfig

- java.lang.Object
- - com.hazelcast.config.EventJournalConfig

- All Implemented Interfaces:
    DataSerializable, IdentifiedDataSerializable

      public class EventJournalConfig
      extends Object
      implements IdentifiedDataSerializable

  Configuration for an event journal. The event journal keeps events related to a specific partition and data structure. For instance, it could keep map add, update, remove, merge events along with the key, old value, new value and so on. This configuration is not tied to a specific data structure and can be reused. NOTE This config is intended to be used with Hazelcast Jet and does not expose any features in Hazelcast IMDG.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_CAPACITY` Default value of capacity of the event journal.
    `static int` | `DEFAULT_TTL_SECONDS` Default value for the time to live property.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EventJournalConfig()`
    `EventJournalConfig(EventJournalConfig config)` Clones a `EventJournalConfig`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `String` | `getCacheName()` Returns the cache name to which this config applies.
    `int` | `getCapacity()` Gets the capacity of the event journal.
    `int` | `getFactoryId()` Returns DataSerializableFactory factory ID for this class.
    `int` | `getId()` Returns type identifier for this class.
    `String` | `getMapName()` Returns the map name to which this config applies.
    `int` | `getTimeToLiveSeconds()` Gets the time to live in seconds.
    `int` | `hashCode()`
    `boolean` | `isEnabled()` Returns if the event journal is enabled.
    `void` | `readData(ObjectDataInput in)` Reads fields from the input stream
    `EventJournalConfig` | `setCacheName(String cacheName)` Sets the cache name to which this config applies.
    `EventJournalConfig` | `setCapacity(int capacity)` Sets the capacity of the event journal.
    `EventJournalConfig` | `setEnabled(boolean enabled)` Enables or disables the event journal.
    `EventJournalConfig` | `setMapName(String mapName)` Sets the map name to which this config applies.
    `EventJournalConfig` | `setTimeToLiveSeconds(int timeToLiveSeconds)` Sets the time to live in seconds.
    `String` | `toString()`
    `void` | `writeData(ObjectDataOutput out)` Writes object fields to output stream

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

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

- - ### Field Detail

    - #### DEFAULT_CAPACITY

          public static final int DEFAULT_CAPACITY

      Default value of capacity of the event journal.
      See Also:
        Constant Field Values

    - #### DEFAULT_TTL_SECONDS

          public static final int DEFAULT_TTL_SECONDS

      Default value for the time to live property.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### EventJournalConfig

          public EventJournalConfig()

    - #### EventJournalConfig

          public EventJournalConfig(EventJournalConfig config)

      Clones a `EventJournalConfig`.
      Parameters:
        `config` - the event journal config to clone
      Throws:
        `NullPointerException` - if the config is null

  - ### Method Detail

    - #### getCapacity

          public int getCapacity()

      Gets the capacity of the event journal. The capacity is the total number of items that the event journal can hold at any moment. The actual number of items contained in the journal can be lower.

      NOTE The capacity is shared equally between all partitions. This is done by assigning each partition `getCapacity() / partitionCount` available slots in the event journal. Because of this, the effective total capacity may be somewhat lower and you must make sure that the configured capacity is at least greater than the partition count.

      Returns:
        the capacity.

    - #### setCapacity

          public EventJournalConfig setCapacity(int capacity)

      Sets the capacity of the event journal. The capacity is the total number of items that the event journal can hold at any moment. The actual number of items contained in the journal can be lower.

      NOTE The capacity is shared equally between all partitions. This is done by assigning each partition `getCapacity() / partitionCount` available slots in the event journal. Because of this, the effective total capacity may be somewhat lower and you must make sure that the configured capacity is at least greater than the partition count.

      Parameters:
        `capacity` - the capacity.
      Returns:
        the updated config.
      Throws:
        `IllegalArgumentException` - if capacity smaller than 1.
      See Also:
        `getCapacity()`

    - #### getTimeToLiveSeconds

          public int getTimeToLiveSeconds()

      Gets the time to live in seconds.
      Returns:
        the time to live in seconds. Returns 0 the time to live if the items don't expire.

    - #### setTimeToLiveSeconds

          public EventJournalConfig setTimeToLiveSeconds(int timeToLiveSeconds)

      Sets the time to live in seconds. Time to live is the time the event journal retains items before removing them from the journal. The events are removed on journal read and write actions, not while the journal is idle.

      Time to live can be disabled by setting timeToLiveSeconds to 0. This means that the events never expire but they can be overwritten when the capacity of the journal is exceeded.

      Parameters:
        `timeToLiveSeconds` - the time to live period in seconds
      Returns:
        the updated config
      Throws:
        `IllegalArgumentException` - if timeToLiveSeconds smaller than 0.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getMapName

          public String getMapName()

      Returns the map name to which this config applies.
      Returns:
        the map name

    - #### setMapName

          public EventJournalConfig setMapName(String mapName)

      Sets the map name to which this config applies. Map names are also matched by pattern and event journal with map name "default" applies to all maps that do not have more specific event journal configs.
      Parameters:
        `mapName` - the map name
      Returns:
        the event journal config

    - #### getCacheName

          public String getCacheName()

      Returns the cache name to which this config applies.
      Returns:
        the cache name

    - #### setCacheName

          public EventJournalConfig setCacheName(String cacheName)

      Sets the cache name to which this config applies. Cache names are also matched by pattern and event journal with cache name "default" applies to all caches that do not have more specific event journal configs.
      Parameters:
        `cacheName` - the cache name
      Returns:
        the event journal config

    - #### isEnabled

          public boolean isEnabled()

      Returns if the event journal is enabled.
      Returns:
        `true` if the event journal is enabled, `false` otherwise

    - #### setEnabled

          public EventJournalConfig setEnabled(boolean enabled)

      Enables or disables the event journal.
      Parameters:
        `enabled` - `true` if enabled, `false` otherwise.
      Returns:
        the updated config.

    - #### getFactoryId

          public int getFactoryId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns DataSerializableFactory factory ID for this class.
      Specified by:
        `getFactoryId` in interface `IdentifiedDataSerializable`
      Returns:
        factory ID

    - #### getId

          public int getId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns type identifier for this class. It should be unique per DataSerializableFactory.
      Specified by:
        `getId` in interface `IdentifiedDataSerializable`
      Returns:
        type ID

    - #### writeData

          public void writeData(ObjectDataOutput out)
                         throws IOException

      Description copied from interface: `DataSerializable`
      Writes object fields to output stream
      Specified by:
        `writeData` in interface `DataSerializable`
      Parameters:
        `out` - output
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the output stream has been closed.

    - #### readData

          public void readData(ObjectDataInput in)
                        throws IOException

      Description copied from interface: `DataSerializable`
      Reads fields from the input stream
      Specified by:
        `readData` in interface `DataSerializable`
      Parameters:
        `in` - input
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the input stream has been closed.

    - #### equals

          public final boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public final int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2019. All rights reserved.