本文整理汇总了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;未经允许,请勿转载。 |
请发表评论