ActiveNamenodeResolver, StateStoreCachepublic class MembershipNamenodeResolver extends java.lang.Object implements ActiveNamenodeResolver, StateStoreCache
StateStoreService to
discover available nameservices and namenodes.| Constructor | Description |
|---|---|
MembershipNamenodeResolver(org.apache.hadoop.conf.Configuration conf,
StateStoreService store) |
| Modifier and Type | Method | Description |
|---|---|---|
java.util.Set<java.lang.String> |
getDisabledNamespaces() |
Get a list of all namespaces that are disabled.
|
java.util.List<? extends FederationNamenodeContext> |
getNamenodesForBlockPoolId(java.lang.String bpId) |
Returns a prioritized list of the most recent cached registration entries
for a single block pool ID.
|
java.util.List<? extends FederationNamenodeContext> |
getNamenodesForNameserviceId(java.lang.String nsId,
boolean listObserversFirst) |
Returns a prioritized list of the most recent cached registration entries
for a single nameservice ID.
|
java.util.Set<FederationNamespaceInfo> |
getNamespaces() |
Get a list of all namespaces that are registered and active in the
federation.
|
boolean |
loadCache(boolean force) |
Load the cache from the State Store.
|
boolean |
registerNamenode(NamenodeStatusReport report) |
Register a namenode in the State Store.
|
void |
rotateCache(java.lang.String nsId,
FederationNamenodeContext namenode,
boolean listObserversFirst) |
Rotate cache, make the current namenode have the lowest priority,
to ensure that the current namenode will not be accessed first next time.
|
void |
setRouterId(java.lang.String router) |
Assign a unique identifier for the parent router service.
|
void |
updateActiveNamenode(java.lang.String nsId,
java.net.InetSocketAddress address) |
Report a successful, active NN address for a nameservice or blockPool.
|
void |
updateUnavailableNamenode(java.lang.String nsId,
java.net.InetSocketAddress address) |
Report a failed, unavailable NN address for a nameservice or blockPool.
|
public MembershipNamenodeResolver(org.apache.hadoop.conf.Configuration conf,
StateStoreService store)
throws java.io.IOException
java.io.IOExceptionpublic boolean loadCache(boolean force)
StateStoreCacheloadCache in interface StateStoreCacheforce - If we force the load.public void updateUnavailableNamenode(java.lang.String nsId,
java.net.InetSocketAddress address)
throws java.io.IOException
ActiveNamenodeResolverupdateUnavailableNamenode in interface ActiveNamenodeResolvernsId - Nameservice identifier.address - The address the failed responded to the command.java.io.IOException - If the state store cannot be accessed.public void updateActiveNamenode(java.lang.String nsId,
java.net.InetSocketAddress address)
throws java.io.IOException
ActiveNamenodeResolverupdateActiveNamenode in interface ActiveNamenodeResolvernsId - Nameservice identifier.address - The address the successful responded to the
command.java.io.IOException - If the state store cannot be accessed.public java.util.List<? extends FederationNamenodeContext> getNamenodesForNameserviceId(java.lang.String nsId, boolean listObserversFirst) throws java.io.IOException
ActiveNamenodeResolvergetNamenodesForNameserviceId in interface ActiveNamenodeResolvernsId - Nameservice identifier.listObserversFirst - Observer read case, observer NN will be ranked firstjava.io.IOException - If the state store cannot be accessed.public java.util.List<? extends FederationNamenodeContext> getNamenodesForBlockPoolId(java.lang.String bpId) throws java.io.IOException
ActiveNamenodeResolvergetNamenodesForBlockPoolId in interface ActiveNamenodeResolverbpId - Block pool identifier for the nameservice.java.io.IOException - If the state store cannot be accessed.public boolean registerNamenode(NamenodeStatusReport report) throws java.io.IOException
ActiveNamenodeResolverregisterNamenode in interface ActiveNamenodeResolverreport - Namenode status report.java.io.IOException - Throws exception if the namenode could not be
registered.public java.util.Set<FederationNamespaceInfo> getNamespaces() throws java.io.IOException
ActiveNamenodeResolvergetNamespaces in interface ActiveNamenodeResolverjava.io.IOException - Throws exception if the namespace list is not
available.public java.util.Set<java.lang.String> getDisabledNamespaces()
throws java.io.IOException
ActiveNamenodeResolvergetDisabledNamespaces in interface ActiveNamenodeResolverjava.io.IOException - If the disabled list is not available.public void setRouterId(java.lang.String router)
ActiveNamenodeResolversetRouterId in interface ActiveNamenodeResolverrouter - Unique string identifier for the router.public void rotateCache(java.lang.String nsId,
FederationNamenodeContext namenode,
boolean listObserversFirst)
rotateCache in interface ActiveNamenodeResolvernsId - name service id.namenode - namenode contexts.listObserversFirst - Observer read case, observer NN will be ranked first.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.