@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
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() |
java.util.concurrent.ExecutorService |
getExecutor()
Get SyncManager Executor.
|
java.util.List<AlluxioURI> |
getFilterList(long mountId)
Get the filter list associated with mount Id.
|
CloseableIterator<Journal.JournalEntry> |
getJournalEntryIterator() |
java.util.concurrent.locks.Lock |
getLock()
Gets the lock protecting the syncManager.
|
java.util.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) |
void |
recoverFromStartSync(AlluxioURI uri,
long mountId)
Recover from start sync operation.
|
void |
recoverFromStopSync(AlluxioURI uri)
Recover from a stop sync operation.
|
void |
resetState()
It clears all sync points, and stops the polling thread.
|
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, waitapplyAndJournal, restoreFromCheckpoint, writeToCheckpointpublic ActiveSyncManager(MountTable mountTable, FileSystemMaster fileSystemMaster)
mountTable - mount tablefileSystemMaster - file system masterpublic java.util.concurrent.locks.Lock getLock()
public boolean isSyncPoint(AlluxioURI syncPoint)
syncPoint - the uri to checkpublic boolean isUnderSyncPoint(AlluxioURI path)
path - path to checkpublic 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)
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 startInvalidPathExceptionpublic void stopSyncForMount(long mountId)
throws InvalidPathException
mountId - mountId to stop active syncInvalidPathExceptionpublic void stopSyncAndJournal(RpcContext rpcContext, AlluxioURI syncPoint) throws InvalidPathException
rpcContext - the master rpc or no-op contextsyncPoint - sync point to be stoppedInvalidPathExceptionpublic java.util.List<AlluxioURI> getFilterList(long mountId)
mountId - mountIdpublic java.util.List<SyncPointInfo> getSyncPathList()
public void setTxId(long mountId,
long txId)
mountId - mount idtxId - transaction idpublic java.util.concurrent.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)
processJournalEntry in interface Journaledpublic void resetState()
resetState in interface Journaledpublic CheckpointName getCheckpointName()
getCheckpointName in interface Checkpointedpublic CloseableIterator<Journal.JournalEntry> getJournalEntryIterator()
getJournalEntryIterator in interface JournalEntryIterableCopyright © 2020. All Rights Reserved.