public static DatanodeLocalInfoProto convert(DatanodeLocalInfo info) { DatanodeLocalInfoProto.Builder builder = DatanodeLocalInfoProto.newBuilder(); builder.setSoftwareVersion(info.getSoftwareVersion()); builder.setConfigVersion(info.getConfigVersion()); builder.setUptime(info.getUptime()); return builder.build(); }
@Override public DatanodeLocalInfo getDatanodeInfo() throws IOException { GetDatanodeInfoResponseProto response; try { response = rpcProxy.getDatanodeInfo(NULL_CONTROLLER, VOID_GET_DATANODE_INFO); return PBHelper.convert(response.getLocalInfo()); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
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; }
@Override public DatanodeLocalInfo getDatanodeInfo() throws IOException { GetDatanodeInfoResponseProto response; try { response = rpcProxy.getDatanodeInfo(NULL_CONTROLLER, VOID_GET_DATANODE_INFO); return PBHelperClient.convert(response.getLocalInfo()); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
@Override //ClientDatanodeProtocol public DatanodeLocalInfo getDatanodeInfo() { long uptime = ManagementFactory.getRuntimeMXBean().getUptime()/1000; return new DatanodeLocalInfo(VersionInfo.getVersion(), confVersion, uptime); }
public static DatanodeLocalInfo convert(DatanodeLocalInfoProto proto) { return new DatanodeLocalInfo(proto.getSoftwareVersion(), proto.getConfigVersion(), proto.getUptime()); }