Package com.hazelcast.config
Class CardinalityEstimatorConfig
- java.lang.Object
-
- com.hazelcast.config.CardinalityEstimatorConfig
-
- All Implemented Interfaces:
NamedConfig
,DataSerializable
,IdentifiedDataSerializable
public class CardinalityEstimatorConfig extends java.lang.Object implements IdentifiedDataSerializable, NamedConfig
Configuration options for theCardinalityEstimator
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_ASYNC_BACKUP_COUNT
The number of async backups per estimatorstatic MergePolicyConfig
DEFAULT_MERGE_POLICY_CONFIG
The default merge policy used for cardinality estimatorsstatic int
DEFAULT_SYNC_BACKUP_COUNT
The number of sync backups per estimator
-
Constructor Summary
Constructors Constructor Description CardinalityEstimatorConfig()
CardinalityEstimatorConfig(CardinalityEstimatorConfig config)
CardinalityEstimatorConfig(java.lang.String name)
CardinalityEstimatorConfig(java.lang.String name, int backupCount, int asyncBackupCount)
CardinalityEstimatorConfig(java.lang.String name, int backupCount, int asyncBackupCount, MergePolicyConfig mergePolicyConfig)
CardinalityEstimatorConfig(java.lang.String name, int backupCount, int asyncBackupCount, java.lang.String splitBrainProtectionName, MergePolicyConfig mergePolicyConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
getAsyncBackupCount()
Gets the number of synchronous backups.int
getBackupCount()
Gets the number of synchronous backups.int
getClassId()
Returns type identifier for this class.int
getFactoryId()
Returns DataSerializableFactory factory ID for this class.MergePolicyConfig
getMergePolicyConfig()
Gets theMergePolicyConfig
for the cardinality estimator.java.lang.String
getName()
Gets the name of the cardinality estimator.java.lang.String
getSplitBrainProtectionName()
Returns the split brain protection name for operations.int
getTotalBackupCount()
Returns the total number of backups: backupCount plus asyncBackupCount.int
hashCode()
void
readData(ObjectDataInput in)
Reads fields from the input streamCardinalityEstimatorConfig
setAsyncBackupCount(int asyncBackupCount)
Sets the number of synchronous backups.CardinalityEstimatorConfig
setBackupCount(int backupCount)
Sets the number of synchronous backups.CardinalityEstimatorConfig
setMergePolicyConfig(MergePolicyConfig mergePolicyConfig)
Sets theMergePolicyConfig
for the scheduler.CardinalityEstimatorConfig
setName(java.lang.String name)
Sets the name of the cardinality estimator.CardinalityEstimatorConfig
setSplitBrainProtectionName(java.lang.String splitBrainProtectionName)
Sets the split brain protection name for operations.java.lang.String
toString()
void
validate()
void
writeData(ObjectDataOutput out)
Writes object fields to output stream
-
-
-
Field Detail
-
DEFAULT_SYNC_BACKUP_COUNT
public static final int DEFAULT_SYNC_BACKUP_COUNT
The number of sync backups per estimator- See Also:
- Constant Field Values
-
DEFAULT_ASYNC_BACKUP_COUNT
public static final int DEFAULT_ASYNC_BACKUP_COUNT
The number of async backups per estimator- See Also:
- Constant Field Values
-
DEFAULT_MERGE_POLICY_CONFIG
public static final MergePolicyConfig DEFAULT_MERGE_POLICY_CONFIG
The default merge policy used for cardinality estimators
-
-
Constructor Detail
-
CardinalityEstimatorConfig
public CardinalityEstimatorConfig()
-
CardinalityEstimatorConfig
public CardinalityEstimatorConfig(java.lang.String name)
-
CardinalityEstimatorConfig
public CardinalityEstimatorConfig(java.lang.String name, int backupCount, int asyncBackupCount)
-
CardinalityEstimatorConfig
public CardinalityEstimatorConfig(java.lang.String name, int backupCount, int asyncBackupCount, MergePolicyConfig mergePolicyConfig)
-
CardinalityEstimatorConfig
public CardinalityEstimatorConfig(java.lang.String name, int backupCount, int asyncBackupCount, java.lang.String splitBrainProtectionName, MergePolicyConfig mergePolicyConfig)
-
CardinalityEstimatorConfig
public CardinalityEstimatorConfig(CardinalityEstimatorConfig config)
-
-
Method Detail
-
getName
public java.lang.String getName()
Gets the name of the cardinality estimator.- Specified by:
getName
in interfaceNamedConfig
- Returns:
- the name of the estimator
-
setName
public CardinalityEstimatorConfig setName(java.lang.String name)
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
public MergePolicyConfig getMergePolicyConfig()
Gets theMergePolicyConfig
for the cardinality estimator.- Returns:
- the
MergePolicyConfig
for the cardinality estimator
-
setMergePolicyConfig
public CardinalityEstimatorConfig setMergePolicyConfig(MergePolicyConfig mergePolicyConfig)
Sets theMergePolicyConfig
for the scheduler.- Returns:
- this executor config instance
-
getBackupCount
public int getBackupCount()
Gets the number of synchronous backups.- Returns:
- number of synchronous backups
-
setBackupCount
public CardinalityEstimatorConfig setBackupCount(int backupCount)
Sets the number of synchronous backups.- Parameters:
backupCount
- the number of synchronous backups to set- Returns:
- the updated CardinalityEstimatorConfig
- Throws:
java.lang.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:
setAsyncBackupCount(int)
,getBackupCount()
-
getAsyncBackupCount
public int getAsyncBackupCount()
Gets the number of synchronous backups.- Returns:
- number of synchronous backups
-
setAsyncBackupCount
public CardinalityEstimatorConfig setAsyncBackupCount(int asyncBackupCount)
Sets the number of synchronous backups.- Parameters:
asyncBackupCount
- the number of synchronous backups to set- Returns:
- the updated CardinalityEstimatorConfig
- Throws:
java.lang.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:
setAsyncBackupCount(int)
,getBackupCount()
-
getTotalBackupCount
public int getTotalBackupCount()
Returns the total number of backups: backupCount plus asyncBackupCount.- Returns:
- the total number of backups: backupCount plus asyncBackupCount
-
getSplitBrainProtectionName
public java.lang.String getSplitBrainProtectionName()
Returns the split brain protection name for operations.- Returns:
- the split brain protection name
-
setSplitBrainProtectionName
public CardinalityEstimatorConfig setSplitBrainProtectionName(java.lang.String splitBrainProtectionName)
Sets the split brain protection name for operations.- Parameters:
splitBrainProtectionName
- the split brain protection name- Returns:
- the updated configuration
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
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
public void writeData(ObjectDataOutput out) throws java.io.IOException
Description copied from interface:DataSerializable
Writes object fields to output stream- Specified by:
writeData
in interfaceDataSerializable
- Parameters:
out
- output- Throws:
java.io.IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
readData
public void readData(ObjectDataInput in) throws java.io.IOException
Description copied from interface:DataSerializable
Reads fields from the input stream- Specified by:
readData
in interfaceDataSerializable
- Parameters:
in
- input- Throws:
java.io.IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the input stream has been closed.
-
equals
public final boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
validate
public final void validate()
-
-