public interface PersistenceConfig extends Config
By default the persistence service is not enabled. Enabling persistence will cause all topics and updates to those topics to be persisted to files enabling the topics to be restored when the server is restarted.
When a server is started and persistence is on, the topic tree will be restored from existing persistence files. This will happen concurrently with connecting client sessions, replication and fan-out and the persistence system will resolve any conflicts.
Topic events (such as the creation of topics, updates to topics and removal of topics) are written to 'append only' files as they occur. To manage the size of these files they are periodically switched out of service so that they can be made available for 'compaction'.
The process of 'compaction' involves reading existing files, removing redundant information (for example, removed topics and anything but the last update to each topic) and then writing back a single 'compacted' file.
Modifier and Type | Method and Description |
---|---|
String |
getStoreDirectory()
Deprecated.
since 6.3
See |
boolean |
isEnabled()
Indicates whether the persistence service is enabled.
|
void |
setEnabled(boolean enabled)
Enable or disable the persistence service.
|
void |
setStoreDirectory(String path)
Deprecated.
since 6.3
Use |
void setEnabled(boolean enabled) throws ConfigException
The service is disabled by default.
enabled
- true to enable the persistence serviceConfigException
- if the configuration is locked
boolean isEnabled()
setEnabled(boolean)
@Deprecated void setStoreDirectory(String path) throws ConfigException
Use ServerConfig.setPersistenceDirectory(java.lang.String)
instead.
This will be removed in a future release.
If this is not specified, the Diffusion home directory is used.
A directory called 'persistence' will be created under the specified store directory (or the Diffusion home directory) to hold persistence files.
path
- specifies the path of a directory that must exist when the
server is started. The path will only be validated at runtime and
if the directory does not exist then the server would not start.ConfigException
- if the configuration is locked
@Deprecated String getStoreDirectory()
See setStoreDirectory(java.lang.String)
. This will be removed in a
future release.
setStoreDirectory(String)
Copyright © 2022 Push Technology Ltd. All Rights Reserved.