Class InstanceTrackingConfig
The file is overwritten on every start of the Hazelcast instance and if multiple instance share the same file system, every instance will overwrite the tracking file of a previously started instance.
If this instance is unable to write the file, the exception is logged and the instance is allowed to start.
- Since:
- 4.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe mode in which this instance is running.static enumProduct name for the Hazelcast instancestatic enumEnumeration of instance properties provided to the format pattern for output. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the name of the file which will contain the tracking metadata.Returns the pattern used to render the contents of the instance tracking file.inthashCode()booleanReturnstrueif instance tracking is enabled.setEnabled(boolean enabled) Enables or disables instance tracking.setFileName(String fileName) Sets the name of the file which will contain the tracking metadata.setFormatPattern(String formatPattern) Sets the pattern used to render the contents of the instance tracking file.toString()
-
Field Details
-
DEFAULT_FILE
Default file to which the instance metadata will be written. -
PLACEHOLDER_NAMESPACE
Namespace for the placeholders in the file name and format pattern to distinguish between different types of placeholders.- See Also:
-
-
Constructor Details
-
InstanceTrackingConfig
public InstanceTrackingConfig() -
InstanceTrackingConfig
-
-
Method Details
-
isEnabled
public boolean isEnabled()Returnstrueif instance tracking is enabled. -
setEnabled
Enables or disables instance tracking.- Parameters:
enabled-trueif instance tracking should be enabled- Returns:
- this configuration
-
getFileName
Returns the name of the file which will contain the tracking metadata. Ifnull,DEFAULT_FILEis used instead.The filename can contain placeholders that will be resolved in the same way as placeholders for the format pattern (see
setFormatPattern(String)). -
setFileName
Sets the name of the file which will contain the tracking metadata. If set tonull,DEFAULT_FILEis used instead.The filename can contain placeholders that will be resolved in the same way as placeholders for the format pattern (see
setFormatPattern(String)).- Parameters:
fileName- the name of the file to contain the tracking metadata- Returns:
- this configuration
-
getFormatPattern
Returns the pattern used to render the contents of the instance tracking file. It may contain placeholders for properties listed in theInstanceTrackingConfig.InstanceTrackingPropertiesenum. The placeholders are defined by a $HZ_INSTANCE_TRACKING{ prefix and followed by }. For instance, a placeholder for theInstanceTrackingConfig.InstanceTrackingProperties.START_TIMESTAMPwould be $HZ_INSTANCE_TRACKING{start_timestamp}.The placeholders are resolved in a fail-safe manner. Any incorrect syntax is ignored and only the known properties are resolved, placeholders for any parameters which do not have defined values will be ignored. This also means that if there is a missing closing bracket in one of the placeholders, the property name will be resolved as anything from the opening bracket to the next closing bracket, which might contain additional opening brackets.
If set to
null, a JSON formatted output will be used.- Returns:
- the pattern for the instance tracking file
- See Also:
-
setFormatPattern
Sets the pattern used to render the contents of the instance tracking file. It may contain placeholders for properties listed in theInstanceTrackingConfig.InstanceTrackingPropertiesenum. The placeholders are defined by a $HZ_INSTANCE_TRACKING{ prefix and followed by }. For instance, a placeholder for theInstanceTrackingConfig.InstanceTrackingProperties.START_TIMESTAMPwould be $HZ_INSTANCE_TRACKING{start_timestamp}.The placeholders are resolved in a fail-safe manner. Any incorrect syntax is ignored and only the known properties are resolved, placeholders for any parameters which do not have defined values will be ignored. This also means that if there is a missing closing bracket in one of the placeholders, the property name will be resolved as anything from the opening bracket to the next closing bracket, which might contain additional opening brackets.
If set to
null, a JSON formatted output will be used.- Parameters:
formatPattern- the pattern for the instance tracking file- Returns:
- this configuration
-
equals
-
hashCode
public int hashCode() -
toString
-