Class CounterResource
java.lang.Object
org.infinispan.server.core.backup.resources.CounterResource
- All Implemented Interfaces:
ContainerResource
ContainerResource implementation for BackupManager.Resources.Type.COUNTERS.- Since:
- 12.0
- Author:
- Ryan Emerson
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classProtoStream entity used to represent counter instances. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BlockingManagerprotected static final Logprotected final BackupManager.Resourcesprotected final Pathprotected final BackupManager.Resources.Typeprotected final boolean -
Method Summary
Modifier and TypeMethodDescriptionbackup()Writes the backup files for theBackupManager.Resources.Typeto the local filesystem, where it can then be packaged for distribution.protected voidvoidA method to ensure that the resources requested in theBackupManager.Resourcesare valid and can be included in a backup.voidprepareAndValidateRestore(Properties properties) A method to ensure that the resources requested in theBackupManager.Resourcesare contained in the backup to be restored.protected static <T> TreadMessageStream(org.infinispan.protostream.ImmutableSerializationContext ctx, Class<T> clazz, DataInputStream is) Restores theBackupManager.Resources.Typecontent from the providedZipFileto the target container.protected static voidwriteMessageStream(Object o, org.infinispan.protostream.ImmutableSerializationContext serCtx, DataOutputStream output) voidwriteToManifest(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:ContainerResourceA method to ensure that the resources requested in theBackupManager.Resourcesare valid and can be included in a backup. This method is called for allContainerResourceimplementations before the backup process begins in order to allow a backup to fail-fast before any data is processed. -
backup
Description copied from interface:ContainerResourceWrites the backup files for theBackupManager.Resources.Typeto the local filesystem, where it can then be packaged for distribution.Implementations of this method depend on content created by
ContainerResource.prepareAndValidateBackup().- Returns:
- a
CompletionStagethat completes once the backup of thisBackupManager.Resources.Typehas finished.
-
restore
Description copied from interface:ContainerResourceRestores theBackupManager.Resources.Typecontent from the providedZipFileto the target container.- Parameters:
zip- theZipFileto restore content from.- Returns:
- a
CompletionStagethat completes once the restoration of thisBackupManager.Resources.Typehas finished.
-
writeToManifest
Description copied from interface:ContainerResourceWrites the name of the individual resources that have been included in this backup. TheBackupManager.Resources.Typeassociated 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:
writeToManifestin interfaceContainerResource- Parameters:
properties- thePropertiesinstance to add the key/value property.
-
prepareAndValidateRestore
Description copied from interface:ContainerResourceA method to ensure that the resources requested in theBackupManager.Resourcesare contained in the backup to be restored. This method is called for allContainerResourceimplementations before the restore process begins in order to allow a restore to fail-fast before any state is restored to a container.- Specified by:
prepareAndValidateRestorein 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
-