public class OakBacklogClusterSyncService extends AbstractServiceWithBackgroundCheck implements ClusterSyncService
| Constructor and Description |
|---|
OakBacklogClusterSyncService() |
| Modifier and Type | Method and Description |
|---|---|
void |
cancelSync() |
ClusterSyncHistory |
getConsistencyHistory() |
List<String> |
getSyncHistory() |
void |
setConsistencyHistory(ClusterSyncHistory consistencyHistory) |
void |
sync(BaseTopologyView view,
Runnable callback)
Starts the synchronization process and calls the provided
callback upon completion.
|
static OakBacklogClusterSyncService |
testConstructor(DiscoveryLiteConfig commonsConfig,
IdMapService idMapService,
SlingSettingsService settingsService,
ResourceResolverFactory resourceResolverFactory)
for testing only!
|
static OakBacklogClusterSyncService |
testConstructorAndActivate(DiscoveryLiteConfig commonsConfig,
IdMapService idMapService,
SlingSettingsService settingsService,
ResourceResolverFactory resourceResolverFactory) |
public static OakBacklogClusterSyncService testConstructorAndActivate(DiscoveryLiteConfig commonsConfig, IdMapService idMapService, SlingSettingsService settingsService, ResourceResolverFactory resourceResolverFactory)
public static OakBacklogClusterSyncService testConstructor(DiscoveryLiteConfig commonsConfig, IdMapService idMapService, SlingSettingsService settingsService, ResourceResolverFactory resourceResolverFactory)
resourceResolverFactory - slingId - the local slingIdsyncTokenTimeoutMillis - timeout value in millis after which the
sync-token process is cancelled - or -1 if no timeout should be used therebacklogWaitTimeoutMillis - timeout value in millis after which
the waiting-while-backlog should be cancelled - or -1 if no timeout should be
used thereLoginException - when the login for initialization failedJSONException - when the descriptor wasn't proper json at init timepublic void setConsistencyHistory(ClusterSyncHistory consistencyHistory)
public ClusterSyncHistory getConsistencyHistory()
public void cancelSync()
cancelSync in interface ClusterSyncServicepublic void sync(BaseTopologyView view, Runnable callback)
ClusterSyncServicesync() is not thread-safe and should not be invoked concurrently.
If sync() gets called before a previous invocation finished, that previous invocation will be discarded, ie the callback of the previous invocation will no longer be called.
The synchronization process consists of making sure that the repository has processed any potential backlog of instances that are no longer part of the provided, new view. Plus it writes a 'sync-token' to a well-defined location, with all peers doing the same, and upon seeing all other sync-tokens declares successful completion - at which point it calls the callback.run().
sync in interface ClusterSyncServiceview - the view which all instances in the local cluster
should agree on having seencallback - the runnable which should be called after
successful syncing"Copyright © 2010 - 2017 Adobe Systems Incorporated. All Rights Reserved"