public class DefaultIndexRecoveryService extends Object implements IndexRecoveryService, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
IndexRecoveryService
.Constructor and Description |
---|
DefaultIndexRecoveryService(JournalStateStore journalStateStore,
JournalDao journalDao,
ClusterManager clusterManager,
com.atlassian.event.api.EventPublisher eventPublisher,
ClusterEventWrapperService clusterEventWrapperService,
com.atlassian.plugin.PluginAccessor pluginAccessor) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
boolean |
createIndexBackup(JournalIdentifier journalId,
String indexDirName,
IndexRecoverer indexRecoverer)
Creates an index snapshot in the cluster shared home.
|
void |
destroy() |
void |
handleEvent(ClusterEventWrapper eventWrapper) |
void |
handleModuleEnableEvent(com.atlassian.plugin.event.events.PluginModuleEnabledEvent event) |
void |
handleStartingEvent(com.atlassian.plugin.event.events.PluginFrameworkResumingEvent event) |
boolean |
isIndexRecoveryRequired(JournalIdentifier journalId,
String indexDirName)
Checks to see whether the index needs to be recovered.
|
boolean |
recoverIndex(JournalIdentifier journalId,
String indexDirName)
Recovers the index required by asking other nodes in the cluster for a snapshot of their index
and copying it to its local home directory.
|
boolean |
recoverIndexFromSharedHome(JournalIdentifier journalId,
String indexDirName)
Recovers the index snapshot stored in the shared home.
|
public DefaultIndexRecoveryService(JournalStateStore journalStateStore, JournalDao journalDao, ClusterManager clusterManager, com.atlassian.event.api.EventPublisher eventPublisher, ClusterEventWrapperService clusterEventWrapperService, com.atlassian.plugin.PluginAccessor pluginAccessor)
public boolean isIndexRecoveryRequired(JournalIdentifier journalId, String indexDirName)
IndexRecoveryService
This will be true if the index folder does not exist, or, if the index is copied over from a live system and is invalid, or, if the journal has been purged past where the node is currently processing, Note, this will always return false if the instance is not clustered.
isIndexRecoveryRequired
in interface IndexRecoveryService
journalId
- the index to check whether it needs to be recoveredindexDirName
- the name of the subdirectory containing the Lucene indexpublic boolean recoverIndex(JournalIdentifier journalId, String indexDirName)
IndexRecoveryService
This will overwrite the local index files if it already exists.
recoverIndex
in interface IndexRecoveryService
journalId
- the index to recoverindexDirName
- the name of the subdirectory containing the Lucene indexpublic boolean recoverIndexFromSharedHome(JournalIdentifier journalId, String indexDirName)
IndexRecoveryService
This will overwrite the local index files if it already exists.
recoverIndexFromSharedHome
in interface IndexRecoveryService
journalId
- the index to recoverindexDirName
- the name of the subdirectory where the Lucene index will be moved topublic boolean createIndexBackup(JournalIdentifier journalId, String indexDirName, IndexRecoverer indexRecoverer)
IndexRecoveryService
This will overwrite existing snapshots of the same index in the shared home.
createIndexBackup
in interface IndexRecoveryService
journalId
- the index to backupindexDirName
- the name of the subdirectory containing the Lucene indexindexRecoverer
- the index recover module that will take the lucene index snapshot@EventListener public void handleStartingEvent(com.atlassian.plugin.event.events.PluginFrameworkResumingEvent event)
@EventListener public void handleModuleEnableEvent(com.atlassian.plugin.event.events.PluginModuleEnabledEvent event)
@EventListener public void handleEvent(ClusterEventWrapper eventWrapper) throws Exception
Exception
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
Copyright © 2003–2017 Atlassian. All rights reserved.