FileSubclusterResolver, StateStoreCacheMultipleDestinationMountTableResolverpublic class MountTableResolver extends java.lang.Object implements FileSubclusterResolver, StateStoreCache
Router to map
the global HDFS view to the remote namespaces. This is similar to
ViewFs.
This is implemented as a tree.| Constructor | Description |
|---|---|
MountTableResolver(org.apache.hadoop.conf.Configuration conf) |
|
MountTableResolver(org.apache.hadoop.conf.Configuration conf,
Router routerService) |
|
MountTableResolver(org.apache.hadoop.conf.Configuration conf,
Router routerService,
StateStoreService store) |
|
MountTableResolver(org.apache.hadoop.conf.Configuration conf,
StateStoreService store) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addEntry(MountTable entry) |
Add a mount entry to the table.
|
void |
clear() |
Clears all data.
|
protected long |
getCacheSize() |
Get the size of the cache.
|
java.lang.String |
getDefaultNameService() |
|
java.lang.String |
getDefaultNamespace() |
Get the default namespace for the cluster.
|
PathLocation |
getDestinationForPath(java.lang.String path) |
Get the destinations for a global path.
|
java.util.concurrent.atomic.LongAdder |
getLocCacheAccess() |
|
java.util.concurrent.atomic.LongAdder |
getLocCacheMiss() |
|
MountTable |
getMountPoint(java.lang.String path) |
Get the mount table entry for a path.
|
java.util.List<java.lang.String> |
getMountPoints(java.lang.String str) |
Get a list of mount points for a path.
|
java.util.List<MountTable> |
getMounts(java.lang.String path) |
Get all the mount records at or beneath a given path.
|
protected MountTableStore |
getMountTableStore() |
Get the mount table store for this resolver.
|
protected Router |
getRouter() |
Get a reference for the Router for this resolver.
|
static java.lang.String |
getTrashRoot() |
|
boolean |
isDefaultNSEnable() |
|
static boolean |
isTrashPath(java.lang.String path) |
Check if path is the trail associated with the Trash.
|
boolean |
loadCache(boolean force) |
Replaces the current in-memory cached of the mount table with a new
version fetched from the data store.
|
PathLocation |
lookupLocation(java.lang.String str) |
Build the path location to insert into the cache atomically.
|
void |
refreshEntries(java.util.Collection<MountTable> entries) |
Updates the mount path tree with a new set of mount table entries.
|
void |
removeEntry(java.lang.String srcPath) |
Remove a mount table entry.
|
void |
setDefaultNameService(java.lang.String defaultNameService) |
|
void |
setDefaultNSEnable(boolean defaultNSRWEnable) |
|
void |
setDisabled(boolean disable) |
|
static java.lang.String |
subtractTrashCurrentPath(java.lang.String path) |
Subtract a TrashCurrent to get a new path.
|
java.lang.String |
toString() |
@VisibleForTesting public MountTableResolver(org.apache.hadoop.conf.Configuration conf)
public MountTableResolver(org.apache.hadoop.conf.Configuration conf,
Router routerService)
public MountTableResolver(org.apache.hadoop.conf.Configuration conf,
StateStoreService store)
public MountTableResolver(org.apache.hadoop.conf.Configuration conf,
Router routerService,
StateStoreService store)
protected Router getRouter()
protected MountTableStore getMountTableStore() throws java.io.IOException
java.io.IOException - If it cannot connect to the State Store.public void addEntry(MountTable entry)
entry - The mount table record to add from the state store.public void removeEntry(java.lang.String srcPath)
srcPath - Source path for the entry to remove.@VisibleForTesting public void refreshEntries(java.util.Collection<MountTable> entries)
entries - Full set of mount table entries to update.@VisibleForTesting
public static boolean isTrashPath(java.lang.String path)
throws java.io.IOException
path - a path.java.io.IOException - if retrieving current user's trash directory fails.@VisibleForTesting
public static java.lang.String getTrashRoot()
throws java.io.IOException
java.io.IOException@VisibleForTesting
public static java.lang.String subtractTrashCurrentPath(java.lang.String path)
throws java.io.IOException
path - a path.java.io.IOException - if retrieving current user's trash directory fails.public boolean loadCache(boolean force)
loadCache in interface StateStoreCacheforce - If we force the load.public void clear()
public PathLocation getDestinationForPath(java.lang.String path) throws java.io.IOException
FileSubclusterResolvergetDestinationForPath in interface FileSubclusterResolverpath - Global path.java.io.IOException - Throws exception if the data is not available.public PathLocation lookupLocation(java.lang.String str) throws java.io.IOException
str - Path to check/insert.java.io.IOException - If it cannot find the location.public MountTable getMountPoint(java.lang.String path) throws java.io.IOException
path - Path to look for.java.io.IOException - If the State Store could not be reached.public java.util.List<java.lang.String> getMountPoints(java.lang.String str)
throws java.io.IOException
FileSubclusterResolvergetMountPoints in interface FileSubclusterResolverstr - Path to get the mount points under.java.io.IOException - Throws exception if the data is not available.public java.util.List<MountTable> getMounts(java.lang.String path) throws java.io.IOException
path - Path to get the mount points from.java.io.IOException - If it's not connected to the State Store.public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getDefaultNamespace()
FileSubclusterResolvergetDefaultNamespace in interface FileSubclusterResolverprotected long getCacheSize()
throws java.io.IOException
java.io.IOException - If the cache is not initialized.@VisibleForTesting public java.lang.String getDefaultNameService()
@VisibleForTesting public void setDefaultNameService(java.lang.String defaultNameService)
@VisibleForTesting public boolean isDefaultNSEnable()
@VisibleForTesting public void setDefaultNSEnable(boolean defaultNSRWEnable)
@VisibleForTesting public void setDisabled(boolean disable)
public java.util.concurrent.atomic.LongAdder getLocCacheMiss()
public java.util.concurrent.atomic.LongAdder getLocCacheAccess()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.