@Override public DaRPCNameNodeFuture<RpcVoid> setFile(FileInfo fileInfo, boolean close) throws IOException { if (CrailConstants.DEBUG){ LOG.debug("RPC: setFile, id " + fileInfo.getFd() + ", close " + close); } RpcRequestMessage.SetFileReq setFileReq = new RpcRequestMessage.SetFileReq(fileInfo, close); DaRPCNameNodeRequest request = new DaRPCNameNodeRequest(setFileReq); request.setCommand(RpcProtocol.CMD_SET_FILE); RpcResponseMessage.VoidRes voidRes = new RpcResponseMessage.VoidRes(); DaRPCNameNodeResponse response = new DaRPCNameNodeResponse(voidRes); DaRPCFuture<DaRPCNameNodeRequest, DaRPCNameNodeResponse> future = issueRPC(request, response); DaRPCNameNodeFuture<RpcVoid> nameNodeFuture = new DaRPCNameNodeFuture<RpcVoid>(future, voidRes); return nameNodeFuture; }
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 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 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 RpcFuture<RpcVoid> setFile(FileInfo fileInfo, boolean b) throws IOException { RpcRequestMessage.SetFileReq req = new RpcRequestMessage.SetFileReq(fileInfo, b); RpcResponseMessage.VoidRes resp = new RpcResponseMessage.VoidRes(); TcpNameNodeRequest request = new TcpNameNodeRequest(req); TcpNameNodeResponse response = new TcpNameNodeResponse(resp); request.setCommand(RpcProtocol.CMD_SET_FILE); NaRPCFuture<TcpNameNodeRequest, TcpNameNodeResponse> future = endpoint.issueRequest(request, response); return new TcpFuture<RpcVoid>(future, resp); }