Package com.hazelcast.config
Class PNCounterConfig
java.lang.Object
com.hazelcast.config.PNCounterConfig
- All Implemented Interfaces:
- NamedConfig,- DataSerializable,- IdentifiedDataSerializable
Configuration for a 
PNCounter- Since:
- 3.10
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intThe default number of replicas on which state for this CRDT is keptstatic final booleanDefault value for statistics enabled.
- 
Constructor SummaryConstructorsConstructorDescriptionPNCounterConfig(PNCounterConfig config) PNCounterConfig(String name) PNCounterConfig(String name, int replicaCount, String splitBrainProtectionName, boolean statisticsEnabled) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleanintReturns type identifier for this class.intReturns DataSerializableFactory factory ID for this class.getName()Gets the name of the PN counter.intReturns the number of replicas on which state for this PN counter will be kept.Returns the split brain protection name for operations.inthashCode()booleanChecks if statistics are enabled for this PN countervoidReads fields from the input streamSets the name of the PN counter.setReplicaCount(int replicaCount) Sets the number of replicas on which state for this PN counter will be kept.setSplitBrainProtectionName(String splitBrainProtectionName) Sets the split brain protection name for operations.setStatisticsEnabled(boolean statisticsEnabled) Enables or disables statistics for this PN countervoidWrites object fields to output stream
- 
Field Details- 
DEFAULT_REPLICA_COUNTpublic static final int DEFAULT_REPLICA_COUNTThe default number of replicas on which state for this CRDT is kept- See Also:
 
- 
DEFAULT_STATISTICS_ENABLEDpublic static final boolean DEFAULT_STATISTICS_ENABLEDDefault value for statistics enabled.- See Also:
 
 
- 
- 
Constructor Details- 
PNCounterConfigpublic PNCounterConfig()
- 
PNCounterConfig
- 
PNCounterConfig
- 
PNCounterConfig
 
- 
- 
Method Details- 
getNameGets the name of the PN counter.- Specified by:
- getNamein interface- NamedConfig
 
- 
setNameSets the name of the PN counter.- Specified by:
- setNamein interface- NamedConfig
- Parameters:
- name- the name of the PN counter
- Returns:
- the updated PN counter config
 
- 
isStatisticsEnabledpublic boolean isStatisticsEnabled()Checks if statistics are enabled for this PN counter- Returns:
- trueif enabled,- falseotherwise
 
- 
setStatisticsEnabledEnables or disables statistics for this PN counter- Parameters:
- statisticsEnabled-- trueto enable statistics,- falseto disable
- Returns:
- the updated PN counter config
 
- 
getReplicaCountpublic int getReplicaCount()Returns the number of replicas on which state for this PN counter will be kept. This number applies in quiescent state, if there are currently membership changes or clusters are merging, the state may be temporarily kept on more replicas.- Returns:
- the number of replicas for the CRDT state
 
- 
setReplicaCountSets the number of replicas on which state for this PN counter will be kept. This number applies in quiescent state, if there are currently membership changes or clusters are merging, the state may be temporarily kept on more replicas.The provided replicaCountmust be between 1 and 2147483647.- Parameters:
- replicaCount- the number of replicas for the CRDT state
- Returns:
- the updated PN counter config
- Throws:
- InvalidConfigurationException- if the- replicaCountis less than 1
 
- 
getSplitBrainProtectionNameReturns the split brain protection name for operations.- Returns:
- the split brain protection name
 
- 
setSplitBrainProtectionNameSets the split brain protection name for operations.- Parameters:
- splitBrainProtectionName- the split brain protection name
- Returns:
- the updated PN counter config
 
- 
getFactoryIdpublic int getFactoryId()Description copied from interface:IdentifiedDataSerializableReturns DataSerializableFactory factory ID for this class.- Specified by:
- getFactoryIdin interface- IdentifiedDataSerializable
- Returns:
- factory ID
 
- 
getClassIdpublic int getClassId()Description copied from interface:IdentifiedDataSerializableReturns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
- getClassIdin interface- IdentifiedDataSerializable
- Returns:
- type ID
 
- 
writeDataDescription copied from interface:DataSerializableWrites object fields to output stream- Specified by:
- writeDatain interface- DataSerializable
- Parameters:
- out- output
- Throws:
- IOException- if an I/O error occurs. In particular, an- IOExceptionmay be thrown if the output stream has been closed.
 
- 
readDataDescription copied from interface:DataSerializableReads fields from the input stream- Specified by:
- readDatain interface- DataSerializable
- Parameters:
- in- input
- Throws:
- IOException- if an I/O error occurs. In particular, an- IOExceptionmay be thrown if the input stream has been closed.
 
- 
equals
- 
hashCodepublic int hashCode()
 
-