public class IndexUtils extends Object
Modifier and Type | Field and Description |
---|---|
static com.google.common.io.PatternFilenameFilter |
INDEX_SNAPSHOT_FILTER |
Constructor and Description |
---|
IndexUtils(com.atlassian.event.api.EventPublisher eventPublisher,
FeatureManager featureManager,
ApplicationProperties applicationProperties,
IndexBackupContributorsManager indexBackupContributorsManager,
ClusterNodes clusterNodes) |
Modifier and Type | Method and Description |
---|---|
protected long |
calculateFileSize(File snapshot) |
protected Long |
createIndexSnapshot(File snapshot,
ArchiveUtils.Type archiveType,
TemporaryFilesProvider metadataProvider) |
protected int |
deleteOldSnapshots(File directory,
int numToKeep) |
String |
performBackupOperations(String destinationPath,
String snapshotId,
int maxSnapshots,
ArchiveUtils.Type archiveType,
TemporaryFilesProvider metadataProvider,
String requestingNodeId)
Creates a backup file at
destinationPath . |
public static final com.google.common.io.PatternFilenameFilter INDEX_SNAPSHOT_FILTER
public IndexUtils(com.atlassian.event.api.EventPublisher eventPublisher, FeatureManager featureManager, ApplicationProperties applicationProperties, IndexBackupContributorsManager indexBackupContributorsManager, ClusterNodes clusterNodes)
public String performBackupOperations(@Nonnull String destinationPath, @Nonnull String snapshotId, int maxSnapshots, @Nullable ArchiveUtils.Type archiveType, @Nullable TemporaryFilesProvider metadataProvider, @Nullable String requestingNodeId)
destinationPath
.
Allows backup contributors registered in IndexBackupContributorsManager
to contribute to that file.
Creates temporary folder for the time of operation and allows and the metadataProvider
to crate additional files in that folder and also adds them to the backup.
Performs cleanup of existing previous snapshot in destination
to leave only maxSnapshots
destinationPath
- directory path for newly created snapshot. Will be created if necessarysnapshotId
- identifier suffix added to snapshot filenamemaxSnapshots
- maximum number of snapshots to be left after cleanup phasearchiveType
- archiver used for creating the snapshot. If it's null default archiver will be usedmetadataProvider
- provider of additional files that should be included in the archive, can be null. Files it will create in given temp directory will be removed after the backup endsprotected Long createIndexSnapshot(@Nonnull File snapshot, @Nonnull ArchiveUtils.Type archiveType, @Nullable TemporaryFilesProvider metadataProvider)
protected long calculateFileSize(File snapshot)
protected int deleteOldSnapshots(File directory, int numToKeep)
Copyright © 2002-2021 Atlassian. All Rights Reserved.