private void initialize() throws IOException { // ZK configuration must _not_ have hbase.security.authentication or it will require SASL auth Configuration zkConf = new Configuration(conf); zkConf.set(User.HBASE_SECURITY_CONF_KEY, "simple"); this.zookeeper = new ZKWatcher(zkConf, TokenServer.class.getSimpleName(), this, true); this.rpcServer.start(); // Mock up region coprocessor environment RegionCoprocessorEnvironment mockRegionCpEnv = mock(RegionCoprocessorEnvironment.class, Mockito.withSettings().extraInterfaces(HasRegionServerServices.class)); when(mockRegionCpEnv.getConfiguration()).thenReturn(conf); when(mockRegionCpEnv.getClassLoader()).then( (var1) -> Thread.currentThread().getContextClassLoader()); RegionServerServices mockRss = mock(RegionServerServices.class); when(mockRss.getRpcServer()).thenReturn(rpcServer); when(((HasRegionServerServices) mockRegionCpEnv).getRegionServerServices()) .thenReturn(mockRss); super.start(mockRegionCpEnv); started = true; }
@Override public ClassLoader getClassLoader() { return delegate.getClassLoader(); }
@Override public ClassLoader getClassLoader() { return delegate.getClassLoader(); }
@Override public ClassLoader getClassLoader() { return delegate.getClassLoader(); }
private void initialize() throws IOException { // ZK configuration must _not_ have hbase.security.authentication or it will require SASL auth Configuration zkConf = new Configuration(conf); zkConf.set(User.HBASE_SECURITY_CONF_KEY, "simple"); this.zookeeper = new ZKWatcher(zkConf, TokenServer.class.getSimpleName(), this, true); this.rpcServer.start(); // Mock up region coprocessor environment RegionCoprocessorEnvironment mockRegionCpEnv = mock(RegionCoprocessorEnvironment.class, Mockito.withSettings().extraInterfaces(HasRegionServerServices.class)); when(mockRegionCpEnv.getConfiguration()).thenReturn(conf); when(mockRegionCpEnv.getClassLoader()).then( (var1) -> Thread.currentThread().getContextClassLoader()); RegionServerServices mockRss = mock(RegionServerServices.class); when(mockRss.getRpcServer()).thenReturn(rpcServer); when(((HasRegionServerServices) mockRegionCpEnv).getRegionServerServices()) .thenReturn(mockRss); super.start(mockRegionCpEnv); started = true; }