@Override public DaRPCNameNodeFuture<RpcGetBlock> getBlock(long fd, long token, long position, long capacity) throws IOException { if (CrailConstants.DEBUG){ LOG.debug("RPC: getBlock, fd " + fd + ", token " + token + ", position " + position + ", capacity " + capacity); } RpcRequestMessage.GetBlockReq getBlockReq = new RpcRequestMessage.GetBlockReq(fd, token, position, capacity); DaRPCNameNodeRequest request = new DaRPCNameNodeRequest(getBlockReq); request.setCommand(RpcProtocol.CMD_GET_BLOCK); RpcResponseMessage.GetBlockRes getBlockRes = new RpcResponseMessage.GetBlockRes(); DaRPCNameNodeResponse response = new DaRPCNameNodeResponse(getBlockRes); DaRPCFuture<DaRPCNameNodeRequest, DaRPCNameNodeResponse> future = issueRPC(request, response); DaRPCNameNodeFuture<RpcGetBlock> nameNodeFuture = new DaRPCNameNodeFuture<RpcGetBlock>(future, getBlockRes); return nameNodeFuture; }
break; case RpcProtocol.REQ_GET_BLOCK: getBlockReq.update(buffer); break; case RpcProtocol.REQ_GET_LOCATION:
break; case RpcProtocol.REQ_GET_BLOCK: written += getBlockReq.write(buffer); break; case RpcProtocol.REQ_GET_LOCATION:
long fd = request.getFd(); long token = request.getToken(); long position = request.getPosition(); long capacity = request.getCapacity();
break; case RpcProtocol.REQ_GET_BLOCK: written += getBlockReq.write(buffer); break; case RpcProtocol.REQ_GET_LOCATION:
break; case RpcProtocol.REQ_GET_BLOCK: getBlockReq.update(buffer); break; case RpcProtocol.REQ_GET_LOCATION:
break; case RpcProtocol.REQ_GET_BLOCK: getBlockReq.update(buffer); break; case RpcProtocol.REQ_GET_LOCATION:
break; case RpcProtocol.REQ_GET_BLOCK: written += getBlockReq.write(buffer); break; case RpcProtocol.REQ_GET_LOCATION:
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 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 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 DaRPCNameNodeRequest(RpcRequestMessage.GetBlockReq message) { this.type = message.getType(); this.getBlockReq = message; }
public LogRecord(RpcRequestMessage.GetBlockReq message) { this.type = message.getType(); this.getBlockReq = message; }
public TcpNameNodeRequest(RpcRequestMessage.GetBlockReq message) { this.type = message.getType(); this.getBlockReq = message; }
public RpcFuture<RpcGetBlock> getBlock(long fd, long token, long position, long capacity) throws IOException { RpcRequestMessage.GetBlockReq req = new RpcRequestMessage.GetBlockReq(fd, token, position, capacity); RpcResponseMessage.GetBlockRes resp = new RpcResponseMessage.GetBlockRes(); TcpNameNodeRequest request = new TcpNameNodeRequest(req); TcpNameNodeResponse response = new TcpNameNodeResponse(resp); request.setCommand(RpcProtocol.CMD_GET_BLOCK); NaRPCFuture<TcpNameNodeRequest, TcpNameNodeResponse> future = endpoint.issueRequest(request, response); return new TcpFuture<RpcGetBlock>(future, resp); }