Record Class CortexProperties.Restore
- Record Components:
enabled- whether the latest backup is restored at startupkeyPrefix- the S3 key prefix backups were uploaded under; only objects beneath it are considered, and the most recent is restored
- Enclosing class:
CortexProperties
CortexRestoreAutoConfiguration.
Disabled by default. When enabled, the latest backup under keyPrefix is downloaded
and loaded into the assertions store during startup, before the application serves traffic —
treating S3 as the source of truth and the local store as replaceable. It is a wipe-and-load
that runs on every boot, so it requires CortexProperties.persistent() to be
true and an enabled, configured CortexProperties.S3 client, exactly as backups do; the same
software.amazon.awssdk:s3 and software.amazon.awssdk:apache-client dependencies must
be on the classpath. A bucket with no backup yet is not an error — a first-ever deployment
starts empty.
The switch is independent of CortexProperties.Backup.enabled(): an instance may restore without
scheduling backups of its own (a replica seeded from another's uploads) or take backups without
restoring. Because the two are independent, keyPrefix is configured here rather than
read from CortexProperties.Backup.keyPrefix(); it defaults to the same cortex/, so an instance
that both backs up and restores works with no extra configuration, but if
cortex.backup.key-prefix is customized then cortex.restore.key-prefix must be set to
match for the restore to find the uploads.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanenabled()Returns the value of theenabledrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thekeyPrefixrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
enabled
public boolean enabled()Returns the value of theenabledrecord component.- Returns:
- the value of the
enabledrecord component
-
keyPrefix
Returns the value of thekeyPrefixrecord component.- Returns:
- the value of the
keyPrefixrecord component
-