本文整理汇总了Java中org.apache.hadoop.hbase.ipc.SecureRpcEngine类的典型用法代码示例。如果您正苦于以下问题:Java SecureRpcEngine类的具体用法?Java SecureRpcEngine怎么用?Java SecureRpcEngine使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SecureRpcEngine类属于org.apache.hadoop.hbase.ipc包,在下文中一共展示了SecureRpcEngine类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupBeforeClass
import org.apache.hadoop.hbase.ipc.SecureRpcEngine; //导入依赖的package包/类
@BeforeClass
public static void setupBeforeClass() throws Exception {
TEST_UTIL = new HBaseTestingUtility();
Configuration conf = TEST_UTIL.getConfiguration();
conf.set(HBaseRPC.RPC_ENGINE_PROP, SecureRpcEngine.class.getName());
conf.set("hbase.coprocessor.region.classes",
IdentityCoprocessor.class.getName());
TEST_UTIL.startMiniCluster();
HRegionServer rs = TEST_UTIL.getMiniHBaseCluster().getRegionServer(0);
RpcServer server = rs.getRpcServer();
assertTrue(server instanceof SecureServer);
SecretManager mgr =
((SecureServer)server).getSecretManager();
assertTrue(mgr instanceof AuthenticationTokenSecretManager);
secretManager = (AuthenticationTokenSecretManager)mgr;
}
示例2: enableSecurity
import org.apache.hadoop.hbase.ipc.SecureRpcEngine; //导入依赖的package包/类
public static void enableSecurity(Configuration conf) throws IOException {
conf.set("hadoop.security.authorization", "false");
conf.set("hadoop.security.authentication", "simple");
conf.set("hbase.rpc.engine", SecureRpcEngine.class.getName());
conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, AccessController.class.getName());
conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, AccessController.class.getName()+
","+SecureBulkLoadEndpoint.class.getName());
conf.set(CoprocessorHost.REGIONSERVER_COPROCESSOR_CONF_KEY, AccessController.class.getName());
// add the process running user to superusers
String currentUser = User.getCurrent().getName();
conf.set("hbase.superuser", "admin,"+currentUser);
}