break; case RpcProtocol.RES_GET_DATANODE: written += getDataNodeRes.write(buffer); break; case RpcProtocol.RES_PING_NAMENODE:
break; case RpcProtocol.RES_GET_DATANODE: written += getDataNodeRes.write(buffer); break; case RpcProtocol.RES_PING_NAMENODE:
break; case RpcProtocol.RES_GET_DATANODE: written += getDataNodeRes.write(buffer); break; case RpcProtocol.RES_PING_NAMENODE:
@Override public short getDataNode(RpcRequestMessage.GetDataNodeReq request, RpcResponseMessage.GetDataNodeRes response, RpcNameNodeState errorState) throws Exception { //check protocol if (!RpcProtocol.verifyProtocol(RpcProtocol.CMD_GET_DATANODE, request, response)){ return RpcErrors.ERR_PROTOCOL_MISMATCH; } //get params DataNodeInfo dnInfo = request.getInfo(); //rpc DataNodeBlocks dnInfoNn = blockStore.getDataNode(dnInfo); if (dnInfoNn == null){ return RpcErrors.ERR_DATANODE_NOT_REGISTERED; } dnInfoNn.touch(); response.setServiceId(serviceId); response.setFreeBlockCount(dnInfoNn.getBlockCount()); return RpcErrors.ERR_OK; }
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(); }
public TcpNameNodeResponse(RpcResponseMessage.GetDataNodeRes message) { this.type = message.getType(); this.getDataNodeRes = message; }
public DaRPCNameNodeResponse(RpcResponseMessage.GetDataNodeRes message) { this.type = message.getType(); this.getDataNodeRes = message; }
public LogResponse(RpcResponseMessage.GetDataNodeRes message) { this.type = message.getType(); this.getDataNodeRes = message; }
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 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(); }
public RpcFuture<RpcGetDataNode> getDataNode(DataNodeInfo dataNodeInfo) throws Exception { RpcRequestMessage.GetDataNodeReq req = new RpcRequestMessage.GetDataNodeReq(dataNodeInfo); RpcResponseMessage.GetDataNodeRes resp = new RpcResponseMessage.GetDataNodeRes(); TcpNameNodeRequest request = new TcpNameNodeRequest(req); TcpNameNodeResponse response = new TcpNameNodeResponse(resp); request.setCommand(RpcProtocol.CMD_GET_DATANODE); NaRPCFuture<TcpNameNodeRequest, TcpNameNodeResponse> future = endpoint.issueRequest(request, response); return new TcpFuture<RpcGetDataNode>(future, resp); }
@Override public DaRPCNameNodeFuture<RpcGetDataNode> getDataNode(DataNodeInfo dnInfo) throws Exception { RpcRequestMessage.GetDataNodeReq getDataNodeReq = new RpcRequestMessage.GetDataNodeReq(dnInfo); DaRPCNameNodeRequest request = new DaRPCNameNodeRequest(getDataNodeReq); request.setCommand(RpcProtocol.CMD_GET_DATANODE); RpcResponseMessage.GetDataNodeRes getDataNodeRes = new RpcResponseMessage.GetDataNodeRes(); DaRPCNameNodeResponse response = new DaRPCNameNodeResponse(getDataNodeRes); DaRPCFuture<DaRPCNameNodeRequest, DaRPCNameNodeResponse> future = issueRPC(request, response); DaRPCNameNodeFuture<RpcGetDataNode> nameNodeFuture = new DaRPCNameNodeFuture<RpcGetDataNode>(future, getDataNodeRes); return nameNodeFuture; }