• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java VerifierNone类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



VerifierNone类属于org.apache.hadoop.oncrpc.security包,在下文中一共展示了VerifierNone类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: writeExportList

import org.apache.hadoop.oncrpc.security.VerifierNone; //导入依赖的package包/类
/** Response for RPC call {@link MountInterface.MNTPROC#EXPORT} */
public static XDR writeExportList(XDR xdr, int xid, List<String> exports,
    List<NfsExports> hostMatcher) {
  assert (exports.size() == hostMatcher.size());

  RpcAcceptedReply.getAcceptInstance(xid, new VerifierNone()).write(xdr);
  for (int i = 0; i < exports.size(); i++) {
    xdr.writeBoolean(true); // Value follows - yes
    xdr.writeString(exports.get(i));

    // List host groups
    String[] hostGroups = hostMatcher.get(i).getHostGroupList();
    if (hostGroups.length > 0) {
      for (int j = 0; j < hostGroups.length; j++) {
        xdr.writeBoolean(true); // Value follows - yes
        xdr.writeVariableOpaque(hostGroups[j].getBytes(Charsets.UTF_8));
      }
    }
    xdr.writeBoolean(false); // Value follows - no more group
  }
  
  xdr.writeBoolean(false); // Value follows - no
  return xdr;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:25,代码来源:MountResponse.java


示例2: testConstructor

import org.apache.hadoop.oncrpc.security.VerifierNone; //导入依赖的package包/类
@Test
public void testConstructor() {
  Credentials credential = new CredentialsNone();
  Verifier verifier = new VerifierNone();
  int rpcVersion = RpcCall.RPC_VERSION;
  int program = 2;
  int version = 3;
  int procedure = 4;
  RpcCall call = new RpcCall(0, RpcMessage.Type.RPC_CALL, rpcVersion, program,
      version, procedure, credential, verifier);
  assertEquals(0, call.getXid());
  assertEquals(RpcMessage.Type.RPC_CALL, call.getMessageType());
  assertEquals(rpcVersion, call.getRpcVersion());
  assertEquals(program, call.getProgram());
  assertEquals(version, call.getVersion());
  assertEquals(procedure, call.getProcedure());
  assertEquals(credential, call.getCredential());
  assertEquals(verifier, call.getVerifier());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:TestRpcCall.java


示例3: handleInternal

import org.apache.hadoop.oncrpc.security.VerifierNone; //导入依赖的package包/类
@Override
protected void handleInternal(ChannelHandlerContext ctx, RpcInfo info) {
  // This is just like what's done in RpcProgramMountd#handleInternal and
  // RpcProgramNfs3#handleInternal.
  RpcCall rpcCall = (RpcCall) info.header();
  final int procedure = rpcCall.getProcedure();
  if (procedure != 0) {
    boolean portMonitorSuccess = doPortMonitoring(info.remoteAddress());
    if (!portMonitorSuccess) {
      sendRejectedReply(rpcCall, info.remoteAddress(), ctx);
      return;
    }
  }
  
  resultSize = info.data().readableBytes();
  RpcAcceptedReply reply = RpcAcceptedReply.getAcceptInstance(1234,
      new VerifierNone());
  XDR out = new XDR();
  reply.write(out);
  ChannelBuffer b = ChannelBuffers.wrappedBuffer(out.asReadOnlyWrap().buffer());
  RpcResponse rsp = new RpcResponse(b, info.remoteAddress());
  RpcUtil.sendRpcResponse(ctx, rsp);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:24,代码来源:TestFrameDecoder.java


示例4: writeExportList

import org.apache.hadoop.oncrpc.security.VerifierNone; //导入依赖的package包/类
/** Response for RPC call {@link MountInterface.MNTPROC#EXPORT} */
public static XDR writeExportList(XDR xdr, int xid, List<String> exports,
    List<NfsExports> hostMatcher) {
  assert (exports.size() == hostMatcher.size());

  RpcAcceptedReply.getAcceptInstance(xid, new VerifierNone()).write(xdr);
  for (int i = 0; i < exports.size(); i++) {
    xdr.writeBoolean(true); // Value follows - yes
    xdr.writeString(exports.get(i));

    // List host groups
    String[] hostGroups = hostMatcher.get(i).getHostGroupList();
    if (hostGroups.length > 0) {
      for (int j = 0; j < hostGroups.length; j++) {
        xdr.writeBoolean(true); // Value follows - yes
        xdr.writeVariableOpaque(hostGroups[j].getBytes());
      }
    }
    xdr.writeBoolean(false); // Value follows - no more group
  }
  
  xdr.writeBoolean(false); // Value follows - no
  return xdr;
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:25,代码来源:MountResponse.java


示例5: writeExportList

import org.apache.hadoop.oncrpc.security.VerifierNone; //导入依赖的package包/类
/**
 * Response for RPC call {@link MountInterface.MNTPROC#EXPORT}.
 * @param xdr XDR message object
 * @param xid transaction id
 * @param exports export list
 * @param hostMatcher the list of export host
 * @return response XDR
 */
public static XDR writeExportList(XDR xdr, int xid, List<String> exports,
    List<NfsExports> hostMatcher) {
  assert (exports.size() == hostMatcher.size());

  RpcAcceptedReply.getAcceptInstance(xid, new VerifierNone()).write(xdr);
  for (int i = 0; i < exports.size(); i++) {
    xdr.writeBoolean(true); // Value follows - yes
    xdr.writeString(exports.get(i));

    // List host groups
    String[] hostGroups = hostMatcher.get(i).getHostGroupList();
    if (hostGroups.length > 0) {
      for (int j = 0; j < hostGroups.length; j++) {
        xdr.writeBoolean(true); // Value follows - yes
        xdr.writeVariableOpaque(
            hostGroups[j].getBytes(StandardCharsets.UTF_8));
      }
    }
    xdr.writeBoolean(false); // Value follows - no more group
  }
  
  xdr.writeBoolean(false); // Value follows - no
  return xdr;
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:33,代码来源:MountResponse.java


示例6: nullOp

import org.apache.hadoop.oncrpc.security.VerifierNone; //导入依赖的package包/类
@Override
public XDR nullOp(XDR out, int xid, InetAddress client) {
  if (LOG.isDebugEnabled()) {
    LOG.debug("MOUNT NULLOP : " + " client: " + client);
  }
  return RpcAcceptedReply.getAcceptInstance(xid, new VerifierNone()).write(
      out);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:RpcProgramMountd.java


示例7: umnt

import org.apache.hadoop.oncrpc.security.VerifierNone; //导入依赖的package包/类
@Override
public XDR umnt(XDR xdr, XDR out, int xid, InetAddress client) {
  String path = xdr.readString();
  if (LOG.isDebugEnabled()) {
    LOG.debug("MOUNT UMNT path: " + path + " client: " + client);
  }
  
  String host = client.getHostName();
  mounts.remove(new MountEntry(host, path));
  RpcAcceptedReply.getAcceptInstance(xid, new VerifierNone()).write(out);
  return out;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:RpcProgramMountd.java


示例8: umntall

import org.apache.hadoop.oncrpc.security.VerifierNone; //导入依赖的package包/类
@Override
public XDR umntall(XDR out, int xid, InetAddress client) {
  if (LOG.isDebugEnabled()) {
    LOG.debug("MOUNT UMNTALL : " + " client: " + client);
  }
  mounts.clear();
  return RpcAcceptedReply.getAcceptInstance(xid, new VerifierNone()).write(
      out);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:RpcProgramMountd.java


示例9: create

import org.apache.hadoop.oncrpc.security.VerifierNone; //导入依赖的package包/类
static XDR create() {
  XDR request = new XDR();
  RpcCall.getInstance(0x8000004c, Nfs3Constant.PROGRAM, Nfs3Constant.VERSION,
      Nfs3Constant.NFSPROC3.CREATE.getValue(), new CredentialsNone(),
      new VerifierNone()).write(request);

  SetAttr3 objAttr = new SetAttr3();
  CREATE3Request createReq = new CREATE3Request(new FileHandle("/"),
      "out-of-order-write" + System.currentTimeMillis(), 0, objAttr, 0);
  createReq.serialize(request);
  return request;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:TestOutOfOrderWrite.java


示例10: write

import org.apache.hadoop.oncrpc.security.VerifierNone; //导入依赖的package包/类
static XDR write(FileHandle handle, int xid, long offset, int count,
    byte[] data) {
  XDR request = new XDR();
  RpcCall.getInstance(xid, Nfs3Constant.PROGRAM, Nfs3Constant.VERSION,
      Nfs3Constant.NFSPROC3.CREATE.getValue(), new CredentialsNone(),
      new VerifierNone()).write(request);

  WRITE3Request write1 = new WRITE3Request(handle, offset, count,
      WriteStableHow.UNSTABLE, ByteBuffer.wrap(data));
  write1.serialize(request);
  return request;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:TestOutOfOrderWrite.java


示例11: sendRejectedReply

import org.apache.hadoop.oncrpc.security.VerifierNone; //导入依赖的package包/类
protected static void sendRejectedReply(RpcCall call,
    SocketAddress remoteAddress, ChannelHandlerContext ctx) {
  XDR out = new XDR();
  RpcDeniedReply reply = new RpcDeniedReply(call.getXid(),
      RpcReply.ReplyState.MSG_DENIED,
      RpcDeniedReply.RejectState.AUTH_ERROR, new VerifierNone());
  reply.write(out);
  ChannelBuffer buf = ChannelBuffers.wrappedBuffer(out.asReadOnlyWrap()
      .buffer());
  RpcResponse rsp = new RpcResponse(buf, remoteAddress);
  RpcUtil.sendRpcResponse(ctx, rsp);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:RpcProgram.java


示例12: writeMNTResponse

import org.apache.hadoop.oncrpc.security.VerifierNone; //导入依赖的package包/类
/** Response for RPC call {@link MountInterface.MNTPROC#MNT} */
public static XDR writeMNTResponse(int status, XDR xdr, int xid,
    byte[] handle) {
  RpcAcceptedReply.getAcceptInstance(xid, new VerifierNone()).write(xdr);
  xdr.writeInt(status);
  if (status == MNT_OK) {
    xdr.writeVariableOpaque(handle);
    // Only MountV3 returns a list of supported authFlavors
    xdr.writeInt(1);
    xdr.writeInt(AuthFlavor.AUTH_SYS.getValue());
  }
  return xdr;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:MountResponse.java


示例13: writeMountList

import org.apache.hadoop.oncrpc.security.VerifierNone; //导入依赖的package包/类
/** Response for RPC call {@link MountInterface.MNTPROC#DUMP} */
public static XDR writeMountList(XDR xdr, int xid, List<MountEntry> mounts) {
  RpcAcceptedReply.getAcceptInstance(xid, new VerifierNone()).write(xdr);
  for (MountEntry mountEntry : mounts) {
    xdr.writeBoolean(true); // Value follows yes
    xdr.writeString(mountEntry.getHost());
    xdr.writeString(mountEntry.getPath());
  }
  xdr.writeBoolean(false); // Value follows no
  return xdr;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:MountResponse.java


示例14: messageReceived

import org.apache.hadoop.oncrpc.security.VerifierNone; //导入依赖的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


示例15: pmapList

import org.apache.hadoop.oncrpc.security.VerifierNone; //导入依赖的package包/类
public static XDR pmapList(XDR xdr, int xid, PortmapMapping[] list) {
  RpcAcceptedReply.getAcceptInstance(xid, new VerifierNone()).write(xdr);
  for (PortmapMapping mapping : list) {
    xdr.writeBoolean(true); // Value follows
    mapping.serialize(xdr);
  }
  xdr.writeBoolean(false); // No value follows
  return xdr;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:PortmapResponse.java


示例16: create

import org.apache.hadoop.oncrpc.security.VerifierNone; //导入依赖的package包/类
public static XDR create(PortmapMapping mapping, boolean set) {
  XDR request = new XDR();
  int procedure = set ? RpcProgramPortmap.PMAPPROC_SET
      : RpcProgramPortmap.PMAPPROC_UNSET;
  RpcCall call = RpcCall.getInstance(
      RpcUtil.getNewXid(String.valueOf(RpcProgramPortmap.PROGRAM)),
      RpcProgramPortmap.PROGRAM, RpcProgramPortmap.VERSION, procedure,
      new CredentialsNone(), new VerifierNone());
  call.write(request);
  return mapping.serialize(request);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:PortmapRequest.java


示例17: testConstructor

import org.apache.hadoop.oncrpc.security.VerifierNone; //导入依赖的package包/类
@Test
public void testConstructor() {
  RpcDeniedReply reply = new RpcDeniedReply(0, ReplyState.MSG_ACCEPTED,
      RejectState.AUTH_ERROR, new VerifierNone());
  Assert.assertEquals(0, reply.getXid());
  Assert.assertEquals(RpcMessage.Type.RPC_REPLY, reply.getMessageType());
  Assert.assertEquals(ReplyState.MSG_ACCEPTED, reply.getState());
  Assert.assertEquals(RejectState.AUTH_ERROR, reply.getRejectState());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:TestRpcDeniedReply.java


示例18: testRpcReply

import org.apache.hadoop.oncrpc.security.VerifierNone; //导入依赖的package包/类
@Test
public void testRpcReply() {
  RpcReply reply = new RpcReply(0, ReplyState.MSG_ACCEPTED,
      new VerifierNone()) {
        @Override
        public XDR write(XDR xdr) {
          return null;
        }
  };
  Assert.assertEquals(0, reply.getXid());
  Assert.assertEquals(RpcMessage.Type.RPC_REPLY, reply.getMessageType());
  Assert.assertEquals(ReplyState.MSG_ACCEPTED, reply.getState());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:TestRpcReply.java


示例19: testConstructor

import org.apache.hadoop.oncrpc.security.VerifierNone; //导入依赖的package包/类
@Test
public void testConstructor() {
  Verifier verifier = new VerifierNone();
  RpcAcceptedReply reply = new RpcAcceptedReply(0, 
      ReplyState.MSG_ACCEPTED, verifier, AcceptState.SUCCESS);
  assertEquals(0, reply.getXid());
  assertEquals(RpcMessage.Type.RPC_REPLY, reply.getMessageType());
  assertEquals(ReplyState.MSG_ACCEPTED, reply.getState());
  assertEquals(verifier, reply.getVerifier());
  assertEquals(AcceptState.SUCCESS, reply.getAcceptState());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:TestRpcAcceptedReply.java


示例20: testRegistration

import org.apache.hadoop.oncrpc.security.VerifierNone; //导入依赖的package包/类
@Test(timeout = 1000)
public void testRegistration() throws IOException, InterruptedException {
  XDR req = new XDR();
  RpcCall.getInstance(++xid, RpcProgramPortmap.PROGRAM,
      RpcProgramPortmap.VERSION,
      RpcProgramPortmap.PMAPPROC_SET,
      new CredentialsNone(), new VerifierNone()).write(req);

  PortmapMapping sent = new PortmapMapping(90000, 1,
      PortmapMapping.TRANSPORT_TCP, 1234);
  sent.serialize(req);

  byte[] reqBuf = req.getBytes();
  DatagramSocket s = new DatagramSocket();
  DatagramPacket p = new DatagramPacket(reqBuf, reqBuf.length,
      pm.getUdpServerLoAddress());
  try {
    s.send(p);
  } finally {
    s.close();
  }

  // Give the server a chance to process the request
  Thread.sleep(100);
  boolean found = false;
  @SuppressWarnings("unchecked")
  Map<String, PortmapMapping> map = (Map<String, PortmapMapping>) Whitebox
      .getInternalState(pm.getHandler(), "map");

  for (PortmapMapping m : map.values()) {
    if (m.getPort() == sent.getPort()
        && PortmapMapping.key(m).equals(PortmapMapping.key(sent))) {
      found = true;
      break;
    }
  }
  Assert.assertTrue("Registration failed", found);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:39,代码来源:TestPortmap.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FirebaseCredentials类代码示例发布时间:2022-05-22
下一篇:
Java AndroidPublisher类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap