Class NameNodeConnector
java.lang.Object
org.apache.hadoop.hdfs.server.balancer.NameNodeConnector
- All Implemented Interfaces:
Closeable,AutoCloseable
The class provides utilities for accessing a NameNode.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNameNodeConnector(String name, URI nameNodeUri, String nsId, org.apache.hadoop.fs.Path idPath, List<org.apache.hadoop.fs.Path> targetPaths, org.apache.hadoop.conf.Configuration conf, int maxNotChangedIterations) NameNodeConnector(String name, URI nameNodeUri, org.apache.hadoop.fs.Path idPath, List<org.apache.hadoop.fs.Path> targetPaths, org.apache.hadoop.conf.Configuration conf, int maxNotChangedIterations) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBytesMoved(long numBytes) static voidcheckOtherInstanceRunning(boolean toCheck) voidclose()getBlocks(org.apache.hadoop.hdfs.protocol.DatanodeInfo datanode, long size, long minBlockSize, long timeInterval, org.apache.hadoop.fs.StorageType storageType) org.apache.hadoop.hdfs.DistributedFileSystemReturns fallbackToSimpleAuth.org.apache.hadoop.hdfs.server.protocol.DatanodeStorageReport[]List<org.apache.hadoop.fs.Path>booleanstatic List<NameNodeConnector>newNameNodeConnectors(Collection<URI> namenodes, String name, org.apache.hadoop.fs.Path idPath, org.apache.hadoop.conf.Configuration conf, int maxIdleIterations) CreateNameNodeConnectorfor the given namenodes.static List<NameNodeConnector>newNameNodeConnectors(Collection<URI> namenodes, Collection<String> nsIds, String name, org.apache.hadoop.fs.Path idPath, org.apache.hadoop.conf.Configuration conf, int maxIdleIterations) static List<NameNodeConnector>newNameNodeConnectors(Map<URI, List<org.apache.hadoop.fs.Path>> namenodes, String name, org.apache.hadoop.fs.Path idPath, org.apache.hadoop.conf.Configuration conf, int maxIdleIterations) static voidsetWrite2IdFile(boolean write2IdFile) booleanshouldContinue(long dispatchBlockMoveBytes) Should the instance continue running?toString()
-
Field Details
-
DEFAULT_MAX_IDLE_ITERATIONS
public static final int DEFAULT_MAX_IDLE_ITERATIONS- See Also:
-
-
Constructor Details
-
NameNodeConnector
public NameNodeConnector(String name, URI nameNodeUri, org.apache.hadoop.fs.Path idPath, List<org.apache.hadoop.fs.Path> targetPaths, org.apache.hadoop.conf.Configuration conf, int maxNotChangedIterations) throws IOException - Throws:
IOException
-
NameNodeConnector
public NameNodeConnector(String name, URI nameNodeUri, String nsId, org.apache.hadoop.fs.Path idPath, List<org.apache.hadoop.fs.Path> targetPaths, org.apache.hadoop.conf.Configuration conf, int maxNotChangedIterations) throws IOException - Throws:
IOException
-
-
Method Details
-
newNameNodeConnectors
public static List<NameNodeConnector> newNameNodeConnectors(Collection<URI> namenodes, String name, org.apache.hadoop.fs.Path idPath, org.apache.hadoop.conf.Configuration conf, int maxIdleIterations) throws IOException CreateNameNodeConnectorfor the given namenodes.- Throws:
IOException
-
newNameNodeConnectors
public static List<NameNodeConnector> newNameNodeConnectors(Map<URI, List<org.apache.hadoop.fs.Path>> namenodes, String name, org.apache.hadoop.fs.Path idPath, org.apache.hadoop.conf.Configuration conf, int maxIdleIterations) throws IOException- Throws:
IOException
-
newNameNodeConnectors
public static List<NameNodeConnector> newNameNodeConnectors(Collection<URI> namenodes, Collection<String> nsIds, String name, org.apache.hadoop.fs.Path idPath, org.apache.hadoop.conf.Configuration conf, int maxIdleIterations) throws IOException - Throws:
IOException
-
setWrite2IdFile
@VisibleForTesting public static void setWrite2IdFile(boolean write2IdFile) -
checkOtherInstanceRunning
@VisibleForTesting public static void checkOtherInstanceRunning(boolean toCheck) -
getDistributedFileSystem
public org.apache.hadoop.hdfs.DistributedFileSystem getDistributedFileSystem() -
getBlockpoolID
- Returns:
- the block pool ID
-
getBytesMoved
-
getBlocksMoved
-
getBlocksFailed
-
addBytesMoved
public void addBytesMoved(long numBytes) -
getNameNodeUri
-
getBlocks
public BlocksWithLocations getBlocks(org.apache.hadoop.hdfs.protocol.DatanodeInfo datanode, long size, long minBlockSize, long timeInterval, org.apache.hadoop.fs.StorageType storageType) throws IOException - Returns:
- blocks with locations.
- Throws:
IOException
-
isUpgrading
- Returns:
- true if an upgrade is in progress, false if not.
- Throws:
IOException
-
getLiveDatanodeStorageReport
public org.apache.hadoop.hdfs.server.protocol.DatanodeStorageReport[] getLiveDatanodeStorageReport() throws IOException- Returns:
- live datanode storage reports.
- Throws:
IOException
-
getKeyManager
- Returns:
- the key manager
-
getTargetPaths
- Returns:
- the list of paths to scan/migrate
-
shouldContinue
public boolean shouldContinue(long dispatchBlockMoveBytes) Should the instance continue running? -
getFallbackToSimpleAuth
Returns fallbackToSimpleAuth. This will be true or false during calls to indicate if a secure client falls back to simple auth. -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getNNProtocolConnection
-
toString
-