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

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

Best Java code snippets using org.apache.hadoop.hbase.coprocessor.HasMasterServices (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.coprocessorHasMasterServices

Javadoc

Mark a class that it has a MasterServices accessor. Temporary hack until core Coprocesssors are integrated.

Most used methods

  • getMasterServices

Popular in Java

  • Reading from database using SQL prepared statement
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (Timer)
  • getApplicationContext (Context)
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top Vim plugins
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