public class InstanceTrackingConfig extends Object
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.
Modifier and Type | Class and Description |
---|---|
static class |
InstanceTrackingConfig.InstanceMode
The mode in which this instance is running.
|
static class |
InstanceTrackingConfig.InstanceProductName
Product name for the Hazelcast instance
|
static class |
InstanceTrackingConfig.InstanceTrackingProperties
Enumeration of instance properties provided to the format pattern for
output.
|
Modifier and Type | Field and Description |
---|---|
static Path |
DEFAULT_FILE
Default file to which the instance metadata will be written.
|
static String |
PLACEHOLDER_NAMESPACE
Namespace for the placeholders in the file name and format pattern to
distinguish between different types of placeholders.
|
Constructor and Description |
---|
InstanceTrackingConfig() |
InstanceTrackingConfig(InstanceTrackingConfig other) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
String |
getFileName()
Returns the name of the file which will contain the tracking metadata.
|
String |
getFormatPattern()
Returns the pattern used to render the contents of the instance tracking file.
|
int |
hashCode() |
boolean |
isEnabled()
Returns
true if instance tracking is enabled. |
InstanceTrackingConfig |
setEnabled(boolean enabled)
Enables or disables instance tracking.
|
InstanceTrackingConfig |
setFileName(String fileName)
Sets the name of the file which will contain the tracking metadata.
|
InstanceTrackingConfig |
setFormatPattern(String formatPattern)
Sets the pattern used to render the contents of the instance tracking file.
|
String |
toString() |
public static final Path DEFAULT_FILE
public static final String PLACEHOLDER_NAMESPACE
public InstanceTrackingConfig()
public InstanceTrackingConfig(InstanceTrackingConfig other)
public boolean isEnabled()
true
if instance tracking is enabled.public InstanceTrackingConfig setEnabled(boolean enabled)
enabled
- true
if instance tracking should be enabledpublic String getFileName()
null
, DEFAULT_FILE
is used instead.
The filename can contain placeholders that will be resolved in the same way
as placeholders for the format pattern (see setFormatPattern(String)
).
public InstanceTrackingConfig setFileName(String fileName)
null
, DEFAULT_FILE
is used instead.
The filename can contain placeholders that will be resolved in the same way
as placeholders for the format pattern (see setFormatPattern(String)
).
fileName
- the name of the file to contain the tracking metadatapublic String getFormatPattern()
InstanceTrackingConfig.InstanceTrackingProperties
enum. The placeholders are defined by
a $HZ_INSTANCE_TRACKING{ prefix and followed by }. For instance, a placeholder for
the InstanceTrackingConfig.InstanceTrackingProperties.START_TIMESTAMP
would 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.
InstanceTrackingConfig.InstanceTrackingProperties
public InstanceTrackingConfig setFormatPattern(String formatPattern)
InstanceTrackingConfig.InstanceTrackingProperties
enum. The placeholders are defined by
a $HZ_INSTANCE_TRACKING{ prefix and followed by }. For instance, a placeholder for
the InstanceTrackingConfig.InstanceTrackingProperties.START_TIMESTAMP
would 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.
formatPattern
- the pattern for the instance tracking fileCopyright © 2023 Hazelcast, Inc.. All rights reserved.