@NotThreadSafe public class ActiveSyncManager extends 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() |
ExecutorService |
getExecutor()
Get SyncManager Executor.
|
List<AlluxioURI> |
getFilterList(long mountId)
Get the filter list associated with mount Id.
|
Iterator<Journal.JournalEntry> |
getJournalEntryIterator() |
Lock |
getSyncManagerLock()
Gets the lock protecting the syncManager.
|
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)
Attempts to apply a journal 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()
Resets the object's journaled state.
|
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, wait
applyAndJournal, restoreFromCheckpoint, writeToCheckpoint
public ActiveSyncManager(MountTable mountTable, FileSystemMaster fileSystemMaster)
mountTable
- mount tablefileSystemMaster
- file system masterpublic boolean isActivelySynced(AlluxioURI path)
path
- path to checkpublic Lock getSyncManagerLock()
public void start() throws IOException
IOException
public 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 stopInvalidPathException
public void stopSyncInternal(AlluxioURI syncPoint, long mountId)
syncPoint
- sync point to be stoppedmountId
- mountIdpublic List<AlluxioURI> getFilterList(long mountId)
mountId
- mountIdpublic List<SyncPointInfo> getSyncPathList()
public void stopSyncPostJournal(AlluxioURI syncPoint) throws InvalidPathException
syncPoint
- the sync point to stopInvalidPathException
public void setTxId(long mountId, long txId)
mountId
- mount idtxId
- transaction idpublic ExecutorService getExecutor()
public void stop()
public void startSyncPostJournal(AlluxioURI uri) throws InvalidPathException
uri
- the sync point that we are trying to startInvalidPathException
public 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)
Journaled
processJournalEntry
in interface Journaled
entry
- the entry to applypublic void resetState()
resetState
in interface Journaled
public CheckpointName getCheckpointName()
getCheckpointName
in interface Checkpointed
public Iterator<Journal.JournalEntry> getJournalEntryIterator()
getJournalEntryIterator
in interface JournalEntryIterable
Iterator
that iterates all the journal entriesCopyright © 2023. All Rights Reserved.