Tabnine Logo
HasMasterServices.getMasterServices
Code IndexAdd Tabnine to your IDE (free)

How to use
getMasterServices
method
in
org.apache.hadoop.hbase.coprocessor.HasMasterServices

Best Java code snippets using org.apache.hadoop.hbase.coprocessor.HasMasterServices.getMasterServices (Showing top 6 results out of 315)

origin: apache/hbase

@Override
public void start(CoprocessorEnvironment env) throws IOException {
 if (!(env instanceof HasMasterServices)) {
  throw new IOException("Does not implement HMasterServices");
 }
 master = ((HasMasterServices)env).getMasterServices();
 groupInfoManager = RSGroupInfoManagerImpl.getInstance(master);
 groupAdminServer = new RSGroupAdminServer(master, groupInfoManager);
 Class<?> clazz =
   master.getConfiguration().getClass(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, null);
 if (!RSGroupableBalancer.class.isAssignableFrom(clazz)) {
  throw new IOException("Configured balancer does not support RegionServer groups.");
 }
 ZKWatcher zk = ((HasMasterServices)env).getMasterServices().getZooKeeper();
 accessChecker = new AccessChecker(env.getConfiguration(), zk);
 // set the user-provider.
 this.userProvider = UserProvider.instantiate(env.getConfiguration());
}
origin: apache/hbase

 /**
  * Assert that when a Coprocessor is annotated with CoreCoprocessor, then it is possible to
  * access a MasterServices instance. Assert the opposite too.
  * Do it to MasterCoprocessors.
  * @throws IOException
  */
 @Test
 public void testCoreRegionCoprocessor() throws IOException {
  MasterCoprocessorEnvironment env =
    this.mch.load(null, NotCoreMasterCoprocessor.class.getName(), 0, HTU.getConfiguration());
  assertFalse(env instanceof HasMasterServices);
  env = this.mch.load(null, CoreMasterCoprocessor.class.getName(), 1, HTU.getConfiguration());
  assertTrue(env instanceof HasMasterServices);
  assertEquals(this.ms, ((HasMasterServices)env).getMasterServices());
 }
}
origin: apache/hbase

zk = ((HasMasterServices)mEnv).getMasterServices().getZooKeeper();
origin: org.apache.hbase/hbase-rsgroup

@Override
public void start(CoprocessorEnvironment env) throws IOException {
 if (!(env instanceof HasMasterServices)) {
  throw new IOException("Does not implement HMasterServices");
 }
 master = ((HasMasterServices)env).getMasterServices();
 groupInfoManager = RSGroupInfoManagerImpl.getInstance(master);
 groupAdminServer = new RSGroupAdminServer(master, groupInfoManager);
 Class<?> clazz =
   master.getConfiguration().getClass(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, null);
 if (!RSGroupableBalancer.class.isAssignableFrom(clazz)) {
  throw new IOException("Configured balancer does not support RegionServer groups.");
 }
 ZKWatcher zk = ((HasMasterServices)env).getMasterServices().getZooKeeper();
 accessChecker = new AccessChecker(env.getConfiguration(), zk);
 // set the user-provider.
 this.userProvider = UserProvider.instantiate(env.getConfiguration());
}
origin: com.aliyun.hbase/alihbase-rsgroup

@Override
public void start(CoprocessorEnvironment env) throws IOException {
 if (!(env instanceof HasMasterServices)) {
  throw new IOException("Does not implement HMasterServices");
 }
 master = ((HasMasterServices)env).getMasterServices();
 groupInfoManager = RSGroupInfoManagerImpl.getInstance(master);
 groupAdminServer = new RSGroupAdminServer(master, groupInfoManager);
 Class<?> clazz =
   master.getConfiguration().getClass(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, null);
 if (!RSGroupableBalancer.class.isAssignableFrom(clazz)) {
  throw new IOException("Configured balancer does not support RegionServer groups.");
 }
 ZKWatcher zk = ((HasMasterServices)env).getMasterServices().getZooKeeper();
 accessChecker = new AccessChecker(env.getConfiguration(), zk);
 // set the user-provider.
 this.userProvider = UserProvider.instantiate(env.getConfiguration());
}
origin: org.apache.hbase/hbase-server

 /**
  * Assert that when a Coprocessor is annotated with CoreCoprocessor, then it is possible to
  * access a MasterServices instance. Assert the opposite too.
  * Do it to MasterCoprocessors.
  * @throws IOException
  */
 @Test
 public void testCoreRegionCoprocessor() throws IOException {
  MasterCoprocessorEnvironment env =
    this.mch.load(null, NotCoreMasterCoprocessor.class.getName(), 0, HTU.getConfiguration());
  assertFalse(env instanceof HasMasterServices);
  env = this.mch.load(null, CoreMasterCoprocessor.class.getName(), 1, HTU.getConfiguration());
  assertTrue(env instanceof HasMasterServices);
  assertEquals(this.ms, ((HasMasterServices)env).getMasterServices());
 }
}
org.apache.hadoop.hbase.coprocessorHasMasterServicesgetMasterServices

Popular methods of HasMasterServices

    Popular in Java

    • Parsing JSON documents to java classes using gson
    • putExtra (Intent)
    • getContentResolver (Context)
    • startActivity (Activity)
    • GridBagLayout (java.awt)
      The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
    • Rectangle (java.awt)
      A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
    • Arrays (java.util)
      This class contains various methods for manipulating arrays (such as sorting and searching). This cl
    • BlockingQueue (java.util.concurrent)
      A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
    • Handler (java.util.logging)
      A Handler object accepts a logging request and exports the desired messages to a target, for example
    • Project (org.apache.tools.ant)
      Central representation of an Ant project. This class defines an Ant project with all of its targets,
    • Top plugins for WebStorm
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now