Class CacheResource
java.lang.Object
org.infinispan.server.core.backup.resources.CacheResource
- All Implemented Interfaces:
ContainerResource
ContainerResource
implementation for BackupManager.Resources.Type.CACHES
.- Since:
- 12.0
- Author:
- Ryan Emerson
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
ProtoStream entity used to represent individual cache entries. -
Field Summary
Modifier and TypeFieldDescriptionprotected final BlockingManager
protected static final Log
protected final BackupManager.Resources
protected final Path
protected final BackupManager.Resources.Type
protected final boolean
-
Method Summary
Modifier and TypeMethodDescriptionbackup()
Writes the backup files for theBackupManager.Resources.Type
to the local filesystem, where it can then be packaged for distribution.protected void
void
A method to ensure that the resources requested in theBackupManager.Resources
are valid and can be included in a backup.void
prepareAndValidateRestore
(Properties properties) A method to ensure that the resources requested in theBackupManager.Resources
are contained in the backup to be restored.protected static <T> T
readMessageStream
(org.infinispan.protostream.ImmutableSerializationContext ctx, Class<T> clazz, DataInputStream is) Restores theBackupManager.Resources.Type
content from the providedZipFile
to the target container.protected static void
writeMessageStream
(Object o, org.infinispan.protostream.ImmutableSerializationContext serCtx, DataOutputStream output) void
writeToManifest
(Properties properties) Writes the name of the individual resources that have been included in this backup.
-
Field Details
-
log
-
type
-
params
-
root
-
blockingManager
-
wildcard
protected final boolean wildcard -
resources
-
-
Method Details
-
prepareAndValidateBackup
public void prepareAndValidateBackup()Description copied from interface:ContainerResource
A method to ensure that the resources requested in theBackupManager.Resources
are valid and can be included in a backup. This method is called for allContainerResource
implementations before the backup process begins in order to allow a backup to fail-fast before any data is processed. -
backup
Description copied from interface:ContainerResource
Writes the backup files for theBackupManager.Resources.Type
to the local filesystem, where it can then be packaged for distribution.Implementations of this method depend on content created by
ContainerResource.prepareAndValidateBackup()
.- Returns:
- a
CompletionStage
that completes once the backup of thisBackupManager.Resources.Type
has finished.
-
restore
Description copied from interface:ContainerResource
Restores theBackupManager.Resources.Type
content from the providedZipFile
to the target container.- Parameters:
zip
- theZipFile
to restore content from.- Returns:
- a
CompletionStage
that completes once the restoration of thisBackupManager.Resources.Type
has finished.
-
writeToManifest
Description copied from interface:ContainerResource
Writes the name of the individual resources that have been included in this backup. TheBackupManager.Resources.Type
associated with an implementation is the key, whilst the value is a csv of resource names.Implementations of this method depend on state created by
ContainerResource.backup()
.- Specified by:
writeToManifest
in interfaceContainerResource
- Parameters:
properties
- theProperties
instance to add the key/value property.
-
prepareAndValidateRestore
Description copied from interface:ContainerResource
A method to ensure that the resources requested in theBackupManager.Resources
are contained in the backup to be restored. This method is called for allContainerResource
implementations before the restore process begins in order to allow a restore to fail-fast before any state is restored to a container.- Specified by:
prepareAndValidateRestore
in interfaceContainerResource
-
mkdirs
-
writeMessageStream
protected static void writeMessageStream(Object o, org.infinispan.protostream.ImmutableSerializationContext serCtx, DataOutputStream output) throws IOException - Throws:
IOException
-
readMessageStream
protected static <T> T readMessageStream(org.infinispan.protostream.ImmutableSerializationContext ctx, Class<T> clazz, DataInputStream is) throws IOException - Throws:
IOException
-