当前位置: 首页>>代码示例>>Java>>正文


Java MasterCoprocessorHost.findCoprocessor方法代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.master.MasterCoprocessorHost.findCoprocessor方法的典型用法代码示例。如果您正苦于以下问题:Java MasterCoprocessorHost.findCoprocessor方法的具体用法?Java MasterCoprocessorHost.findCoprocessor怎么用?Java MasterCoprocessorHost.findCoprocessor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hbase.master.MasterCoprocessorHost的用法示例。


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

示例1: testStarted

import org.apache.hadoop.hbase.master.MasterCoprocessorHost; //导入方法依赖的package包/类
@Test (timeout=180000)
public void testStarted() throws Exception {
  MiniHBaseCluster cluster = UTIL.getHBaseCluster();

  HMaster master = cluster.getMaster();
  assertTrue("Master should be active", master.isActiveMaster());
  MasterCoprocessorHost host = master.getMasterCoprocessorHost();
  assertNotNull("CoprocessorHost should not be null", host);
  CPMasterObserver cp = (CPMasterObserver)host.findCoprocessor(
      CPMasterObserver.class.getName());
  assertNotNull("CPMasterObserver coprocessor not found or not installed!", cp);

  // check basic lifecycle
  assertTrue("MasterObserver should have been started", cp.wasStarted());
  assertTrue("preMasterInitialization() hook should have been called",
      cp.wasMasterInitializationCalled());
  assertTrue("postStartMaster() hook should have been called",
      cp.wasStartMasterCalled());
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:20,代码来源:TestMasterObserver.java

示例2: testTableDescriptorsEnumeration

import org.apache.hadoop.hbase.master.MasterCoprocessorHost; //导入方法依赖的package包/类
@Test (timeout=180000)
public void testTableDescriptorsEnumeration() throws Exception {
  MiniHBaseCluster cluster = UTIL.getHBaseCluster();

  HMaster master = cluster.getMaster();
  MasterCoprocessorHost host = master.getMasterCoprocessorHost();
  CPMasterObserver cp = (CPMasterObserver)host.findCoprocessor(
      CPMasterObserver.class.getName());
  cp.resetStates();

  GetTableDescriptorsRequest req =
      RequestConverter.buildGetTableDescriptorsRequest((List<TableName>)null);
  master.getMasterRpcServices().getTableDescriptors(null, req);

  assertTrue("Coprocessor should be called on table descriptors request",
    cp.wasGetTableDescriptorsCalled());
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:18,代码来源:TestMasterObserver.java

示例3: testStarted

import org.apache.hadoop.hbase.master.MasterCoprocessorHost; //导入方法依赖的package包/类
@Test
public void testStarted() throws Exception {
  MiniHBaseCluster cluster = UTIL.getHBaseCluster();

  HMaster master = cluster.getMaster();
  assertTrue("Master should be active", master.isActiveMaster());
  MasterCoprocessorHost host = master.getCoprocessorHost();
  assertNotNull("CoprocessorHost should not be null", host);
  CPMasterObserver cp = (CPMasterObserver)host.findCoprocessor(
      CPMasterObserver.class.getName());
  assertNotNull("CPMasterObserver coprocessor not found or not installed!", cp);

  // check basic lifecycle
  assertTrue("MasterObserver should have been started", cp.wasStarted());
  assertTrue("postStartMaster() hook should have been called",
      cp.wasStartMasterCalled());
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:18,代码来源:TestMasterObserver.java

示例4: testStarted

import org.apache.hadoop.hbase.master.MasterCoprocessorHost; //导入方法依赖的package包/类
@Test
public void testStarted() throws Exception {
  MiniHBaseCluster cluster = UTIL.getHBaseCluster();

  HMaster master = cluster.getMaster();
  assertTrue("Master should be active", master.isActiveMaster());
  MasterCoprocessorHost host = master.getMasterCoprocessorHost();
  assertNotNull("CoprocessorHost should not be null", host);
  CPMasterObserver cp = (CPMasterObserver)host.findCoprocessor(
      CPMasterObserver.class.getName());
  assertNotNull("CPMasterObserver coprocessor not found or not installed!", cp);

  // check basic lifecycle
  assertTrue("MasterObserver should have been started", cp.wasStarted());
  assertTrue("preMasterInitialization() hook should have been called",
      cp.wasMasterInitializationCalled());
  assertTrue("postStartMaster() hook should have been called",
      cp.wasStartMasterCalled());
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:20,代码来源:TestMasterObserver.java

示例5: testTableDescriptorsEnumeration

import org.apache.hadoop.hbase.master.MasterCoprocessorHost; //导入方法依赖的package包/类
@Test
public void testTableDescriptorsEnumeration() throws Exception {
  MiniHBaseCluster cluster = UTIL.getHBaseCluster();

  HMaster master = cluster.getMaster();
  MasterCoprocessorHost host = master.getMasterCoprocessorHost();
  CPMasterObserver cp = (CPMasterObserver)host.findCoprocessor(
      CPMasterObserver.class.getName());
  cp.resetStates();

  GetTableDescriptorsRequest req =
      RequestConverter.buildGetTableDescriptorsRequest((List<TableName>)null);
  master.getMasterRpcServices().getTableDescriptors(null, req);

  assertTrue("Coprocessor should be called on table descriptors request",
    cp.wasGetTableDescriptorsCalled());
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:18,代码来源:TestMasterObserver.java

示例6: testStarted

import org.apache.hadoop.hbase.master.MasterCoprocessorHost; //导入方法依赖的package包/类
@Test
public void testStarted() throws Exception {
  MiniHBaseCluster cluster = UTIL.getHBaseCluster();

  HMaster master = cluster.getMaster();
  assertTrue("Master should be active", master.isActiveMaster());
  MasterCoprocessorHost host = master.getCoprocessorHost();
  assertNotNull("CoprocessorHost should not be null", host);
  CPMasterObserver cp = (CPMasterObserver)host.findCoprocessor(
      CPMasterObserver.class.getName());
  assertNotNull("CPMasterObserver coprocessor not found or not installed!", cp);

  // check basic lifecycle
  assertTrue("MasterObserver should have been started", cp.wasStarted());
  assertTrue("preMasterInitialization() hook should have been called",
      cp.wasMasterInitializationCalled());
  assertTrue("postStartMaster() hook should have been called",
      cp.wasStartMasterCalled());
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:20,代码来源:TestMasterObserver.java

示例7: testTableDescriptorsEnumeration

import org.apache.hadoop.hbase.master.MasterCoprocessorHost; //导入方法依赖的package包/类
@Test
public void testTableDescriptorsEnumeration() throws Exception {
  MiniHBaseCluster cluster = UTIL.getHBaseCluster();

  HMaster master = cluster.getMaster();
  MasterCoprocessorHost host = master.getCoprocessorHost();
  CPMasterObserver cp = (CPMasterObserver)host.findCoprocessor(
      CPMasterObserver.class.getName());
  cp.resetStates();

  GetTableDescriptorsRequest req =
      RequestConverter.buildGetTableDescriptorsRequest((List<TableName>)null);
  master.getTableDescriptors(null, req);

  assertTrue("Coprocessor should be called on table descriptors request",
    cp.wasGetTableDescriptorsCalled());
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:18,代码来源:TestMasterObserver.java

示例8: testStarted

import org.apache.hadoop.hbase.master.MasterCoprocessorHost; //导入方法依赖的package包/类
@Test (timeout=180000)
public void testStarted() throws Exception {
  MiniHBaseCluster cluster = UTIL.getHBaseCluster();

  HMaster master = cluster.getMaster();
  assertTrue("Master should be active", master.isActiveMaster());
  MasterCoprocessorHost host = master.getMasterCoprocessorHost();
  assertNotNull("CoprocessorHost should not be null", host);
  CPMasterObserver cp = host.findCoprocessor(CPMasterObserver.class);
  assertNotNull("CPMasterObserver coprocessor not found or not installed!", cp);

  // check basic lifecycle
  assertTrue("MasterObserver should have been started", cp.wasStarted());
  assertTrue("preMasterInitialization() hook should have been called",
      cp.wasMasterInitializationCalled());
  assertTrue("postStartMaster() hook should have been called",
      cp.wasStartMasterCalled());
}
 
开发者ID:apache,项目名称:hbase,代码行数:19,代码来源:TestMasterObserver.java

示例9: testNamespaceOperations

import org.apache.hadoop.hbase.master.MasterCoprocessorHost; //导入方法依赖的package包/类
@Test (timeout=180000)
public void testNamespaceOperations() throws Exception {
  MiniHBaseCluster cluster = UTIL.getHBaseCluster();
  String testNamespace = "observed_ns";
  HMaster master = cluster.getMaster();
  MasterCoprocessorHost host = master.getMasterCoprocessorHost();
  CPMasterObserver cp = host.findCoprocessor(CPMasterObserver.class);

  // create a table
  Admin admin = UTIL.getAdmin();
  admin.createNamespace(NamespaceDescriptor.create(testNamespace).build());
  assertTrue("Test namespace should be created", cp.wasCreateNamespaceCalled());

  assertNotNull(admin.getNamespaceDescriptor(testNamespace));
  assertTrue("Test namespace descriptor should have been called",
      cp.wasGetNamespaceDescriptorCalled());
  // This test used to do a bunch w/ bypass but bypass of these table and namespace stuff has
  // been removed so the testing code was removed.
}
 
开发者ID:apache,项目名称:hbase,代码行数:20,代码来源:TestMasterObserver.java

示例10: testTableDescriptorsEnumeration

import org.apache.hadoop.hbase.master.MasterCoprocessorHost; //导入方法依赖的package包/类
@Test (timeout=180000)
public void testTableDescriptorsEnumeration() throws Exception {
  MiniHBaseCluster cluster = UTIL.getHBaseCluster();

  HMaster master = cluster.getMaster();
  MasterCoprocessorHost host = master.getMasterCoprocessorHost();
  CPMasterObserver cp = host.findCoprocessor(CPMasterObserver.class);
  cp.resetStates();

  GetTableDescriptorsRequest req =
      RequestConverter.buildGetTableDescriptorsRequest((List<TableName>)null);
  master.getMasterRpcServices().getTableDescriptors(null, req);

  assertTrue("Coprocessor should be called on table descriptors request",
    cp.wasGetTableDescriptorsCalled());
}
 
开发者ID:apache,项目名称:hbase,代码行数:17,代码来源:TestMasterObserver.java

示例11: setupBeforeClass

import org.apache.hadoop.hbase.master.MasterCoprocessorHost; //导入方法依赖的package包/类
@BeforeClass
public static void setupBeforeClass() throws Exception {
  // setup configuration
  conf = TEST_UTIL.getConfiguration();
  conf.setInt(HConstants.REGION_SERVER_HIGH_PRIORITY_HANDLER_COUNT, 10);
  // Enable security
  enableSecurity(conf);
  // Verify enableSecurity sets up what we require
  verifyConfiguration(conf);

  TEST_UTIL.startMiniCluster();
  MasterCoprocessorHost cpHost = TEST_UTIL.getMiniHBaseCluster().getMaster()
      .getMasterCoprocessorHost();
  cpHost.load(AccessController.class, Coprocessor.PRIORITY_HIGHEST, conf);
  AccessController ac = (AccessController)
    cpHost.findCoprocessor(AccessController.class.getName());
  cpHost.createEnvironment(AccessController.class, ac, Coprocessor.PRIORITY_HIGHEST, 1, conf);
  RegionServerCoprocessorHost rsHost = TEST_UTIL.getMiniHBaseCluster().getRegionServer(0)
      .getRegionServerCoprocessorHost();
  rsHost.createEnvironment(AccessController.class, ac, Coprocessor.PRIORITY_HIGHEST, 1, conf);

  // Wait for the ACL table to become available
  TEST_UTIL.waitTableEnabled(AccessControlLists.ACL_TABLE_NAME);

  // create a set of test users
  USER_OWNER = User.createUserForTesting(conf, "owner", new String[0]);
  USER_OTHER = User.createUserForTesting(conf, "other", new String[0]);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:29,代码来源:TestScanEarlyTermination.java

示例12: testCoprocessorLoading

import org.apache.hadoop.hbase.master.MasterCoprocessorHost; //导入方法依赖的package包/类
@Test (timeout=180000)
public void testCoprocessorLoading() throws Exception {
  MasterCoprocessorHost cpHost =
      TEST_UTIL.getMiniHBaseCluster().getMaster().getMasterCoprocessorHost();
  cpHost.load(MyAccessController.class, Coprocessor.PRIORITY_HIGHEST, conf);
  AccessController ACCESS_CONTROLLER = (AccessController) cpHost.findCoprocessor(
    MyAccessController.class.getName());
  MasterCoprocessorEnvironment CP_ENV = cpHost.createEnvironment(
    MyAccessController.class, ACCESS_CONTROLLER, Coprocessor.PRIORITY_HIGHEST, 1, conf);
  RegionServerCoprocessorHost rsHost = TEST_UTIL.getMiniHBaseCluster().getRegionServer(0)
      .getRegionServerCoprocessorHost();
  RegionServerCoprocessorEnvironment RSCP_ENV = rsHost.createEnvironment(
    MyAccessController.class, ACCESS_CONTROLLER, Coprocessor.PRIORITY_HIGHEST, 1, conf);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:15,代码来源:TestAccessController2.java

示例13: setupBeforeClass

import org.apache.hadoop.hbase.master.MasterCoprocessorHost; //导入方法依赖的package包/类
@BeforeClass
public static void setupBeforeClass() throws Exception {
  // setup configuration
  conf = TEST_UTIL.getConfiguration();
  conf.setInt(HConstants.REGION_SERVER_HIGH_PRIORITY_HANDLER_COUNT, 10);
  // Enable security
  enableSecurity(conf);
  // Verify enableSecurity sets up what we require
  verifyConfiguration(conf);

  // We expect 0.98 cell ACL semantics
  conf.setBoolean(AccessControlConstants.CF_ATTRIBUTE_EARLY_OUT, false);

  TEST_UTIL.startMiniCluster();
  MasterCoprocessorHost cpHost = TEST_UTIL.getMiniHBaseCluster().getMaster()
      .getMasterCoprocessorHost();
  cpHost.load(AccessController.class, Coprocessor.PRIORITY_HIGHEST, conf);
  AccessController ac = (AccessController)
    cpHost.findCoprocessor(AccessController.class.getName());
  cpHost.createEnvironment(AccessController.class, ac, Coprocessor.PRIORITY_HIGHEST, 1, conf);
  RegionServerCoprocessorHost rsHost = TEST_UTIL.getMiniHBaseCluster().getRegionServer(0)
      .getRegionServerCoprocessorHost();
  rsHost.createEnvironment(AccessController.class, ac, Coprocessor.PRIORITY_HIGHEST, 1, conf);

  // Wait for the ACL table to become available
  TEST_UTIL.waitTableEnabled(AccessControlLists.ACL_TABLE_NAME);

  // create a set of test users
  USER_OWNER = User.createUserForTesting(conf, "owner", new String[0]);
  USER_OTHER = User.createUserForTesting(conf, "other", new String[0]);
  GROUP_USER = User.createUserForTesting(conf, "group_user", new String[] { GROUP });

  usersAndGroups = new String[] { USER_OTHER.getShortName(), AuthUtil.toGroupEntry(GROUP) };
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:35,代码来源:TestCellACLs.java

示例14: setupBeforeClass

import org.apache.hadoop.hbase.master.MasterCoprocessorHost; //导入方法依赖的package包/类
@BeforeClass
public static void setupBeforeClass() throws Exception {
  // setup configuration
  conf = TEST_UTIL.getConfiguration();
  // Enable security
  enableSecurity(conf);
  // Verify enableSecurity sets up what we require
  verifyConfiguration(conf);

  // We expect 0.98 cell ACL semantics
  conf.setBoolean(AccessControlConstants.CF_ATTRIBUTE_EARLY_OUT, false);

  TEST_UTIL.startMiniCluster();
  MasterCoprocessorHost cpHost = TEST_UTIL.getMiniHBaseCluster().getMaster()
      .getMasterCoprocessorHost();
  cpHost.load(AccessController.class, Coprocessor.PRIORITY_HIGHEST, conf);
  AccessController ac = (AccessController)
    cpHost.findCoprocessor(AccessController.class.getName());
  cpHost.createEnvironment(AccessController.class, ac, Coprocessor.PRIORITY_HIGHEST, 1, conf);
  RegionServerCoprocessorHost rsHost = TEST_UTIL.getMiniHBaseCluster().getRegionServer(0)
      .getRegionServerCoprocessorHost();
  rsHost.createEnvironment(AccessController.class, ac, Coprocessor.PRIORITY_HIGHEST, 1, conf);

  // Wait for the ACL table to become available
  TEST_UTIL.waitTableEnabled(AccessControlLists.ACL_TABLE_NAME);

  // create a set of test users
  USER_OWNER = User.createUserForTesting(conf, "owner", new String[0]);
  USER_OTHER = User.createUserForTesting(conf, "other", new String[0]);
  USER_OTHER2 = User.createUserForTesting(conf, "other2", new String[0]);
  GROUP_USER = User.createUserForTesting(conf, "group_user", new String[] { GROUP });

  usersAndGroups = new String[] { USER_OTHER.getShortName(), AuthUtil.toGroupEntry(GROUP) };
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:35,代码来源:TestCellACLWithMultipleVersions.java

示例15: testTableNamesEnumeration

import org.apache.hadoop.hbase.master.MasterCoprocessorHost; //导入方法依赖的package包/类
@Test (timeout=180000)
public void testTableNamesEnumeration() throws Exception {
  MiniHBaseCluster cluster = UTIL.getHBaseCluster();

  HMaster master = cluster.getMaster();
  MasterCoprocessorHost host = master.getMasterCoprocessorHost();
  CPMasterObserver cp = (CPMasterObserver)host.findCoprocessor(
      CPMasterObserver.class.getName());
  cp.resetStates();

  master.getMasterRpcServices().getTableNames(null,
      GetTableNamesRequest.newBuilder().build());
  assertTrue("Coprocessor should be called on table names request",
    cp.wasGetTableNamesCalled());
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:16,代码来源:TestMasterObserver.java


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