@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
File.AddSyncPointEntry and journal the entry. |
void |
applyAndJournal(java.util.function.Supplier<JournalContext> context,
File.RemoveSyncPointEntry entry)
Apply
File.RemoveSyncPointEntry and journal the entry. |
CheckpointName |
getCheckpointName() |
ExecutorService |
getExecutor()
Get SyncManager Executor.
|
List<AlluxioURI> |
getFilterList(long mountId)
Get the filter list associated with mount Id.
|
CloseableIterator<Journal.JournalEntry> |
getJournalEntryIterator() |
Lock |
getLock()
Gets the lock protecting the syncManager.
|
List<SyncPointInfo> |
getSyncPathList()
Get the sync point list.
|
boolean |
isSyncPoint(AlluxioURI syncPoint) |
boolean |
isUnderSyncPoint(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)
Recover from a stop sync operation.
|
void |
resetState()
Resets the object's journaled state.
|
void |
setTxId(long mountId,
long txId)
Set the transaction id for a particular mountId.
|
void |
start()
Start the polling threads.
|
void |
startSyncAndJournal(RpcContext rpcContext,
AlluxioURI syncPoint)
Start active sync on a URI and journal the add entry.
|
void |
stop()
Stops the sync manager and any outstanding threads, does not change the sync points.
|
void |
stopSyncAndJournal(RpcContext rpcContext,
AlluxioURI syncPoint)
Stop active sync on a URI and journal the remove entry.
|
void |
stopSyncForMount(long mountId)
Stop active sync on a mount id.
|
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 Lock getLock()
public boolean isSyncPoint(AlluxioURI syncPoint)
syncPoint
- the uri to checkpublic boolean isUnderSyncPoint(AlluxioURI path)
path
- path to checkpublic 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)
File.AddSyncPointEntry
and journal the entry.context
- journal contextentry
- addSyncPoint entrypublic void applyAndJournal(java.util.function.Supplier<JournalContext> context, File.RemoveSyncPointEntry entry)
File.RemoveSyncPointEntry
and journal the entry.context
- journal contextentry
- removeSyncPoint entrypublic void startSyncAndJournal(RpcContext rpcContext, AlluxioURI syncPoint) throws InvalidPathException
rpcContext
- the master rpc or no-op contextsyncPoint
- sync point to be startInvalidPathException
public void stopSyncForMount(long mountId) throws InvalidPathException
mountId
- mountId to stop active syncInvalidPathException
public void stopSyncAndJournal(RpcContext rpcContext, AlluxioURI syncPoint) throws InvalidPathException
rpcContext
- the master rpc or no-op contextsyncPoint
- sync point to be stoppedInvalidPathException
public List<AlluxioURI> getFilterList(long mountId)
mountId
- mountIdpublic List<SyncPointInfo> getSyncPathList()
public void setTxId(long mountId, long txId)
mountId
- mount idtxId
- transaction idpublic ExecutorService getExecutor()
public void stop()
public void recoverFromStopSync(AlluxioURI uri)
uri
- uri to stop syncpublic 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 CloseableIterator<Journal.JournalEntry> getJournalEntryIterator()
getJournalEntryIterator
in interface JournalEntryIterable
CloseableIterator
that iterates all the journal entriesCopyright © 2023. All Rights Reserved.