public void dumpNameNode() throws Exception { rpcConnection.dumpNameNode().get(CrailConstants.RPC_TIMEOUT, TimeUnit.MILLISECONDS); }
RpcGetBlock getBlockRes = rpcFuture.get(CrailConstants.RPC_TIMEOUT, TimeUnit.MILLISECONDS); if (!rpcFuture.isDone()){ throw new IOException("rpc timeout ");
public void closeFile(FileInfo fileInfo) throws Exception { if (fileInfo.getToken() > 0){ rpcConnection.setFile(fileInfo, true).get(CrailConstants.RPC_TIMEOUT, TimeUnit.MILLISECONDS); } }
public void ping() throws Exception { RpcPing pingRes = rpcConnection.pingNameNode().get(CrailConstants.RPC_TIMEOUT, TimeUnit.MILLISECONDS); if (pingRes.getError() != RpcErrors.ERR_OK) { LOG.info("Ping: " + RpcErrors.messages[pingRes.getError()]); throw new IOException(RpcErrors.messages[pingRes.getError()]); } }
public DataNodeStatistics getDataNode() throws Exception{ InetSocketAddress inetAddress = serverAddress; DataNodeInfo dnInfo = new DataNodeInfo(storageType, storageClass.value(), locationClass.value(), inetAddress.getAddress().getAddress(), inetAddress.getPort()); return this.rpcConnection.getDataNode(dnInfo).get(CrailConstants.RPC_TIMEOUT, TimeUnit.MILLISECONDS).getStatistics(); } }
public void setBlock(long lba, long addr, int length, int key) throws Exception { InetSocketAddress inetAddress = serverAddress; DataNodeInfo dnInfo = new DataNodeInfo(storageType, storageClass.value(), locationClass.value(), inetAddress.getAddress().getAddress(), inetAddress.getPort()); BlockInfo blockInfo = new BlockInfo(dnInfo, lba, addr, length, key); RpcVoid res = rpcConnection.setBlock(blockInfo).get(CrailConstants.RPC_TIMEOUT, TimeUnit.MILLISECONDS); if (res.getError() != RpcErrors.ERR_OK){ LOG.info("setBlock: " + RpcErrors.messages[res.getError()]); throw new IOException("setBlock: " + RpcErrors.messages[res.getError()]); } }
public DirectoryInputStream _listEntries(String name, boolean randomize) throws Exception { FileName directory = new FileName(name); if (CrailConstants.DEBUG){ LOG.info("getDirectoryList: " + name); } RpcGetFile fileRes = rpcConnection.getFile(directory, false).get(CrailConstants.RPC_TIMEOUT, TimeUnit.MILLISECONDS); if (fileRes.getError() != RpcErrors.ERR_OK) { LOG.info("getDirectoryList: " + RpcErrors.messages[fileRes.getError()]); throw new FileNotFoundException(RpcErrors.messages[fileRes.getError()]); } FileInfo dirInfo = fileRes.getFile(); if (!dirInfo.getType().isContainer()){ LOG.info("getDirectoryList: " + RpcErrors.messages[RpcErrors.ERR_FILE_IS_NOT_DIR]); throw new FileNotFoundException(RpcErrors.messages[RpcErrors.ERR_FILE_IS_NOT_DIR]); } CoreDirectory dirFile = new CoreDirectory(this, dirInfo, name); DirectoryInputStream inputStream = dirFile.getDirectoryInputStream(randomize); return inputStream; }
RpcGetLocation getLocationRes = rpcConnection.getLocation(name, current).get(CrailConstants.RPC_TIMEOUT, TimeUnit.MILLISECONDS); if (getLocationRes.getError() != RpcErrors.ERR_OK) { LOG.info("location: " + RpcErrors.messages[getLocationRes.getError()]);