Class ClusterInfo
- All Implemented Interfaces:
Serializable,Cloneable
- Direct Known Subclasses:
ClusterInfoImpl
ClusterInfoAware) in order to be informed of their
specific cluster instance deployment.
Note, the cluster information is obtained externally from the application context which means
that this feature need to be supported by specific containers (and is not supported by plain
Spring application context). This means that beans that implement ClusterInfoAware should
take into account the fact that the cluster info provided might be null.
Naturally, this information can be used by plain Spring application context by constructing
this class using Spring and providing it as a parameter to ClusterInfoBeanPostProcessor
which is also configured within Spring application context. Note, if the same application context
will later be deployed into a container that provides cluster information, extra caution need to
be taken to resolve clashes. The best solution would be to define the cluster info within a
different Spring xml context, and excluding it when deploying the full context to a cluster info
aware container.
The absence (null value) of a certain cluster information property means that it
was not set.
- Author:
- kimchy
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionConstructs a new cluster info with null values on all the fieldsClusterInfo(String schema, Integer instanceId, Integer backupId, Integer numberOfInstances, Integer numberOfBackups) Constructs a new Cluster infoprotectedClusterInfo(ClusterInfo other) protectedClusterInfo(ClusterInfoBuilder builder) -
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns the backup id of the specific cluster member.intGets the generation of the cluster topologyReturns the instance id of the specific cluster member.getName()Returns the logical name of the cluster.Returns the number of backups that each primary instance will have in a cluster.Returns the number of primary instances that are running within the cluster.intReturns a "running" number represented by the cluster info.intReturns a "running" number:getRunningNumber()+ 1.Returns the schema the cluster operates under.Returns a String suffix that can be used to discriminate instances.Returns a unique name of the processing unit.booleansetBackupId(Integer backupId) Sets the backup id of the specific cluster member.setInstanceId(Integer instanceId) Sets the instance id of the specific cluster member.setNumberOfBackups(Integer numberOfBackups) Sets the number of backups that each primary instance will have in a cluster.setNumberOfInstances(Integer numberOfInstances) Sets the number of primary instances that are running within the cluster.Sets the schema the cluster operates under.booleantoString()
-
Constructor Details
-
ClusterInfo
public ClusterInfo()Constructs a new cluster info with null values on all the fields -
ClusterInfo
public ClusterInfo(String schema, Integer instanceId, Integer backupId, Integer numberOfInstances, Integer numberOfBackups) Constructs a new Cluster info- Parameters:
schema- The cluster schemainstanceId- The instance idbackupId- The backupId (can benull)numberOfInstances- Number of instancesnumberOfBackups- Number Of backups (can benull)
-
ClusterInfo
-
ClusterInfo
-
-
Method Details
-
isSecured
public boolean isSecured() -
getGeneration
public int getGeneration()Gets the generation of the cluster topology- Since:
- 15.5
-
getSchema
Returns the schema the cluster operates under. Usually maps to a Space cluster schema. Can havenullvalue which means that it was not set. -
setSchema
Sets the schema the cluster operates under. Usually maps to a Space cluster schema. Can havenullvalue which means that it was not set. -
getInstanceId
Returns the instance id of the specific cluster member. Can havenullvalue which means that it was not set and should not be taken into account. -
setInstanceId
Sets the instance id of the specific cluster member. Can havenullvalue which means that it was not set and should not be taken into account.- Throws:
IllegalArgumentException- if value not greater than zero.
-
getBackupId
Returns the backup id of the specific cluster member. Can havenullvalue which means that it was not set and should not be taken into account. -
setBackupId
Sets the backup id of the specific cluster member. Can havenullvalue which means that it was not set and should not be taken into account.- Throws:
IllegalArgumentException- if value not greater than zero.
-
getNumberOfInstances
Returns the number of primary instances that are running within the cluster. Note, this are the number of primary instances. Each instance might also have one or more backups that are set bynumberOfBackups. Can havenullvalue which means that it was not set and should not be taken into account. -
setNumberOfInstances
Sets the number of primary instances that are running within the cluster. Note, this are the number of primary instances. Each instance might also have one or more backups that are set bynumberOfBackups. Can havenullvalue which means that it was not set and should not be taken into account. -
getNumberOfBackups
Returns the number of backups that each primary instance will have in a cluster. Can havenullvalue which means that it was not set and should not be taken into account. -
setNumberOfBackups
Sets the number of backups that each primary instance will have in a cluster. Can havenullvalue which means that it was not set and should not be taken into account. -
getName
Returns the logical name of the cluster. -
setName
-
getRunningNumber
public int getRunningNumber()Returns a "running" number represented by the cluster info. Some examples:1. NumberOfInstances=2, numberOfBackups=0, instanceId=1: 0. 2. NumberOfInstances=2, numberOfBackups=0, instanceId=2: 1. 3. NumberOfInstances=2, numberOfBackups=1, instanceId=1, backupId=0: 0. 4. NumberOfInstances=2, numberOfBackups=1, instanceId=1, backupId=1: 1. 5. NumberOfInstances=2, numberOfBackups=1, instanceId=2, backupId=0: 2. 6. NumberOfInstances=2, numberOfBackups=1, instanceId=2, backupId=1: 3.
-
getRunningNumberOffset1
public int getRunningNumberOffset1()Returns a "running" number:getRunningNumber()+ 1. -
getSuffix
Returns a String suffix that can be used to discriminate instances. Uses [instanceId]_[backupId] if there is a backupId. If there is none, uses [instanceId]. -
getUniqueName
Returns a unique name of the processing unit. Returns [name]_[suffix] -
supportsDynamicPartitioning
public boolean supportsDynamicPartitioning() -
getDynamicPartitionInfo
-
copy
-
toString
-