本文整理汇总了Java中org.apache.hadoop.oncrpc.RpcCall.getXid方法的典型用法代码示例。如果您正苦于以下问题:Java RpcCall.getXid方法的具体用法?Java RpcCall.getXid怎么用?Java RpcCall.getXid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.oncrpc.RpcCall
的用法示例。
在下文中一共展示了RpcCall.getXid方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: write
import org.apache.hadoop.oncrpc.RpcCall; //导入方法依赖的package包/类
@Override
public WRITE3Response write(XDR xdr, RpcInfo info) {
SecurityHandler securityHandler = getSecurityHandler(info);
RpcCall rpcCall = (RpcCall) info.header();
int xid = rpcCall.getXid();
SocketAddress remoteAddress = info.remoteAddress();
return write(xdr, info.channel(), xid, securityHandler, remoteAddress);
}
示例3: commit
import org.apache.hadoop.oncrpc.RpcCall; //导入方法依赖的package包/类
@Override
public COMMIT3Response commit(XDR xdr, RpcInfo info) {
SecurityHandler securityHandler = getSecurityHandler(info);
RpcCall rpcCall = (RpcCall) info.header();
int xid = rpcCall.getXid();
SocketAddress remoteAddress = info.remoteAddress();
return commit(xdr, info.channel(), xid, securityHandler, remoteAddress);
}
示例4: 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);
}
示例5: handleInternal
import org.apache.hadoop.oncrpc.RpcCall; //导入方法依赖的package包/类
@Override
public XDR handleInternal(RpcCall rpcCall, XDR in, XDR out,
InetAddress client, Channel channel) {
Procedure procedure = Procedure.fromValue(rpcCall.getProcedure());
int xid = rpcCall.getXid();
switch (procedure) {
case PMAPPROC_NULL:
out = nullOp(xid, in, out);
break;
case PMAPPROC_SET:
out = set(xid, in, out);
break;
case PMAPPROC_UNSET:
out = unset(xid, in, out);
break;
case PMAPPROC_DUMP:
out = dump(xid, in, out);
break;
case PMAPPROC_GETPORT:
out = getport(xid, in, out);
break;
case PMAPPROC_GETVERSADDR:
out = getport(xid, in, out);
break;
default:
LOG.info("PortmapHandler unknown rpc procedure=" + procedure);
RpcAcceptedReply.voidReply(out, xid,
RpcAcceptedReply.AcceptState.PROC_UNAVAIL);
}
return out;
}
示例6: handleInternal
import org.apache.hadoop.oncrpc.RpcCall; //导入方法依赖的package包/类
@Override
public void handleInternal(ChannelHandlerContext ctx, RpcInfo info) {
RpcCall rpcCall = (RpcCall) info.header();
final MNTPROC mntproc = MNTPROC.fromValue(rpcCall.getProcedure());
int xid = rpcCall.getXid();
byte[] data = new byte[info.data().readableBytes()];
info.data().readBytes(data);
XDR xdr = new XDR(data);
XDR out = new XDR();
InetAddress client =
((InetSocketAddress) info.remoteAddress()).getAddress();
if (mntproc == MNTPROC.NULL) {
out = nullOp(out, xid, client);
} else if (mntproc == MNTPROC.MNT) {
out = mnt(xdr, out, xid, client);
} else if (mntproc == MNTPROC.DUMP) {
out = dump(out, xid, client);
} else if (mntproc == MNTPROC.UMNT) {
out = umnt(xdr, out, xid, client);
} else if (mntproc == MNTPROC.UMNTALL) {
umntall(out, xid, client);
} else if (mntproc == MNTPROC.EXPORT) {
// Currently only support one NFS export
List<NfsExports> hostsMatchers = new ArrayList<NfsExports>();
hostsMatchers.add(hostsMatcher);
out = MountResponse.writeExportList(out, xid, exports, hostsMatchers);
} else {
// Invalid procedure
RpcAcceptedReply
.getInstance(xid, RpcAcceptedReply.AcceptState.PROC_UNAVAIL,
new VerifierNone()).write(out);
}
ChannelBuffer buf =
ChannelBuffers.wrappedBuffer(out.asReadOnlyWrap().buffer());
RpcResponse rsp = new RpcResponse(buf, info.remoteAddress());
RpcUtil.sendRpcResponse(ctx, rsp);
}
示例7: handleInternal
import org.apache.hadoop.oncrpc.RpcCall; //导入方法依赖的package包/类
@Override
public void handleInternal(ChannelHandlerContext ctx, RpcInfo info) {
RpcCall rpcCall = (RpcCall) info.header();
final MNTPROC mntproc = MNTPROC.fromValue(rpcCall.getProcedure());
int xid = rpcCall.getXid();
byte[] data = new byte[info.data().readableBytes()];
info.data().readBytes(data);
XDR xdr = new XDR(data);
XDR out = new XDR();
InetAddress client = ((InetSocketAddress) info.remoteAddress()).getAddress();
if (mntproc == MNTPROC.NULL) {
out = nullOp(out, xid, client);
} else if (mntproc == MNTPROC.MNT) {
out = mnt(xdr, out, xid, client);
} else if (mntproc == MNTPROC.DUMP) {
out = dump(out, xid, client);
} else if (mntproc == MNTPROC.UMNT) {
out = umnt(xdr, out, xid, client);
} else if (mntproc == MNTPROC.UMNTALL) {
umntall(out, xid, client);
} else if (mntproc == MNTPROC.EXPORT) {
// Currently only support one NFS export "/"
List<NfsExports> hostsMatchers = new ArrayList<NfsExports>();
hostsMatchers.add(hostsMatcher);
out = MountResponse.writeExportList(out, xid, exports, hostsMatchers);
} else {
// Invalid procedure
RpcAcceptedReply.getInstance(xid,
RpcAcceptedReply.AcceptState.PROC_UNAVAIL, new VerifierNone()).write(
out);
}
ChannelBuffer buf = ChannelBuffers.wrappedBuffer(out.asReadOnlyWrap().buffer());
RpcResponse rsp = new RpcResponse(buf, info.remoteAddress());
RpcUtil.sendRpcResponse(ctx, rsp);
}
示例8: handleInternal
import org.apache.hadoop.oncrpc.RpcCall; //导入方法依赖的package包/类
@Override
public void handleInternal(ChannelHandlerContext ctx, RpcInfo info) {
RpcCall rpcCall = (RpcCall) info.header();
final Procedure portmapProc = Procedure.fromValue(rpcCall.getProcedure());
int xid = rpcCall.getXid();
byte[] data = new byte[info.data().readableBytes()];
info.data().readBytes(data);
XDR in = new XDR(data);
XDR out = new XDR();
if (portmapProc == Procedure.PMAPPROC_NULL) {
out = nullOp(xid, in, out);
} else if (portmapProc == Procedure.PMAPPROC_SET) {
out = set(xid, in, out);
} else if (portmapProc == Procedure.PMAPPROC_UNSET) {
out = unset(xid, in, out);
} else if (portmapProc == Procedure.PMAPPROC_DUMP) {
out = dump(xid, in, out);
} else if (portmapProc == Procedure.PMAPPROC_GETPORT) {
out = getport(xid, in, out);
} else if (portmapProc == Procedure.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);
}
示例9: handleInternal
import org.apache.hadoop.oncrpc.RpcCall; //导入方法依赖的package包/类
@Override
public void handleInternal(ChannelHandlerContext ctx, RpcInfo info) {
RpcCall rpcCall = (RpcCall) info.header();
final MNTPROC mntproc = MNTPROC.fromValue(rpcCall.getProcedure());
int xid = rpcCall.getXid();
byte[] data = new byte[info.data().readableBytes()];
info.data().readBytes(data);
XDR xdr = new XDR(data);
XDR out = new XDR();
InetAddress client = ((InetSocketAddress) info.remoteAddress()).getAddress();
if (mntproc == MNTPROC.NULL) {
out = nullOp(out, xid, client);
} else if (mntproc == MNTPROC.MNT) {
out = mnt(xdr, out, xid, client);
} else if (mntproc == MNTPROC.DUMP) {
out = dump(out, xid, client);
} else if (mntproc == MNTPROC.UMNT) {
out = umnt(xdr, out, xid, client);
} else if (mntproc == MNTPROC.UMNTALL) {
umntall(out, xid, client);
} else if (mntproc == MNTPROC.EXPORT) {
// Currently only support one NFS export
List<NfsExports> hostsMatchers = new ArrayList<NfsExports>();
hostsMatchers.add(hostsMatcher);
out = MountResponse.writeExportList(out, xid, exports, hostsMatchers);
} else {
// Invalid procedure
RpcAcceptedReply.getInstance(xid,
RpcAcceptedReply.AcceptState.PROC_UNAVAIL, new VerifierNone()).write(
out);
}
ChannelBuffer buf = ChannelBuffers.wrappedBuffer(out.asReadOnlyWrap().buffer());
RpcResponse rsp = new RpcResponse(buf, info.remoteAddress());
RpcUtil.sendRpcResponse(ctx, rsp);
}
示例10: handleInternal
import org.apache.hadoop.oncrpc.RpcCall; //导入方法依赖的package包/类
@Override
public void handleInternal(ChannelHandlerContext ctx, RpcInfo info) {
RpcCall rpcCall = (RpcCall) info.header();
final MNTPROC mntproc = MNTPROC.fromValue(rpcCall.getProcedure());
int xid = rpcCall.getXid();
byte[] data = new byte[info.data().readableBytes()];
info.data().readBytes(data);
XDR xdr = new XDR(data);
XDR out = new XDR();
InetAddress client = ((InetSocketAddress) info.remoteAddress()).getAddress();
if (mntproc == MNTPROC.NULL) {
out = nullOp(out, xid, client);
} else if (mntproc == MNTPROC.MNT) {
// Only do port monitoring for MNT
if (!doPortMonitoring(info.remoteAddress())) {
out = MountResponse.writeMNTResponse(Nfs3Status.NFS3ERR_ACCES, out,
xid, null);
} else {
out = mnt(xdr, out, xid, client);
}
} else if (mntproc == MNTPROC.DUMP) {
out = dump(out, xid, client);
} else if (mntproc == MNTPROC.UMNT) {
out = umnt(xdr, out, xid, client);
} else if (mntproc == MNTPROC.UMNTALL) {
umntall(out, xid, client);
} else if (mntproc == MNTPROC.EXPORT) {
// Currently only support one NFS export
List<NfsExports> hostsMatchers = new ArrayList<NfsExports>();
if (hostsMatcher != null) {
hostsMatchers.add(hostsMatcher);
out = MountResponse.writeExportList(out, xid, exports, hostsMatchers);
} else {
// This means there are no valid exports provided.
RpcAcceptedReply.getInstance(xid,
RpcAcceptedReply.AcceptState.PROC_UNAVAIL, new VerifierNone()).write(
out);
}
} else {
// Invalid procedure
RpcAcceptedReply.getInstance(xid,
RpcAcceptedReply.AcceptState.PROC_UNAVAIL, new VerifierNone()).write(
out);
}
ChannelBuffer buf = ChannelBuffers.wrappedBuffer(out.asReadOnlyWrap().buffer());
RpcResponse rsp = new RpcResponse(buf, info.remoteAddress());
RpcUtil.sendRpcResponse(ctx, rsp);
}
示例11: 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;
}