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

Java AccessPrivilege类代码示例

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

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



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

示例1: checkAccessPrivilege

import org.apache.hadoop.nfs.AccessPrivilege; //导入依赖的package包/类
private boolean checkAccessPrivilege(SocketAddress remoteAddress,
    final AccessPrivilege expected) {
  // Port monitoring
  if (!doPortMonitoring(remoteAddress)) {
    return false;
  }

  // Check export table
  if (exports == null) {
      return false;
  }
  InetAddress client = ((InetSocketAddress) remoteAddress).getAddress();
  AccessPrivilege access = exports.getAccessPrivilege(client);
  if (access == AccessPrivilege.NONE) {
    return false;
  }
  if (access == AccessPrivilege.READ_ONLY
      && expected == AccessPrivilege.READ_WRITE) {
    return false;
  }
  return true;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:RpcProgramNfs3.java


示例2: testMultiMatchers

import org.apache.hadoop.nfs.AccessPrivilege; //导入依赖的package包/类
@Test
public void testMultiMatchers() throws Exception {
  long shortExpirationPeriod = 1 * 1000 * 1000 * 1000; // 1s
  NfsExports matcher = new NfsExports(CacheSize, shortExpirationPeriod, 
      "192.168.0.[0-9]+;[a-z]+.b.com rw");
  Assert.assertEquals(AccessPrivilege.READ_ONLY,
      matcher.getAccessPrivilege(address1, hostname2));
  Assert.assertEquals(AccessPrivilege.READ_ONLY,
      matcher.getAccessPrivilege(address1, address1));
  Assert.assertEquals(AccessPrivilege.READ_ONLY,
      matcher.getAccessPrivilege(address1, hostname1));
  Assert.assertEquals(AccessPrivilege.READ_WRITE,
      matcher.getAccessPrivilege(address2, hostname1));
  // address2 will hit the cache
  Assert.assertEquals(AccessPrivilege.READ_WRITE,
      matcher.getAccessPrivilege(address2, hostname2));
  
  Thread.sleep(1000);
  // no cache for address2 now
  Assert.assertEquals(AccessPrivilege.NONE,
      matcher.getAccessPrivilege(address2, address2));
}
 
开发者ID:chendave,项目名称:hadoop-TCP,代码行数:23,代码来源:TestNfsExports.java


示例3: checkAccessPrivilege

import org.apache.hadoop.nfs.AccessPrivilege; //导入依赖的package包/类
private boolean checkAccessPrivilege(final InetAddress client,
    final AccessPrivilege expected) {
  AccessPrivilege access = exports.getAccessPrivilege(client);
  if (access == AccessPrivilege.NONE) {
    return false;
  }
  if (access == AccessPrivilege.READ_ONLY &&
      expected == AccessPrivilege.READ_WRITE) {
    return false;
  }
  return true;
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:13,代码来源:RpcProgramNfs3.java


示例4: checkAccessPrivilege

import org.apache.hadoop.nfs.AccessPrivilege; //导入依赖的package包/类
private boolean checkAccessPrivilege(final InetAddress client,
    final AccessPrivilege expected) {
  AccessPrivilege access = exports.getAccessPrivilege(client);
  if (access == AccessPrivilege.NONE) {
    return false;
  }
  if (access == AccessPrivilege.READ_ONLY
      && expected == AccessPrivilege.READ_WRITE) {
    return false;
  }
  return true;
}
 
开发者ID:chendave,项目名称:hadoop-TCP,代码行数:13,代码来源:RpcProgramNfs3.java


示例5: testExactAddressRW

import org.apache.hadoop.nfs.AccessPrivilege; //导入依赖的package包/类
@Test
public void testExactAddressRW() {
  NfsExports matcher = new NfsExports(CacheSize, ExpirationPeriod, address1
      + " rw");
  Assert.assertEquals(AccessPrivilege.READ_WRITE,
      matcher.getAccessPrivilege(address1, hostname1));
  Assert.assertFalse(AccessPrivilege.READ_WRITE == matcher
      .getAccessPrivilege(address2, hostname1));
}
 
开发者ID:chendave,项目名称:hadoop-TCP,代码行数:10,代码来源:TestNfsExports.java


示例6: testExactAddressRO

import org.apache.hadoop.nfs.AccessPrivilege; //导入依赖的package包/类
@Test
public void testExactAddressRO() {
  NfsExports matcher = new NfsExports(CacheSize, ExpirationPeriod, address1);
  Assert.assertEquals(AccessPrivilege.READ_ONLY,
      matcher.getAccessPrivilege(address1, hostname1));
  Assert.assertEquals(AccessPrivilege.NONE,
      matcher.getAccessPrivilege(address2, hostname1));
}
 
开发者ID:chendave,项目名称:hadoop-TCP,代码行数:9,代码来源:TestNfsExports.java


示例7: testExactHostRW

import org.apache.hadoop.nfs.AccessPrivilege; //导入依赖的package包/类
@Test
public void testExactHostRW() {
  NfsExports matcher = new NfsExports(CacheSize, ExpirationPeriod, hostname1
      + " rw");
  Assert.assertEquals(AccessPrivilege.READ_WRITE,
      matcher.getAccessPrivilege(address1, hostname1));
}
 
开发者ID:chendave,项目名称:hadoop-TCP,代码行数:8,代码来源:TestNfsExports.java


示例8: testCidrShortRW

import org.apache.hadoop.nfs.AccessPrivilege; //导入依赖的package包/类
@Test
public void testCidrShortRW() {
  NfsExports matcher = new NfsExports(CacheSize, ExpirationPeriod,
      "192.168.0.0/22 rw");
  Assert.assertEquals(AccessPrivilege.READ_WRITE,
      matcher.getAccessPrivilege(address1, hostname1));
  Assert.assertEquals(AccessPrivilege.NONE,
      matcher.getAccessPrivilege(address2, hostname1));
}
 
开发者ID:chendave,项目名称:hadoop-TCP,代码行数:10,代码来源:TestNfsExports.java


示例9: testCidrShortRO

import org.apache.hadoop.nfs.AccessPrivilege; //导入依赖的package包/类
@Test
public void testCidrShortRO() {
  NfsExports matcher = new NfsExports(CacheSize, ExpirationPeriod,
      "192.168.0.0/22");
  Assert.assertEquals(AccessPrivilege.READ_ONLY,
      matcher.getAccessPrivilege(address1, hostname1));
  Assert.assertEquals(AccessPrivilege.NONE,
      matcher.getAccessPrivilege(address2, hostname1));
}
 
开发者ID:chendave,项目名称:hadoop-TCP,代码行数:10,代码来源:TestNfsExports.java


示例10: testCidrLongRW

import org.apache.hadoop.nfs.AccessPrivilege; //导入依赖的package包/类
@Test
public void testCidrLongRW() {
  NfsExports matcher = new NfsExports(CacheSize, ExpirationPeriod, 
      "192.168.0.0/255.255.252.0 rw");
  Assert.assertEquals(AccessPrivilege.READ_WRITE,
      matcher.getAccessPrivilege(address1, hostname1));
  Assert.assertEquals(AccessPrivilege.NONE,
      matcher.getAccessPrivilege(address2, hostname1));
}
 
开发者ID:chendave,项目名称:hadoop-TCP,代码行数:10,代码来源:TestNfsExports.java


示例11: testCidrLongRO

import org.apache.hadoop.nfs.AccessPrivilege; //导入依赖的package包/类
@Test
public void testCidrLongRO() {
  NfsExports matcher = new NfsExports(CacheSize, ExpirationPeriod, 
      "192.168.0.0/255.255.252.0");
  Assert.assertEquals(AccessPrivilege.READ_ONLY,
      matcher.getAccessPrivilege(address1, hostname1));
  Assert.assertEquals(AccessPrivilege.NONE,
      matcher.getAccessPrivilege(address2, hostname1));
}
 
开发者ID:chendave,项目名称:hadoop-TCP,代码行数:10,代码来源:TestNfsExports.java


示例12: testRegexIPRW

import org.apache.hadoop.nfs.AccessPrivilege; //导入依赖的package包/类
@Test
public void testRegexIPRW() {
  NfsExports matcher = new NfsExports(CacheSize, ExpirationPeriod,
      "192.168.0.[0-9]+ rw");
  Assert.assertEquals(AccessPrivilege.READ_WRITE,
      matcher.getAccessPrivilege(address1, hostname1));
  Assert.assertEquals(AccessPrivilege.NONE,
      matcher.getAccessPrivilege(address2, hostname1));
}
 
开发者ID:chendave,项目名称:hadoop-TCP,代码行数:10,代码来源:TestNfsExports.java


示例13: testRegexIPRO

import org.apache.hadoop.nfs.AccessPrivilege; //导入依赖的package包/类
@Test
public void testRegexIPRO() {
  NfsExports matcher = new NfsExports(CacheSize, ExpirationPeriod,
      "192.168.0.[0-9]+");
  Assert.assertEquals(AccessPrivilege.READ_ONLY,
      matcher.getAccessPrivilege(address1, hostname1));
  Assert.assertEquals(AccessPrivilege.NONE,
      matcher.getAccessPrivilege(address2, hostname1));
}
 
开发者ID:chendave,项目名称:hadoop-TCP,代码行数:10,代码来源:TestNfsExports.java


示例14: testRegexHostRW

import org.apache.hadoop.nfs.AccessPrivilege; //导入依赖的package包/类
@Test
public void testRegexHostRW() {
  NfsExports matcher = new NfsExports(CacheSize, ExpirationPeriod,
      "[a-z]+.b.com rw");
  Assert.assertEquals(AccessPrivilege.READ_WRITE,
      matcher.getAccessPrivilege(address1, hostname1));
  // address1 will hit the cache
  Assert.assertEquals(AccessPrivilege.READ_WRITE,
      matcher.getAccessPrivilege(address1, hostname2));
}
 
开发者ID:chendave,项目名称:hadoop-TCP,代码行数:11,代码来源:TestNfsExports.java


示例15: testRegexHostRO

import org.apache.hadoop.nfs.AccessPrivilege; //导入依赖的package包/类
@Test
public void testRegexHostRO() {
  NfsExports matcher = new NfsExports(CacheSize, ExpirationPeriod,
      "[a-z]+.b.com");
  Assert.assertEquals(AccessPrivilege.READ_ONLY,
      matcher.getAccessPrivilege(address1, hostname1));
  // address1 will hit the cache
  Assert.assertEquals(AccessPrivilege.READ_ONLY,
      matcher.getAccessPrivilege(address1, hostname2));
}
 
开发者ID:chendave,项目名称:hadoop-TCP,代码行数:11,代码来源:TestNfsExports.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java ProxyConnection类代码示例发布时间:2022-05-22
下一篇:
Java Encdec类代码示例发布时间: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