public TcpNameNodeResponse() { this.type = 0; this.error = 0; this.voidRes = new RpcResponseMessage.VoidRes(); this.createFileRes = new RpcResponseMessage.CreateFileRes(); this.getFileRes = new RpcResponseMessage.GetFileRes(); this.delFileRes = new RpcResponseMessage.DeleteFileRes(); this.renameRes = new RpcResponseMessage.RenameRes(); this.getBlockRes = new RpcResponseMessage.GetBlockRes(); this.getLocationRes = new RpcResponseMessage.GetLocationRes(); this.getDataNodeRes = new RpcResponseMessage.GetDataNodeRes(); this.pingNameNodeRes = new RpcResponseMessage.PingNameNodeRes(); }
@Override public short ping(RpcRequestMessage.PingNameNodeReq request, RpcResponseMessage.PingNameNodeRes response, RpcNameNodeState errorState) throws Exception { if (!RpcProtocol.verifyProtocol(RpcProtocol.CMD_PING_NAMENODE, request, response)){ return RpcErrors.ERR_PROTOCOL_MISMATCH; } response.setData(request.getOp()+1); return RpcErrors.ERR_OK; }
public LogRecord() { this.cmd = 0; this.type = 0; this.createFileReq = new RpcRequestMessage.CreateFileReq(); this.fileReq = new RpcRequestMessage.GetFileReq(); this.setFileReq = new RpcRequestMessage.SetFileReq(); this.removeReq = new RpcRequestMessage.RemoveFileReq(); this.renameFileReq = new RpcRequestMessage.RenameFileReq(); this.getBlockReq = new RpcRequestMessage.GetBlockReq(); this.getLocationReq = new RpcRequestMessage.GetLocationReq(); this.setBlockReq = new RpcRequestMessage.SetBlockReq(); this.dumpNameNodeReq = new RpcRequestMessage.DumpNameNodeReq(); this.pingNameNodeReq = new RpcRequestMessage.PingNameNodeReq(); this.getDataNodeReq = new RpcRequestMessage.GetDataNodeReq(); }
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 TcpNameNodeRequest(RpcRequestMessage.CreateFileReq message) { this.type = message.getType(); this.createFileReq = message; } public TcpNameNodeRequest(RpcRequestMessage.GetFileReq message) {
@Override public short dump(DumpNameNodeReq request, VoidRes response, RpcNameNodeState errorState) throws Exception { return service.dump(request, response, errorState); }
@Override public short getLocation(GetLocationReq request, GetLocationRes response, RpcNameNodeState errorState) throws Exception { return service.getLocation(request, response, errorState); }
@Override public short getDataNode(GetDataNodeReq request, GetDataNodeRes response, RpcNameNodeState errorState) throws Exception { return service.getDataNode(request, response, errorState); }
@Override public short ping(PingNameNodeReq request, PingNameNodeRes response, RpcNameNodeState errorState) throws Exception { return service.ping(request, response, errorState); }
public LogRecord(RpcRequestMessage.SetBlockReq message) { this.type = message.getType(); this.setBlockReq = message; }
public LogRecord(RpcRequestMessage.PingNameNodeReq message) { this.type = message.getType(); this.pingNameNodeReq = message; }
public DaRPCNameNodeResponse(RpcResponseMessage.PingNameNodeRes message) { this.type = message.getType(); this.pingNameNodeRes = message; }
@Override public RpcFuture<RpcGetBlock> getBlock(long fd, long token, long position, long capacity) throws IOException { int index = computeIndex(fd); // LOG.info("issuing get block for fd [" + fd + "], on index " + index); return connections[index].getBlock(fd, token, position, capacity); }
@Override public RpcFuture<RpcGetDataNode> getDataNode(DataNodeInfo dnInfo) throws Exception { // LOG.info("issuing get datanode on index " + getDataNodeIndex); RpcFuture<RpcGetDataNode> res = connections[getDataNodeIndex].getDataNode(dnInfo); getDataNodeIndex = (getDataNodeIndex + 1) % connections.length; return res; }
@Override public RpcFuture<RpcGetFile> getFile(FileName filename, boolean writeable) throws IOException { int index = computeIndex(filename.getComponent(0)); // LOG.info("issuing get file for filename [" + filename.toString() + "], on index " + index); return connections[index].getFile(filename, writeable); }
@Override public RpcFuture<RpcGetLocation> getLocation(FileName fileName, long position) throws IOException { int index = computeIndex(fileName.getComponent(0)); // LOG.info("issuing get location for filename [" + fileName.toString() + "], on index " + index); return connections[index].getLocation(fileName, position); }
public DaRPCNameNodeRequest() { this.cmd = 0; this.type = 0; this.createFileReq = new RpcRequestMessage.CreateFileReq(); this.fileReq = new RpcRequestMessage.GetFileReq(); this.setFileReq = new RpcRequestMessage.SetFileReq(); this.removeReq = new RpcRequestMessage.RemoveFileReq(); this.renameFileReq = new RpcRequestMessage.RenameFileReq(); this.getBlockReq = new RpcRequestMessage.GetBlockReq(); this.getLocationReq = new RpcRequestMessage.GetLocationReq(); this.setBlockReq = new RpcRequestMessage.SetBlockReq(); this.dumpNameNodeReq = new RpcRequestMessage.DumpNameNodeReq(); this.pingNameNodeReq = new RpcRequestMessage.PingNameNodeReq(); this.getDataNodeReq = new RpcRequestMessage.GetDataNodeReq(); }
public DaRPCNameNodeResponse() { this.type = 0; this.error = 0; this.voidRes = new RpcResponseMessage.VoidRes(); this.createFileRes = new RpcResponseMessage.CreateFileRes(); this.getFileRes = new RpcResponseMessage.GetFileRes(); this.delFileRes = new RpcResponseMessage.DeleteFileRes(); this.renameRes = new RpcResponseMessage.RenameRes(); this.getBlockRes = new RpcResponseMessage.GetBlockRes(); this.getLocationRes = new RpcResponseMessage.GetLocationRes(); this.getDataNodeRes = new RpcResponseMessage.GetDataNodeRes(); this.pingNameNodeRes = new RpcResponseMessage.PingNameNodeRes(); }
public TcpNameNodeRequest() { this.cmd = 0; this.type = 0; this.createFileReq = new RpcRequestMessage.CreateFileReq(); this.fileReq = new RpcRequestMessage.GetFileReq(); this.setFileReq = new RpcRequestMessage.SetFileReq(); this.removeReq = new RpcRequestMessage.RemoveFileReq(); this.renameFileReq = new RpcRequestMessage.RenameFileReq(); this.getBlockReq = new RpcRequestMessage.GetBlockReq(); this.getLocationReq = new RpcRequestMessage.GetLocationReq(); this.setBlockReq = new RpcRequestMessage.SetBlockReq(); this.dumpNameNodeReq = new RpcRequestMessage.DumpNameNodeReq(); this.pingNameNodeReq = new RpcRequestMessage.PingNameNodeReq(); this.getDataNodeReq = new RpcRequestMessage.GetDataNodeReq(); }
public LogResponse() { this.type = 0; this.error = 0; this.voidRes = new RpcResponseMessage.VoidRes(); this.createFileRes = new RpcResponseMessage.CreateFileRes(); this.getFileRes = new RpcResponseMessage.GetFileRes(); this.delFileRes = new RpcResponseMessage.DeleteFileRes(); this.renameRes = new RpcResponseMessage.RenameRes(); this.getBlockRes = new RpcResponseMessage.GetBlockRes(); this.getLocationRes = new RpcResponseMessage.GetLocationRes(); this.getDataNodeRes = new RpcResponseMessage.GetDataNodeRes(); this.pingNameNodeRes = new RpcResponseMessage.PingNameNodeRes(); }