@Override public RpcFuture<RpcCreateFile> createFile(FileName filename, CrailNodeType type, int storageClass, int locationClass) throws IOException { if (CrailConstants.DEBUG){ LOG.debug("RPC: createFile, fileType " + type + ", storageClass " + storageClass + ", locationClass " + locationClass); } RpcRequestMessage.CreateFileReq createFileReq = new RpcRequestMessage.CreateFileReq(filename, type, storageClass, locationClass); DaRPCNameNodeRequest request = new DaRPCNameNodeRequest(createFileReq); request.setCommand(RpcProtocol.CMD_CREATE_FILE); RpcResponseMessage.CreateFileRes fileRes = new RpcResponseMessage.CreateFileRes(); DaRPCNameNodeResponse response = new DaRPCNameNodeResponse(fileRes); DaRPCFuture<DaRPCNameNodeRequest, DaRPCNameNodeResponse> future = issueRPC(request, response); DaRPCNameNodeFuture<RpcCreateFile> nameNodeFuture = new DaRPCNameNodeFuture<RpcCreateFile>(future, fileRes); return nameNodeFuture; }
createFileReq.update(buffer); break; case RpcProtocol.REQ_GET_FILE:
switch(type){ case RpcProtocol.REQ_CREATE_FILE: written += createFileReq.write(buffer); break; case RpcProtocol.REQ_GET_FILE:
FileName fileHash = request.getFileName(); CrailNodeType type = request.getFileType(); boolean writeable = type.isDirectory() ? false : true; int storageClass = request.getStorageClass(); int locationClass = request.getLocationClass();
switch(type){ case RpcProtocol.REQ_CREATE_FILE: message += createFileReq.toString(); break; case RpcProtocol.REQ_GET_FILE:
createFileReq.update(buffer); break; case RpcProtocol.REQ_GET_FILE:
switch(type){ case RpcProtocol.REQ_CREATE_FILE: written += createFileReq.write(buffer); break; case RpcProtocol.REQ_GET_FILE:
createFileReq.update(buffer); break; case RpcProtocol.REQ_GET_FILE:
switch(type){ case RpcProtocol.REQ_CREATE_FILE: written += createFileReq.write(buffer); break; case RpcProtocol.REQ_GET_FILE:
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 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 LogRecord(RpcRequestMessage.CreateFileReq message) { this.type = message.getType(); this.createFileReq = message; } public LogRecord(RpcRequestMessage.GetFileReq message) {
public DaRPCNameNodeRequest(RpcRequestMessage.CreateFileReq message) { this.type = message.getType(); this.createFileReq = message; } public DaRPCNameNodeRequest(RpcRequestMessage.GetFileReq message) {
public RpcFuture<RpcCreateFile> createFile(FileName fileName, CrailNodeType type, int storageAffinity, int locationAffinity) throws IOException { RpcRequestMessage.CreateFileReq req = new RpcRequestMessage.CreateFileReq(fileName, type, storageAffinity, locationAffinity); RpcResponseMessage.CreateFileRes resp = new RpcResponseMessage.CreateFileRes(); TcpNameNodeRequest request = new TcpNameNodeRequest(req); TcpNameNodeResponse response = new TcpNameNodeResponse(resp); request.setCommand(RpcProtocol.CMD_CREATE_FILE); NaRPCFuture<TcpNameNodeRequest, TcpNameNodeResponse> future = endpoint.issueRequest(request, response); return new TcpFuture<RpcCreateFile>(future, resp); }
public TcpNameNodeRequest(RpcRequestMessage.CreateFileReq message) { this.type = message.getType(); this.createFileReq = message; } public TcpNameNodeRequest(RpcRequestMessage.GetFileReq message) {