public class ReliableIdGeneratorConfig extends Object implements IdentifiedDataSerializable
ReliableIdGeneratorConfig contains the configuration for the member
regarding Reliable ID Generator.
Settings here only apply when ID generator is used from member, not when clients
connect to this member to generate IDs - each client has its own settings in ClientConfig.
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PREFETCH_COUNT
Default value for
getPrefetchCount(). |
static long |
DEFAULT_PREFETCH_VALIDITY_MILLIS
Default value for
getPrefetchValidityMillis(). |
| Constructor and Description |
|---|
ReliableIdGeneratorConfig(ReliableIdGeneratorConfig other)
Copy-constructor
|
ReliableIdGeneratorConfig(String name) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
ReliableIdGeneratorConfigReadOnly |
getAsReadOnly()
Deprecated.
this method will be removed in 4.0; it is meant for internal usage only
|
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
int |
getId()
Returns type identifier for this class.
|
String |
getName()
Returns the configuration name.
|
int |
getPrefetchCount() |
long |
getPrefetchValidityMillis() |
int |
hashCode() |
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
void |
setName(String name)
Sets the name or name pattern for this config.
|
ReliableIdGeneratorConfig |
setPrefetchCount(int prefetchCount)
How many IDs are pre-fetched on the background when one call to
ReliableIdGenerator.newId() is made. |
ReliableIdGeneratorConfig |
setPrefetchValidityMillis(long prefetchValidityMs)
For how long the pre-fetched IDs can be used.
|
String |
toString() |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public static final int DEFAULT_PREFETCH_COUNT
getPrefetchCount().public static final long DEFAULT_PREFETCH_VALIDITY_MILLIS
getPrefetchValidityMillis().public ReliableIdGeneratorConfig(String name)
public ReliableIdGeneratorConfig(ReliableIdGeneratorConfig other)
public ReliableIdGeneratorConfigReadOnly getAsReadOnly()
public String getName()
public void setName(String name)
Config.public int getPrefetchCount()
setPrefetchCount(int)public ReliableIdGeneratorConfig setPrefetchCount(int prefetchCount)
ReliableIdGenerator.newId() is made.
Value must be >= 1, default is 100.
public long getPrefetchValidityMillis()
setPrefetchValidityMillis(long)public ReliableIdGeneratorConfig setPrefetchValidityMillis(long prefetchValidityMs)
Time unit is milliseconds.
If value is <= 0, validity is unlimited. Default value is 600,000 (10 minutes).
The IDs contain timestamp component, which ensures rough global ordering of IDs. If an ID is assigned to an event that occurred much later, it will be much out of order. If you don't need ordering, set this value to 0.
public int getFactoryId()
IdentifiedDataSerializablegetFactoryId in interface IdentifiedDataSerializablepublic int getId()
IdentifiedDataSerializablegetId in interface IdentifiedDataSerializablepublic void writeData(ObjectDataOutput out) throws IOException
DataSerializablewriteData in interface DataSerializableout - 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
DataSerializablereadData in interface DataSerializablein - inputIOException - if an I/O error occurs. In particular,
an IOException may be thrown if the
input stream has been closed.Copyright © 2018. All Rights Reserved.