public class PNCounterConfig extends Object implements IdentifiedDataSerializable, NamedConfig
PNCounter
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_REPLICA_COUNT
The default number of replicas on which state for this CRDT is kept
|
static boolean |
DEFAULT_STATISTICS_ENABLED
Default value for statistics enabled.
|
Constructor and Description |
---|
PNCounterConfig() |
PNCounterConfig(PNCounterConfig config) |
PNCounterConfig(String name) |
PNCounterConfig(String name,
int replicaCount,
String splitBrainProtectionName,
boolean statisticsEnabled) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
getClassId()
Returns type identifier for this class.
|
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
String |
getName()
Gets the name of the PN counter.
|
int |
getReplicaCount()
Returns the number of replicas on which state for this PN counter will
be kept.
|
String |
getSplitBrainProtectionName()
Returns the split brain protection name for operations.
|
int |
hashCode() |
boolean |
isStatisticsEnabled()
Checks if statistics are enabled for this PN counter
|
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
PNCounterConfig |
setName(String name)
Sets the name of the PN counter.
|
PNCounterConfig |
setReplicaCount(int replicaCount)
Sets the number of replicas on which state for this PN counter will
be kept.
|
PNCounterConfig |
setSplitBrainProtectionName(String splitBrainProtectionName)
Sets the split brain protection name for operations.
|
PNCounterConfig |
setStatisticsEnabled(boolean statisticsEnabled)
Enables or disables statistics for this PN counter
|
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public static final int DEFAULT_REPLICA_COUNT
public static final boolean DEFAULT_STATISTICS_ENABLED
public PNCounterConfig()
public PNCounterConfig(String name, int replicaCount, String splitBrainProtectionName, boolean statisticsEnabled)
public PNCounterConfig(String name)
public PNCounterConfig(PNCounterConfig config)
public String getName()
getName
in interface NamedConfig
public PNCounterConfig setName(String name)
setName
in interface NamedConfig
name
- the name of the PN counterpublic boolean isStatisticsEnabled()
true
if enabled, false
otherwisepublic PNCounterConfig setStatisticsEnabled(boolean statisticsEnabled)
statisticsEnabled
- true
to enable statistics, false
to disablepublic int getReplicaCount()
public PNCounterConfig setReplicaCount(int replicaCount)
The provided replicaCount
must be between 1 and
.
replicaCount
- the number of replicas for the CRDT stateInvalidConfigurationException
- if the replicaCount
is less than 1public String getSplitBrainProtectionName()
public PNCounterConfig setSplitBrainProtectionName(String splitBrainProtectionName)
splitBrainProtectionName
- the split brain protection namepublic 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.