当前位置: 首页>>代码示例>>Java>>正文


Java RpcCall.getProcedure方法代码示例

本文整理汇总了Java中org.apache.hadoop.oncrpc.RpcCall.getProcedure方法的典型用法代码示例。如果您正苦于以下问题:Java RpcCall.getProcedure方法的具体用法?Java RpcCall.getProcedure怎么用?Java RpcCall.getProcedure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.oncrpc.RpcCall的用法示例。


在下文中一共展示了RpcCall.getProcedure方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleInternal

import org.apache.hadoop.oncrpc.RpcCall; //导入方法依赖的package包/类
@Override
public XDR handleInternal(RpcCall rpcCall, XDR xdr, XDR out,
    InetAddress client, Channel channel) {
  int procedure = rpcCall.getProcedure();
  int xid = rpcCall.getXid();
  if (procedure == MNTPROC_NULL) {
    out = nullOp(out, xid, client);
  } else if (procedure == MNTPROC_MNT) {
    out = mnt(xdr, out, xid, client);
  } else if (procedure == MNTPROC_DUMP) {
    out = dump(out, xid, client);
  } else if (procedure == MNTPROC_UMNT) {      
    out = umnt(xdr, out, xid, client);
  } else if (procedure == MNTPROC_UMNTALL) {
    umntall(out, xid, client);
  } else if (procedure == MNTPROC_EXPORT) {
    out = MountResponse.writeExportList(out, xid, exports);
  } else {
    // Invalid procedure
    RpcAcceptedReply.voidReply(out, xid,
        RpcAcceptedReply.AcceptState.PROC_UNAVAIL);    }  
  return out;
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:24,代码来源:RpcProgramMountd.java

示例2: messageReceived

import org.apache.hadoop.oncrpc.RpcCall; //导入方法依赖的package包/类
@Override
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
    throws Exception {

  RpcInfo info = (RpcInfo) e.getMessage();
  RpcCall rpcCall = (RpcCall) info.header();
  final int portmapProc = rpcCall.getProcedure();
  int xid = rpcCall.getXid();
  XDR in = new XDR(info.data().toByteBuffer().asReadOnlyBuffer(),
      XDR.State.READING);
  XDR out = new XDR();

  if (portmapProc == PMAPPROC_NULL) {
    out = nullOp(xid, in, out);
  } else if (portmapProc == PMAPPROC_SET) {
    out = set(xid, in, out);
  } else if (portmapProc == PMAPPROC_UNSET) {
    out = unset(xid, in, out);
  } else if (portmapProc == PMAPPROC_DUMP) {
    out = dump(xid, in, out);
  } else if (portmapProc == PMAPPROC_GETPORT) {
    out = getport(xid, in, out);
  } else if (portmapProc == PMAPPROC_GETVERSADDR) {
    out = getport(xid, in, out);
  } else {
    LOG.info("PortmapHandler unknown rpc procedure=" + portmapProc);
    RpcAcceptedReply reply = RpcAcceptedReply.getInstance(xid,
        RpcAcceptedReply.AcceptState.PROC_UNAVAIL, new VerifierNone());
    reply.write(out);
  }

  ChannelBuffer buf = ChannelBuffers.wrappedBuffer(out.asReadOnlyWrap()
      .buffer());
  RpcResponse rsp = new RpcResponse(buf, info.remoteAddress());
  RpcUtil.sendRpcResponse(ctx, rsp);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:37,代码来源:RpcProgramPortmap.java

示例3: handleInternal

import org.apache.hadoop.oncrpc.RpcCall; //导入方法依赖的package包/类
@Override
public XDR handleInternal(RpcCall rpcCall, final XDR xdr, XDR out,
    InetAddress client, Channel channel) {
  int procedure = rpcCall.getProcedure();
  int xid = rpcCall.getXid();
  RpcAuthSys authSys = null;
  
  // Ignore auth only for NFSPROC3_NULL, especially for Linux clients.
  if (procedure != Nfs3Constant.NFSPROC3_NULL) {
    if (rpcCall.getCredential().getFlavor() != AuthFlavor.AUTH_SYS) {
      LOG.info("Wrong RPC AUTH flavor, "
          + rpcCall.getCredential().getFlavor() + " is not AUTH_SYS.");
      XDR reply = new XDR();
      reply = RpcDeniedReply.voidReply(reply, xid,
          RpcReply.ReplyState.MSG_ACCEPTED,
          RpcDeniedReply.RejectState.AUTH_ERROR);
      return reply;
    }
    authSys = RpcAuthSys.from(rpcCall.getCredential().getBody());
  }
  
  NFS3Response response = null;
  if (procedure == Nfs3Constant.NFSPROC3_NULL) {
    response = nullProcedure();
  } else if (procedure == Nfs3Constant.NFSPROC3_GETATTR) {
    response = getattr(xdr, authSys);
  } else if (procedure == Nfs3Constant.NFSPROC3_SETATTR) {
    response = setattr(xdr, authSys);
  } else if (procedure == Nfs3Constant.NFSPROC3_LOOKUP) {
    response = lookup(xdr, authSys);
  } else if (procedure == Nfs3Constant.NFSPROC3_ACCESS) {
    response = access(xdr, authSys);
  } else if (procedure == Nfs3Constant.NFSPROC3_READLINK) {
    response = readlink(xdr, authSys);
  } else if (procedure == Nfs3Constant.NFSPROC3_READ) {
    response = read(xdr, authSys);
  } else if (procedure == Nfs3Constant.NFSPROC3_WRITE) {
    response = write(xdr, channel, xid, authSys);
  } else if (procedure == Nfs3Constant.NFSPROC3_CREATE) {
    response = create(xdr, authSys);
  } else if (procedure == Nfs3Constant.NFSPROC3_MKDIR) {      
    response = mkdir(xdr, authSys);
  } else if (procedure == Nfs3Constant.NFSPROC3_SYMLINK) {
    response = symlink(xdr, authSys);
  } else if (procedure == Nfs3Constant.NFSPROC3_MKNOD) {
    response = mknod(xdr, authSys);
  } else if (procedure == Nfs3Constant.NFSPROC3_REMOVE) {
    response = remove(xdr, authSys);
  } else if (procedure == Nfs3Constant.NFSPROC3_RMDIR) {
    response = rmdir(xdr, authSys);
  } else if (procedure == Nfs3Constant.NFSPROC3_RENAME) {
    response = rename(xdr, authSys);
  } else if (procedure == Nfs3Constant.NFSPROC3_LINK) {
    response = link(xdr, authSys);
  } else if (procedure == Nfs3Constant.NFSPROC3_READDIR) {
    response = readdir(xdr, authSys);
  } else if (procedure == Nfs3Constant.NFSPROC3_READDIRPLUS) {
    response = readdirplus(xdr, authSys);
  } else if (procedure == Nfs3Constant.NFSPROC3_FSSTAT) {
    response = fsstat(xdr, authSys);
  } else if (procedure == Nfs3Constant.NFSPROC3_FSINFO) {
    response = fsinfo(xdr, authSys);
  } else if (procedure == Nfs3Constant.NFSPROC3_PATHCONF) {
    response = pathconf(xdr, authSys);
  } else if (procedure == Nfs3Constant.NFSPROC3_COMMIT) {
    response = commit(xdr, authSys);
  } else {
    // Invalid procedure
    RpcAcceptedReply.voidReply(out, xid,
        RpcAcceptedReply.AcceptState.PROC_UNAVAIL);
  }
  if (response != null) {
    out = response.send(out, xid);
  }
  return out;
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:77,代码来源:RpcProgramNfs3.java


注:本文中的org.apache.hadoop.oncrpc.RpcCall.getProcedure方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。