@NotThreadSafe public class ActiveSyncManager extends java.lang.Object implements Journaled
| Constructor and Description |
|---|
ActiveSyncManager(MountTable mountTable,
FileSystemMaster fileSystemMaster)
Constructs a Active Sync Manager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
applyAndJournal(java.util.function.Supplier<JournalContext> context,
File.AddSyncPointEntry entry)
Apply AddSyncPoint entry and journal the entry.
|
void |
applyAndJournal(java.util.function.Supplier<JournalContext> context,
File.RemoveSyncPointEntry entry)
Apply removeSyncPoint entry and journal the entry.
|
CheckpointName |
getCheckpointName() |
java.util.concurrent.ExecutorService |
getExecutor()
Get SyncManager Executor.
|
java.util.List<AlluxioURI> |
getFilterList(long mountId)
Get the filter list associated with mount Id.
|
java.util.Iterator<Journal.JournalEntry> |
getJournalEntryIterator() |
java.util.concurrent.locks.Lock |
getSyncManagerLock()
Gets the lock protecting the syncManager.
|
java.util.List<SyncPointInfo> |
getSyncPathList()
Get the sync point list.
|
boolean |
isActivelySynced(AlluxioURI path)
Check if a URI is actively synced.
|
void |
launchPollingThread(long mountId,
long txId)
Launches polling thread on a particular mount point with starting txId.
|
boolean |
processJournalEntry(Journal.JournalEntry entry) |
void |
recoverFromStartSync(AlluxioURI uri,
long mountId)
Recover from start sync operation.
|
void |
recoverFromStopSync(AlluxioURI uri,
long mountId)
Recover from a stop sync operation.
|
void |
resetState()
It clears all sync points, and stops the polling thread.
|
MountTable.Resolution |
resolveSyncPoint(AlluxioURI syncPoint)
Perform various checks of stopping a sync point.
|
void |
setTxId(long mountId,
long txId)
set the transaction id for a particular mountId.
|
void |
start()
start the polling threads.
|
void |
startSyncPostJournal(AlluxioURI uri)
Continue to start sync after we have journaled the operation.
|
void |
stop()
Stops the sync manager and any outstanding threads, does not change the sync points.
|
void |
stopSyncForMount(long mountId)
stop active sync on a mount id.
|
void |
stopSyncInternal(AlluxioURI syncPoint,
long mountId)
stop active sync on a URI.
|
void |
stopSyncPostJournal(AlluxioURI syncPoint)
Clean up tasks to stop sync point after we have journaled.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapplyAndJournal, restoreFromCheckpoint, writeToCheckpointpublic ActiveSyncManager(MountTable mountTable, FileSystemMaster fileSystemMaster)
mountTable - mount tablefileSystemMaster - file system masterpublic boolean isActivelySynced(AlluxioURI path)
path - path to checkpublic java.util.concurrent.locks.Lock getSyncManagerLock()
public void start()
throws java.io.IOException
java.io.IOExceptionpublic void launchPollingThread(long mountId,
long txId)
mountId - launch polling thread on a mount idtxId - specifies the transaction id to initialize the pollling threadpublic void applyAndJournal(java.util.function.Supplier<JournalContext> context, File.AddSyncPointEntry entry)
context - journal contextentry - addSyncPoint entrypublic void applyAndJournal(java.util.function.Supplier<JournalContext> context, File.RemoveSyncPointEntry entry)
context - journal contextentry - removeSyncPoint entrypublic void stopSyncForMount(long mountId)
throws InvalidPathException
mountId - mountId to stop active syncInvalidPathException@Nullable public MountTable.Resolution resolveSyncPoint(AlluxioURI syncPoint) throws InvalidPathException
syncPoint - sync point to stopInvalidPathExceptionpublic void stopSyncInternal(AlluxioURI syncPoint, long mountId)
syncPoint - sync point to be stoppedmountId - mountIdpublic java.util.List<AlluxioURI> getFilterList(long mountId)
mountId - mountIdpublic java.util.List<SyncPointInfo> getSyncPathList()
public void stopSyncPostJournal(AlluxioURI syncPoint) throws InvalidPathException
syncPoint - the sync point to stopInvalidPathExceptionpublic void setTxId(long mountId,
long txId)
mountId - mount idtxId - transaction idpublic java.util.concurrent.ExecutorService getExecutor()
public void stop()
public void startSyncPostJournal(AlluxioURI uri) throws InvalidPathException
uri - the sync point that we are trying to startInvalidPathExceptionpublic void recoverFromStopSync(AlluxioURI uri, long mountId)
uri - uri to stop syncmountId - mount id of the uripublic void recoverFromStartSync(AlluxioURI uri, long mountId)
uri - uri to start syncmountId - mount id of the uripublic boolean processJournalEntry(Journal.JournalEntry entry)
processJournalEntry in interface Journaledpublic void resetState()
resetState in interface Journaledpublic CheckpointName getCheckpointName()
getCheckpointName in interface Checkpointedpublic java.util.Iterator<Journal.JournalEntry> getJournalEntryIterator()
getJournalEntryIterator in interface JournalEntryIterableCopyright © 2019. All Rights Reserved.