public class DoraMetaManager extends Object implements Closeable
Constructor and Description |
---|
DoraMetaManager(AlluxioConfiguration conf,
PagedDoraWorker doraWorker,
CacheManager cacheManger,
DoraUfsManager ufsManager)
Creates a dora meta manager.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
Optional<DoraMeta.FileStatus> |
getFromMetaStore(String path)
Gets file meta from the metastore.
|
Optional<DoraMeta.FileStatus> |
getFromUfs(String path)
Gets file meta from UFS.
|
void |
invalidateListingCache(String path)
Invalidates the listing cache of a given path.
|
void |
invalidateListingCacheOfParent(String path)
Invalidates the listing cache of its parent of a given path.
|
Optional<ListStatusResult> |
listCached(String path,
boolean isRecursive)
Get the cached listing result from the listing cache.
|
Optional<UfsStatus[]> |
listFromUfs(String path,
boolean isRecursive)
Lists a directory from UFS.
|
Optional<UfsStatus[]> |
listFromUfsThenCache(String path,
boolean isRecursive)
Lists a directory from UFS and cache it into the listing cache if it exists.
|
Optional<DoraMeta.FileStatus> |
loadFromUfs(String path)
Gets file meta from UFS and loads it into metastore if exists.
|
void |
put(String path,
DoraMeta.FileStatus status)
Puts meta of a file into the metastore, and invalidates the file data cache.
|
Optional<DoraMeta.FileStatus> |
removeFromMetaStore(String path)
Removes meta of a file from the meta store.
|
public DoraMetaManager(AlluxioConfiguration conf, PagedDoraWorker doraWorker, CacheManager cacheManger, DoraUfsManager ufsManager)
conf
- configurationdoraWorker
- the dora worker instancecacheManger
- the cache manager to manage the page cacheufsManager
- the ufs Managerpublic Optional<DoraMeta.FileStatus> getFromUfs(String path) throws IOException
path
- the full ufs pathIOException
public Optional<DoraMeta.FileStatus> loadFromUfs(String path) throws IOException
path
- the full ufs pathIOException
public Optional<DoraMeta.FileStatus> getFromMetaStore(String path)
path
- the full ufs pathpublic void put(String path, DoraMeta.FileStatus status)
path
- the full ufs pathstatus
- the file metapublic Optional<DoraMeta.FileStatus> removeFromMetaStore(String path)
path
- the full ufs pathpublic void invalidateListingCache(String path)
path
- the full ufs pathpublic void invalidateListingCacheOfParent(String path)
path
- the full ufs pathpublic Optional<ListStatusResult> listCached(String path, boolean isRecursive)
path
- the full ufs path to listisRecursive
- if the list is recursivepublic Optional<UfsStatus[]> listFromUfsThenCache(String path, boolean isRecursive) throws IOException
path
- the ufs pathisRecursive
- if the listing is recursiveIOException
- if the UFS call failedpublic Optional<UfsStatus[]> listFromUfs(String path, boolean isRecursive) throws IOException
path
- the ufs pathisRecursive
- if the listing is recursiveIOException
- if the UFS call failedpublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2023. All Rights Reserved.