@Beta public class PNCounterConfig extends Object implements IdentifiedDataSerializable
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 quorumName,
boolean statisticsEnabled) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
int |
getId()
Returns type identifier for this class.
|
String |
getName()
Gets the name of the PN counter.
|
String |
getQuorumName()
Returns the quorum name for operations.
|
int |
getReplicaCount()
Returns the number of replicas on which state for this PN counter will
be kept.
|
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 |
setQuorumName(String quorumName)
Sets the quorum name for operations.
|
PNCounterConfig |
setReplicaCount(int replicaCount)
Sets the number of replicas on which state for this PN counter will
be kept.
|
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 quorumName, boolean statisticsEnabled)
public PNCounterConfig(String name)
public PNCounterConfig(PNCounterConfig config)
public String getName()
public PNCounterConfig setName(String name)
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 stateConfigurationException - if the replicaCount is less than 1public String getQuorumName()
public PNCounterConfig setQuorumName(String quorumName)
quorumName - the quorum namepublic 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 Hazelcast, Inc.. All Rights Reserved.