public class EventJournalConfig extends Object implements IdentifiedDataSerializable
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 and Description |
---|
EventJournalConfig() |
EventJournalConfig(EventJournalConfig config)
Clones a
EventJournalConfig . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
getCapacity()
Gets the capacity of the event journal.
|
int |
getClassId()
Returns type identifier for this class.
|
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
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 |
setCapacity(int capacity)
Sets the capacity of the event journal.
|
EventJournalConfig |
setEnabled(boolean enabled)
Enables or disables the event journal.
|
EventJournalConfig |
setTimeToLiveSeconds(int timeToLiveSeconds)
Sets the time to live in seconds.
|
String |
toString() |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public static final int DEFAULT_CAPACITY
public static final int DEFAULT_TTL_SECONDS
public EventJournalConfig()
public EventJournalConfig(EventJournalConfig config)
EventJournalConfig
.config
- the event journal config to cloneNullPointerException
- if the config is nullpublic int getCapacity()
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.
public EventJournalConfig setCapacity(int capacity)
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.
capacity
- the capacity.IllegalArgumentException
- if capacity smaller than 1.getCapacity()
public int getTimeToLiveSeconds()
public EventJournalConfig setTimeToLiveSeconds(int timeToLiveSeconds)
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.
timeToLiveSeconds
- the time to live period in secondsIllegalArgumentException
- if timeToLiveSeconds smaller than 0.public boolean isEnabled()
true
if the event journal is enabled, false
otherwisepublic EventJournalConfig setEnabled(boolean enabled)
enabled
- true
if enabled, false
otherwise.public int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getClassId()
IdentifiedDataSerializable
getClassId
in interface IdentifiedDataSerializable
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- outputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
output stream has been closed.public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
input stream has been closed.Copyright © 2020 Hazelcast, Inc.. All rights reserved.