private int refreshNamenodes(String[] argv, int i) throws IOException { String datanode = argv[i]; ClientDatanodeProtocol refreshProtocol = getDataNodeProxy(datanode); refreshProtocol.refreshNamenodes(); return 0; }
private int evictWriters(String[] argv, int i) throws IOException { final String dn = argv[i]; ClientDatanodeProtocol dnProxy = getDataNodeProxy(dn); try { dnProxy.evictWriters(); System.out.println("Requested writer eviction to datanode " + dn); } catch (IOException ioe) { throw new IOException("Datanode unreachable. " + ioe, ioe); } return 0; }
private int getVolumeReport(String[] argv, int i) throws IOException { ClientDatanodeProtocol datanode = getDataNodeProxy(argv[i]); List<DatanodeVolumeInfo> volumeReport = datanode .getVolumeReport(); System.out.println("Active Volumes : " + volumeReport.size()); for (DatanodeVolumeInfo info : volumeReport) { System.out.println("\n" + info.getDatanodeVolumeReport()); } return 0; }
/** * Command to get balancer bandwidth for the given datanode. Usage: hdfs * dfsadmin -getBalancerBandwidth {@literal <datanode_host:ipc_port>} * @param argv List of of command line parameters. * @param idx The index of the command that is being processed. * @exception IOException */ public int getBalancerBandwidth(String[] argv, int idx) throws IOException { ClientDatanodeProtocol dnProxy = getDataNodeProxy(argv[idx]); try { long bandwidth = dnProxy.getBalancerBandwidth(); System.out.println("Balancer bandwidth is " + bandwidth + " bytes per second."); } catch (IOException ioe) { throw new IOException("Datanode unreachable. " + ioe, ioe); } return 0; }
private int getDatanodeInfo(String[] argv, int i) throws IOException { ClientDatanodeProtocol dnProxy = getDataNodeProxy(argv[i]); try { DatanodeLocalInfo dnInfo = dnProxy.getDatanodeInfo(); System.out.println(dnInfo.getDatanodeLocalReport()); } catch (IOException ioe) { throw new IOException("Datanode unreachable. " + ioe, ioe); } return 0; }
private int shutdownDatanode(String[] argv, int i) throws IOException { final String dn = argv[i]; ClientDatanodeProtocol dnProxy = getDataNodeProxy(dn); boolean upgrade = false; if (argv.length-1 == i+1) { if ("upgrade".equalsIgnoreCase(argv[i+1])) { upgrade = true; } else { printUsage("-shutdownDatanode"); return -1; } } dnProxy.shutdownDatanode(upgrade); System.out.println("Submitted a shutdown request to datanode " + dn); return 0; }
private int deleteBlockPool(String[] argv, int i) throws IOException { ClientDatanodeProtocol dnProxy = getDataNodeProxy(argv[i]); boolean force = false; if (argv.length-1 == i+2) { if ("force".equals(argv[i+2])) { force = true; } else { printUsage("-deleteBlockPool"); return -1; } } dnProxy.deleteBlockPool(argv[i+1], force); return 0; }
List<String> getReconfigurablePropertiesDispatch(final String nodeType, final String address, final PrintStream out, final PrintStream err) throws IOException { if ("namenode".equals(nodeType)) { ReconfigurationProtocol reconfProxy = getNameNodeProxy(address); return reconfProxy.listReconfigurableProperties(); } else if ("datanode".equals(nodeType)) { ClientDatanodeProtocol reconfProxy = getDataNodeProxy(address); return reconfProxy.listReconfigurableProperties(); } else { err.println("Node type " + nodeType + " does not support reconfiguration."); return null; } }
ReconfigurationTaskStatus getReconfigurationStatusDispatch( final String nodeType, final String address, final PrintStream out, final PrintStream err) throws IOException { if ("namenode".equals(nodeType)) { ReconfigurationProtocol reconfProxy = getNameNodeProxy(address); return reconfProxy.getReconfigurationStatus(); } else if ("datanode".equals(nodeType)) { ClientDatanodeProtocol reconfProxy = getDataNodeProxy(address); return reconfProxy.getReconfigurationStatus(); } else { err.println("Node type " + nodeType + " does not support reconfiguration."); return null; } }
int startReconfigurationDispatch(final String nodeType, final String address, final PrintStream out, final PrintStream err) throws IOException { if ("namenode".equals(nodeType)) { ReconfigurationProtocol reconfProxy = getNameNodeProxy(address); reconfProxy.startReconfiguration(); return 0; } else if ("datanode".equals(nodeType)) { ClientDatanodeProtocol reconfProxy = getDataNodeProxy(address); reconfProxy.startReconfiguration(); return 0; } else { System.err.println("Node type " + nodeType + " does not support reconfiguration."); return 1; } }
return 1; ClientDatanodeProtocol dnProxy = getDataNodeProxy(hostPort); try { dnProxy.triggerBlockReport(
private int refreshNamenodes(String[] argv, int i) throws IOException { String datanode = argv[i]; ClientDatanodeProtocol refreshProtocol = getDataNodeProxy(datanode); refreshProtocol.refreshNamenodes(); return 0; }
int startReconfiguration(String nodeType, String address) throws IOException { if ("datanode".equals(nodeType)) { ClientDatanodeProtocol dnProxy = getDataNodeProxy(address); dnProxy.startReconfiguration(); System.out.println("Started reconfiguration task on DataNode " + address); return 0; } else { System.err.println("Node type " + nodeType + " does not support reconfiguration."); return 1; } }
int startReconfiguration(String nodeType, String address) throws IOException { if ("datanode".equals(nodeType)) { ClientDatanodeProtocol dnProxy = getDataNodeProxy(address); dnProxy.startReconfiguration(); System.out.println("Started reconfiguration task on DataNode " + address); return 0; } else { System.err.println("Node type " + nodeType + " does not support reconfiguration."); return 1; } }
private int refreshNamenodes(String[] argv, int i) throws IOException { String datanode = argv[i]; ClientDatanodeProtocol refreshProtocol = getDataNodeProxy(datanode); refreshProtocol.refreshNamenodes(); return 0; }
private int getDatanodeInfo(String[] argv, int i) throws IOException { ClientDatanodeProtocol dnProxy = getDataNodeProxy(argv[i]); try { DatanodeLocalInfo dnInfo = dnProxy.getDatanodeInfo(); System.out.println(dnInfo.getDatanodeLocalReport()); } catch (IOException ioe) { System.err.println("Datanode unreachable."); return -1; } return 0; }
private int getDatanodeInfo(String[] argv, int i) throws IOException { ClientDatanodeProtocol dnProxy = getDataNodeProxy(argv[i]); try { DatanodeLocalInfo dnInfo = dnProxy.getDatanodeInfo(); System.out.println(dnInfo.getDatanodeLocalReport()); } catch (IOException ioe) { System.err.println("Datanode unreachable."); return -1; } return 0; }
private int shutdownDatanode(String[] argv, int i) throws IOException { final String dn = argv[i]; ClientDatanodeProtocol dnProxy = getDataNodeProxy(dn); boolean upgrade = false; if (argv.length-1 == i+1) { if ("upgrade".equalsIgnoreCase(argv[i+1])) { upgrade = true; } else { printUsage("-shutdownDatanode"); return -1; } } dnProxy.shutdownDatanode(upgrade); System.out.println("Submitted a shutdown request to datanode " + dn); return 0; }
private int deleteBlockPool(String[] argv, int i) throws IOException { ClientDatanodeProtocol dnProxy = getDataNodeProxy(argv[i]); boolean force = false; if (argv.length-1 == i+2) { if ("force".equals(argv[i+2])) { force = true; } else { printUsage("-deleteBlockPool"); return -1; } } dnProxy.deleteBlockPool(argv[i+1], force); return 0; }
private int deleteBlockPool(String[] argv, int i) throws IOException { ClientDatanodeProtocol dnProxy = getDataNodeProxy(argv[i]); boolean force = false; if (argv.length-1 == i+2) { if ("force".equals(argv[i+2])) { force = true; } else { printUsage("-deleteBlockPool"); return -1; } } dnProxy.deleteBlockPool(argv[i+1], force); return 0; }