Package com.hazelcast.config
Class CardinalityEstimatorConfig
java.lang.Object
com.hazelcast.config.CardinalityEstimatorConfig
- All Implemented Interfaces:
NamedConfig
,SplitBrainPolicyAwareConfig
,DataSerializable
,IdentifiedDataSerializable
public class CardinalityEstimatorConfig
extends Object
implements IdentifiedDataSerializable, NamedConfig, SplitBrainPolicyAwareConfig
Configuration options for the
CardinalityEstimator
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The number of async backups per estimatorstatic final MergePolicyConfig
The default merge policy used for cardinality estimatorsstatic final int
The number of sync backups per estimator -
Constructor Summary
ConstructorDescriptionCardinalityEstimatorConfig
(String name, int backupCount, int asyncBackupCount) CardinalityEstimatorConfig
(String name, int backupCount, int asyncBackupCount, MergePolicyConfig mergePolicyConfig) CardinalityEstimatorConfig
(String name, int backupCount, int asyncBackupCount, String splitBrainProtectionName, MergePolicyConfig mergePolicyConfig) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
int
Gets the number of synchronous backups.int
Gets the number of synchronous backups.int
Returns type identifier for this class.int
Returns DataSerializableFactory factory ID for this class.Gets theMergePolicyConfig
for the cardinality estimator.getName()
Gets the name of the cardinality estimator.Returns the split brain protection name for operations.int
Returns the total number of backups: backupCount plus asyncBackupCount.final int
hashCode()
void
Reads fields from the input streamsetAsyncBackupCount
(int asyncBackupCount) Sets the number of synchronous backups.setBackupCount
(int backupCount) Sets the number of synchronous backups.setMergePolicyConfig
(MergePolicyConfig mergePolicyConfig) Sets theMergePolicyConfig
for the cardinality estimator.Sets the name of the cardinality estimator.setSplitBrainProtectionName
(String splitBrainProtectionName) Sets the split brain protection name for operations.toString()
final void
validate()
void
Writes object fields to output stream
-
Field Details
-
DEFAULT_SYNC_BACKUP_COUNT
public static final int DEFAULT_SYNC_BACKUP_COUNTThe number of sync backups per estimator- See Also:
-
DEFAULT_ASYNC_BACKUP_COUNT
public static final int DEFAULT_ASYNC_BACKUP_COUNTThe number of async backups per estimator- See Also:
-
DEFAULT_MERGE_POLICY_CONFIG
The default merge policy used for cardinality estimators
-
-
Constructor Details
-
CardinalityEstimatorConfig
public CardinalityEstimatorConfig() -
CardinalityEstimatorConfig
-
CardinalityEstimatorConfig
-
CardinalityEstimatorConfig
public CardinalityEstimatorConfig(String name, int backupCount, int asyncBackupCount, MergePolicyConfig mergePolicyConfig) -
CardinalityEstimatorConfig
public CardinalityEstimatorConfig(String name, int backupCount, int asyncBackupCount, String splitBrainProtectionName, MergePolicyConfig mergePolicyConfig) -
CardinalityEstimatorConfig
-
-
Method Details
-
getName
Gets the name of the cardinality estimator.- Specified by:
getName
in interfaceNamedConfig
- Returns:
- the name of the estimator
-
setName
Sets the name of the cardinality estimator.- Specified by:
setName
in interfaceNamedConfig
- Parameters:
name
- the name of the estimator- Returns:
- the cardinality estimator config instance
-
getMergePolicyConfig
Gets theMergePolicyConfig
for the cardinality estimator.- Specified by:
getMergePolicyConfig
in interfaceSplitBrainPolicyAwareConfig
- Returns:
- the
MergePolicyConfig
for the cardinality estimator
-
setMergePolicyConfig
Sets theMergePolicyConfig
for the cardinality estimator.- Specified by:
setMergePolicyConfig
in interfaceSplitBrainPolicyAwareConfig
- Returns:
- this configuration
-
getBackupCount
public int getBackupCount()Gets the number of synchronous backups.- Returns:
- number of synchronous backups
-
setBackupCount
Sets the number of synchronous backups.- Parameters:
backupCount
- the number of synchronous backups to set- Returns:
- the updated CardinalityEstimatorConfig
- Throws:
IllegalArgumentException
- if backupCount smaller than 0, or larger than the maximum number of backup or the sum of the backups and async backups is larger than the maximum number of backups- See Also:
-
getAsyncBackupCount
public int getAsyncBackupCount()Gets the number of synchronous backups.- Returns:
- number of synchronous backups
-
setAsyncBackupCount
Sets the number of synchronous backups.- Parameters:
asyncBackupCount
- the number of synchronous backups to set- Returns:
- the updated CardinalityEstimatorConfig
- Throws:
IllegalArgumentException
- if backupCount smaller than 0, or larger than the maximum number of backup or the sum of the backups and async backups is larger than the maximum number of backups- See Also:
-
getTotalBackupCount
public int getTotalBackupCount()Returns the total number of backups: backupCount plus asyncBackupCount.- Returns:
- the total number of backups: backupCount plus asyncBackupCount
-
getSplitBrainProtectionName
Returns the split brain protection name for operations.- Specified by:
getSplitBrainProtectionName
in interfaceSplitBrainPolicyAwareConfig
- Returns:
- the split brain protection name
-
setSplitBrainProtectionName
Sets the split brain protection name for operations.- Specified by:
setSplitBrainProtectionName
in interfaceSplitBrainPolicyAwareConfig
- Parameters:
splitBrainProtectionName
- the split brain protection name- Returns:
- the updated configuration
-
toString
-
getFactoryId
public int getFactoryId()Description copied from interface:IdentifiedDataSerializable
Returns DataSerializableFactory factory ID for this class.- Specified by:
getFactoryId
in interfaceIdentifiedDataSerializable
- Returns:
- factory ID
-
getClassId
public int getClassId()Description copied from interface:IdentifiedDataSerializable
Returns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
getClassId
in interfaceIdentifiedDataSerializable
- Returns:
- type ID
-
writeData
Description copied from interface:DataSerializable
Writes object fields to output stream- Specified by:
writeData
in interfaceDataSerializable
- Parameters:
out
- output- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
readData
Description copied from interface:DataSerializable
Reads fields from the input stream- Specified by:
readData
in interfaceDataSerializable
- Parameters:
in
- input- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the input stream has been closed.
-
equals
-
hashCode
public final int hashCode() -
validate
public final void validate()
-